Skip to content

Commit

Permalink
User Alt+Shift keys for shortcuts
Browse files Browse the repository at this point in the history
- See #948
- And remove Windows workaround as it's no longer needed
  • Loading branch information
Phillipus committed Jul 21, 2023
1 parent bcab676 commit 176884d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 37 deletions.
10 changes: 5 additions & 5 deletions com.archimatetool.editor/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -614,27 +614,27 @@
<key
commandId="com.archimatetool.editor.action.showTreeModelView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+1">
sequence="M3+SHIFT+1">
</key>
<key
commandId="com.archimatetool.editor.action.showPropertiesView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+2">
sequence="M3+SHIFT+2">
</key>
<key
commandId="com.archimatetool.editor.action.showOutlineView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+3">
sequence="M3+SHIFT+3">
</key>
<key
commandId="com.archimatetool.editor.action.showNavigatorView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+4">
sequence="M3+SHIFT+4">
</key>
<key
commandId="com.archimatetool.editor.action.showPaletteView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+5">
sequence="M3+SHIFT+5">
</key>
<key
commandId="com.archimatetool.editor.action.exportAsImageToClipboard"
Expand Down
2 changes: 1 addition & 1 deletion com.archimatetool.hammer/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<key
commandId="com.archimatetool.hammer.command.showValidatorView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+8">
sequence="M3+SHIFT+8">
</key>
</extension>
<extension
Expand Down
2 changes: 1 addition & 1 deletion com.archimatetool.help/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<key
commandId="com.archimatetool.help.command.showHintsView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+7">
sequence="M3+SHIFT+7">
</key>
</extension>
<extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.IViewPart;

import com.archimatetool.editor.ui.services.ViewManager;
import com.archimatetool.editor.utils.PlatformUtils;



Expand All @@ -26,31 +22,7 @@ public class ShowHintsViewHandler extends AbstractHandler {

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {

// Eclipse Bug on Windows when using Alt-7 key command to close a View containing a Browser - it crashes!

// Key code of non-zero indicates a key command
if(PlatformUtils.isWindows() && event.getTrigger() instanceof Event && ((Event)event.getTrigger()).keyCode != 0) {
IViewPart part = ViewManager.findViewPart(IHintsView.ID);

// We are closing the View so put it on a thread for the workaround
if(part != null) {
Display.getCurrent().asyncExec(new Runnable() {
@Override
public void run() {
ViewManager.hideViewPart(IHintsView.ID);
}
});
}
// We are opening the View
else {
ViewManager.showViewPart(IHintsView.ID, true);
}
}
else {
ViewManager.toggleViewPart(IHintsView.ID, true);
}

ViewManager.toggleViewPart(IHintsView.ID, true);
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion com.archimatetool.zest/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<key
commandId="com.archimatetool.zest.action.showZestView"
schemeId="com.archimatetool.editor.keybindings"
sequence="M3+6">
sequence="M3+SHIFT+6">
</key>
</extension>
<extension
Expand Down

0 comments on commit 176884d

Please sign in to comment.