Package org.eclipse.ui.part

Examples of org.eclipse.ui.part.FileEditorInput


    @Override
    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
        super.init(site, input);
        getSite().getPage().addSelectionListener(this);
        FileEditorInput fileInput = (FileEditorInput) input;
        this.definitionFile = fileInput.getFile();
        IPath path = fileInput.getPath().removeLastSegments(1);
        path = path.removeFirstSegments(path.segmentCount() - 1);
        setPartName(path.lastSegment());
        definition = ProcessCache.getProcessDefinition(definitionFile);
        definition.setDirty(false);
        ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
View Full Code Here


      dialog.setName(definition.getName());
      if(dialog.open() == IDialogConstants.OK_ID) {
      String newName = dialog.getName();
        try {
          IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
          IEditorPart editor = page.findEditor(new FileEditorInput(definitionFile));
          if (editor != null) {
            page.closeEditor(editor, false);
          }
         
          IPath oldPath = definitionFolder.getFullPath();
View Full Code Here

            activePage.closeEditor(activeEditor, true);
            ProcessDefinition newDefinition = JpdlVersionRegistry.updateToNextVersion(oldDefinition, definitionFile);
      ParContentProvider.saveAuxInfo(definitionFile, newDefinition);
      ProcessCache.invalidateProcessDefinition(definitionFile);
      needsCloseEditorOnError = true;
      IDE.openEditor(activePage, new FileEditorInput(definitionFile), DesignerEditor.ID, true);
    } catch (Exception e) {
            DesignerLogger.logError(Messages.getString("Update.jpdl.error"), e);
            restorePreviousVersion();
    }
    }
View Full Code Here

            oldDefinition.getContentProvider().saveToXML(oldDefinition, document);
            byte[] bytes = XmlUtil.writeXml(document);
            definitionFile.setContents(new ByteArrayInputStream(bytes), true, true, null);
      ParContentProvider.saveAuxInfo(definitionFile, oldDefinition);
      ProcessCache.invalidateProcessDefinition(definitionFile);
      IDE.openEditor(activePage, new FileEditorInput(definitionFile), DesignerEditor.ID, true);
    } catch (Exception e) {
            DesignerLogger.logError("Undo update process definition to next jPDL version failed", e);
    }
    }
View Full Code Here

    monitor.setTaskName("Starting editor for new descriptor...");
    getShell().getDisplay().asyncExec(new Runnable() {
      public void run() {
        IWorkbenchPage page1 = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        try {
          page1.openEditor(new FileEditorInput(file), "taeconfigurator.editors.MultiPageEditor");
        } catch (PartInitException e) {
        }
      }
    });
    monitor.worked(2);
View Full Code Here

    if (m_nSaveAsStatus == SAVE_AS_CANCELLED) {
      m_nSaveAsStatus = SAVE_AS_NOT_IN_PROGRESS;
      return;
    }
    // should only do if editorInput is new
    FileEditorInput newEditorInput = (FileEditorInput) sourceTextEditor.getEditorInput();

    // if(old)
    setInput(newEditorInput);
    firePropertyChange(PROP_INPUT);
    // setTitle(newEditorInput.getFile().getName());
    setPartName(newEditorInput.getFile().getName());
    // this next does NOT seem to change the overall page title

    firePropertyChange(PROP_TITLE);
    finishSave(null, modelOK);
  }
View Full Code Here

    Shell shell = new Shell();
    shell.getDisplay().asyncExec(new Runnable() {
      public void run() {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        try {
          page.openEditor(new FileEditorInput(ffile), "taeconfigurator.editors.MultiPageEditor"); //$NON-NLS-1$
        } catch (PartInitException e) {
          throw new InternalErrorCDE("unexpected exception");
        }
      }
    });
View Full Code Here

    Shell shell = new Shell();
    shell.getDisplay().asyncExec(new Runnable() {
      public void run() {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        try {
          page.openEditor(new FileEditorInput(ffile), "org.eclipse.ui.DefaultTextEditor"); //$NON-NLS-1$
        } catch (PartInitException e) {
          throw new InternalErrorCDE("unexpected exception");
        }
      }
    });
View Full Code Here

        org.apache.uima.caseditor.editor.CasDocumentProvider {

  @Override
  protected IDocument createDocument(Object element) throws CoreException {
    if (element instanceof FileEditorInput) {
      FileEditorInput fileInput = (FileEditorInput) element;

      IFile file = fileInput.getFile();

      INlpElement nlpElement = CasEditorPlugin.getNlpModel().findMember(file);

      if (nlpElement instanceof DocumentElement) {
View Full Code Here

          boolean overwrite) throws CoreException {

    fireElementStateChanging(element);

    if (element instanceof FileEditorInput) {
      FileEditorInput fileInput = (FileEditorInput) element;

      IFile file = fileInput.getFile();

      INlpElement nlpElement =
              org.apache.uima.caseditor.CasEditorPlugin.getNlpModel().findMember(file);

      if (nlpElement instanceof DocumentElement) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.part.FileEditorInput

Copyright © 2018 www.massapicom. 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.