Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian de Alwis2012-11-22 23:34:17 +0000
committerBrian de Alwis2012-11-22 23:34:17 +0000
commit89223f8b25c795feb2899571c971b5b454d15017 (patch)
tree87cf28daf56837c2f48bf5fdb83c358c6423fcc3 /bundles/org.eclipse.e4.tools.css.spy
parent345f286b68d4c262546a9001eec74c45838df9e8 (diff)
downloadorg.eclipse.e4.tools-89223f8b25c795feb2899571c971b5b454d15017.tar.gz
org.eclipse.e4.tools-89223f8b25c795feb2899571c971b5b454d15017.tar.xz
org.eclipse.e4.tools-89223f8b25c795feb2899571c971b5b454d15017.zip
Back out mistaken CSS-Spy related changes in previous commit
Diffstat (limited to 'bundles/org.eclipse.e4.tools.css.spy')
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java6
-rw-r--r--bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java29
2 files changed, 14 insertions, 21 deletions
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java
index f986d15f..e2ad3583 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyDialog.java
@@ -362,9 +362,9 @@ public class CssSpyDialog extends Dialog {
// bounds = slectedShell.getDisplay().map(null, selectedShell,
// bounds);
}
- // create the highlight; want it to appear on top
- Shell highlight = new Shell(selectedShell, SWT.NO_TRIM | SWT.MODELESS
- | SWT.NO_FOCUS | SWT.ON_TOP);
+ Shell highlight = new Shell(selectedShell, SWT.NO_TRIM | SWT.MODELESS); // appears
+ // on
+ // top
highlight.setBackground(display.getSystemColor(SWT.COLOR_RED));
Region highlightRegion = new Region();
highlightRegion.add(0, 0, 1, bounds.height + 2);
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java
index 04ca2854..4ea90037 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/SpyInstaller.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011,2012 Manumitting Technologies, Inc.
+ * Copyright (c) 2011 Manumitting Technologies, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,21 +21,16 @@ import org.eclipse.e4.ui.model.application.commands.MHandler;
import org.eclipse.e4.ui.model.application.commands.MKeyBinding;
public class SpyInstaller {
- private static final String BUNDLE_ID = "org.eclipse.e4.tools.css.spy";
public static final String OPEN_SPY_COMMAND_ID = "org.eclipse.e4.css.OpenSpy";
private static final String SPY_HANDLER_ID = OpenSpyHandler.class.getName();
- private static final String SPY_HANDLER_URI = "bundleclass://" + BUNDLE_ID
- + "/"
+ private static final String SPY_HANDLER_URI = "bundleclass://org.eclipse.e4.tools.css.spy/"
+ OpenSpyHandler.class.getName();
public static final String OPEN_SCRATCHPAD_COMMAND_ID = "org.eclipse.e4.css.OpenSctachpad";
private static final String SCRATCHPAD_HANDLER_ID = OpenScratchpadHandler.class
.getName();
- private static final String SCRATCHPAD_HANDLER_URI = "bundleclass://"
- + BUNDLE_ID + "/"
+ private static final String SCRATCHPAD_HANDLER_URI = "bundleclass://org.eclipse.e4.tools.css.spy/"
+ OpenScratchpadHandler.class.getName();
- private static final String CONTRIBUTOR_URI = "platform:/plugin/"
- + BUNDLE_ID;
@Inject
protected MApplication app;
@@ -48,19 +43,14 @@ public class SpyInstaller {
MCommand openSpyCommand = installCommand("Open CSS Spy",
OPEN_SPY_COMMAND_ID);
installHandler(openSpyCommand, SPY_HANDLER_ID, SPY_HANDLER_URI);
-
- // M1 = Control or Cmd on MacOS X
- // M2 = Shift
- // M3 = Alt
- // M4 = Control on MacOS X, Command on others
installBinding("org.eclipse.ui.contexts.dialogAndWindow",
- openSpyCommand, "M2+M3+F5"); // Alt-Shift-F5
+ openSpyCommand, "M2+M3+F4");
MCommand openScratchpadCommand = installCommand("Open CSS Scratchpad",
OPEN_SCRATCHPAD_COMMAND_ID);
installHandler(openScratchpadCommand, SCRATCHPAD_HANDLER_ID, SCRATCHPAD_HANDLER_URI);
installBinding("org.eclipse.ui.contexts.dialogAndWindow",
- openScratchpadCommand, "M2+M3+F6"); // Alt-Shift-F5
+ openScratchpadCommand, "M1+M2+M3+F4");
}
private void removeBindingTable(String tableId) {
@@ -75,6 +65,8 @@ public class SpyInstaller {
private MCommand installCommand(String label, String commandId) {
for(MCommand cmd : app.getCommands()) {
if (commandId.equals(cmd.getElementId())) {
+ System.err.println(cmd.getElementId()
+ + ": command already installed");
return cmd;
}
}
@@ -82,7 +74,6 @@ public class SpyInstaller {
MCommand cmd = MCommandsFactory.INSTANCE.createCommand();
cmd.setCommandName(label);
cmd.setElementId(commandId);
- cmd.setContributorURI(CONTRIBUTOR_URI);
app.getCommands().add(cmd);
return cmd;
}
@@ -91,6 +82,7 @@ public class SpyInstaller {
String handlerURI) {
for(MHandler hdlr : app.getHandlers()) {
if (handlerId.equals(hdlr.getElementId())) {
+ System.err.println(handlerId + ": handler already installed");
return hdlr;
}
}
@@ -99,7 +91,6 @@ public class SpyInstaller {
hdlr.setElementId(handlerId);
hdlr.setContributionURI(handlerURI);
hdlr.setCommand(cmd);
- hdlr.setContributorURI(CONTRIBUTOR_URI);
app.getHandlers().add(hdlr);
return hdlr;
}
@@ -113,6 +104,9 @@ public class SpyInstaller {
for(MBindingTable table : app.getBindingTables()) {
for(MKeyBinding binding : table.getBindings()) {
if(binding.getCommand() == cmd) {
+ System.err.println(cmd.getElementId()
+ + ": binding already installed as "
+ + binding.getKeySequence());
return;
}
}
@@ -133,7 +127,6 @@ public class SpyInstaller {
binding.setCommand(cmd);
binding.setKeySequence(keySeq);
binding.setElementId("kb." + cmd.getElementId());
- binding.setContributorURI(CONTRIBUTOR_URI);
bindingTable.getBindings().add(binding);
}

Back to the top