Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-05-01 19:10:32 -0400
committerAndrew Gvozdev2012-05-01 23:05:41 -0400
commit5edeb05a5b0fd3f3d31b26f73262cd9ad3cc9e1f (patch)
treecfde31ea00905e4bb822fd3e19892d350437fc19 /build/org.eclipse.cdt.managedbuilder.ui
parent2b5e3e6a20a411b4f000c0d9a4eb7a33813a628c (diff)
downloadorg.eclipse.cdt-5edeb05a5b0fd3f3d31b26f73262cd9ad3cc9e1f.tar.gz
org.eclipse.cdt-5edeb05a5b0fd3f3d31b26f73262cd9ad3cc9e1f.tar.xz
org.eclipse.cdt-5edeb05a5b0fd3f3d31b26f73262cd9ad3cc9e1f.zip
bug 328007: [sd90] Disablement of property pages depending on preference
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/plugin.xml4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java53
2 files changed, 53 insertions, 4 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
index f5c72d2b4a..aa14d2bdc2 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml
@@ -534,7 +534,7 @@
<test property="org.eclipse.core.resources.projectNature"
value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
</adapt>
- <test property="org.eclipse.cdt.ui.pageEnabled" value="export" />
+ <test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.export.page.enable=true"/>
</and>
</enabledWhen>
</page>
@@ -564,7 +564,7 @@
<test property="org.eclipse.core.resources.projectNature"
value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
</adapt>
- <test property="org.eclipse.cdt.ui.pageEnabled" value="toolEdit" />
+ <test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.toolchain.modification.disable=false"/>
</and>
</enabledWhen>
</page>
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
index 1cb3196cbe..18d6660c72 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
@@ -24,10 +24,13 @@ import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager;
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgScannerConfigUtil;
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigProfileManager;
+import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
import org.eclipse.cdt.core.model.util.CDTListComparator;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
+import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
+import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2Set;
@@ -46,7 +49,9 @@ import org.eclipse.cdt.managedbuilder.core.IInputType;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.Messages;
+import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.cdt.utils.ui.controls.TabFolderLayout;
@@ -103,6 +108,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
private Button reportProblemsCheckBox;
private Combo profileComboBox;
private Composite profileOptionsComposite;
+ private Button clearButton;
private ICfgScannerConfigBuilderInfo2Set cbi;
private Map<InfoContext, IScannerConfigBuilderInfo2> baseInfoMap;
@@ -116,6 +122,8 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
private DiscoveryPageWrapper wrapper = null;
+ private StatusMessageLine fStatusLine;
+
/*
* (non-Javadoc)
*
@@ -184,6 +192,9 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
profileOptionsComposite.setLayoutData(gd);
profileOptionsComposite.setLayout(new TabFolderLayout());
+ fStatusLine = new StatusMessageLine(usercomp, SWT.LEFT, 2);
+ setEnablement();
+
sashForm.setWeights(DEFAULT_SASH_WEIGHTS);
}
@@ -204,6 +215,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
buildInfo.setSelectedProfileId(id);
handleDiscoveryProfileChanged();
}
+ showStatusLine();
}
});
reportProblemsCheckBox = setupCheck(autoDiscoveryGroup,
@@ -236,7 +248,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
Label clearLabel = ControlFactory.createLabel(autoDiscoveryGroup, Messages.DiscoveryTab_ClearDisoveredEntries);
// "Clear" button
- Button clearButton = ControlFactory.createPushButton(autoDiscoveryGroup, Messages.DiscoveryTab_Clear);
+ clearButton = ControlFactory.createPushButton(autoDiscoveryGroup, Messages.DiscoveryTab_Clear);
GridData gd = (GridData) clearButton.getLayoutData();
gd.grabExcessHorizontalSpace = true;
//Bug 331783 - NLS: "Clear" button label in Makefile Project preferences truncated
@@ -334,6 +346,37 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
} else {
setVisibility(Messages.DiscoveryTab_6);
}
+
+ setEnablement();
+ }
+
+ private void setEnablement() {
+ ICConfigurationDescription cfgDescription = page.getResDesc().getConfiguration();
+ boolean isEnabled = !LanguageSettingsProvidersPage.isLanguageSettingsProvidersEnabled(getProject()) || ScannerDiscoveryLegacySupport.isMbsLanguageSettingsProviderOn(cfgDescription);
+
+ scopeComboBox.setEnabled(isEnabled);
+ resTable.setEnabled(isEnabled);
+ boolean isSCDEnabled = autoDiscoveryCheckBox.getSelection();
+ reportProblemsCheckBox.setEnabled(isEnabled && isSCDEnabled);
+ autoDiscoveryCheckBox.setEnabled(isEnabled);
+ autoDiscoveryGroup.setEnabled(isEnabled);
+ clearButton.setEnabled(isEnabled);
+
+ showStatusLine();
+ }
+
+ private void showStatusLine() {
+ ICConfigurationDescription cfgDescription = page.getResDesc().getConfiguration();
+ boolean isEnabled = !LanguageSettingsProvidersPage.isLanguageSettingsProvidersEnabled(getProject()) || ScannerDiscoveryLegacySupport.isMbsLanguageSettingsProviderOn(cfgDescription);
+ IStatus status = null;
+ if (isEnabled) {
+ if (autoDiscoveryCheckBox.getSelection()) {
+ status = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, "This discovery method is deprecated, use 'Preprocessor Include Paths' instead.");
+ }
+ } else {
+ status = new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, "Managed Build language settings provider is not enabled (see 'Preprocessor Include Paths' page).");
+ }
+ fStatusLine.setErrorStatus(status);
}
private void setVisibility(String errMsg) {
@@ -372,7 +415,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
buildInfo = (IScannerConfigBuilderInfo2) ti.getData("info"); //$NON-NLS-1$
String selectedProfileId = buildInfo.getSelectedProfileId();
iContext = (CfgInfoContext) ti.getData("cont"); //$NON-NLS-1$
- autoDiscoveryCheckBox.setSelection(buildInfo.isAutoDiscoveryEnabled()
+ boolean autodiscoveryEnabled2 = buildInfo.isAutoDiscoveryEnabled();
+ if (autodiscoveryEnabled2) {
+ IConfiguration cfg = iContext.getConfiguration();
+ ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(cfg);
+ autodiscoveryEnabled2 = ScannerDiscoveryLegacySupport.isLegacyScannerDiscoveryOn(cfgDescription);
+ }
+ autoDiscoveryCheckBox.setSelection(autodiscoveryEnabled2
&& !selectedProfileId.equals(ScannerConfigProfileManager.NULL_PROFILE_ID));
reportProblemsCheckBox.setSelection(buildInfo.isProblemReportingEnabled());

Back to the top