Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2012-03-02 00:14:54 +0000
committerSergey Prigogin2012-03-02 00:18:19 +0000
commit9fa581109a44fbaff7dec26b3b2f4724cb586ee9 (patch)
tree0ecb963d32fbea4ba48d342d44adcd0378ca7db8 /codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan
parent92bd2aa4cc2ee47a965d12add89be8af5ed0812b (diff)
downloadorg.eclipse.cdt-9fa581109a44fbaff7dec26b3b2f4724cb586ee9.tar.gz
org.eclipse.cdt-9fa581109a44fbaff7dec26b3b2f4724cb586ee9.tar.xz
org.eclipse.cdt-9fa581109a44fbaff7dec26b3b2f4724cb586ee9.zip
Fixed compiler warnings.
Diffstat (limited to 'codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan')
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java10
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java19
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java38
3 files changed, 13 insertions, 54 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java
index 05a60f97a94..cdc2b5ed306 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java
@@ -123,10 +123,6 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
}
}
- /**
- * @param s
- * @return
- */
protected abstract Object modelFromString(String s);
Control getTreeControl() {
@@ -160,10 +156,6 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
return ((ITreeContentProvider) treeViewer.getContentProvider());
}
- /**
- * @param parent
- * @param event
- */
private void updateCheckedState(Object parent) {
Object[] children = getContentProvider().getChildren(parent);
int i, count = 0;
@@ -281,7 +273,7 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
* </p>
*
* @return the combined string
- * @see #stringToModel
+ * @see #modelFromString(String)
*/
protected abstract String modelToString(Object model);
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
index 25c210df10e..d498be65f88 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2010 Berthold Daum.
+ * Copyright (c) 2003, 2010 Berthold Daum and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.ui.preferences;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
import org.eclipse.cdt.codan.core.CodanCorePlugin;
import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
@@ -44,12 +40,15 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbenchPropertyPage;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @author Berthold Daum
*/
public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
// Stores all created field editors
- private List editors = new ArrayList();
+ private List<FieldEditor> editors = new ArrayList<FieldEditor>();
// Stores owning element of properties
private IAdaptable element;
// Additional buttons for property pages
@@ -156,7 +155,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
* a new PropertyStore as local preference store. After all control have
* been create, we enable/disable these controls.
*
- * @see org.eclipse.jface.preference.PreferencePage#createControl()
+ * @see org.eclipse.jface.preference.PreferencePage#createControl(Composite)
*/
@Override
public void createControl(Composite parent) {
@@ -169,7 +168,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
if (e != null) {
ProjectScope ps = new ProjectScope((IProject) e);
ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, CodanCorePlugin.PLUGIN_ID);
- scoped.setSearchContexts(new IScopeContext[] { ps, new InstanceScope() });
+ scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE });
overlayStore = scoped;
}
// Set overlay store as current preference store
@@ -288,9 +287,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
*/
protected void updateFieldEditors(boolean enabled) {
Composite parent = getFieldEditorParent();
- Iterator it = editors.iterator();
- while (it.hasNext()) {
- FieldEditor editor = (FieldEditor) it.next();
+ for (FieldEditor editor : editors) {
editor.setEnabled(enabled, parent);
}
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
index 9f28f8b7bee..664d2b3d750 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
@@ -6,13 +6,11 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Alena Laskavaia - initial API and implementation
- * IBM Corporation
+ * Alena Laskavaia - initial API and implementation
+ * IBM Corporation
*******************************************************************************/
package org.eclipse.cdt.codan.internal.ui.preferences;
-import java.text.MessageFormat;
-
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.core.model.CodanSeverity;
@@ -45,6 +43,8 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
+import java.text.MessageFormat;
+
public class ProblemsTreeEditor extends CheckedTreeEditor {
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final String SINGLE_PLACEHOLDER_ONLY = "{0}"; //$NON-NLS-1$
@@ -134,12 +134,10 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
class ProblemsContentProvider implements IContentProvider, ITreeContentProvider {
@Override
public void dispose() {
- // TODO Auto-generated method stub
}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // TODO Auto-generated method stub
}
@Override
@@ -316,12 +314,6 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
getViewer().setInput(profile);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#doLoad()
- */
@Override
protected void doLoad() {
if (getTreeControl() != null) {
@@ -356,12 +348,6 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
}
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#doStore()
- */
@Override
protected void doStore() {
codanPreferencesLoader.setInput((IProblemProfile) getViewer().getInput());
@@ -376,32 +362,16 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
}
}
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#
- * modelFromString(java.lang.String)
- */
@Override
protected Object modelFromString(String s) {
return codanPreferencesLoader.getInput();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#modelToString
- * (java.lang.Object)
- */
@Override
protected String modelToString(Object model) {
return ""; //$NON-NLS-1$
}
- /**
- * @return
- */
public static String getSampleMessage(IProblem problem) {
String messagePattern = problem.getMessagePattern();
String message = CodanUIMessages.CodanPreferencePage_NoInfo;

Back to the top