mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-10 18:45:26 +02:00
Bug 491062: [Launchbar] Add preference to control Build button
https://bugs.eclipse.org/bugs/show_bug.cgi?id=491062 Signed-off-by: Vincent Guignot <vincent.guignot@ingenico.com> Change-Id: I4de5a684b4d694db81c6cd782bdbc9c03b4a4747
This commit is contained in:
parent
c3f9546a47
commit
3ad5cd3e42
7 changed files with 35 additions and 19 deletions
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer
|
* Doug Schaefer
|
||||||
* Torkild U. Resheim - add preference to control target selector
|
* Torkild U. Resheim - add preference to control target selector
|
||||||
|
* Vincent Guignot - Ingenico - add preference to control Build button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.launchbar.ui.internal;
|
package org.eclipse.launchbar.ui.internal;
|
||||||
|
|
||||||
|
@ -59,6 +60,7 @@ public class Activator extends AbstractUIPlugin {
|
||||||
// Preference ids
|
// Preference ids
|
||||||
public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$
|
public static final String PREF_ENABLE_LAUNCHBAR = "enableLaunchBar"; //$NON-NLS-1$
|
||||||
public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$
|
public static final String PREF_ENABLE_TARGETSELECTOR = "enableTargetSelector"; //$NON-NLS-1$
|
||||||
|
public static final String PREF_ENABLE_BUILDBUTTON = "enableBuildButton"; //$NON-NLS-1$
|
||||||
public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$
|
public static final String PREF_LAUNCH_HISTORY_SIZE = "launchHistorySize"; //$NON-NLS-1$
|
||||||
|
|
||||||
// The shared instance
|
// The shared instance
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer
|
* Doug Schaefer
|
||||||
* Torkild U. Resheim - add preference to control target selector
|
* Torkild U. Resheim - add preference to control target selector
|
||||||
|
* Vincent Guignot - Ingenico - add preference to control Build button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.launchbar.ui.internal;
|
package org.eclipse.launchbar.ui.internal;
|
||||||
|
|
||||||
|
@ -72,7 +73,7 @@ public class LaunchBarInjector {
|
||||||
boolean enabled = Boolean.parseBoolean(event.getNewValue().toString());
|
boolean enabled = Boolean.parseBoolean(event.getNewValue().toString());
|
||||||
injectIntoAll(enabled);
|
injectIntoAll(enabled);
|
||||||
}
|
}
|
||||||
if (event.getProperty().equals(Activator.PREF_ENABLE_TARGETSELECTOR)) {
|
if (event.getProperty().equals(Activator.PREF_ENABLE_TARGETSELECTOR)|| event.getProperty().equals(Activator.PREF_ENABLE_BUILDBUTTON)) {
|
||||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||||
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR);
|
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_LAUNCHBAR);
|
||||||
if (enabled){
|
if (enabled){
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2014, 2015 QNX Software Systems and others.
|
* Copyright (c) 2014, 2016 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer
|
* Doug Schaefer
|
||||||
* Torkild U. Resheim - add preference to control target selector
|
* Torkild U. Resheim - add preference to control target selector
|
||||||
|
* Vincent Guignot - Ingenico - add preference to control Build button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.launchbar.ui.internal;
|
package org.eclipse.launchbar.ui.internal;
|
||||||
|
|
||||||
|
@ -19,6 +20,7 @@ public class LaunchBarPreferenceInitializer extends AbstractPreferenceInitialize
|
||||||
@Override
|
@Override
|
||||||
public void initializeDefaultPreferences() {
|
public void initializeDefaultPreferences() {
|
||||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||||
|
store.setDefault(Activator.PREF_ENABLE_BUILDBUTTON, true);
|
||||||
store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true);
|
store.setDefault(Activator.PREF_ENABLE_LAUNCHBAR, true);
|
||||||
store.setDefault(Activator.PREF_ENABLE_TARGETSELECTOR, true);
|
store.setDefault(Activator.PREF_ENABLE_TARGETSELECTOR, true);
|
||||||
store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3);
|
store.setDefault(Activator.PREF_LAUNCH_HISTORY_SIZE, 3);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer
|
* Doug Schaefer
|
||||||
* Torkild U. Resheim - add preference to control target selector
|
* Torkild U. Resheim - add preference to control target selector
|
||||||
|
* Vincent Guignot - Ingenico - add preference to control Build button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.launchbar.ui.internal;
|
package org.eclipse.launchbar.ui.internal;
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ public class LaunchBarPreferencePage extends FieldEditorPreferencePage implement
|
||||||
protected void createFieldEditors() {
|
protected void createFieldEditors() {
|
||||||
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent()));
|
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_LAUNCHBAR, Messages.LaunchBarPreferencePage_1, getFieldEditorParent()));
|
||||||
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_TARGETSELECTOR, Messages.LaunchBarPreferencePage_EnableTargetSelector, getFieldEditorParent()));
|
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_TARGETSELECTOR, Messages.LaunchBarPreferencePage_EnableTargetSelector, getFieldEditorParent()));
|
||||||
|
addField(new BooleanFieldEditor(Activator.PREF_ENABLE_BUILDBUTTON, Messages.LaunchBarPreferencePage_EnableBuildButton, getFieldEditorParent()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer
|
* Doug Schaefer
|
||||||
* Torkild U. Resheim - add preference to control target selector
|
* Torkild U. Resheim - add preference to control target selector
|
||||||
|
* Vincent Guignot - Ingenico - add preference to control Build button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.launchbar.ui.internal;
|
package org.eclipse.launchbar.ui.internal;
|
||||||
|
|
||||||
|
@ -34,6 +35,7 @@ public class Messages extends NLS {
|
||||||
public static String LaunchBarPreferencePage_0;
|
public static String LaunchBarPreferencePage_0;
|
||||||
public static String LaunchBarPreferencePage_1;
|
public static String LaunchBarPreferencePage_1;
|
||||||
public static String LaunchBarPreferencePage_EnableTargetSelector;
|
public static String LaunchBarPreferencePage_EnableTargetSelector;
|
||||||
|
public static String LaunchBarPreferencePage_EnableBuildButton;
|
||||||
public static String LaunchConfigurationEditDialog_0;
|
public static String LaunchConfigurationEditDialog_0;
|
||||||
public static String LaunchConfigurationEditDialog_1;
|
public static String LaunchConfigurationEditDialog_1;
|
||||||
public static String LaunchConfigurationEditDialog_2;
|
public static String LaunchConfigurationEditDialog_2;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer
|
* Doug Schaefer
|
||||||
* Torkild U. Resheim - add preference to control target selector
|
* Torkild U. Resheim - add preference to control target selector
|
||||||
|
* Vincent Guignot - Ingenico - add preference to control Build button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.launchbar.ui.internal.controls;
|
package org.eclipse.launchbar.ui.internal.controls;
|
||||||
|
|
||||||
|
@ -66,7 +67,12 @@ public class LaunchBarControl implements ILaunchBarListener {
|
||||||
});
|
});
|
||||||
|
|
||||||
ToolBar toolBar = new ToolBar(container, SWT.FLAT);
|
ToolBar toolBar = new ToolBar(container, SWT.FLAT);
|
||||||
|
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
||||||
|
boolean buildEnabled = store.getBoolean(Activator.PREF_ENABLE_BUILDBUTTON);
|
||||||
|
if (buildEnabled) {
|
||||||
createButton(toolBar, Activator.IMG_BUTTON_BUILD, Messages.LaunchBarControl_Build, Activator.CMD_BUILD);
|
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_LAUNCH, Messages.LaunchBarControl_Launch, Activator.CMD_LAUNCH);
|
||||||
createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP);
|
createButton(toolBar, Activator.IMG_BUTTON_STOP, Messages.LaunchBarControl_Stop, Activator.CMD_STOP);
|
||||||
|
|
||||||
|
@ -78,7 +84,7 @@ public class LaunchBarControl implements ILaunchBarListener {
|
||||||
configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
||||||
configSelector.setInput(manager);
|
configSelector.setInput(manager);
|
||||||
|
|
||||||
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
|
|
||||||
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR);
|
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR);
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
Label label = new Label(container, SWT.NONE);
|
Label label = new Label(container, SWT.NONE);
|
||||||
|
|
|
@ -14,9 +14,10 @@ LaunchBarControl_Build=Build
|
||||||
LaunchBarControl_Launch=Launch
|
LaunchBarControl_Launch=Launch
|
||||||
LaunchBarControl_Stop=Stop
|
LaunchBarControl_Stop=Stop
|
||||||
LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane
|
LaunchBarListViewer_0=Increase/Decrease size of recently used elements pane
|
||||||
LaunchBarPreferencePage_0=Preferences for the Launch Bar.
|
LaunchBarPreferencePage_0=Preferences for the Launch Bar
|
||||||
LaunchBarPreferencePage_1=Enable the Launch Bar.
|
LaunchBarPreferencePage_1=Enable the Launch Bar
|
||||||
LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector.
|
LaunchBarPreferencePage_EnableTargetSelector=Enable the target selector
|
||||||
|
LaunchBarPreferencePage_EnableBuildButton=Enable the Build button
|
||||||
LaunchConfigurationEditDialog_0=Delete
|
LaunchConfigurationEditDialog_0=Delete
|
||||||
LaunchConfigurationEditDialog_1=Duplicate
|
LaunchConfigurationEditDialog_1=Duplicate
|
||||||
LaunchConfigurationEditDialog_2=Launch
|
LaunchConfigurationEditDialog_2=Launch
|
||||||
|
|
Loading…
Add table
Reference in a new issue