1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 04:25:21 +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; return viewer;
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("unchecked")
@Override @Override
public Object getAdapter(Class key) { public <T> T getAdapter(Class<T> key) {
if (ProjectionAnnotationModel.class.equals(key)) { if (ProjectionAnnotationModel.class.equals(key)) {
if (projectionSupport != null) { if (projectionSupport != null) {
Object result = projectionSupport.getAdapter(getSourceViewer(), key); T result = projectionSupport.getAdapter(getSourceViewer(), key);
if (result != null) { if (result != null) {
return result; return result;
} }
} }
} else if (key.equals(IContentOutlinePage.class)) { } else if (key.equals(IContentOutlinePage.class)) {
return getOutlinePage(); return (T) getOutlinePage();
} }
return super.getAdapter(key); return super.getAdapter(key);
} }

View file

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

View file

@ -14,10 +14,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
/**
* @version 1.0
* @author
*/
public abstract class SharedPart { public abstract class SharedPart {
private boolean enabled = true; 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.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
/**
* @version 1.0
* @author
*/
public abstract class SharedPartWithButtons extends SharedPart { public abstract class SharedPartWithButtons extends SharedPart {
private String[] buttonLabels; private String[] buttonLabels;
private Control[] controls; 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 createMainControl(Composite parent, int style, int span);
protected abstract void buttonSelected(Button button, int index); protected abstract void buttonSelected(Button button, int index);
/*
* @see SharedPart#createControl(Composite, FormWidgetFactory)
*/
@Override @Override
public void createControl(Composite parent, int style, int span) { public void createControl(Composite parent, int style, int span) {
createMainLabel(parent, 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.layout.GridData;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
/**
* @version 1.0
* @author
*/
public abstract class StructuredViewerPart extends SharedPartWithButtons { public abstract class StructuredViewerPart extends SharedPartWithButtons {
private StructuredViewer viewer; private StructuredViewer viewer;
private Point minSize = null; private Point minSize = null;
@ -35,9 +32,6 @@ public abstract class StructuredViewerPart extends SharedPartWithButtons {
return viewer.getControl(); return viewer.getControl();
} }
/*
* @see SharedPartWithButtons#createMainControl(Composite, int, FormWidgetFactory)
*/
@Override @Override
protected void createMainControl(Composite parent, int style, int span) { protected void createMainControl(Composite parent, int style, int span) {
viewer = createStructuredViewer(parent, style); viewer = createStructuredViewer(parent, style);