package brn.gui.diagram;

import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorInput;
import org.eclipse.gmf.runtime.notation.Diagram;


public class SimulatorDiagramEditorInput extends DiagramEditorInput {

  private SimulatorResource resource;

  public SimulatorDiagramEditorInput(SimulatorResource resource) {
    super((Diagram) resource.getEObject("diagram"));

    this.resource = resource;
  }

  /**
   * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class)
   */
  public Object getAdapter(Class adapter) {
    if (adapter == Resource.class)
      return getResource();

    return super.getAdapter(adapter);
  }

  public SimulatorResource getResource() {
    return resource;
  }

}
