mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 16:56:04 +02:00
Code streamlining.
This commit is contained in:
parent
2e121463ed
commit
fb3a4c8d26
8 changed files with 10 additions and 26 deletions
|
@ -243,7 +243,7 @@ public class ExcludeFromBuildHandler extends AbstractHandler {
|
|||
try {
|
||||
CoreModel.getDefault().setProjectDescription(p, prjd);
|
||||
} catch (CoreException e) {
|
||||
CUIPlugin.getDefault().logErrorMessage(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
CUIPlugin.logError(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
}
|
||||
AbstractPage.updateViews(res);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@ import org.eclipse.cdt.internal.ui.dialogs.IStatusChangeListener;
|
|||
public abstract class OptionsConfigurationBlock {
|
||||
|
||||
public static final class Key {
|
||||
|
||||
private String fQualifier;
|
||||
private String fKey;
|
||||
|
||||
|
@ -118,9 +117,7 @@ public abstract class OptionsConfigurationBlock {
|
|||
public String getQualifier() {
|
||||
return fQualifier;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected static class ControlData {
|
||||
private Key fKey;
|
||||
|
@ -208,7 +205,7 @@ public abstract class OptionsConfigurationBlock {
|
|||
};
|
||||
}
|
||||
|
||||
testIfOptionsComplete(allKeys);
|
||||
checkIfOptionsComplete(allKeys);
|
||||
if (fProject == null || hasProjectSpecificOptions(fProject)) {
|
||||
fDisabledProjectSettings= null;
|
||||
} else {
|
||||
|
@ -245,12 +242,11 @@ public abstract class OptionsConfigurationBlock {
|
|||
protected final static Key getCDTUIKey(String key) {
|
||||
return getKey(CUIPlugin.PLUGIN_ID, key);
|
||||
}
|
||||
|
||||
|
||||
private void testIfOptionsComplete(Key[] allKeys) {
|
||||
private void checkIfOptionsComplete(Key[] allKeys) {
|
||||
for (int i= 0; i < allKeys.length; i++) {
|
||||
if (allKeys[i].getStoredValue(fLookupOrder, false, fManager) == null) {
|
||||
CUIPlugin.getDefault().logErrorMessage("preference option missing: " + allKeys[i] + " (" + this.getClass().getName() +')'); //$NON-NLS-1$//$NON-NLS-2$
|
||||
CUIPlugin.logError("Preference option missing: " + allKeys[i] + " (" + this.getClass().getName() +')'); //$NON-NLS-1$//$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,11 +260,9 @@ public abstract class OptionsConfigurationBlock {
|
|||
fManager.getWorkingCopy(DefaultScope.INSTANCE.getNode(CUIPlugin.PLUGIN_ID)).putInt(REBUILD_COUNT_KEY, fRebuildCount);
|
||||
}
|
||||
|
||||
|
||||
protected void settingsUpdated() {
|
||||
}
|
||||
|
||||
|
||||
public void selectOption(String key, String qualifier) {
|
||||
for (int i= 0; i < fAllKeys.length; i++) {
|
||||
Key curr= fAllKeys[i];
|
||||
|
@ -295,7 +289,6 @@ public abstract class OptionsConfigurationBlock {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean hasProjectSpecificOptions(IProject project) {
|
||||
if (project != null) {
|
||||
IScopeContext projectContext= new ProjectScope(project);
|
||||
|
@ -696,7 +689,6 @@ public abstract class OptionsConfigurationBlock {
|
|||
return fDisabledProjectSettings == null || fProject == null;
|
||||
}
|
||||
|
||||
|
||||
public boolean performOk() {
|
||||
return processChanges(fContainer);
|
||||
}
|
||||
|
|
|
@ -59,9 +59,7 @@ import org.eclipse.cdt.internal.ui.preferences.formatter.ProfileManager.CustomPr
|
|||
import org.eclipse.cdt.internal.ui.preferences.formatter.ProfileManager.Profile;
|
||||
|
||||
|
||||
|
||||
public class ProfileStore {
|
||||
|
||||
/** The default encoding to use */
|
||||
public static final String ENCODING= "UTF-8"; //$NON-NLS-1$
|
||||
|
||||
|
@ -71,7 +69,6 @@ public class ProfileStore {
|
|||
* A SAX event handler to parse the xml format for profiles.
|
||||
*/
|
||||
private final static class ProfileDefaultHandler extends DefaultHandler {
|
||||
|
||||
private List<Profile> fProfiles;
|
||||
private int fVersion;
|
||||
|
||||
|
@ -123,7 +120,6 @@ public class ProfileStore {
|
|||
public List<Profile> getProfiles() {
|
||||
return fProfiles;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -229,7 +225,6 @@ public class ProfileStore {
|
|||
* @throws CoreException
|
||||
*/
|
||||
protected static List<Profile> readProfilesFromStream(InputSource inputSource) throws CoreException {
|
||||
|
||||
final ProfileDefaultHandler handler= new ProfileDefaultHandler();
|
||||
try {
|
||||
final SAXParserFactory factory= SAXParserFactory.newInstance();
|
||||
|
@ -274,8 +269,6 @@ public class ProfileStore {
|
|||
* @throws CoreException
|
||||
*/
|
||||
private static void writeProfilesToStream(Collection<Profile> profiles, OutputStream stream, String encoding, IProfileVersioner profileVersioner) throws CoreException {
|
||||
|
||||
|
||||
try {
|
||||
final DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilder builder= factory.newDocumentBuilder();
|
||||
|
@ -305,7 +298,6 @@ public class ProfileStore {
|
|||
throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_serializing_xml_message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create a new profile element in the specified document. The profile is not added
|
||||
|
@ -328,7 +320,7 @@ public class ProfileStore {
|
|||
setting.setAttribute(XML_ATTRIBUTE_VALUE, value);
|
||||
element.appendChild(setting);
|
||||
} else {
|
||||
CUIPlugin.getDefault().logErrorMessage("ProfileStore: Profile does not contain value for key " + key); //$NON-NLS-1$
|
||||
CUIPlugin.logError("ProfileStore: Profile does not contain value for key " + key); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
return element;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class CorrectionCommandInstaller {
|
|||
}
|
||||
|
||||
if (fCorrectionHandlerActivations != null) {
|
||||
CUIPlugin.getDefault().logErrorMessage("correction handler activations not released"); //$NON-NLS-1$
|
||||
CUIPlugin.logError("Correction handler activations not released"); //$NON-NLS-1$
|
||||
}
|
||||
fCorrectionHandlerActivations= new ArrayList<IHandlerActivation>();
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public class OpenNewWizardAction extends AbstractOpenWizardAction {
|
|||
}
|
||||
return null;
|
||||
} catch (MalformedURLException exception) {
|
||||
CUIPlugin.getDefault().logErrorMessage("Unable to load wizard icon"); //$NON-NLS-1$
|
||||
CUIPlugin.logError("Unable to load wizard icon"); //$NON-NLS-1$
|
||||
}
|
||||
return ImageDescriptor.getMissingImageDescriptor();
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ implements IWorkbenchWindowPulldownDelegate2, IObjectActionDelegate {
|
|||
try {
|
||||
CoreModel.getDefault().setProjectDescription(p, prjd);
|
||||
} catch (CoreException e) {
|
||||
CUIPlugin.getDefault().logErrorMessage(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
CUIPlugin.logError(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
}
|
||||
AbstractPage.updateViews(res);
|
||||
}
|
||||
|
|
|
@ -656,7 +656,7 @@ implements
|
|||
else
|
||||
CDTPropertyManager.performOk(AbstractPage.this);
|
||||
} catch (CoreException e) {
|
||||
CUIPlugin.getDefault().logErrorMessage(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
CUIPlugin.logError(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
}
|
||||
updateViews(internalElement);
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ public class CDTPropertyManager {
|
|||
try {
|
||||
CoreModel.getDefault().setProjectDescription(project, prjd);
|
||||
} catch (CoreException e) {
|
||||
CUIPlugin.getDefault().logErrorMessage(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
CUIPlugin.logError(Messages.AbstractPage_11 + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
if (pages.size() == 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue