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

Fixed some warnings

Change-Id: Icb6f7ba6151b55296c3f8137552a10fd7872b317
Signed-off-by: Andrew Gvozdev <angvoz.dev@gmail.com>
This commit is contained in:
Andrew Gvozdev 2015-12-30 11:09:36 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 73805d2ea4
commit 2a4cb495b5
5 changed files with 7 additions and 24 deletions

View file

@ -186,18 +186,18 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
return viewer;
}
@SuppressWarnings("rawtypes")
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class key) {
public <T> T getAdapter(Class<T> key) {
if (ProjectionAnnotationModel.class.equals(key)) {
if (projectionSupport != null) {
Object result = projectionSupport.getAdapter(getSourceViewer(), key);
T result = projectionSupport.getAdapter(getSourceViewer(), key);
if (result != null) {
return result;
}
}
} else if (key.equals(IContentOutlinePage.class)) {
return getOutlinePage();
return (T) getOutlinePage();
}
return super.getAdapter(key);
}

View file

@ -145,7 +145,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
fInput= manager.getWorkingCopy(fEditor.getEditorInput());
if (fInput != null) {
ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
ProjectionAnnotationModel model= fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model != null) {
Map<MakefileProjectionAnnotation, Position> additions= computeAdditions((IParent) fInput);
model.removeAllAnnotations();
@ -229,7 +229,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
return;
}
ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
ProjectionAnnotationModel model= fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model == null) {
return;
}

View file

@ -14,10 +14,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
/**
* @version 1.0
* @author
*/
public abstract class SharedPart {
private boolean enabled = true;

View file

@ -19,10 +19,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
* @version 1.0
* @author
*/
public abstract class SharedPartWithButtons extends SharedPart {
private String[] buttonLabels;
private Control[] controls;
@ -58,9 +54,6 @@ public abstract class SharedPartWithButtons extends SharedPart {
protected abstract void createMainControl(Composite parent, int style, int span);
protected abstract void buttonSelected(Button button, int index);
/*
* @see SharedPart#createControl(Composite, FormWidgetFactory)
*/
@Override
public void createControl(Composite parent, int style, int span) {
createMainLabel(parent, span);

View file

@ -15,10 +15,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
* @version 1.0
* @author
*/
public abstract class StructuredViewerPart extends SharedPartWithButtons {
private StructuredViewer viewer;
private Point minSize = null;
@ -35,9 +32,6 @@ public abstract class StructuredViewerPart extends SharedPartWithButtons {
return viewer.getControl();
}
/*
* @see SharedPartWithButtons#createMainControl(Composite, int, FormWidgetFactory)
*/
@Override
protected void createMainControl(Composite parent, int style, int span) {
viewer = createStructuredViewer(parent, style);