From 1aaa1cbdf6072a3c875382c090ee1e971543b032 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Thu, 24 Apr 2008 12:02:08 +0000 Subject: [PATCH] Fix warnings --- .../ScalabilityPreferencePage.java | 24 +++++++++---------- .../ui/text/CSourceViewerConfiguration.java | 6 ++--- 2 files changed, 14 insertions(+), 16 deletions(-) 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 6005090c2d6..da8d5334e97 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 @@ -53,8 +53,6 @@ public class ScalabilityPreferencePage extends PreferencePage implements // Files with this number of lines will trigger scalability mode private IntegerFieldEditor fLinesToTrigger; - private Button fAlertMe; - private Button fEnableAll; private Button fReconciler; @@ -74,7 +72,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements public ScalabilityPreferencePage() { setPreferenceStore(PreferenceConstants.getPreferenceStore()); - setDescription(PreferencesMessages.ScalabilityPreferencePage_description); + setDescription(PreferencesMessages.ScalabilityPreferencePage_description); } /** @@ -106,7 +104,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements SelectionListener listener= (SelectionListener)iter.next(); listener.widgetSelected(null); } - fLinesToTrigger.setStringValue(Integer.toString(prefs.getInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES))); + fLinesToTrigger.setStringValue(Integer.toString(prefs.getInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES))); } /* @@ -116,7 +114,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements public void createControl(Composite parent) { super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), ICHelpContextIds.SCALABILITY_PREFERENCE_PAGE); - } + } /* * @see PreferencePage#createContents(Composite) @@ -140,14 +138,14 @@ public class ScalabilityPreferencePage extends PreferencePage implements createDetectionSettings(composite); - new Separator().doFillIntoGrid(composite, nColumns); + new Separator().doFillIntoGrid(composite, nColumns); createScalabilityModeSettings(composite); - new Separator().doFillIntoGrid(composite, nColumns); + new Separator().doFillIntoGrid(composite, nColumns); String noteTitle= PreferencesMessages.ScalabilityPreferencePage_note; - String noteMessage= PreferencesMessages.ScalabilityPreferencePage_preferenceOnlyForNewViews; + String noteMessage= PreferencesMessages.ScalabilityPreferencePage_preferenceOnlyForNewViews; Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), composite, noteTitle, noteMessage); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; @@ -179,7 +177,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements */ private void createDetectionSettings( Composite parent ) { Composite group = createGroupComposite( parent, 1, PreferencesMessages.ScalabilityPreferencePage_detection_group_label ); - fAlertMe = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_detection_label,PreferenceConstants.SCALABILITY_ALERT); + createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_detection_label,PreferenceConstants.SCALABILITY_ALERT); } /** @@ -198,7 +196,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements fLinesToTrigger.setValidRange( 1, Integer.MAX_VALUE ); String minValue = Integer.toString( 1 ); String maxValue = Integer.toString( Integer.MAX_VALUE ); - fLinesToTrigger.setErrorMessage( MessageFormat.format(PreferencesMessages.ScalabilityPreferencePage_error, new String[]{ minValue, maxValue } ) ); + fLinesToTrigger.setErrorMessage( MessageFormat.format(PreferencesMessages.ScalabilityPreferencePage_error, new Object[]{ minValue, maxValue } ) ); fLinesToTrigger.load(); fLinesToTrigger.setPropertyChangeListener( new IPropertyChangeListener() { @@ -224,7 +222,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements private static void indent(Control control) { GridData gridData= new GridData(); gridData.horizontalIndent= 20; - control.setLayoutData(gridData); + control.setLayoutData(gridData); } private void createDependency(final Button master, String masterKey, final Control slave) { @@ -271,7 +269,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements prefs.setValue(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES, fLinesToTrigger.getIntValue()); CUIPlugin.getDefault().savePluginPreferences(); return super.performOk(); - } + } /* * @see PreferencePage#performDefaults() @@ -293,6 +291,6 @@ public class ScalabilityPreferencePage extends PreferencePage implements SelectionListener listener= (SelectionListener)iter.next(); listener.widgetSelected(null); } - fLinesToTrigger.setStringValue(Integer.toString(prefs.getDefaultInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES))); + fLinesToTrigger.setStringValue(Integer.toString(prefs.getDefaultInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES))); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java index 44674ef020a..379498aaabc 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java @@ -561,7 +561,7 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration { /** * Returns the ICProject associated with this CSourceViewerConfiguration, or null if * no ICProject could be determined - * @return + * @return the ICProject or null */ protected ICProject getCProject() { ITextEditor editor= getEditor(); @@ -636,7 +636,7 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration { public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) { CEditorTextHoverDescriptor[] hoverDescs= CUIPlugin.getDefault().getCEditorTextHoverDescriptors(); int stateMasks[]= new int[hoverDescs.length]; - int stateMasksLength= 0; + int stateMasksLength= 0; for (CEditorTextHoverDescriptor hoverDesc : hoverDescs) { if (hoverDesc.isEnabled()) { int j= 0; @@ -932,7 +932,7 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration { protected IInformationControlCreator getMacroExplorationControlCreator() { final IInformationControlCreator conrolCreator = new IInformationControlCreator() { public IInformationControl createInformationControl(Shell parent) { - return new CMacroExpansionExplorationControl(parent); + return new CMacroExpansionExplorationControl(parent); } }; return conrolCreator;