1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-05-23 21:07:44 +00:00
parent a69e4f47a1
commit 25dd44749e

View file

@ -96,13 +96,11 @@ public class IndexerBlock extends AbstractCOptionPage {
initializeIndexerConfigMap(); initializeIndexerConfigMap();
} }
@Override @Override
public boolean isValid() { public boolean isValid() {
return super.isValid() && (fCurrentPage == null || fCurrentPage.isValid()); return super.isValid() && (fCurrentPage == null || fCurrentPage.isValid());
} }
@Override @Override
public String getErrorMessage() { public String getErrorMessage() {
String msg = super.getErrorMessage(); String msg = super.getErrorMessage();
@ -112,7 +110,6 @@ public class IndexerBlock extends AbstractCOptionPage {
return msg; return msg;
} }
/** /**
* Create a profile page only on request * Create a profile page only on request
*/ */
@ -133,8 +130,7 @@ public class IndexerBlock extends AbstractCOptionPage {
if (fPage == null) { if (fPage == null) {
try { try {
fPage= (AbstractIndexerPage) fElement.createExecutableExtension(ATTRIB_CLASS); fPage= (AbstractIndexerPage) fElement.createExecutableExtension(ATTRIB_CLASS);
} } catch (Exception e) {
catch (Exception e) {
CUIPlugin.log(e); CUIPlugin.log(e);
} }
if (fPage == null) { if (fPage == null) {
@ -294,8 +290,7 @@ public class IndexerBlock extends AbstractCOptionPage {
ICProjectDescription prefs= prjDescMgr.getProjectDescription(getProject(), false); ICProjectDescription prefs= prjDescMgr.getProjectDescription(getProject(), false);
selectBuildConfigInCombo(prefs.getActiveConfiguration().getName()); selectBuildConfigInCombo(prefs.getActiveConfiguration().getName());
fBuildConfigComboBox.setEnabled(false); fBuildConfigComboBox.setEnabled(false);
} } else {
else {
// independent of the scope // independent of the scope
fBuildConfigComboBox.setEnabled(true); fBuildConfigComboBox.setEnabled(true);
} }
@ -310,8 +305,7 @@ public class IndexerBlock extends AbstractCOptionPage {
} }
if (enable) { if (enable) {
fEnableState= null; fEnableState= null;
} } else {
else {
fEnableState= ControlEnableState.disable(fPreferenceContent); fEnableState= ControlEnableState.disable(fPreferenceContent);
} }
} }
@ -345,7 +339,6 @@ public class IndexerBlock extends AbstractCOptionPage {
names[j++]= fIndexerConfigMap.get(id).getName(); names[j++]= fIndexerConfigMap.get(id).getName();
} }
} }
@SuppressWarnings("unchecked")
final Comparator<Object> collator = Collator.getInstance(); final Comparator<Object> collator = Collator.getInstance();
Arrays.sort(names, collator); Arrays.sort(names, collator);
fIndexersComboBox.setItems(names); fIndexersComboBox.setItems(names);
@ -371,7 +364,6 @@ public class IndexerBlock extends AbstractCOptionPage {
ICConfigurationDescription config = configs[i]; ICConfigurationDescription config = configs[i];
names[i]= config.getName(); names[i]= config.getName();
} }
@SuppressWarnings("unchecked")
final Comparator<Object> collator = Collator.getInstance(); final Comparator<Object> collator = Collator.getInstance();
Arrays.sort(names, collator); Arrays.sort(names, collator);
fBuildConfigComboBox.setItems(names); fBuildConfigComboBox.setItems(names);
@ -398,8 +390,7 @@ public class IndexerBlock extends AbstractCOptionPage {
if (getIndexerName(indexerId) == null) { if (getIndexerName(indexerId) == null) {
if (fCurrentProperties != null) { if (fCurrentProperties != null) {
props= fCurrentProperties; props= fCurrentProperties;
} } else {
else {
props= IndexerPreferences.getProperties(getProject(), IndexerPreferences.SCOPE_INSTANCE); props= IndexerPreferences.getProperties(getProject(), IndexerPreferences.SCOPE_INSTANCE);
} }
} }
@ -479,7 +470,6 @@ public class IndexerBlock extends AbstractCOptionPage {
fCurrentPage= page; fCurrentPage= page;
} }
/** /**
* Adds all the contributed Indexer Pages to a map * Adds all the contributed Indexer Pages to a map
*/ */
@ -552,11 +542,10 @@ public class IndexerBlock extends AbstractCOptionPage {
ICProjectDescription prefs= prjDescMgr.getProjectDescription(getProject(), true); ICProjectDescription prefs= prjDescMgr.getProjectDescription(getProject(), true);
if (scope == IndexerPreferences.SCOPE_INSTANCE) { if (scope == IndexerPreferences.SCOPE_INSTANCE) {
prefs.useDefaultConfigurationRelations(); prefs.useDefaultConfigurationRelations();
} } else {
else { prefs.setConfigurationRelations(useActive ?
prefs.setConfigurationRelations(useActive ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE :
? ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE ICProjectDescriptionPreferences.CONFIGS_INDEPENDENT);
: ICProjectDescriptionPreferences.CONFIGS_INDEPENDENT);
} }
if (!useActive) { if (!useActive) {
final ICConfigurationDescription config= prefs.getConfigurationByName(fBuildConfigComboBox.getText()); final ICConfigurationDescription config= prefs.getConfigurationByName(fBuildConfigComboBox.getText());
@ -575,8 +564,7 @@ public class IndexerBlock extends AbstractCOptionPage {
if (fPrefScopeBlock != null) { if (fPrefScopeBlock != null) {
fPrefScopeBlock.setInstanceScope(); fPrefScopeBlock.setInstanceScope();
onPreferenceScopeChange(); onPreferenceScopeChange();
} } else {
else {
fCurrentProperties= IndexerPreferences.getDefaultIndexerProperties(); fCurrentProperties= IndexerPreferences.getDefaultIndexerProperties();
updateForNewProperties(IndexerPreferences.SCOPE_INSTANCE); updateForNewProperties(IndexerPreferences.SCOPE_INSTANCE);
} }
@ -612,8 +600,7 @@ public class IndexerBlock extends AbstractCOptionPage {
if (container instanceof ICOptionContainerExtension) { if (container instanceof ICOptionContainerExtension) {
try { try {
return ((ICOptionContainerExtension) container).getProjectHandle(); return ((ICOptionContainerExtension) container).getProjectHandle();
} } catch (Exception e) {
catch (Exception e) {
return null; return null;
} }
} }