mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
Fixed compiler warnings.
This commit is contained in:
parent
92bd2aa4cc
commit
9fa581109a
3 changed files with 13 additions and 54 deletions
|
@ -123,10 +123,6 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param s
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected abstract Object modelFromString(String s);
|
protected abstract Object modelFromString(String s);
|
||||||
|
|
||||||
Control getTreeControl() {
|
Control getTreeControl() {
|
||||||
|
@ -160,10 +156,6 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
|
||||||
return ((ITreeContentProvider) treeViewer.getContentProvider());
|
return ((ITreeContentProvider) treeViewer.getContentProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param parent
|
|
||||||
* @param event
|
|
||||||
*/
|
|
||||||
private void updateCheckedState(Object parent) {
|
private void updateCheckedState(Object parent) {
|
||||||
Object[] children = getContentProvider().getChildren(parent);
|
Object[] children = getContentProvider().getChildren(parent);
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
|
@ -281,7 +273,7 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return the combined string
|
* @return the combined string
|
||||||
* @see #stringToModel
|
* @see #modelFromString(String)
|
||||||
*/
|
*/
|
||||||
protected abstract String modelToString(Object model);
|
protected abstract String modelToString(Object model);
|
||||||
|
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Common Public License v1.0
|
* are made available under the terms of the Common Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,10 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.codan.internal.ui.preferences;
|
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.CodanCorePlugin;
|
||||||
import org.eclipse.cdt.codan.core.PreferenceConstants;
|
import org.eclipse.cdt.codan.core.PreferenceConstants;
|
||||||
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
|
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.IWorkbenchPropertyPage;
|
||||||
import org.eclipse.ui.preferences.ScopedPreferenceStore;
|
import org.eclipse.ui.preferences.ScopedPreferenceStore;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Berthold Daum
|
* @author Berthold Daum
|
||||||
*/
|
*/
|
||||||
public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
|
public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
|
||||||
// Stores all created field editors
|
// Stores all created field editors
|
||||||
private List editors = new ArrayList();
|
private List<FieldEditor> editors = new ArrayList<FieldEditor>();
|
||||||
// Stores owning element of properties
|
// Stores owning element of properties
|
||||||
private IAdaptable element;
|
private IAdaptable element;
|
||||||
// Additional buttons for property pages
|
// 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
|
* a new PropertyStore as local preference store. After all control have
|
||||||
* been create, we enable/disable these controls.
|
* been create, we enable/disable these controls.
|
||||||
*
|
*
|
||||||
* @see org.eclipse.jface.preference.PreferencePage#createControl()
|
* @see org.eclipse.jface.preference.PreferencePage#createControl(Composite)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void createControl(Composite parent) {
|
public void createControl(Composite parent) {
|
||||||
|
@ -169,7 +168,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
ProjectScope ps = new ProjectScope((IProject) e);
|
ProjectScope ps = new ProjectScope((IProject) e);
|
||||||
ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, CodanCorePlugin.PLUGIN_ID);
|
ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, CodanCorePlugin.PLUGIN_ID);
|
||||||
scoped.setSearchContexts(new IScopeContext[] { ps, new InstanceScope() });
|
scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE });
|
||||||
overlayStore = scoped;
|
overlayStore = scoped;
|
||||||
}
|
}
|
||||||
// Set overlay store as current preference store
|
// Set overlay store as current preference store
|
||||||
|
@ -288,9 +287,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
|
||||||
*/
|
*/
|
||||||
protected void updateFieldEditors(boolean enabled) {
|
protected void updateFieldEditors(boolean enabled) {
|
||||||
Composite parent = getFieldEditorParent();
|
Composite parent = getFieldEditorParent();
|
||||||
Iterator it = editors.iterator();
|
for (FieldEditor editor : editors) {
|
||||||
while (it.hasNext()) {
|
|
||||||
FieldEditor editor = (FieldEditor) it.next();
|
|
||||||
editor.setEnabled(enabled, parent);
|
editor.setEnabled(enabled, parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,11 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Alena Laskavaia - initial API and implementation
|
* Alena Laskavaia - initial API and implementation
|
||||||
* IBM Corporation
|
* IBM Corporation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.codan.internal.ui.preferences;
|
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.CodanRuntime;
|
||||||
import org.eclipse.cdt.codan.core.PreferenceConstants;
|
import org.eclipse.cdt.codan.core.PreferenceConstants;
|
||||||
import org.eclipse.cdt.codan.core.model.CodanSeverity;
|
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.ISharedImages;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
|
||||||
public class ProblemsTreeEditor extends CheckedTreeEditor {
|
public class ProblemsTreeEditor extends CheckedTreeEditor {
|
||||||
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
private static final String SINGLE_PLACEHOLDER_ONLY = "{0}"; //$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 {
|
class ProblemsContentProvider implements IContentProvider, ITreeContentProvider {
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -316,12 +314,6 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
|
||||||
getViewer().setInput(profile);
|
getViewer().setInput(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#doLoad()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void doLoad() {
|
protected void doLoad() {
|
||||||
if (getTreeControl() != null) {
|
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
|
@Override
|
||||||
protected void doStore() {
|
protected void doStore() {
|
||||||
codanPreferencesLoader.setInput((IProblemProfile) getViewer().getInput());
|
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
|
@Override
|
||||||
protected Object modelFromString(String s) {
|
protected Object modelFromString(String s) {
|
||||||
return codanPreferencesLoader.getInput();
|
return codanPreferencesLoader.getInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#modelToString
|
|
||||||
* (java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected String modelToString(Object model) {
|
protected String modelToString(Object model) {
|
||||||
return ""; //$NON-NLS-1$
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getSampleMessage(IProblem problem) {
|
public static String getSampleMessage(IProblem problem) {
|
||||||
String messagePattern = problem.getMessagePattern();
|
String messagePattern = problem.getMessagePattern();
|
||||||
String message = CodanUIMessages.CodanPreferencePage_NoInfo;
|
String message = CodanUIMessages.CodanPreferencePage_NoInfo;
|
||||||
|
|
Loading…
Add table
Reference in a new issue