From b1013baa60236746cc9ebb6824e2c6e99a8ead83 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 6 Jan 2012 12:23:26 -0800 Subject: [PATCH] @Override annotations. --- .../ui/preferences/NameStyleBlock.java | 10 ++++- .../ui/preferences/PreferencesAccess.java | 28 +++----------- .../ui/preferences/PreviewSourceViewer.java | 3 +- .../preferences/ProjectSelectionDialog.java | 5 ++- .../PropertyAndPreferencePage.java | 38 +++++++------------ .../ScalabilityPreferencePage.java | 15 +++++--- .../SmartTypingConfigurationBlock.java | 19 +++++++--- .../SpellingConfigurationBlock.java | 3 ++ .../preferences/SpellingPreferenceBlock.java | 16 ++++++-- .../TodoTaskConfigurationBlock.java | 12 ++++-- .../ui/preferences/TodoTaskInputDialog.java | 8 ++-- .../WorkInProgressPreferencePage.java | 8 ++-- 12 files changed, 87 insertions(+), 78 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java index f31d47696dc..f8356f1405a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/NameStyleBlock.java @@ -440,7 +440,7 @@ public class NameStyleBlock extends OptionsConfigurationBlock { private Key prefixKey; private Key alternativePrefixKey; private Key suffixKey; - private String seedName; + private final String seedName; private Category seedNameGenerator; private NameValidator nameValidator; @@ -630,31 +630,39 @@ public class NameStyleBlock extends OptionsConfigurationBlock { private class NameStyleAdapter extends ViewerComparator implements ITreeListAdapter, IDialogFieldListener { + @Override public void selectionChanged(TreeListDialogField field) { updateConfigurationBlock(field.getSelectedElements()); } + @Override public void customButtonPressed(TreeListDialogField field, int index) { } + @Override public void doubleClicked(TreeListDialogField field) { } + @Override public Category[] getChildren(TreeListDialogField field, Object element) { return ((Category) element).getChildren(); } + @Override public Category getParent(TreeListDialogField field, Object element) { return ((Category) element).parent; } + @Override public boolean hasChildren(TreeListDialogField field, Object element) { return ((Category) element).hasChildren(); } + @Override public void dialogFieldChanged(DialogField field) { } + @Override public void keyPressed(TreeListDialogField field, KeyEvent event) { } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesAccess.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesAccess.java index bede9ca7141..edb73ab1c59 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesAccess.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesAccess.java @@ -7,22 +7,18 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Sergey Prigogin, Google + * Sergey Prigogin (Google) *******************************************************************************/ - package org.eclipse.cdt.internal.ui.preferences; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ProjectScope; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.IScopeContext; import org.eclipse.core.runtime.preferences.InstanceScope; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ProjectScope; - import org.eclipse.ui.preferences.IWorkingCopyManager; - import org.osgi.service.prefs.BackingStoreException; /** @@ -57,9 +53,7 @@ public class PreferencesAccess { public void applyChanges() throws BackingStoreException { } - private static class WorkingCopyPreferencesAccess extends PreferencesAccess { - private final IWorkingCopyManager fWorkingCopyManager; private WorkingCopyPreferencesAccess(IWorkingCopyManager workingCopyManager) { @@ -85,9 +79,6 @@ public class PreferencesAccess { return getWorkingCopyScopeContext(super.getProjectScope(project)); } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.ui.preferences.PreferencesAccess#applyChanges() - */ @Override public void applyChanges() throws BackingStoreException { fWorkingCopyManager.applyChanges(); @@ -95,7 +86,6 @@ public class PreferencesAccess { } private static class WorkingCopyScopeContext implements IScopeContext { - private final IWorkingCopyManager fWorkingCopyManager; private final IScopeContext fOriginal; @@ -104,23 +94,17 @@ public class PreferencesAccess { fOriginal= original; } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.preferences.IScopeContext#getName() - */ + @Override public String getName() { return fOriginal.getName(); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.preferences.IScopeContext#getNode(java.lang.String) - */ + @Override public IEclipsePreferences getNode(String qualifier) { return fWorkingCopyManager.getWorkingCopy(fOriginal.getNode(qualifier)); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.preferences.IScopeContext#getLocation() - */ + @Override public IPath getLocation() { return fOriginal.getLocation(); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreviewSourceViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreviewSourceViewer.java index 1edac3a6344..33fc625dcd5 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreviewSourceViewer.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreviewSourceViewer.java @@ -8,7 +8,6 @@ * Contributors: * Qnx Software Systems - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.internal.ui.preferences; import org.eclipse.jface.preference.IPreferenceStore; @@ -30,7 +29,6 @@ import org.eclipse.ui.texteditor.AbstractTextEditor; */ @Deprecated class PreviewSourceViewer extends SourceViewer implements IPropertyChangeListener { - /** * This viewer's foreground color. * @@ -251,6 +249,7 @@ class PreviewSourceViewer extends SourceViewer implements IPropertyChangeListene /* * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) */ + @Override public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); if (AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND.equals(property) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProjectSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProjectSelectionDialog.java index 760a1b86481..69513c5c12f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProjectSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ProjectSelectionDialog.java @@ -46,7 +46,6 @@ import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; public class ProjectSelectionDialog extends SelectionStatusDialog { - // the visual selection widget group private TableViewer fTableViewer; private Set fProjectsWithSpecifics; @@ -89,11 +88,13 @@ public class ProjectSelectionDialog extends SelectionStatusDialog { fTableViewer= new TableViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { doSelectionChanged(((IStructuredSelection) event.getSelection()).toArray()); } }); fTableViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { okPressed(); } @@ -112,9 +113,11 @@ public class ProjectSelectionDialog extends SelectionStatusDialog { checkbox.setText(PreferencesMessages.ProjectSelectionDialog_filter); checkbox.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false)); checkbox.addSelectionListener(new SelectionListener() { + @Override public void widgetSelected(SelectionEvent e) { updateFilter(((Button) e.widget).getSelection()); } + @Override public void widgetDefaultSelected(SelectionEvent e) { updateFilter(((Button) e.widget).getSelection()); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java index 2bb8834c739..901a2e2a366 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PropertyAndPreferencePage.java @@ -6,9 +6,9 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation - * Sergey Prigogin, Google - * Anton Leherbauer (Wind River Systems) + * IBM Corporation - initial API and implementation + * Sergey Prigogin (Google) + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.ui.preferences; @@ -54,7 +54,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFie * Base for project property and preference pages */ public abstract class PropertyAndPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IWorkbenchPropertyPage { - private Control fConfigurationBlockControl; private ControlEnableState fBlockEnableState; private Link fChangeWorkspaceSettings; @@ -63,7 +62,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement private Composite fParentComposite; private IProject fProject; // project or null - private Map fData; // page data + private Map fData; // page data public static final String DATA_NO_LINK= "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$ @@ -102,6 +101,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); IDialogFieldListener listener= new IDialogFieldListener() { + @Override public void dialogFieldChanged(DialogField field) { enableProjectSpecificSettings(((SelectionButtonDialogField)field).isSelected()); } @@ -162,10 +162,12 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement link.setFont(composite.getFont()); link.setText("" + text + ""); //$NON-NLS-1$//$NON-NLS-2$ link.addSelectionListener(new SelectionListener() { + @Override public void widgetSelected(SelectionEvent e) { doLinkActivated((Link) e.widget); } + @Override public void widgetDefaultSelected(SelectionEvent e) { doLinkActivated((Link) e.widget); } @@ -228,7 +230,6 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement } } - protected void enableProjectSpecificSettings(boolean useProjectSpecificSettings) { fUseProjectSettings.setSelection(useProjectSpecificSettings); enablePreferenceContent(useProjectSpecificSettings); @@ -245,7 +246,6 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement fChangeWorkspaceSettings.setEnabled(!useProjectSettings()); } } - protected void setPreferenceContentStatus(IStatus status) { fBlockStatus= status; @@ -259,6 +259,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement */ protected IStatusChangeListener getNewStatusChangedListener() { return new IStatusChangeListener() { + @Override public void statusChanged(IStatus status) { setPreferenceContentStatus(status); } @@ -290,9 +291,6 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement } } - /* - * @see org.eclipse.jface.preference.IPreferencePage#performDefaults() - */ @Override protected void performDefaults() { if (useProjectSettings()) { @@ -306,34 +304,24 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement StatusUtil.applyToStatusLine(this, status); } - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ + @Override public void init(IWorkbench workbench) { } - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement() - */ + @Override public IAdaptable getElement() { return fProject; } - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable) - */ + @Override public void setElement(IAdaptable element) { fProject= (IProject) element.getAdapter(IResource.class); } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#applyData(java.lang.Object) - */ @Override public void applyData(Object data) { if (data instanceof Map) { - fData= (Map) data; + fData= (Map) data; } if (fChangeWorkspaceSettings != null) { if (!offerLink()) { @@ -343,7 +331,7 @@ public abstract class PropertyAndPreferencePage extends PreferencePage implement } } - protected Map getData() { + protected Map getData() { return fData; } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java index fe242e8720a..64477f479b0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ScalabilityPreferencePage.java @@ -9,10 +9,8 @@ * IBM Corporation - initial API and implementation * Anton Leherbauer (Wind River Systems) *******************************************************************************/ - package org.eclipse.cdt.internal.ui.preferences; -import com.ibm.icu.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -40,14 +38,15 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; +import com.ibm.icu.text.MessageFormat; + import org.eclipse.cdt.ui.PreferenceConstants; import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.cdt.internal.ui.ICHelpContextIds; import org.eclipse.cdt.internal.ui.wizards.dialogfields.Separator; -public class ScalabilityPreferencePage extends PreferencePage implements - IWorkbenchPreferencePage { +public class ScalabilityPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { // Files with this number of lines will trigger scalability mode private IntegerFieldEditor fLinesToTrigger; @@ -64,14 +63,14 @@ public class ScalabilityPreferencePage extends PreferencePage implements private Button fContentAssistAutoActivation; - private Map fCheckBoxes= new HashMap(); + private final Map fCheckBoxes= new HashMap(); /** * List of master/slave listeners when there's a dependency. * * @see #createDependency(Button, String, Control) */ - private ArrayList fMasterSlaveListeners= new ArrayList(); + private final ArrayList fMasterSlaveListeners= new ArrayList(); public ScalabilityPreferencePage() { setPreferenceStore(PreferenceConstants.getPreferenceStore()); @@ -196,6 +195,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements fLinesToTrigger.load(); fLinesToTrigger.setPropertyChangeListener( new IPropertyChangeListener() { + @Override public void propertyChange( PropertyChangeEvent event ) { if ( event.getProperty().equals( FieldEditor.IS_VALID ) ) setValid( fLinesToTrigger.isValid() ); @@ -246,6 +246,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements } SelectionListener listener= new SelectionListener() { + @Override public void widgetSelected(SelectionEvent e) { slave.setEnabled(!master.getSelection()); if (master.getSelection()) { @@ -253,6 +254,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements } } + @Override public void widgetDefaultSelected(SelectionEvent e) {} }; master.addSelectionListener(listener); @@ -262,6 +264,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements /* * @see IWorkbenchPreferencePage#init(IWorkbench) */ + @Override public void init(IWorkbench workbench) { } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SmartTypingConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SmartTypingConfigurationBlock.java index ee241877e3a..1803b0e0213 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SmartTypingConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SmartTypingConfigurationBlock.java @@ -7,7 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Sergey Prigogin, Google + * Sergey Prigogin (Google) * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.ui.preferences; @@ -73,6 +73,7 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock { * @param parent the parent composite * @return the control for the preference page */ + @Override public Control createControl(Composite parent) { ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); @@ -190,10 +191,13 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock { String linkTooltip= PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_tooltip; String text; String indentMode= CUIPlugin.getDefault().getCombinedPreferenceStore().getString(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR); - if (CCorePlugin.TAB.equals(indentMode)) - text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_tab_text, Integer.toString(getTabDisplaySize())); - else - text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_others_text, Integer.toString(getTabDisplaySize()), Integer.toString(getIndentSize()), getIndentMode()); + if (CCorePlugin.TAB.equals(indentMode)) { + text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_tab_text, + Integer.toString(getTabDisplaySize())); + } else { + text= Messages.format(PreferencesMessages.SmartTypingConfigurationBlock_tabs_message_others_text, + Integer.toString(getTabDisplaySize()), Integer.toString(getIndentSize()), getIndentMode()); + } final Link link= new Link(composite, SWT.NONE); link.setText(text); @@ -204,13 +208,15 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock { link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - PreferencesUtil.createPreferenceDialogOn(link.getShell(), "org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage", null, null); //$NON-NLS-1$ + PreferencesUtil.createPreferenceDialogOn(link.getShell(), + "org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage", null, null); //$NON-NLS-1$ } }); final IPreferenceStore combinedStore= CUIPlugin.getDefault().getCombinedPreferenceStore(); final IPropertyChangeListener propertyChangeListener= new IPropertyChangeListener() { private boolean fHasRun= false; + @Override public void propertyChange(PropertyChangeEvent event) { if (fHasRun) return; @@ -230,6 +236,7 @@ class SmartTypingConfigurationBlock extends AbstractConfigurationBlock { }; combinedStore.addPropertyChangeListener(propertyChangeListener); link.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) { combinedStore.removePropertyChangeListener(propertyChangeListener); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java index fd59f908d3f..93b57e3592d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingConfigurationBlock.java @@ -99,10 +99,12 @@ public class SpellingConfigurationBlock extends OptionsConfigurationBlock { */ protected static void createSelectionDependency(final Button master, final Control slave) { master.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent event) { // Do nothing } + @Override public void widgetSelected(SelectionEvent event) { slave.setEnabled(master.getSelection()); } @@ -485,6 +487,7 @@ public class SpellingConfigurationBlock extends OptionsConfigurationBlock { // Redirect status messages from the field editor to the status change listener DialogPage fakePage= new DialogPage() { + @Override public void createControl(Composite c) { } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingPreferenceBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingPreferenceBlock.java index e9b96559e2c..5975c006cda 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingPreferenceBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/SpellingPreferenceBlock.java @@ -13,10 +13,8 @@ package org.eclipse.cdt.internal.ui.preferences; import org.eclipse.core.runtime.IStatus; - import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; - import org.eclipse.ui.texteditor.spelling.IPreferenceStatusMonitor; import org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock; @@ -31,12 +29,13 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener#statusChanged(org.eclipse.core.runtime.IStatus) */ + @Override public void statusChanged(IStatus status) { } } private class StatusChangeListenerAdapter implements IStatusChangeListener { - private IPreferenceStatusMonitor fMonitor; + private final IPreferenceStatusMonitor fMonitor; private IStatus fStatus; @@ -48,6 +47,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener#statusChanged(org.eclipse.core.runtime.IStatus) */ + @Override public void statusChanged(IStatus status) { fStatus= status; fMonitor.statusChanged(status); @@ -58,13 +58,14 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { } } - private SpellingConfigurationBlock fBlock= new SpellingConfigurationBlock(new NullStatusChangeListener(), null, null); + private final SpellingConfigurationBlock fBlock= new SpellingConfigurationBlock(new NullStatusChangeListener(), null, null); private SpellingPreferenceBlock.StatusChangeListenerAdapter fStatusMonitor; /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public Control createControl(Composite parent) { return fBlock.createContents(parent); } @@ -72,6 +73,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#initialize(org.eclipse.ui.texteditor.spelling.IPreferenceStatusMonitor) */ + @Override public void initialize(IPreferenceStatusMonitor statusMonitor) { fStatusMonitor= new StatusChangeListenerAdapter(statusMonitor); fBlock.fContext= fStatusMonitor; @@ -80,6 +82,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#canPerformOk() */ + @Override public boolean canPerformOk() { return fStatusMonitor == null || fStatusMonitor.getStatus() == null || !fStatusMonitor.getStatus().matches(IStatus.ERROR); } @@ -87,6 +90,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performOk() */ + @Override public void performOk() { fBlock.performOk(); } @@ -94,6 +98,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performDefaults() */ + @Override public void performDefaults() { fBlock.performDefaults(); } @@ -101,6 +106,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#performRevert() */ + @Override public void performRevert() { fBlock.performRevert(); } @@ -108,6 +114,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#dispose() */ + @Override public void dispose() { fBlock.dispose(); } @@ -115,6 +122,7 @@ public class SpellingPreferenceBlock implements ISpellingPreferenceBlock { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock#setEnabled(boolean) */ + @Override public void setEnabled(boolean enabled) { fBlock.setEnabled(enabled); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java index c21e4a63d30..e5baa229c6f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java @@ -9,7 +9,6 @@ * IBM Corporation - initial API and implementation * Sergey Prigogin (Google) *******************************************************************************/ - package org.eclipse.cdt.internal.ui.preferences; import java.util.ArrayList; @@ -88,12 +87,14 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) */ + @Override public Image getColumnImage(Object element, int columnIndex) { return null; } /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) */ + @Override public String getColumnText(Object element, int columnIndex) { TodoTask task = (TodoTask) element; if (columnIndex == 0) { @@ -116,6 +117,7 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object) */ + @Override public Font getFont(Object element) { if (isDefaultTask((TodoTask) element)) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT); @@ -138,8 +140,8 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock { private static final int IDX_DEFAULT = 4; private IStatus fTaskTagsStatus; - private ListDialogField fTodoTasksList; - private SelectionButtonDialogField fCaseSensitiveCheckBox; + private final ListDialogField fTodoTasksList; + private final SelectionButtonDialogField fCaseSensitiveCheckBox; public TodoTaskConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) { @@ -212,22 +214,26 @@ public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock { return selectedElements.size() == 1 && !isDefaultTask(selectedElements.get(0)); } + @Override public void customButtonPressed(ListDialogField field, int index) { doTodoButtonPressed(index); } + @Override public void selectionChanged(ListDialogField field) { List selectedElements = field.getSelectedElements(); field.enableButton(IDX_EDIT, canEdit(selectedElements)); field.enableButton(IDX_DEFAULT, canSetToDefault(selectedElements)); } + @Override public void doubleClicked(ListDialogField field) { if (canEdit(field.getSelectedElements())) { doTodoButtonPressed(IDX_EDIT); } } + @Override public void dialogFieldChanged(DialogField field) { updateModel(field); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java index 18722bff8b0..9c12e60e321 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java @@ -9,7 +9,6 @@ * IBM Corporation - initial API and implementation * Sergey Prigogin (Google) *******************************************************************************/ - package org.eclipse.cdt.internal.ui.preferences; import java.util.ArrayList; @@ -40,15 +39,16 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringDialogField; public class TodoTaskInputDialog extends StatusDialog { private class CompilerTodoTaskInputAdapter implements IDialogFieldListener { + @Override public void dialogFieldChanged(DialogField field) { doValidation(); } } - private StringDialogField fNameDialogField; - private ComboDialogField fPriorityDialogField; + private final StringDialogField fNameDialogField; + private final ComboDialogField fPriorityDialogField; - private List fExistingNames; + private final List fExistingNames; public TodoTaskInputDialog(Shell parent, TodoTask task, List existingEntries) { super(parent); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java index 18ec57843f5..66778e4fb0c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/WorkInProgressPreferencePage.java @@ -35,10 +35,9 @@ import org.eclipse.cdt.ui.CUIPlugin; * Preference page for work in progress. */ public class WorkInProgressPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - - private List