1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Fixed compiler warnings.

This commit is contained in:
Sergey Prigogin 2012-03-01 16:14:54 -08:00
parent 92bd2aa4cc
commit 9fa581109a
3 changed files with 13 additions and 54 deletions

View file

@ -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);

View file

@ -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);
}
}

View file

@ -11,8 +11,6 @@
*******************************************************************************/
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;