Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-05-01 22:36:29 -0400
committerAndrew Gvozdev2012-05-01 23:05:37 -0400
commit2b5e3e6a20a411b4f000c0d9a4eb7a33813a628c (patch)
tree745f350fba172de078332a534b44a3e6bd98e93a /build/org.eclipse.cdt.managedbuilder.ui
parentaae4b1de8eb0544940484487772a85ae4b34c3c9 (diff)
downloadorg.eclipse.cdt-2b5e3e6a20a411b4f000c0d9a4eb7a33813a628c.tar.gz
org.eclipse.cdt-2b5e3e6a20a411b4f000c0d9a4eb7a33813a628c.tar.xz
org.eclipse.cdt-2b5e3e6a20a411b4f000c0d9a4eb7a33813a628c.zip
bug 328007: [sd90] Design user interface for new scanner discovery
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/inspect_sys.gifbin0 -> 553 bytes
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/log_obj.gifbin0 -> 335 bytes
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/mbs.gifbin0 -> 380 bytes
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml39
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties13
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java155
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/GCCBuildCommandParserOptionPage.java231
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryConsole.java39
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryGlobalConsole.java117
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java61
12 files changed, 640 insertions, 27 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
index beaff8e8eb..1e00b74378 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
@@ -14,6 +14,7 @@ Export-Package: org.eclipse.cdt.managedbuilder.ui.preferences,
Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.ui.console;bundle-version="[3.5.100,4.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.1.0,9.0.0)",
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/inspect_sys.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/inspect_sys.gif
new file mode 100644
index 0000000000..d68100a748
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/inspect_sys.gif
Binary files differ
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/log_obj.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/log_obj.gif
new file mode 100644
index 0000000000..aebeab820d
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/log_obj.gif
Binary files differ
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/mbs.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/mbs.gif
new file mode 100644
index 0000000000..3406bb1865
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/mbs.gif
Binary files differ
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index 9dd588b939..f5c72d2b4a 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -671,5 +671,42 @@
projectType="org.eclipse.cdt.build.makefile.projectType">
</projectTypePage>
</extension>
-
+ <extension
+ point="org.eclipse.cdt.ui.LanguageSettingsProviderAssociation">
+ <id-association
+ id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider"
+ icon="icons/obj16/mbs.gif"
+ ui-clear-entries="false"
+ ui-edit-entries="false">
+ </id-association>
+ <class-association
+ class="org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuildCommandParser"
+ icon="icons/obj16/log_obj.gif"
+ page="org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers.GCCBuildCommandParserOptionPage"
+ ui-clear-entries="true"
+ ui-edit-entries="false">
+ </class-association>
+ <class-association
+ class="org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector"
+ icon="icons/obj16/inspect_sys.gif"
+ page="org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers.BuiltinSpecsDetectorOptionPage"
+ ui-clear-entries="true"
+ ui-edit-entries="false">
+ </class-association>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.CBuildConsole">
+ <CBuildConsole
+ id="org.eclipse.cdt.managedbuilder.ScannerDiscoveryConsole"
+ class="org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers.ScannerDiscoveryConsole">
+ </CBuildConsole>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.CBuildConsole">
+ <CBuildConsole
+ id="org.eclipse.cdt.managedbuilder.ScannerDiscoveryGlobalConsole"
+ class="org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers.ScannerDiscoveryGlobalConsole">
+ </CBuildConsole>
+ </extension>
+
</plugin>
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
index 82299423e1..5986337af0 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.java
@@ -61,6 +61,10 @@ public class Messages extends NLS {
public static String BuildToolSettingsPage_tool_advancedSettings;
public static String BuildToolSettingsPage_tool_command;
public static String BuildToolSettingsPage_tool_commandLinePattern;
+ public static String BuiltinSpecsDetectorOptionPage_AllocateConsole;
+ public static String BuiltinSpecsDetectorOptionPage_Browse;
+ public static String BuiltinSpecsDetectorOptionPage_ChooseFile;
+ public static String BuiltinSpecsDetectorOptionPage_CompilerSpecsCommand;
public static String CConfigWizardPage_0;
public static String CConfigWizardPage_1;
public static String CConfigWizardPage_10;
@@ -105,6 +109,12 @@ public class Messages extends NLS {
public static String DiscoveryTab_ErrorClearingEntries;
public static String EnvironmentTab_15;
public static String EnvironmentTab_23;
+ public static String GCCBuildCommandParserOptionPage_CompilerPattern;
+ public static String GCCBuildCommandParserOptionPage_ContainerForDiscoveredEntries;
+ public static String GCCBuildCommandParserOptionPage_File;
+ public static String GCCBuildCommandParserOptionPage_Folder;
+ public static String GCCBuildCommandParserOptionPage_Project;
+ public static String GCCBuildCommandParserOptionPage_ResolvePaths;
public static String MacrosBlock_label_delete_all_confirm_message;
public static String MacrosBlock_label_delete_all_confirm_title;
public static String MacrosBlock_label_delete_confirm_message;
@@ -212,6 +222,7 @@ public class Messages extends NLS {
public static String PropertyPageDefsTab_8;
public static String PropertyPageDefsTab_9;
public static String PropertyPageDefsTab_showIncludeFileTab;
+ public static String PropertyPageDefsTab_showProvidersTab;
public static String RefreshPolicyExceptionDialog_addDialogLabel;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_message;
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_title;
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
index 652c667936..a39e524536 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/Messages.properties
@@ -274,6 +274,7 @@ PropertyPageDefsTab_7=Show disc. page names if they are unique. Else show profil
PropertyPageDefsTab_8=Always show names + profile IDs
PropertyPageDefsTab_9=Always show profile IDs only
PropertyPageDefsTab_showIncludeFileTab=Display "Include Files" tab
+PropertyPageDefsTab_showProvidersTab=Display "Preprocessor Include Paths" tabs
ProjectConvert_convertersList=Converters List
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
@@ -303,3 +304,15 @@ NewCfgDialog_5=Import predefined
ToolChainSelectionPage_Description=Select the initial toolchain for this project.
ToolChainSelectionPage_Title=Select Tool Chain
+
+# Language Settings Providers
+BuiltinSpecsDetectorOptionPage_AllocateConsole=Allocate console in the Console View
+BuiltinSpecsDetectorOptionPage_Browse=Browse...
+BuiltinSpecsDetectorOptionPage_ChooseFile=Choose file
+BuiltinSpecsDetectorOptionPage_CompilerSpecsCommand=Command to get compiler specs:
+GCCBuildCommandParserOptionPage_CompilerPattern=Compiler command pattern:
+GCCBuildCommandParserOptionPage_ContainerForDiscoveredEntries=Container to keep discovered entries
+GCCBuildCommandParserOptionPage_File=File (use when settings vary for different files)
+GCCBuildCommandParserOptionPage_Folder=Folder (use when settings are the same for all files in each folder)
+GCCBuildCommandParserOptionPage_Project=Project (use when settings are the same for all files in the project)
+GCCBuildCommandParserOptionPage_ResolvePaths=Use heuristics to resolve paths
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java
new file mode 100644
index 0000000000..9888493ed5
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/BuiltinSpecsDetectorOptionPage.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 Andrew Gvozdev and others.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
+
+import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
+import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
+import org.eclipse.cdt.utils.ui.controls.ControlFactory;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Options page for {@link AbstractBuiltinSpecsDetector}.
+ */
+public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettingProviderOptionPage {
+ private boolean fEditable;
+ private Text inputCommand;
+ private Button allocateConsoleCheckBox;
+
+ @Override
+ public void createControl(Composite parent) {
+ fEditable = parent.isEnabled();
+ AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
+
+ Composite composite = createCompositeForPageArea(parent);
+ createCompilerCommandInputControl(composite, provider);
+ createBrowseButton(composite);
+ createConsoleCheckbox(composite, provider);
+
+ setControl(composite);
+ }
+
+ /**
+ * Create composite for the page.
+ */
+ private Composite createCompositeForPageArea(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 1;
+ layout.marginHeight = 1;
+ layout.marginRight = 1;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Dialog.applyDialogFont(composite);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ composite.setLayoutData(gd);
+ return composite;
+ }
+
+ /**
+ * Create input control for compiler command.
+ */
+ private void createCompilerCommandInputControl(Composite composite, AbstractBuiltinSpecsDetector provider) {
+ Label label = ControlFactory.createLabel(composite, Messages.BuiltinSpecsDetectorOptionPage_CompilerSpecsCommand);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ label.setLayoutData(gd);
+ label.setEnabled(fEditable);
+
+ inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
+ String command = provider.getCommand();
+ inputCommand.setText(command!=null ? command : ""); //$NON-NLS-1$
+ inputCommand.setEnabled(fEditable);
+ inputCommand.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ String text = inputCommand.getText();
+ AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
+ if (!text.equals(provider.getCommand())) {
+ AbstractBuiltinSpecsDetector selectedProvider = (AbstractBuiltinSpecsDetector) getProviderWorkingCopy();
+ selectedProvider.setCommand(text);
+ refreshItem(selectedProvider);
+ }
+ }
+ });
+ }
+
+ /**
+ * Create "Browse" button.
+ */
+ private void createBrowseButton(Composite composite) {
+ Button button = ControlFactory.createPushButton(composite, Messages.BuiltinSpecsDetectorOptionPage_Browse);
+ button.setEnabled(fEditable);
+ button.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent evt) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.NONE);
+ dialog.setText(Messages.BuiltinSpecsDetectorOptionPage_ChooseFile);
+ String fileName = inputCommand.getText();
+ // taking chance that the first word is a compiler path
+ int space = fileName.indexOf(' ');
+ if (space > 0) {
+ fileName = fileName.substring(0, space);
+ }
+ IPath folder = new Path(fileName).removeLastSegments(1);
+ dialog.setFilterPath(folder.toOSString());
+ String chosenFile = dialog.open();
+ if (chosenFile != null) {
+ inputCommand.insert(chosenFile);
+ }
+ }
+ });
+ }
+
+ /**
+ * Create check-box for console.
+ */
+ private void createConsoleCheckbox(Composite composite, AbstractBuiltinSpecsDetector provider) {
+ allocateConsoleCheckBox = new Button(composite, SWT.CHECK);
+ allocateConsoleCheckBox.setText(Messages.BuiltinSpecsDetectorOptionPage_AllocateConsole);
+ allocateConsoleCheckBox.setSelection(provider.isConsoleEnabled());
+ allocateConsoleCheckBox.setEnabled(fEditable);
+ allocateConsoleCheckBox.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean enabled = allocateConsoleCheckBox.getSelection();
+ AbstractBuiltinSpecsDetector provider = (AbstractBuiltinSpecsDetector) getProvider();
+ if (enabled != provider.isConsoleEnabled()) {
+ AbstractBuiltinSpecsDetector selectedProvider = (AbstractBuiltinSpecsDetector) getProviderWorkingCopy();
+ selectedProvider.setConsoleEnabled(enabled);
+ refreshItem(selectedProvider);
+ }
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/GCCBuildCommandParserOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/GCCBuildCommandParserOptionPage.java
new file mode 100644
index 0000000000..9f999d8d7a
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/GCCBuildCommandParserOptionPage.java
@@ -0,0 +1,231 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 Andrew Gvozdev and others.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
+
+import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuildCommandParser;
+import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
+import org.eclipse.cdt.utils.ui.controls.ControlFactory;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Options page for {@link AbstractBuildCommandParser}.
+ *
+ */
+public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSettingProviderOptionPage {
+ private boolean fEditable;
+
+ private Text inputCommand;
+ private Button expandRelativePathCheckBox;
+
+ private Button scopeProjectRadioButton;
+ private Button scopeFolderRadioButton;
+ private Button scopeFileRadioButton;
+
+ @Override
+ public void createControl(Composite parent) {
+ fEditable = parent.isEnabled();
+ AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ createCompositeForPageArea(composite);
+ createCompilerPatternInputControl(provider, composite);
+ createResourceScopeGroup(provider, composite);
+ createResolvePathsCheckbox(composite, provider);
+
+ setControl(composite);
+ }
+
+ /**
+ * Create composite for the page.
+ */
+ private void createCompositeForPageArea(final Composite composite) {
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 1;
+ layout.marginHeight = 1;
+ layout.marginRight = 1;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ Dialog.applyDialogFont(composite);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ composite.setLayoutData(gd);
+ }
+ }
+
+ /**
+ * Create input control for compiler pattern.
+ */
+ private void createCompilerPatternInputControl(AbstractBuildCommandParser provider, Composite composite) {
+ Label label = ControlFactory.createLabel(composite, Messages.GCCBuildCommandParserOptionPage_CompilerPattern);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 1;
+ label.setLayoutData(gd);
+ label.setEnabled(fEditable);
+
+ inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
+ String compilerPattern = provider.getCompilerPattern();
+ inputCommand.setText(compilerPattern!=null ? compilerPattern : ""); //$NON-NLS-1$
+
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalAlignment = SWT.FILL;
+ inputCommand.setLayoutData(gd);
+ inputCommand.setEnabled(fEditable);
+
+ inputCommand.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ String text = inputCommand.getText();
+ AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
+ if (!text.equals(provider.getCompilerPattern())) {
+ AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
+ selectedProvider.setCompilerPattern(text);
+ refreshItem(selectedProvider);
+ }
+ }
+ });
+ }
+
+ /**
+ * Create check-box for resolving paths.
+ */
+ private void createResolvePathsCheckbox(Composite composite, AbstractBuildCommandParser provider) {
+ expandRelativePathCheckBox = new Button(composite, SWT.CHECK);
+ expandRelativePathCheckBox.setText(Messages.GCCBuildCommandParserOptionPage_ResolvePaths);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ expandRelativePathCheckBox.setLayoutData(gd);
+
+ expandRelativePathCheckBox.setSelection(provider.isResolvingPaths());
+ expandRelativePathCheckBox.setEnabled(fEditable);
+ expandRelativePathCheckBox.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean enabled = expandRelativePathCheckBox.getSelection();
+ AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
+ if (enabled != provider.isResolvingPaths()) {
+ AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
+ selectedProvider.setResolvingPaths(enabled);
+ refreshItem(selectedProvider);
+ }
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ }
+
+ /**
+ * Create group and radio buttons for container to keep discovered entries.
+ */
+ private void createResourceScopeGroup(AbstractBuildCommandParser provider, Composite composite) {
+ Group resourceScopeGroup = new Group(composite, SWT.NONE);
+ resourceScopeGroup.setText(Messages.GCCBuildCommandParserOptionPage_ContainerForDiscoveredEntries);
+ resourceScopeGroup.setLayout(new GridLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ resourceScopeGroup.setLayoutData(gd);
+
+ scopeFileRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
+ scopeFileRadioButton.setText(Messages.GCCBuildCommandParserOptionPage_File);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ scopeFileRadioButton.setLayoutData(gd);
+
+ scopeFileRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FILE);
+ scopeFileRadioButton.setEnabled(fEditable);
+ scopeFileRadioButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean enabled = scopeFileRadioButton.getSelection();
+ AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
+ if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FILE)) {
+ AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
+ selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.FILE);
+ refreshItem(selectedProvider);
+ }
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ scopeFolderRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
+ scopeFolderRadioButton.setText(Messages.GCCBuildCommandParserOptionPage_Folder);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ scopeFolderRadioButton.setLayoutData(gd);
+
+ scopeFolderRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FOLDER);
+ scopeFolderRadioButton.setEnabled(fEditable);
+ scopeFolderRadioButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean enabled = scopeFolderRadioButton.getSelection();
+ AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
+ if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.FOLDER)) {
+ AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
+ selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.FOLDER);
+ refreshItem(selectedProvider);
+ }
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ scopeProjectRadioButton = new Button(resourceScopeGroup, SWT.RADIO);
+ scopeProjectRadioButton.setText(Messages.GCCBuildCommandParserOptionPage_Project);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ scopeProjectRadioButton.setLayoutData(gd);
+
+ scopeProjectRadioButton.setSelection(provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.PROJECT);
+ scopeProjectRadioButton.setEnabled(fEditable);
+ scopeProjectRadioButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean enabled = scopeProjectRadioButton.getSelection();
+ AbstractBuildCommandParser provider = (AbstractBuildCommandParser) getProvider();
+ if (enabled != (provider.getResourceScope() == AbstractBuildCommandParser.ResourceScope.PROJECT)) {
+ AbstractBuildCommandParser selectedProvider = (AbstractBuildCommandParser) getProviderWorkingCopy();
+ selectedProvider.setResourceScope(AbstractBuildCommandParser.ResourceScope.PROJECT);
+ refreshItem(selectedProvider);
+ }
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryConsole.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryConsole.java
new file mode 100644
index 0000000000..b12bf1c19c
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryConsole.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
+
+import java.net.URL;
+
+import org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
+import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
+
+/**
+ * Console adapter for {@link AbstractBuiltinSpecsDetector}.
+ */
+public class ScannerDiscoveryConsole extends CBuildConsole {
+ /**
+ * {@inheritDoc}
+ * @param consoleId - a console ID is expected here which then is used as menu context ID.
+ * @param defaultIconUrl - if {@code LanguageSettingsProviderAssociation} extension point
+ * defines URL by provider id, {@code defaultIconUrl} will be ignored and the URL from the extension
+ * point will be used. If not, supplied {@code defaultIconUrl} will be used.
+ */
+ @Override
+ public void init(String consoleId, String name, URL defaultIconUrl) {
+ URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId);
+ if (iconUrl == null) {
+ iconUrl = defaultIconUrl;
+ }
+
+ super.init(consoleId, name, iconUrl);
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryGlobalConsole.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryGlobalConsole.java
new file mode 100644
index 0000000000..0eed304893
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/language/settings/providers/ScannerDiscoveryGlobalConsole.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andrew Gvozdev - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.internal.core.ICConsole;
+import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
+import org.eclipse.cdt.ui.CDTSharedImages;
+import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.console.MessageConsoleStream;
+
+/**
+ * Console adapter for global {@link AbstractBuiltinSpecsDetector}.
+ *
+ * Note that this console is not colored.
+ */
+public class ScannerDiscoveryGlobalConsole implements ICConsole {
+ private MessageConsole console;
+
+ private class ConsoleOutputStreamAdapter extends ConsoleOutputStream {
+ private MessageConsoleStream fConsoleStream;
+ public ConsoleOutputStreamAdapter(MessageConsoleStream stream) {
+ fConsoleStream = stream;
+ }
+ @Override
+ public void write(int arg0) throws IOException {
+ fConsoleStream.write(arg0);
+ }
+ @Override
+ public synchronized void write(byte[] b, int off, int len) throws IOException {
+ fConsoleStream.write(b, off, len);
+ }
+
+ @Override
+ public void flush() throws IOException {
+ fConsoleStream.flush();
+ }
+
+ @Override
+ public void close() throws IOException {
+ fConsoleStream.close();
+ }
+ }
+
+ @Override
+ public void start(IProject project) {
+ Assert.isTrue(project == null);
+ }
+
+ @Override
+ public ConsoleOutputStream getOutputStream() throws CoreException {
+ return new ConsoleOutputStreamAdapter(console.newMessageStream());
+ }
+
+ @Override
+ public ConsoleOutputStream getInfoStream() throws CoreException {
+ return new ConsoleOutputStreamAdapter(console.newMessageStream());
+ }
+
+ @Override
+ public ConsoleOutputStream getErrorStream() throws CoreException {
+ return new ConsoleOutputStreamAdapter(console.newMessageStream());
+ }
+
+ @Override
+ public void init(String consoleId, String name, URL defaultIconUrl) {
+ console = null;
+
+ IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
+ IConsole[] allConsoles = consoleManager.getConsoles();
+ for (IConsole con : allConsoles) {
+ if (name.equals(con.getName()) && con instanceof MessageConsole) {
+ console = (MessageConsole) con;
+ console.clearConsole();
+ break;
+ }
+ }
+
+ if (console==null) {
+ URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId);
+ if (iconUrl == null) {
+ iconUrl = defaultIconUrl;
+ }
+
+ ImageDescriptor imageDescriptor;
+ if (iconUrl != null) {
+ imageDescriptor = CDTSharedImages.getImageDescriptor(iconUrl.toString());
+ } else {
+ imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+ }
+
+ console = new MessageConsole(name, imageDescriptor);
+ console.activate();
+ consoleManager.addConsoles(new IConsole[]{ console });
+ }
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
index 458f7e517a..9c6bb0af7e 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/preferences/PropertyPageDefsTab.java
@@ -12,9 +12,10 @@
package org.eclipse.cdt.managedbuilder.ui.preferences;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
+import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
-import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
@@ -25,19 +26,20 @@ import org.eclipse.swt.widgets.Group;
/**
* @since 5.1
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class PropertyPageDefsTab extends AbstractCPropertyTab {
private static final int SPACING = 5; // for radio buttons layout
-
+
private Button show_tree;
private Button show_inc_files;
private Button show_mng;
private Button show_tool;
private Button show_exp;
+ private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab
private Button show_tipbox;
private Button b_0;
@@ -48,77 +50,82 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
private Button s_0;
private Button s_1;
private Button s_2;
-
+
@Override
public void createControls(Composite parent) {
super.createControls(parent);
usercomp.setLayout(new GridLayout(1, false));
show_mng = new Button(usercomp, SWT.CHECK);
- show_mng.setText(Messages.PropertyPageDefsTab_0);
+ show_mng.setText(Messages.PropertyPageDefsTab_0);
show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_inc_files = new Button(usercomp, SWT.CHECK);
- show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab);
+ show_inc_files.setText(Messages.PropertyPageDefsTab_showIncludeFileTab);
show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tree = new Button(usercomp, SWT.CHECK);
- show_tree.setText(Messages.PropertyPageDefsTab_1);
+ show_tree.setText(Messages.PropertyPageDefsTab_1);
show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_tool = new Button(usercomp, SWT.CHECK);
- show_tool.setText(Messages.PropertyPageDefsTab_4);
+ show_tool.setText(Messages.PropertyPageDefsTab_4);
show_tool.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
show_exp = new Button(usercomp, SWT.CHECK);
- show_exp.setText(Messages.PropertyPageDefsTab_10);
+ show_exp.setText(Messages.PropertyPageDefsTab_10);
show_exp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
+ show_providers_tab = new Button(usercomp, SWT.CHECK);
+ show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab);
+ show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
show_tipbox = new Button(usercomp, SWT.CHECK);
- show_tipbox.setText(Messages.PropertyPageDefsTab_16);
+ show_tipbox.setText(Messages.PropertyPageDefsTab_16);
show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Group saveGrp = new Group(usercomp, SWT.NONE);
- saveGrp.setText(Messages.PropertyPageDefsTab_11);
+ saveGrp.setText(Messages.PropertyPageDefsTab_11);
saveGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
FillLayout fl = new FillLayout(SWT.VERTICAL);
fl.spacing = SPACING;
fl.marginHeight = SPACING;
fl.marginWidth = SPACING;
saveGrp.setLayout(fl);
-
+
s_0 = new Button(saveGrp, SWT.RADIO);
- s_0.setText(Messages.PropertyPageDefsTab_13);
+ s_0.setText(Messages.PropertyPageDefsTab_13);
s_1 = new Button(saveGrp, SWT.RADIO);
- s_1.setText(Messages.PropertyPageDefsTab_12);
+ s_1.setText(Messages.PropertyPageDefsTab_12);
s_2 = new Button(saveGrp, SWT.RADIO);
- s_2.setText(Messages.PropertyPageDefsTab_14);
-
+ s_2.setText(Messages.PropertyPageDefsTab_14);
+
Group discGrp = new Group(usercomp, SWT.NONE);
- discGrp.setText(Messages.PropertyPageDefsTab_5);
+ discGrp.setText(Messages.PropertyPageDefsTab_5);
discGrp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fl = new FillLayout(SWT.VERTICAL);
fl.spacing = SPACING;
fl.marginHeight = SPACING;
fl.marginWidth = SPACING;
discGrp.setLayout(fl);
-
+
b_0 = new Button(discGrp, SWT.RADIO);
- b_0.setText(Messages.PropertyPageDefsTab_6);
+ b_0.setText(Messages.PropertyPageDefsTab_6);
b_1 = new Button(discGrp, SWT.RADIO);
- b_1.setText(Messages.PropertyPageDefsTab_7);
+ b_1.setText(Messages.PropertyPageDefsTab_7);
b_2 = new Button(discGrp, SWT.RADIO);
- b_2.setText(Messages.PropertyPageDefsTab_8);
+ b_2.setText(Messages.PropertyPageDefsTab_8);
b_3 = new Button(discGrp, SWT.RADIO);
- b_3.setText(Messages.PropertyPageDefsTab_9);
-
+ b_3.setText(Messages.PropertyPageDefsTab_9);
+
show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES));
show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
show_exp.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_EXPORT));
+ show_providers_tab.setSelection(!CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS));
show_tipbox.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_TIPBOX));
-
+
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES)) {
case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_IDS: b_1.setSelection(true); break;
@@ -140,6 +147,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_EXPORT, show_exp.getSelection());
+ CDTPrefUtil.setBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS, !show_providers_tab.getSelection());
CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
int x = 0;
if (b_1.getSelection()) x = 1;
@@ -152,7 +160,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
else if (s_2.getSelection()) x = CDTPrefUtil.POSITION_SAVE_NONE;
CDTPrefUtil.setInt(CDTPrefUtil.KEY_POSSAVE, x);
}
-
+
@Override
protected void performDefaults() {
show_tree.setSelection(false);
@@ -160,6 +168,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
show_mng.setSelection(true);
show_tool.setSelection(true);
show_exp.setSelection(false);
+ show_providers_tab.setSelection(false);
show_tipbox.setSelection(false);
b_0.setSelection(true);
b_1.setSelection(false);

Back to the top