package es.iiia.sgi.views;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.PlatformUI;
import es.iiia.sgi.handlers.CallShapeEditorHandler;
import es.iiia.sgi.providers.ShapeContentProvider;
import es.iiia.sgi.providers.ShapeLabelProvider;
import es.iiia.shapeeditor.ShapeGrammarInput;
public class ShapeView extends ListView {
public static final String ID = "es.iiia.sgi.views.shapeview";
private ShapeContentProvider contentProvider;
@Override
public IStructuredContentProvider getContentProvider() {
if (this.contentProvider == null) {
this.contentProvider = new ShapeContentProvider(this.getViewer());
}
return this.contentProvider;
}
@Override
protected String getDoubleClickCommandId() {
return CallShapeEditorHandler.ID;
}
@Override
protected ILabelProvider getLabelProvider() {
return new ShapeLabelProvider();
}
public void setContent(ShapeGrammarInput input) {
this.contentProvider.setContent(input);
}
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// register help
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, "es.iiia.sgi.shapes");
}
}