package brn.gui.diagram;

import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditorInput;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramInputDocumentProvider;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
import org.eclipse.ui.IEditorInput;


public class SimulatorDocumentProvider
  extends DiagramInputDocumentProvider implements IDiagramDocumentProvider {

  public SimulatorDocumentProvider() {
  }

  /* (non-Javadoc)
   * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider#createInputWithEditingDomain(org.eclipse.ui.IEditorInput, org.eclipse.gmf.runtime.emf.core.edit.MEditingDomain)
   */
  public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
    if(editorInput instanceof IDiagramEditorInput)
      return new DiagramEditorInputProxy(editorInput, domain);
    assert false;
    return null;
  }

  /* (non-Javadoc)
   * @see org.eclipse.gmf.runtime.diagram.ui.editor.IDocumentProvider#isModifiable(java.lang.Object)
   */
  public boolean isModifiable(Object element) {
    return true;
  }

  /*
   * @see IDocumentProvider#isReadOnly(Object)
   *
   */
  public boolean isReadOnly(Object element) {
    return true;
  }

}
