Package es.iiia.sgi.views

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

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.CallRuleEditorHandler;
import es.iiia.sgi.providers.RuleContentProvider;
import es.iiia.sgi.providers.RuleLabelProvider;
import es.iiia.shapeeditor.ShapeGrammarInput;

public class RuleView extends ListView {

  public static final String ID = "es.iiia.sgi.views.ruleview";

  RuleContentProvider contentProvider;
 
  @Override
  public void createPartControl(Composite parent) {
    super.createPartControl(parent);
   
    // register help
    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, "es.iiia.sgi.rules");
  }
 
  @Override
  public IStructuredContentProvider getContentProvider() {
    if (this.contentProvider == null) {
      this.contentProvider = new RuleContentProvider(this.getViewer());
    }
    return this.contentProvider;
  }

  @Override
  protected String getDoubleClickCommandId() {
    return CallRuleEditorHandler.ID;
  }

  @Override
  protected ILabelProvider getLabelProvider() {
    return new RuleLabelProvider();
  }
 
 
  public void setContent(ShapeGrammarInput input) {
    this.contentProvider.setContent(input);   
  }
}
TOP

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

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.