Package es.iiia.sgi.views

Source Code of es.iiia.sgi.views.ShapeView

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");
  }
}
TOP

Related Classes of es.iiia.sgi.views.ShapeView

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.