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;
|
||||
|
@ -39,6 +39,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
|||
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;
|
||||
|
||||
|
@ -76,6 +77,10 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
|||
show_exp.setText(Messages.PropertyPageDefsTab_10);
|
||||
show_exp.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_providers_tab = new Button(usercomp, SWT.CHECK);
|
||||
show_providers_tab.setText(Messages.PropertyPageDefsTab_showProvidersTab);
|
||||
show_providers_tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
@ -123,7 +128,9 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
|||
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)) {
|
||||
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue