diff --git a/bundles/org.eclipse.launchbar.ui/.options b/bundles/org.eclipse.launchbar.ui/.options new file mode 100644 index 00000000000..ed790682059 --- /dev/null +++ b/bundles/org.eclipse.launchbar.ui/.options @@ -0,0 +1,2 @@ +org.eclipse.launchbar.ui/iconSize32=false +org.eclipse.launchbar.ui/launchIconUpdater=false diff --git a/bundles/org.eclipse.launchbar.ui/icons/build2_24.png b/bundles/org.eclipse.launchbar.ui/icons/build2_24.png new file mode 100644 index 00000000000..d917acea6ab Binary files /dev/null and b/bundles/org.eclipse.launchbar.ui/icons/build2_24.png differ diff --git a/bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png b/bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png new file mode 100644 index 00000000000..e77ea27915e Binary files /dev/null and b/bundles/org.eclipse.launchbar.ui/icons/build2_hot_24.png differ diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch2_24.png b/bundles/org.eclipse.launchbar.ui/icons/launch2_24.png new file mode 100644 index 00000000000..b8cee6ed158 Binary files /dev/null and b/bundles/org.eclipse.launchbar.ui/icons/launch2_24.png differ diff --git a/bundles/org.eclipse.launchbar.ui/icons/launch2_hot_24.png b/bundles/org.eclipse.launchbar.ui/icons/launch2_hot_24.png new file mode 100644 index 00000000000..21cba47b579 Binary files /dev/null and b/bundles/org.eclipse.launchbar.ui/icons/launch2_hot_24.png differ diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop2_24.png b/bundles/org.eclipse.launchbar.ui/icons/stop2_24.png new file mode 100644 index 00000000000..88ba331b3e2 Binary files /dev/null and b/bundles/org.eclipse.launchbar.ui/icons/stop2_24.png differ diff --git a/bundles/org.eclipse.launchbar.ui/icons/stop2_hot_24.png b/bundles/org.eclipse.launchbar.ui/icons/stop2_hot_24.png new file mode 100644 index 00000000000..d3ec021963b Binary files /dev/null and b/bundles/org.eclipse.launchbar.ui/icons/stop2_hot_24.png differ diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java index 267458300cc..faefee75261 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/Activator.java @@ -19,6 +19,7 @@ import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; @@ -43,10 +44,17 @@ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.launchbar.ui"; //$NON-NLS-1$ + // Options + public static final String OPTION_ICON_SIZE32 = Activator.PLUGIN_ID + "/iconSize32"; //$NON-NLS-1$ + public static final String OPTION_LAUNCH_ICON_UPDATER = Activator.PLUGIN_ID + "/launchIconUpdater"; //$NON-NLS-1$ + // Images public static final String IMG_BUTTON_BUILD = "build"; //$NON-NLS-1$ + public static final String IMG_BUTTON_BUILD_HOT = "build.hot"; //$NON-NLS-1$ public static final String IMG_BUTTON_LAUNCH = "launch"; //$NON-NLS-1$ + public static final String IMG_BUTTON_LAUNCH_HOT = "launch.hot"; //$NON-NLS-1$ public static final String IMG_BUTTON_STOP = "stop"; //$NON-NLS-1$ + public static final String IMG_BUTTON_STOP_HOT = "stop.hot"; //$NON-NLS-1$ public static final String IMG_LOCAL_TARGET = "localTarget"; //$NON-NLS-1$ // Command ids @@ -72,19 +80,33 @@ public class Activator extends AbstractUIPlugin { public Activator() { } + @Override public void start(BundleContext context) throws Exception { super.start(context); plugin = this; ImageRegistry imageRegistry = getImageRegistry(); - imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ - imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ - imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ + if ("true".equals(Platform.getDebugOption(OPTION_ICON_SIZE32))) { //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_BUILD_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop.png")); //$NON-NLS-1$ + } else { + imageRegistry.put(IMG_BUTTON_BUILD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build2_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_BUILD_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/build2_hot_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch2_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_LAUNCH_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/launch2_hot_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop2_24.png")); //$NON-NLS-1$ + imageRegistry.put(IMG_BUTTON_STOP_HOT, imageDescriptorFromPlugin(PLUGIN_ID, "icons/stop2_hot_24.png")); //$NON-NLS-1$ + } imageRegistry.put(IMG_LOCAL_TARGET, imageDescriptorFromPlugin(PLUGIN_ID, "icons/localTarget.png")); //$NON-NLS-1$ context.registerService(ILaunchTargetUIManager.class, new LaunchTargetUIManager(), null); } + @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); @@ -124,12 +146,10 @@ public class Activator extends AbstractUIPlugin { } public static void runCommand(String commandId, String... params) { - final ICommandService commandService = (ICommandService) PlatformUI.getWorkbench() - .getService(ICommandService.class); + final ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class); Command command = commandService.getCommand(commandId); final Event trigger = new Event(); - final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench() - .getService(IHandlerService.class); + final IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class); ExecutionEvent executionEvent = handlerService.createExecutionEvent(command, trigger); if (params.length == 0) { try { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java index b3a9b0d1cbd..d697a95a5b4 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/LaunchBarControl.java @@ -65,9 +65,12 @@ public class LaunchBarControl implements ILaunchBarListener { }); ToolBar toolBar = new ToolBar(container, SWT.FLAT); - createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD); - createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); - createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP); + createButton(toolBar, Activator.IMG_BUTTON_BUILD, Activator.IMG_BUTTON_BUILD_HOT, + Messages.LaunchBarControl_Build, Activator.CMD_BUILD); + createButton(toolBar, Activator.IMG_BUTTON_LAUNCH, Activator.IMG_BUTTON_LAUNCH_HOT, + Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH); + createButton(toolBar, Activator.IMG_BUTTON_STOP, Activator.IMG_BUTTON_STOP_HOT, Messages.LaunchBarControl_Stop, + Activator.CMD_STOP); modeSelector = new ModeSelector(container, SWT.NONE); modeSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); @@ -106,10 +109,13 @@ public class LaunchBarControl implements ILaunchBarListener { manager.removeListener(this); } - private ToolItem createButton(Composite parent, String imageName, String toolTipText, final String command) { + private ToolItem createButton(Composite parent, String imageName, String hotImageName, String toolTipText, + final String command) { ToolItem button = new ToolItem((ToolBar) parent, SWT.FLAT); Image srcImage = Activator.getDefault().getImage(imageName); button.setImage(srcImage); + Image hotImage = Activator.getDefault().getImage(hotImageName); + button.setHotImage(hotImage); button.setToolTipText(toolTipText); button.setData("command", command); //$NON-NLS-1$ button.addSelectionListener(new SelectionAdapter() { diff --git a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java index 9bee28361ac..28127fbb82f 100644 --- a/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java +++ b/bundles/org.eclipse.launchbar.ui/src/org/eclipse/launchbar/ui/internal/controls/ModeSelector.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Platform; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchMode; @@ -156,7 +157,7 @@ public class ModeSelector extends CSelector { }); } - protected ILaunchGroup getDefaultLaunchGroup(String mode) throws CoreException { + protected ILaunchGroup getDefaultLaunchGroup(String mode) { String groupId = null; if (mode.equals(ILaunchManager.DEBUG_MODE)) { groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP; @@ -205,7 +206,9 @@ public class ModeSelector extends CSelector { if (element == null) element = noModes[0]; super.setSelection(element); - updateLaunchButton(findLaunchButton()); + if ("true".equals(Platform.getDebugOption(Activator.OPTION_LAUNCH_ICON_UPDATER))) { //$NON-NLS-1$ + updateLaunchButton(findLaunchButton()); + } } private ToolItem findLaunchButton() { @@ -229,6 +232,7 @@ public class ModeSelector extends CSelector { return; } toolItem.setImage(Activator.getDefault().getImage(Activator.IMG_BUTTON_LAUNCH)); + Object selection = getSelection(); if (selection instanceof ILaunchMode) { ILaunchMode lmode = (ILaunchMode) selection;