1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

@Override annotations + organize imports + unnecessary

casts/$NON-NLS + trailing white spaces
This commit is contained in:
Andrew Gvozdev 2011-11-18 17:21:02 -05:00
parent 10dd44163a
commit ba7591a95b
11 changed files with 480 additions and 464 deletions

View file

@ -41,7 +41,7 @@ public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSetti
private boolean fEditable; private boolean fEditable;
private Text inputCommand; private Text inputCommand;
private StatusMessageLine fStatusLine; private StatusMessageLine fStatusLine;
private Button runOnceRadioButton; private Button runOnceRadioButton;
private Button runEveryBuildRadioButton; private Button runEveryBuildRadioButton;
@ -69,7 +69,7 @@ public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSetti
composite.setLayout(layout); composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setLayoutData(new GridData(GridData.FILL_BOTH));
Dialog.applyDialogFont(composite); Dialog.applyDialogFont(composite);
GridData gd = new GridData(GridData.FILL_HORIZONTAL); GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2; gd.horizontalSpan = 2;
composite.setLayoutData(gd); composite.setLayoutData(gd);
@ -90,15 +90,16 @@ public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSetti
inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER); inputCommand = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER);
String customParameter = provider.getCustomParameter(); String customParameter = provider.getCustomParameter();
inputCommand.setText(customParameter!=null ? customParameter : ""); inputCommand.setText(customParameter!=null ? customParameter : "");
GridData gd = new GridData(); GridData gd = new GridData();
gd.horizontalSpan = 1; gd.horizontalSpan = 1;
gd.grabExcessHorizontalSpace = true; gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL; gd.horizontalAlignment = SWT.FILL;
inputCommand.setLayoutData(gd); inputCommand.setLayoutData(gd);
inputCommand.setEnabled(fEditable); inputCommand.setEnabled(fEditable);
inputCommand.addModifyListener(new ModifyListener() { inputCommand.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
String text = inputCommand.getText(); String text = inputCommand.getText();
AbstractBuildCommandParser provider = getRawProvider(); AbstractBuildCommandParser provider = getRawProvider();
@ -155,7 +156,7 @@ public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSetti
}); });
} }
{ {
applyToProjectCheckBox = new Button(composite, SWT.CHECK); applyToProjectCheckBox = new Button(composite, SWT.CHECK);
applyToProjectCheckBox.setText("Apply discovered settings on project level"); applyToProjectCheckBox.setText("Apply discovered settings on project level");
@ -178,23 +179,23 @@ public final class GCCBuildCommandParserOptionPage extends AbstractLanguageSetti
providerTab.refreshItem(selectedProvider); providerTab.refreshItem(selectedProvider);
} }
} }
@Override @Override
public void widgetDefaultSelected(SelectionEvent e) { public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e); widgetSelected(e);
} }
}); });
} }
// // Status line // // Status line
// if (fEditable) { // if (fEditable) {
// fStatusLine = new StatusMessageLine(composite, SWT.LEFT, 2); // fStatusLine = new StatusMessageLine(composite, SWT.LEFT, 2);
// IStatus status = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, "Note that currently not all options are persisted (FIXME)"); // IStatus status = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, "Note that currently not all options are persisted (FIXME)");
// fStatusLine.setErrorStatus(status); // fStatusLine.setErrorStatus(status);
// } // }
setControl(composite); setControl(composite);
} }

View file

@ -30,7 +30,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
@ -42,7 +41,7 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
private boolean fEditable; private boolean fEditable;
private Text inputCommand; private Text inputCommand;
private StatusMessageLine fStatusLine; private StatusMessageLine fStatusLine;
private Button allocateConsoleCheckBox; private Button allocateConsoleCheckBox;
@ -66,7 +65,7 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
composite.setLayout(layout); composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH)); composite.setLayoutData(new GridData(GridData.FILL_BOTH));
Dialog.applyDialogFont(composite); Dialog.applyDialogFont(composite);
GridData gd = new GridData(GridData.FILL_HORIZONTAL); GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2; gd.horizontalSpan = 2;
composite.setLayoutData(gd); composite.setLayoutData(gd);
@ -89,6 +88,7 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
inputCommand.setText(customParameter!=null ? customParameter : ""); inputCommand.setText(customParameter!=null ? customParameter : "");
inputCommand.setEnabled(fEditable); inputCommand.setEnabled(fEditable);
inputCommand.addModifyListener(new ModifyListener() { inputCommand.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
String text = inputCommand.getText(); String text = inputCommand.getText();
AbstractBuiltinSpecsDetector provider = getRawProvider(); AbstractBuiltinSpecsDetector provider = getRawProvider();
@ -225,14 +225,14 @@ public final class BuiltinSpecsDetectorOptionPage extends AbstractLanguageSettin
}); });
} }
// // Status line // // Status line
// if (fEditable) { // if (fEditable) {
// fStatusLine = new StatusMessageLine(composite, SWT.LEFT, 2); // fStatusLine = new StatusMessageLine(composite, SWT.LEFT, 2);
// IStatus status = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, "Note that currently not all options are persisted (FIXME)"); // IStatus status = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, "Note that currently not all options are persisted (FIXME)");
// fStatusLine.setErrorStatus(status); // fStatusLine.setErrorStatus(status);
// } // }
setControl(composite); setControl(composite);
} }

View file

@ -30,7 +30,7 @@ import org.eclipse.ui.console.MessageConsoleStream;
public class ScannerDiscoveryGlobalConsole implements ICConsole { public class ScannerDiscoveryGlobalConsole implements ICConsole {
private MessageConsole console; private MessageConsole console;
private ConsoleOutputStreamAdapter stream; private ConsoleOutputStreamAdapter stream;
private class ConsoleOutputStreamAdapter extends ConsoleOutputStream { private class ConsoleOutputStreamAdapter extends ConsoleOutputStream {
private MessageConsoleStream fConsoleStream; private MessageConsoleStream fConsoleStream;
public ConsoleOutputStreamAdapter(MessageConsoleStream stream) { public ConsoleOutputStreamAdapter(MessageConsoleStream stream) {
@ -44,37 +44,42 @@ public class ScannerDiscoveryGlobalConsole implements ICConsole {
public synchronized void write(byte[] b, int off, int len) throws IOException { public synchronized void write(byte[] b, int off, int len) throws IOException {
fConsoleStream.write(b, off, len); fConsoleStream.write(b, off, len);
} }
@Override @Override
public void flush() throws IOException { public void flush() throws IOException {
fConsoleStream.flush(); fConsoleStream.flush();
} }
@Override @Override
public void close() throws IOException { public void close() throws IOException {
fConsoleStream.close(); fConsoleStream.close();
} }
} }
@Override
public void start(IProject project) { public void start(IProject project) {
Assert.isTrue(project == null); Assert.isTrue(project == null);
} }
@Override
public ConsoleOutputStream getOutputStream() throws CoreException { public ConsoleOutputStream getOutputStream() throws CoreException {
return stream; return stream;
} }
@Override
public ConsoleOutputStream getInfoStream() throws CoreException { public ConsoleOutputStream getInfoStream() throws CoreException {
return stream; return stream;
} }
@Override
public ConsoleOutputStream getErrorStream() throws CoreException { public ConsoleOutputStream getErrorStream() throws CoreException {
return stream; return stream;
} }
@Override
public void init(String consoleId, String name, URL defaultIconUrl) { public void init(String consoleId, String name, URL defaultIconUrl) {
console = null; console = null;
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager(); IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] allConsoles = consoleManager.getConsoles(); IConsole[] allConsoles = consoleManager.getConsoles();
for (IConsole con : allConsoles) { for (IConsole con : allConsoles) {
@ -90,12 +95,12 @@ public class ScannerDiscoveryGlobalConsole implements ICConsole {
if (iconUrl==null) { if (iconUrl==null) {
iconUrl = defaultIconUrl; iconUrl = defaultIconUrl;
} }
console = new MessageConsole(name, CDTSharedImages.getImageDescriptor(iconUrl.toString())); console = new MessageConsole(name, CDTSharedImages.getImageDescriptor(iconUrl.toString()));
console.activate(); console.activate();
consoleManager.addConsoles(new IConsole[]{ console }); consoleManager.addConsoles(new IConsole[]{ console });
} }
stream = new ConsoleOutputStreamAdapter(console.newMessageStream()); stream = new ConsoleOutputStreamAdapter(console.newMessageStream());
} }

View file

@ -50,16 +50,16 @@ import org.eclipse.core.runtime.IPath;
import org.osgi.framework.Version; import org.osgi.framework.Version;
/** /**
* This class represents a set of configurations * This class represents a set of configurations
* to be edited simultaneously on property pages. * to be edited simultaneously on property pages.
*/ */
public class MultiConfiguration extends MultiItemsHolder implements public class MultiConfiguration extends MultiItemsHolder implements
IMultiConfiguration { IMultiConfiguration {
private static final String[] EMPTY_STR_ARRAY = new String[0]; private static final String[] EMPTY_STR_ARRAY = new String[0];
protected IConfiguration[] fCfgs = null; protected IConfiguration[] fCfgs = null;
private int curr = 0; private int curr = 0;
public MultiConfiguration(IConfiguration[] cfs) { public MultiConfiguration(IConfiguration[] cfs) {
fCfgs = cfs; fCfgs = cfs;
for (int i=0; i<fCfgs.length; i++) for (int i=0; i<fCfgs.length; i++)
@ -68,19 +68,19 @@ public class MultiConfiguration extends MultiItemsHolder implements
break; break;
} }
} }
public MultiConfiguration(ICConfigurationDescription[] cfds) { public MultiConfiguration(ICConfigurationDescription[] cfds) {
this(cfds2cfs(cfds)); this(cfds2cfs(cfds));
} }
public static IConfiguration[] cfds2cfs(ICConfigurationDescription[] cfgds) { public static IConfiguration[] cfds2cfs(ICConfigurationDescription[] cfgds) {
IConfiguration[] cfs = new IConfiguration[cfgds.length]; IConfiguration[] cfs = new IConfiguration[cfgds.length];
for (int i=0; i<cfgds.length; i++) for (int i=0; i<cfgds.length; i++)
cfs[i] = ManagedBuildManager.getConfigurationForDescription(cfgds[i]); cfs[i] = ManagedBuildManager.getConfigurationForDescription(cfgds[i]);
return cfs; return cfs;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.MultiItemsHolder#getItems() * @see org.eclipse.cdt.core.settings.model.MultiItemsHolder#getItems()
*/ */
@ -211,24 +211,24 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/ */
@Override @Override
public IManagedCommandLineInfo generateToolCommandLineInfo( public IManagedCommandLineInfo generateToolCommandLineInfo(
String sourceExtension, String sourceExtension,
String[] flags, String[] flags,
String outputFlag, String outputFlag,
String outputPrefix, String outputPrefix,
String outputName, String outputName,
String[] inputResources, String[] inputResources,
IPath inputLocation, IPath inputLocation,
IPath outputLocation) { IPath outputLocation) {
if (DEBUG) if (DEBUG)
System.out.println("Strange multi access: MultiConfiguration.generateToolCommandLineInfo()"); //$NON-NLS-1$ System.out.println("Strange multi access: MultiConfiguration.generateToolCommandLineInfo()"); //$NON-NLS-1$
return curr().generateToolCommandLineInfo( return curr().generateToolCommandLineInfo(
sourceExtension, sourceExtension,
flags, flags,
outputFlag, outputFlag,
outputPrefix, outputPrefix,
outputName, outputName,
inputResources, inputResources,
inputLocation, inputLocation,
outputLocation); outputLocation);
} }
@ -243,7 +243,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
return EMPTY_STR; return EMPTY_STR;
return s; return s;
} }
public String[] getArtifactExtensions() { public String[] getArtifactExtensions() {
String[] s = new String[fCfgs.length]; String[] s = new String[fCfgs.length];
for (int i=0; i<fCfgs.length; i++) for (int i=0; i<fCfgs.length; i++)
@ -278,7 +278,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
String args0 = fCfgs[0].getBuildArguments(); String args0 = fCfgs[0].getBuildArguments();
if (args0 == null) if (args0 == null)
args0 = EMPTY_STR; args0 = EMPTY_STR;
for (IConfiguration cfg : fCfgs) { for (IConfiguration cfg : fCfgs) {
String args = cfg.getBuildArguments(); String args = cfg.getBuildArguments();
if (args == null) if (args == null)
@ -294,7 +294,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/ */
@Override @Override
public IBuildPropertyValue getBuildArtefactType() { public IBuildPropertyValue getBuildArtefactType() {
IBuildPropertyValue b = fCfgs[0].getBuildArtefactType(); IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
if (b == null) if (b == null)
return null; return null;
for (int i=1; i<fCfgs.length; i++) for (int i=1; i<fCfgs.length; i++)
@ -414,7 +414,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds() * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
*/ */
@Override @Override
public String getErrorParserIds() { public String getErrorParserIds() {
String s = fCfgs[0].getErrorParserIds(); String s = fCfgs[0].getErrorParserIds();
@ -440,6 +440,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
return s; return s;
} }
@Override
public String getDefaultLanguageSettingsProvidersIds() { public String getDefaultLanguageSettingsProvidersIds() {
ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode"); ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode");
return null; return null;
@ -847,9 +848,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
return false; return false;
return true; return true;
} }
public boolean[] isManagedBuildOnMulti() { public boolean[] isManagedBuildOnMulti() {
boolean[] b = new boolean[fCfgs.length]; boolean[] b = new boolean[fCfgs.length];
for (int i=0; i<fCfgs.length; i++) for (int i=0; i<fCfgs.length; i++)
b[i] = fCfgs[i].isManagedBuildOn(); b[i] = fCfgs[i].isManagedBuildOn();
return b; return b;
@ -1031,7 +1032,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String) * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String)
*/ */
@Override @Override
public void setName(String name) {} // do nothing public void setName(String name) {} // do nothing
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean) * @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean)
@ -1214,7 +1215,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
} }
return true; // all cfgs report true return true; // all cfgs report true
} }
@Override @Override
public void setParallelDef(boolean parallel) { public void setParallelDef(boolean parallel) {
for (IConfiguration cfg : fCfgs) { for (IConfiguration cfg : fCfgs) {
@ -1222,7 +1223,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
((Configuration)cfg).setParallelDef(parallel); ((Configuration)cfg).setParallelDef(parallel);
} }
} }
@Override @Override
public int getParallelNumber() { public int getParallelNumber() {
int res = 0; int res = 0;
@ -1231,7 +1232,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
int num = ((Configuration)cfg).getParallelNumber(); int num = ((Configuration)cfg).getParallelNumber();
Assert.isTrue(num != 0); // can't be 0, see IMakeCommonBuildInfo.getParallelizationNum() Assert.isTrue(num != 0); // can't be 0, see IMakeCommonBuildInfo.getParallelizationNum()
if (res == 0) if (res == 0)
res = num; res = num;
else if (res != num) else if (res != num)
return 0; // values are different ! return 0; // values are different !
@ -1240,7 +1241,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
} }
return res; // all cfgs report same value return res; // all cfgs report same value
} }
@Override @Override
public void setParallelNumber(int num) { public void setParallelNumber(int num) {
for (IConfiguration cfg : fCfgs) { for (IConfiguration cfg : fCfgs) {
@ -1248,12 +1249,12 @@ public class MultiConfiguration extends MultiItemsHolder implements
((Configuration)cfg).setParallelNumber(num); ((Configuration)cfg).setParallelNumber(num);
} }
} }
@Override @Override
public boolean getInternalBuilderParallel() { public boolean getInternalBuilderParallel() {
return getParallelDef(); return getParallelDef();
} }
@Override @Override
public boolean isInternalBuilderEnabled() { public boolean isInternalBuilderEnabled() {
for (int i=0; i<fCfgs.length; i++) for (int i=0; i<fCfgs.length; i++)
@ -1275,14 +1276,14 @@ public class MultiConfiguration extends MultiItemsHolder implements
return false; return false;
return true; // all cfgs report true return true; // all cfgs report true
} }
@Override @Override
public void enableInternalBuilder(boolean v) { public void enableInternalBuilder(boolean v) {
for (int i=0; i<fCfgs.length; i++) for (int i=0; i<fCfgs.length; i++)
if (fCfgs[i] instanceof Configuration) if (fCfgs[i] instanceof Configuration)
((Configuration)fCfgs[i]).enableInternalBuilder(v); ((Configuration)fCfgs[i]).enableInternalBuilder(v);
} }
/** /**
* Returns "default" configuration. * Returns "default" configuration.
*/ */
@ -1367,7 +1368,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
ManagedBuilderCorePlugin.log(e); ManagedBuilderCorePlugin.log(e);
} }
} }
public String getBuildAttribute(String name, String defValue) { public String getBuildAttribute(String name, String defValue) {
String res = defValue; String res = defValue;
IBuilder b = fCfgs[0].getBuilder(); IBuilder b = fCfgs[0].getBuilder();

View file

@ -15,7 +15,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.cdt.core.AbstractExecutableExtensionBase; import org.eclipse.cdt.core.AbstractExecutableExtensionBase;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsEditableProvider;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider; import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICFileDescription; import org.eclipse.cdt.core.settings.model.ICFileDescription;
@ -31,11 +30,12 @@ import org.eclipse.core.runtime.IPath;
//public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsEditableProvider { //public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsEditableProvider {
public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsProvider { public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsProvider {
@Override
public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) { public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
IPath projectPath = rc.getProjectRelativePath(); IPath projectPath = rc.getProjectRelativePath();
ICLanguageSetting[] languageSettings = null; ICLanguageSetting[] languageSettings = null;
if (rc instanceof IFile) { if (rc instanceof IFile) {
ICLanguageSetting ls = cfgDescription.getLanguageSettingForFile(projectPath, true); ICLanguageSetting ls = cfgDescription.getLanguageSettingForFile(projectPath, true);
if (ls != null) { if (ls != null) {
@ -45,9 +45,9 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
ICResourceDescription rcDescription = cfgDescription.getResourceDescription(projectPath, false); ICResourceDescription rcDescription = cfgDescription.getResourceDescription(projectPath, false);
languageSettings = getLanguageSettings(rcDescription); languageSettings = getLanguageSettings(rcDescription);
} }
List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>(); List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
if (languageSettings != null) { if (languageSettings != null) {
for (ICLanguageSetting langSetting : languageSettings) { for (ICLanguageSetting langSetting : languageSettings) {
if (langSetting!=null) { if (langSetting!=null) {
@ -69,7 +69,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
} }
return list; return list;
} }
private ICLanguageSetting[] getLanguageSettings(ICResourceDescription rcDescription) { private ICLanguageSetting[] getLanguageSettings(ICResourceDescription rcDescription) {
ICLanguageSetting[] array = null; ICLanguageSetting[] array = null;
switch (rcDescription.getType()) { switch (rcDescription.getType()) {
@ -98,7 +98,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
// lang.setSettingEntries(kind, entries); // lang.setSettingEntries(kind, entries);
IPath projectPath = rc.getProjectRelativePath(); IPath projectPath = rc.getProjectRelativePath();
ICResourceDescription rcDescription = cfgDescription.getResourceDescription(projectPath, false); ICResourceDescription rcDescription = cfgDescription.getResourceDescription(projectPath, false);
for (ICLanguageSetting languageSetting : getLanguageSettings(rcDescription)) { for (ICLanguageSetting languageSetting : getLanguageSettings(rcDescription)) {
if (languageSetting!=null) { if (languageSetting!=null) {
String id = languageSetting.getLanguageId(); String id = languageSetting.getLanguageId();

View file

@ -43,7 +43,7 @@ public class LanguageSettingsExtensionManager {
/** Name of the extension point for contributing language settings */ /** Name of the extension point for contributing language settings */
static final String PROVIDER_EXTENSION_FULL_ID = "org.eclipse.cdt.core.LanguageSettingsProvider"; //$NON-NLS-1$ static final String PROVIDER_EXTENSION_FULL_ID = "org.eclipse.cdt.core.LanguageSettingsProvider"; //$NON-NLS-1$
static final String PROVIDER_EXTENSION_SIMPLE_ID = "LanguageSettingsProvider"; //$NON-NLS-1$ static final String PROVIDER_EXTENSION_SIMPLE_ID = "LanguageSettingsProvider"; //$NON-NLS-1$
static final String ELEM_PROVIDER = "provider"; //$NON-NLS-1$ static final String ELEM_PROVIDER = "provider"; //$NON-NLS-1$
static final String ATTR_CLASS = "class"; //$NON-NLS-1$ static final String ATTR_CLASS = "class"; //$NON-NLS-1$
static final String ATTR_ID = "id"; //$NON-NLS-1$ static final String ATTR_ID = "id"; //$NON-NLS-1$
@ -57,7 +57,7 @@ public class LanguageSettingsExtensionManager {
static final String ATTR_KIND = "kind"; //$NON-NLS-1$ static final String ATTR_KIND = "kind"; //$NON-NLS-1$
static final String ATTR_VALUE = "value"; //$NON-NLS-1$ static final String ATTR_VALUE = "value"; //$NON-NLS-1$
/** /**
* Extension providers loaded once. If the provider is editable (read cloneable) * Extension providers loaded once. If the provider is editable (read cloneable)
* external callers get copy rather than real instance. * external callers get copy rather than real instance.
*/ */
@ -82,6 +82,7 @@ public class LanguageSettingsExtensionManager {
// sort by name - for the providers taken from platform extensions // sort by name - for the providers taken from platform extensions
Set<ILanguageSettingsProvider> sortedProviders = new TreeSet<ILanguageSettingsProvider>( Set<ILanguageSettingsProvider> sortedProviders = new TreeSet<ILanguageSettingsProvider>(
new Comparator<ILanguageSettingsProvider>() { new Comparator<ILanguageSettingsProvider>() {
@Override
public int compare(ILanguageSettingsProvider pr1, ILanguageSettingsProvider pr2) { public int compare(ILanguageSettingsProvider pr1, ILanguageSettingsProvider pr2) {
return pr1.getName().compareTo(pr2.getName()); return pr1.getName().compareTo(pr2.getName());
} }
@ -155,7 +156,7 @@ public class LanguageSettingsExtensionManager {
/** /**
* Configure language settings provider with parameters defined in XML metadata. * Configure language settings provider with parameters defined in XML metadata.
* *
* @param provider - empty non-configured provider. * @param provider - empty non-configured provider.
* @param ce - configuration element from registry representing XML. * @param ce - configuration element from registry representing XML.
*/ */
@ -222,7 +223,7 @@ public class LanguageSettingsExtensionManager {
if (className==null || className.length()==0) { if (className==null || className.length()==0) {
return new LanguageSettingsBaseProvider(); return new LanguageSettingsBaseProvider();
} }
try { try {
IExtensionPoint extension = registry.getExtensionPoint(CCorePlugin.PLUGIN_ID, PROVIDER_EXTENSION_SIMPLE_ID); IExtensionPoint extension = registry.getExtensionPoint(CCorePlugin.PLUGIN_ID, PROVIDER_EXTENSION_SIMPLE_ID);
if (extension != null) { if (extension != null) {
@ -249,8 +250,8 @@ public class LanguageSettingsExtensionManager {
} }
/** /**
* Create an instance of language settings provider of given class name. * Create an instance of language settings provider of given class name.
* *
* @param className - class name to instantiate. * @param className - class name to instantiate.
* @return new instance of language settings provider. * @return new instance of language settings provider.
*/ */
@ -258,7 +259,7 @@ public class LanguageSettingsExtensionManager {
if (className==null || className.equals(LanguageSettingsSerializableProvider.class.getName())) { if (className==null || className.equals(LanguageSettingsSerializableProvider.class.getName())) {
return new LanguageSettingsSerializableProvider(); return new LanguageSettingsSerializableProvider();
} }
ILanguageSettingsProvider provider = createProviderCarcass(className, Platform.getExtensionRegistry()); ILanguageSettingsProvider provider = createProviderCarcass(className, Platform.getExtensionRegistry());
if (provider==null) { if (provider==null) {
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "Not able to load provider class=" + className); IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "Not able to load provider class=" + className);
@ -280,7 +281,7 @@ public class LanguageSettingsExtensionManager {
if (provider!=null) { if (provider!=null) {
if (!(provider instanceof ILanguageSettingsEditableProvider)) if (!(provider instanceof ILanguageSettingsEditableProvider))
throw new CloneNotSupportedException("Not able to clone provider " + provider.getClass()); throw new CloneNotSupportedException("Not able to clone provider " + provider.getClass());
provider = ((ILanguageSettingsEditableProvider) provider).clone(); provider = ((ILanguageSettingsEditableProvider) provider).clone();
} }
return provider; return provider;
@ -288,7 +289,7 @@ public class LanguageSettingsExtensionManager {
/** /**
* TODO * TODO
* *
* @param id * @param id
* @return * @return
*/ */
@ -305,7 +306,7 @@ public class LanguageSettingsExtensionManager {
} }
return provider; return provider;
} }
/** /**
* @return list of providers contributed by all extensions. Preferable copy but if not possible * @return list of providers contributed by all extensions. Preferable copy but if not possible
* will return raw provider. * will return raw provider.
@ -321,7 +322,7 @@ public class LanguageSettingsExtensionManager {
} }
if (extensionProvider==null) if (extensionProvider==null)
extensionProvider = fExtensionProviders.get(id); extensionProvider = fExtensionProviders.get(id);
if (extensionProvider!=null) if (extensionProvider!=null)
list.add(extensionProvider); list.add(extensionProvider);
} }

View file

@ -658,7 +658,8 @@ projects:
} }
} }
private static void loadProviderEntries(LanguageSettingsSerializableProvider provider, String cfgId, Element projectElementWsp) { private static void loadProviderEntries(LanguageSettingsSerializableProvider provider,
String cfgId, Element projectElementWsp) {
/* /*
<project> <project>
<configuration id="cfg.id"> <configuration id="cfg.id">

View file

@ -819,6 +819,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return status != null ? status : CConfigurationStatus.CFG_STATUS_OK; return status != null ? status : CConfigurationStatus.CFG_STATUS_OK;
} }
@Override
public void setLanguageSettingProviders(List<ILanguageSettingsProvider> providers) { public void setLanguageSettingProviders(List<ILanguageSettingsProvider> providers) {
try { try {
CConfigurationSpecSettings specSettings = getSpecSettings(); CConfigurationSpecSettings specSettings = getSpecSettings();
@ -828,6 +829,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
} }
} }
@Override
public List<ILanguageSettingsProvider> getLanguageSettingProviders() { public List<ILanguageSettingsProvider> getLanguageSettingProviders() {
try { try {
return getSpecSettings().getLanguageSettingProviders(); return getSpecSettings().getLanguageSettingProviders();

View file

@ -56,7 +56,7 @@ import org.eclipse.core.runtime.QualifiedName;
/** /**
* CConfigurationDescriptionCache is a proxy class for serialization of configuration description data. * CConfigurationDescriptionCache is a proxy class for serialization of configuration description data.
* *
* An inspection of the scenario where user changes project properties and saves it yields * An inspection of the scenario where user changes project properties and saves it yields
* following sequence of events: * following sequence of events:
* - Initialization: * - Initialization:
@ -603,12 +603,14 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
return status != null ? status : CConfigurationStatus.CFG_STATUS_OK; return status != null ? status : CConfigurationStatus.CFG_STATUS_OK;
} }
@Override
public void setLanguageSettingProviders(List<ILanguageSettingsProvider> providers) { public void setLanguageSettingProviders(List<ILanguageSettingsProvider> providers) {
if(!fInitializing) if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException(); throw ExceptionFactory.createIsReadOnlyException();
fSpecSettings.setLanguageSettingProviders(providers); fSpecSettings.setLanguageSettingProviders(providers);
} }
@Override
public List<ILanguageSettingsProvider> getLanguageSettingProviders() { public List<ILanguageSettingsProvider> getLanguageSettingProviders() {
return fSpecSettings.getLanguageSettingProviders(); return fSpecSettings.getLanguageSettingProviders();
} }

View file

@ -639,11 +639,13 @@ public class MultiConfigDescription extends MultiItemsHolder implements
fCfgs[i].removeStorage(id); fCfgs[i].removeStorage(id);
} }
@Override
public void setLanguageSettingProviders(List<ILanguageSettingsProvider> providers) { public void setLanguageSettingProviders(List<ILanguageSettingsProvider> providers) {
if (DEBUG) if (DEBUG)
System.out.println("Bad multi access: MultiConfigDescription.setLanguageSettingProviders()"); //$NON-NLS-1$ System.out.println("Bad multi access: MultiConfigDescription.setLanguageSettingProviders()"); //$NON-NLS-1$
} }
@Override
public List<ILanguageSettingsProvider> getLanguageSettingProviders() { public List<ILanguageSettingsProvider> getLanguageSettingProviders() {
if (DEBUG) if (DEBUG)
System.out.println("Bad multi access: MultiConfigDescription.getLanguageSettingProviders()"); //$NON-NLS-1$ System.out.println("Bad multi access: MultiConfigDescription.getLanguageSettingProviders()"); //$NON-NLS-1$