Examples of URIEditorInput


Examples of com.google.eclipse.protobuf.ui.editor.UriEditorInput

class UriDocumentContentsFactory implements DocumentContentsFactory {
  @Inject private ContentReader contentReader;
  @Inject private XtextResourceFactory resourceFactory;

  @Override public void createContents(XtextDocument document, Object element) throws CoreException {
    UriEditorInput input = supportedEditorInputType().cast(element);
    URI uri = input.getFileUri();
    try {
      String contents = contentsOf(uri);
      document.set(contents);
      XtextResource resource = resourceFactory.createResource(uri, contents);
      document.setInput(resource);
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

        getString("_WARN_No_Editor", uri.lastSegment()));
      return false;
    }
    else {
      try {
        page.openEditor(new URIEditorInput(uri), editorDescriptor.getId());
      }
      catch (PartInitException exception) {
        MessageDialog.openError(
          workbenchWindow.getShell(),
          getString("_UI_OpenEditorError_label"),
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

      }
    }
    URI uri = EcoreUtil.getURI(diagram);
    String editorName = uri.lastSegment()
        + "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$
    IEditorInput editorInput = new URIEditorInput(uri, editorName);
    return editorInput;
  }
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

  public boolean test(Object receiver, String method, Object[] args,
      Object expectedValue) {
    if (false == receiver instanceof URIEditorInput) {
      return false;
    }
    URIEditorInput editorInput = (URIEditorInput) receiver;
    return "ontouml_diagram".equals(editorInput.getURI().fileExtension()); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

   * @generated
   */
  protected void handleElementMoved(IEditorInput input, URI uri) {

    // TODO: append suffix to the URI! (use diagram as a parameter)
    fireElementMoved(input, new URIEditorInput(uri));
  }
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

        }
      }
      URI uri = EcoreUtil.getURI(myDiagram);
      String editorName = uri.lastSegment()
          + "#" + myDiagram.eResource().getContents().indexOf(myDiagram); //$NON-NLS-1$
      IEditorInput editorInput = new URIEditorInput(uri, editorName);
      return editorInput;
    }
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

   */
  public static boolean openDiagram(Resource diagram)
      throws PartInitException {
    IWorkbenchPage page = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage();
    page.openEditor(new URIEditorInput(diagram.getURI()),
        OntoUML.diagram.part.OntoUMLDiagramEditor.ID);
    return true;
  }
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

  public void doSaveAs() {
    String[] filters = FILE_EXTENSION_FILTERS.toArray(new String[FILE_EXTENSION_FILTERS.size()]);
    String[] files = OntoUMLEditorAdvisor.openFilePathDialog(getSite().getShell(), SWT.SAVE, filters);
    if (files.length > 0) {
      URI uri = URI.createFileURI(files[0]);
      doSaveAs(uri, new URIEditorInput(uri));
    }
  }
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

  public void doSaveAs() {
    String[] filters = FILE_EXTENSION_FILTERS.toArray(new String[FILE_EXTENSION_FILTERS.size()]);
    String[] files = OntoUMLEditorAdvisor.openFilePathDialog(getSite().getShell(), SWT.SAVE, filters);
    if (files.length > 0) {
      URI uri = URI.createFileURI(files[0]);
      doSaveAs(uri, new URIEditorInput(uri));
    }
  }
View Full Code Here

Examples of org.eclipse.emf.common.ui.URIEditorInput

                      OntoUML.diagram.part.Messages.DiagramEditorActionBarAdvisor_DefaultFileEditorMessage,
                      fileURI.toFileString()));
      return false;
    } else {
      try {
        page.openEditor(new URIEditorInput(fileURI), editorDescriptor
            .getId());
      } catch (PartInitException exception) {
        MessageDialog
            .openError(
                workbenchWindow.getShell(),
View Full Code Here
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.