mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Enablements of tabs in properties
This commit is contained in:
parent
1e208208ed
commit
1c826045e9
11 changed files with 173 additions and 156 deletions
|
@ -577,8 +577,13 @@
|
|||
>
|
||||
<enabledWhen>
|
||||
<adapt type="org.eclipse.core.resources.IProject">
|
||||
<test property="org.eclipse.core.resources.projectNature"
|
||||
value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
|
||||
<and>
|
||||
<test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.managedbuilder.core.managedBuildNature"/>
|
||||
<or>
|
||||
<test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.sd.page.enable="/>
|
||||
<test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.sd.page.enable=true"/>
|
||||
</or>
|
||||
</and>
|
||||
</adapt>
|
||||
</enabledWhen>
|
||||
</page>
|
||||
|
|
|
@ -223,6 +223,7 @@ public class Messages extends NLS {
|
|||
public static String PropertyPageDefsTab_9;
|
||||
public static String PropertyPageDefsTab_showIncludeFileTab;
|
||||
public static String PropertyPageDefsTab_showProvidersTab;
|
||||
public static String PropertyPageDefsTab_showScannerDiscoveryTab;
|
||||
public static String RefreshPolicyExceptionDialog_addDialogLabel;
|
||||
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_message;
|
||||
public static String RefreshPolicyExceptionDialog_AddExceptionInfoDialog_title;
|
||||
|
|
|
@ -275,6 +275,7 @@ 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" tab and enable language settings providers
|
||||
PropertyPageDefsTab_showScannerDiscoveryTab=Display "Scanner Discovery" tab
|
||||
ProjectConvert_convertersList=Converters List
|
||||
|
||||
AbstractPrefPage_0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.ui.preferences;
|
||||
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
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;
|
||||
|
@ -34,109 +34,116 @@ 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 show_tree;
|
||||
private Button show_inc_files;
|
||||
private Button show_mng;
|
||||
private Button show_tool;
|
||||
private Button show_exp;
|
||||
private Button show_sd;
|
||||
private Button show_providers_tab; // temporary checkbox for scanner discovery Providers tab
|
||||
private Button show_tipbox;
|
||||
|
||||
private Button b_0;
|
||||
private Button b_1;
|
||||
private Button b_2;
|
||||
private Button b_3;
|
||||
private Button b_0;
|
||||
private Button b_1;
|
||||
private Button b_2;
|
||||
private Button b_3;
|
||||
|
||||
private Button s_0;
|
||||
private Button s_1;
|
||||
private Button s_2;
|
||||
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.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
show_mng = new Button(usercomp, SWT.CHECK);
|
||||
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.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
show_inc_files = new Button(usercomp, SWT.CHECK);
|
||||
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.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
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.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
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.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
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_sd = new Button(usercomp, SWT.CHECK);
|
||||
show_sd.setText(Messages.PropertyPageDefsTab_showScannerDiscoveryTab);
|
||||
show_sd.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
show_tipbox = new Button(usercomp, SWT.CHECK);
|
||||
show_tipbox.setText(Messages.PropertyPageDefsTab_16);
|
||||
show_tipbox.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));
|
||||
|
||||
Group saveGrp = new Group(usercomp, SWT.NONE);
|
||||
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);
|
||||
show_tipbox = new Button(usercomp, SWT.CHECK);
|
||||
show_tipbox.setText(Messages.PropertyPageDefsTab_16);
|
||||
show_tipbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
s_0 = new Button(saveGrp, SWT.RADIO);
|
||||
s_0.setText(Messages.PropertyPageDefsTab_13);
|
||||
s_1 = new Button(saveGrp, SWT.RADIO);
|
||||
s_1.setText(Messages.PropertyPageDefsTab_12);
|
||||
s_2 = new Button(saveGrp, SWT.RADIO);
|
||||
s_2.setText(Messages.PropertyPageDefsTab_14);
|
||||
Group saveGrp = new Group(usercomp, SWT.NONE);
|
||||
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);
|
||||
|
||||
Group discGrp = new Group(usercomp, SWT.NONE);
|
||||
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);
|
||||
s_0 = new Button(saveGrp, SWT.RADIO);
|
||||
s_0.setText(Messages.PropertyPageDefsTab_13);
|
||||
s_1 = new Button(saveGrp, SWT.RADIO);
|
||||
s_1.setText(Messages.PropertyPageDefsTab_12);
|
||||
s_2 = new Button(saveGrp, SWT.RADIO);
|
||||
s_2.setText(Messages.PropertyPageDefsTab_14);
|
||||
|
||||
b_0 = new Button(discGrp, SWT.RADIO);
|
||||
b_0.setText(Messages.PropertyPageDefsTab_6);
|
||||
b_1 = new Button(discGrp, SWT.RADIO);
|
||||
b_1.setText(Messages.PropertyPageDefsTab_7);
|
||||
b_2 = new Button(discGrp, SWT.RADIO);
|
||||
b_2.setText(Messages.PropertyPageDefsTab_8);
|
||||
b_3 = new Button(discGrp, SWT.RADIO);
|
||||
b_3.setText(Messages.PropertyPageDefsTab_9);
|
||||
Group discGrp = new Group(usercomp, SWT.NONE);
|
||||
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);
|
||||
|
||||
show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES));
|
||||
show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
|
||||
b_0 = new Button(discGrp, SWT.RADIO);
|
||||
b_0.setText(Messages.PropertyPageDefsTab_6);
|
||||
b_1 = new Button(discGrp, SWT.RADIO);
|
||||
b_1.setText(Messages.PropertyPageDefsTab_7);
|
||||
b_2 = new Button(discGrp, SWT.RADIO);
|
||||
b_2.setText(Messages.PropertyPageDefsTab_8);
|
||||
b_3 = new Button(discGrp, SWT.RADIO);
|
||||
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));
|
||||
// ensure default is "true" for scanner discovery tab
|
||||
show_sd.setSelection(!CDTPrefUtil.getStr(CDTPrefUtil.KEY_SHOW_SD).equals(Boolean.FALSE.toString()));
|
||||
show_providers_tab.setSelection(ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null));
|
||||
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;
|
||||
case CDTPrefUtil.DISC_NAMING_ALWAYS_BOTH: b_2.setSelection(true); break;
|
||||
case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break;
|
||||
case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_BOTH: b_0.setSelection(true); break;
|
||||
case CDTPrefUtil.DISC_NAMING_UNIQUE_OR_IDS: b_1.setSelection(true); break;
|
||||
case CDTPrefUtil.DISC_NAMING_ALWAYS_BOTH: b_2.setSelection(true); break;
|
||||
case CDTPrefUtil.DISC_NAMING_ALWAYS_IDS: b_3.setSelection(true); break;
|
||||
}
|
||||
|
||||
switch (CDTPrefUtil.getInt(CDTPrefUtil.KEY_POSSAVE)) {
|
||||
case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break;
|
||||
case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break;
|
||||
default: s_0.setSelection(true); break;
|
||||
case CDTPrefUtil.POSITION_SAVE_BOTH: s_1.setSelection(true); break;
|
||||
case CDTPrefUtil.POSITION_SAVE_NONE: s_2.setSelection(true); break;
|
||||
default: s_0.setSelection(true); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,7 +154,9 @@ 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());
|
||||
// ensure default is "true" for scanner discovery tab
|
||||
CDTPrefUtil.setStr(CDTPrefUtil.KEY_SHOW_SD, Boolean.toString(show_sd.getSelection()));
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(null, show_providers_tab.getSelection());
|
||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_TIPBOX, show_tipbox.getSelection());
|
||||
int x = 0;
|
||||
if (b_1.getSelection()) x = 1;
|
||||
|
@ -168,7 +177,8 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
|||
show_mng.setSelection(true);
|
||||
show_tool.setSelection(true);
|
||||
show_exp.setSelection(false);
|
||||
show_providers_tab.setSelection(false);
|
||||
show_sd.setSelection(true);
|
||||
show_providers_tab.setSelection(true);
|
||||
show_tipbox.setSelection(false);
|
||||
b_0.setSelection(true);
|
||||
b_1.setSelection(false);
|
||||
|
|
|
@ -43,23 +43,22 @@ public class ScannerDiscoveryLegacySupport {
|
|||
/** ID of MBS language settings provider (from org.eclipse.cdt.managedbuilder.core) */
|
||||
public static final String MBS_LANGUAGE_SETTINGS_PROVIDER_ID = "org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider"; //$NON-NLS-1$
|
||||
|
||||
private static String USE_LANGUAGE_SETTINGS_PROVIDERS_PREFERENCE = "enabled"; //$NON-NLS-1$
|
||||
// the default needs to be "false" for legacy projects to be open with old SD enabled for MBS provider
|
||||
private static boolean USE_LANGUAGE_SETTINGS_PROVIDERS_DEFAULT = false;
|
||||
private static final String PREFERENCES_QUALIFIER = CCorePlugin.PLUGIN_ID;
|
||||
private static final String LANGUAGE_SETTINGS_PROVIDERS_NODE = "languageSettingsProviders"; //$NON-NLS-1$
|
||||
private static String DISABLE_LSP_PREFERENCE = "language.settings.providers.disabled"; //$NON-NLS-1$
|
||||
// the default for project needs to be "disabled" - for legacy projects to be open with old SD enabled for MBS provider
|
||||
private static boolean DISABLE_LSP_DEFAULT_PROJECT = true;
|
||||
private static boolean DISABLE_LSP_DEFAULT_WORKSPACE = false;
|
||||
private static final String PREFERENCES_QUALIFIER_CCORE = CCorePlugin.PLUGIN_ID;
|
||||
|
||||
private static Map<String, String> legacyProfiles = null;
|
||||
|
||||
|
||||
/**
|
||||
* Get preferences node for org.eclipse.cdt.core.
|
||||
*/
|
||||
private static Preferences getPreferences(IProject project) {
|
||||
if (project == null) {
|
||||
return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE);
|
||||
return InstanceScope.INSTANCE.getNode(PREFERENCES_QUALIFIER_CCORE);
|
||||
} else {
|
||||
return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER).node(LANGUAGE_SETTINGS_PROVIDERS_NODE);
|
||||
return new LocalProjectScope(project).getNode(PREFERENCES_QUALIFIER_CCORE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +72,8 @@ public class ScannerDiscoveryLegacySupport {
|
|||
*/
|
||||
public static boolean isLanguageSettingsProvidersFunctionalityEnabled(IProject project) {
|
||||
Preferences pref = getPreferences(project);
|
||||
return pref.getBoolean(USE_LANGUAGE_SETTINGS_PROVIDERS_PREFERENCE, USE_LANGUAGE_SETTINGS_PROVIDERS_DEFAULT);
|
||||
boolean defaultValue = project != null ? DISABLE_LSP_DEFAULT_PROJECT : DISABLE_LSP_DEFAULT_WORKSPACE;
|
||||
return !pref.getBoolean(DISABLE_LSP_PREFERENCE, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,7 @@ public class ScannerDiscoveryLegacySupport {
|
|||
*/
|
||||
public static void setLanguageSettingsProvidersFunctionalityEnabled(IProject project, boolean value) {
|
||||
Preferences pref = getPreferences(project);
|
||||
pref.putBoolean(USE_LANGUAGE_SETTINGS_PROVIDERS_PREFERENCE, value);
|
||||
pref.putBoolean(DISABLE_LSP_PREFERENCE, !value);
|
||||
try {
|
||||
pref.flush();
|
||||
} catch (BackingStoreException e) {
|
||||
|
@ -168,7 +168,7 @@ public class ScannerDiscoveryLegacySupport {
|
|||
|
||||
// InputTypes
|
||||
// TODO -doublecheck
|
||||
// legacyProfiles.put(inputTypeId, scannerConfigDiscoveryProfileId);
|
||||
// legacyProfiles.put(inputTypeId, scannerConfigDiscoveryProfileId);
|
||||
legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
|
||||
legacyProfiles.put("cdt.managedbuild.tool.gnu.cpp.compiler.input", "org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP|org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile");
|
||||
legacyProfiles.put("cdt.managedbuild.tool.gnu.c.compiler.input.cygwin", "org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC");
|
||||
|
@ -179,7 +179,7 @@ public class ScannerDiscoveryLegacySupport {
|
|||
|
||||
// Toolchains
|
||||
// TODO -doublecheck
|
||||
// legacyProfiles.put(toolchainId, scannerConfigDiscoveryProfileId);
|
||||
// legacyProfiles.put(toolchainId, scannerConfigDiscoveryProfileId);
|
||||
}
|
||||
|
||||
return legacyProfiles.get(id);
|
||||
|
|
|
@ -231,6 +231,7 @@ ExcludeAction.label=Exclude from Build...
|
|||
BuildConfigurationActionSet.descr=Build active configuration for the current project
|
||||
|
||||
BuildLoggingPreferencePage.name=Logging
|
||||
LanguageSettingsProvidersPropertyPage.name=Preprocessor Include Paths, Macros etc.
|
||||
|
||||
# Common Editor ruler actions
|
||||
AddTask.label=Add &Task...
|
||||
|
|
|
@ -3370,7 +3370,7 @@
|
|||
</enabledWhen>
|
||||
</page>
|
||||
<page
|
||||
name="Preprocessor Include Paths, Macros etc."
|
||||
name="%LanguageSettingsProvidersPropertyPage.name"
|
||||
id="org.eclipse.cdt.ui.language.settings"
|
||||
class="org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage"
|
||||
category="org.eclipse.cdt.ui.newui.Page_head_general">
|
||||
|
@ -3378,7 +3378,7 @@
|
|||
<adapt type="org.eclipse.core.resources.IResource">
|
||||
<and>
|
||||
<test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
|
||||
<test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.ui:properties.providers.tab.disable=false"/>
|
||||
<test property="org.eclipse.cdt.ui.checkPreference" value="org.eclipse.cdt.core:language.settings.providers.disabled=false"/>
|
||||
</and>
|
||||
</adapt>
|
||||
</enabledWhen>
|
||||
|
|
|
@ -47,6 +47,7 @@ import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvide
|
|||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsBaseProvider;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.model.ILanguage;
|
||||
import org.eclipse.cdt.core.model.LanguageManager;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
|
@ -56,7 +57,6 @@ import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
|||
import org.eclipse.cdt.ui.CDTSharedImages;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.newui.LanguageSettingsImages;
|
||||
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||
|
@ -1054,7 +1054,7 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
|
|||
List<ILanguageSettingsProvider> newProviders = new ArrayList<ILanguageSettingsProvider>(oldProviders.size());
|
||||
|
||||
// clear entries for a given resource for all languages where applicable
|
||||
providers: for (ILanguageSettingsProvider provider : oldProviders) {
|
||||
providers: for (ILanguageSettingsProvider provider : oldProviders) {
|
||||
ILanguageSettingsEditableProvider providerCopy = null;
|
||||
if (provider instanceof ILanguageSettingsEditableProvider) {
|
||||
for (TreeItem langItems : treeLanguages.getItems()) {
|
||||
|
@ -1113,7 +1113,7 @@ providers: for (ILanguageSettingsProvider provider : oldProviders) {
|
|||
|
||||
@Override
|
||||
public boolean canBeVisible() {
|
||||
if (CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS)) {
|
||||
if (!ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvide
|
|||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySupport;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
import org.eclipse.cdt.ui.CDTSharedImages;
|
||||
|
@ -56,7 +57,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
|||
import org.eclipse.cdt.ui.dialogs.ICOptionPage;
|
||||
import org.eclipse.cdt.ui.language.settings.providers.AbstractLanguageSettingProviderOptionPage;
|
||||
import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
|
||||
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
|
||||
import org.eclipse.cdt.utils.ui.controls.TabFolderLayout;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||
|
@ -1161,7 +1161,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
|||
|
||||
@Override
|
||||
public boolean canBeVisible() {
|
||||
if (CDTPrefUtil.getBool(LanguageSettingsProvidersPage.KEY_NO_SHOW_PROVIDERS)) {
|
||||
if (!ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,9 +24,6 @@ import org.eclipse.cdt.ui.newui.ICPropertyTab;
|
|||
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||
*/
|
||||
public class LanguageSettingsProvidersPage extends AbstractPage {
|
||||
/** @since 5.4 */ // temporary key, subject to removal
|
||||
public static final String KEY_NO_SHOW_PROVIDERS = "properties.providers.tab.disable"; //$NON-NLS-1$
|
||||
|
||||
private static boolean isLanguageSettingsProvidersEnabled = false;
|
||||
private static IProject project = null;
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ public class CDTPrefUtil {
|
|||
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
||||
/** @since 5.2 Show the "Include Files" settings entry tab */
|
||||
public static final String KEY_SHOW_INC_FILES = "properties.includefiles.page.enable"; //$NON-NLS-1$
|
||||
/** @since 5.4 Show the "Scanner Discovery" tab*/
|
||||
public static final String KEY_SHOW_SD = "properties.sd.page.enable"; //$NON-NLS-1$
|
||||
/** @since 5.2 */
|
||||
public static final String KEY_TIPBOX = "properties.option.tipbox.enable"; //$NON-NLS-1$
|
||||
// string keys
|
||||
|
@ -47,37 +49,37 @@ public class CDTPrefUtil {
|
|||
public static final String KEY_CONFSET = "workingsets.selected.configs"; //$NON-NLS-1$
|
||||
// integer keys
|
||||
public static final String KEY_POSSAVE = "properties.save.position"; //$NON-NLS-1$
|
||||
public static final int POSITION_SAVE_SIZE = 0;
|
||||
public static final int POSITION_SAVE_NONE = 2;
|
||||
public static final int POSITION_SAVE_BOTH = 3;
|
||||
|
||||
public static final int POSITION_SAVE_SIZE = 0;
|
||||
public static final int POSITION_SAVE_NONE = 2;
|
||||
public static final int POSITION_SAVE_BOTH = 3;
|
||||
|
||||
public static final String KEY_DISC_NAMES = "properties.discovery.naming"; //$NON-NLS-1$
|
||||
public static final int DISC_NAMING_UNIQUE_OR_BOTH = 0;
|
||||
public static final int DISC_NAMING_UNIQUE_OR_IDS = 1;
|
||||
public static final int DISC_NAMING_ALWAYS_BOTH = 2;
|
||||
public static final int DISC_NAMING_ALWAYS_IDS = 3;
|
||||
public static final int DISC_NAMING_DEFAULT = DISC_NAMING_UNIQUE_OR_BOTH;
|
||||
|
||||
public static final int DISC_NAMING_UNIQUE_OR_BOTH = 0;
|
||||
public static final int DISC_NAMING_UNIQUE_OR_IDS = 1;
|
||||
public static final int DISC_NAMING_ALWAYS_BOTH = 2;
|
||||
public static final int DISC_NAMING_ALWAYS_IDS = 3;
|
||||
public static final int DISC_NAMING_DEFAULT = DISC_NAMING_UNIQUE_OR_BOTH;
|
||||
|
||||
/** Property key used for string list display mode for multi-configuration edits (conjunction/disjunction) */
|
||||
public static final String KEY_DMODE = "properties.multi.displ.mode"; //$NON-NLS-1$
|
||||
/** Conjunction implies showing only common elements (intersection) */
|
||||
public static final int DMODE_CONJUNCTION = 1;
|
||||
/** Disjunction implies showing all elements (union) */
|
||||
public static final int DMODE_DISJUNCTION = 2;
|
||||
|
||||
/** Conjunction implies showing only common elements (intersection) */
|
||||
public static final int DMODE_CONJUNCTION = 1;
|
||||
/** Disjunction implies showing all elements (union) */
|
||||
public static final int DMODE_DISJUNCTION = 2;
|
||||
|
||||
/** Property key used for string list write mode for multi-configuration edits (modify/replace) */
|
||||
public static final String KEY_WMODE = "properties.multi.write.mode"; //$NON-NLS-1$
|
||||
/** Modify implies changing only given elements and not changing any others */
|
||||
public static final int WMODE_MODIFY = 4;
|
||||
/** Replace implies replacing the whole list with the given one, overwriting old entries */
|
||||
public static final int WMODE_REPLACE = 8;
|
||||
|
||||
/** Modify implies changing only given elements and not changing any others */
|
||||
public static final int WMODE_MODIFY = 4;
|
||||
/** Replace implies replacing the whole list with the given one, overwriting old entries */
|
||||
public static final int WMODE_REPLACE = 8;
|
||||
|
||||
public static final String NULL = "NULL"; //$NON-NLS-1$
|
||||
private static final IPreferenceStore pref = CUIPlugin.getDefault().getPreferenceStore();
|
||||
private static final String DELIMITER = " "; //$NON-NLS-1$
|
||||
public static final String CONFSETDEL = "\f"; //$NON-NLS-1$
|
||||
private static LinkedList<String> preferredTCs = null;
|
||||
|
||||
|
||||
public static final Object[] EMPTY_ARRAY = new Object[0];
|
||||
|
||||
// low-level methods
|
||||
|
@ -93,34 +95,34 @@ public class CDTPrefUtil {
|
|||
preferredTCs = new LinkedList<String>(Arrays.asList(getStr(KEY_PREFTC).split(DELIMITER)));
|
||||
}
|
||||
public static List<String> getPreferredTCs() {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
return preferredTCs;
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
return preferredTCs;
|
||||
}
|
||||
public static void delPreferredTC(String s) {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
preferredTCs.remove(s);
|
||||
public static void delPreferredTC(String s) {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
preferredTCs.remove(s);
|
||||
}
|
||||
public static void addPreferredTC(String s) {
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
if (!preferredTCs.contains(s)) preferredTCs.add(s);
|
||||
if (preferredTCs == null) readPreferredTCs();
|
||||
if (!preferredTCs.contains(s)) preferredTCs.add(s);
|
||||
}
|
||||
public static void cleanPreferredTCs() {
|
||||
setStr(KEY_PREFTC, IPreferenceStore.STRING_DEFAULT_DEFAULT);
|
||||
readPreferredTCs();
|
||||
readPreferredTCs();
|
||||
}
|
||||
public static void savePreferredTCs() {
|
||||
if (preferredTCs == null) return;
|
||||
if (preferredTCs == null) return;
|
||||
Iterator<String> it = preferredTCs.iterator();
|
||||
StringBuilder b = new StringBuilder();
|
||||
StringBuilder b = new StringBuilder();
|
||||
while (it.hasNext()) {
|
||||
String s = it.next();
|
||||
if (s == null) continue;
|
||||
if (s == null) continue;
|
||||
b.append(s);
|
||||
b.append(DELIMITER);
|
||||
}
|
||||
setStr(KEY_PREFTC, b.toString().trim());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns string list display mode for multi-configuration edits (conjunction/disjunction).
|
||||
*
|
||||
|
@ -136,7 +138,7 @@ public class CDTPrefUtil {
|
|||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets string list display mode for multi-configuration edits (conjunction/disjunction).
|
||||
*
|
||||
|
@ -148,7 +150,7 @@ public class CDTPrefUtil {
|
|||
public static void setMultiCfgStringListDisplayMode(int mode) {
|
||||
setInt(KEY_DMODE, mode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns string list write mode for multi-configuration edits (modify/replace).
|
||||
*
|
||||
|
@ -164,7 +166,7 @@ public class CDTPrefUtil {
|
|||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets string list write mode for multi-configuration edits (modify/replace).
|
||||
*
|
||||
|
@ -176,7 +178,7 @@ public class CDTPrefUtil {
|
|||
public static void setMultiCfgStringListWriteMode(int mode) {
|
||||
setInt(KEY_WMODE, mode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated as of CDT 8.0. Use {@link StringListModeControl} to display string list modes.
|
||||
*/
|
||||
|
@ -185,15 +187,15 @@ public class CDTPrefUtil {
|
|||
String s = null;
|
||||
switch(getMultiCfgStringListDisplayMode()) {
|
||||
case DMODE_CONJUNCTION:
|
||||
s = Messages.EnvironmentTab_17;
|
||||
s = Messages.EnvironmentTab_17;
|
||||
break;
|
||||
case DMODE_DISJUNCTION:
|
||||
s = Messages.EnvironmentTab_18;
|
||||
s = Messages.EnvironmentTab_18;
|
||||
break;
|
||||
}
|
||||
return Messages.EnvironmentTab_19 + s;
|
||||
return Messages.EnvironmentTab_19 + s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated as of CDT 8.0. Use {@link StringListModeControl} to display string list modes.
|
||||
*/
|
||||
|
@ -202,15 +204,15 @@ public class CDTPrefUtil {
|
|||
String s = null;
|
||||
switch(getMultiCfgStringListWriteMode()) {
|
||||
case WMODE_MODIFY:
|
||||
s = Messages.EnvironmentTab_24;
|
||||
s = Messages.EnvironmentTab_24;
|
||||
break;
|
||||
case WMODE_REPLACE:
|
||||
s = Messages.EnvironmentTab_21;
|
||||
s = Messages.EnvironmentTab_21;
|
||||
break;
|
||||
}
|
||||
return Messages.EnvironmentTab_22 + s;
|
||||
return Messages.EnvironmentTab_22 + s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Toggle string list display mode: conjunction <-> disjunction.
|
||||
*/
|
||||
|
@ -240,14 +242,14 @@ public class CDTPrefUtil {
|
|||
public static final String[] getStrListForDisplay(String[][] input) {
|
||||
return getStrListForDisplay(input, getMultiCfgStringListDisplayMode());
|
||||
}
|
||||
|
||||
|
||||
private static final String[] getStrListForDisplay(String[][] input, int mode) {
|
||||
Object[] ob = getListForDisplay(input, getMultiCfgStringListDisplayMode(), null);
|
||||
String[] ss = new String[ob.length];
|
||||
System.arraycopy(ob, 0, ss, 0, ob.length);
|
||||
return ss;
|
||||
}
|
||||
|
||||
|
||||
public static final Object[] getListForDisplay(Object[][] input, Comparator<Object> cmp) {
|
||||
return getListForDisplay(input, getMultiCfgStringListDisplayMode(), cmp);
|
||||
}
|
||||
|
@ -264,15 +266,15 @@ public class CDTPrefUtil {
|
|||
if (input.length == 1) {
|
||||
return (input[0] == null) ?
|
||||
EMPTY_ARRAY :
|
||||
input[0];
|
||||
input[0];
|
||||
}
|
||||
|
||||
Object[] s1 = input[0];
|
||||
if (s1 == null ||
|
||||
s1.length == 0)
|
||||
if (s1 == null ||
|
||||
s1.length == 0)
|
||||
return EMPTY_ARRAY;
|
||||
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
|
||||
{
|
||||
if (getMultiCfgStringListDisplayMode() == DMODE_CONJUNCTION)
|
||||
{
|
||||
ArrayList<Object> lst = new ArrayList<Object>();
|
||||
for (int i=0; i<s1.length; i++) {
|
||||
if (s1[i] == null)
|
||||
|
@ -298,7 +300,7 @@ public class CDTPrefUtil {
|
|||
TreeSet<Object> lst = new TreeSet<Object>(cmp); // set, to avoid doubles
|
||||
for (Object[] element : input) {
|
||||
if (element == null ||
|
||||
element.length == 0)
|
||||
element.length == 0)
|
||||
continue;
|
||||
for (Object element2 : element)
|
||||
lst.add(element2);
|
||||
|
@ -307,7 +309,7 @@ public class CDTPrefUtil {
|
|||
Arrays.sort(s1, cmp);
|
||||
return s1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use the {@link WorkingSetConfigurationManager} class, instead.
|
||||
*/
|
||||
|
@ -315,15 +317,15 @@ public class CDTPrefUtil {
|
|||
public static List<String> readConfigSets() {
|
||||
return new LinkedList<String>(Arrays.asList(getStr(KEY_CONFSET).split(CONFSETDEL)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use the {@link WorkingSetConfigurationManager} class, instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void saveConfigSets(List<String> out) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (String s : out) {
|
||||
if (s == null) continue;
|
||||
if (s == null) continue;
|
||||
b.append(s);
|
||||
b.append(CONFSETDEL);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue