Package org.eclipse.ui

Examples of org.eclipse.ui.PartInitException


   */
  public void init(IEditorSite site, IEditorInput editorInput)
      throws PartInitException
  {
    if (!(editorInput instanceof IFileEditorInput))
      throw new PartInitException("Invalid Input: Must be IFileEditorInput");
    super.init(site, editorInput);

  }
View Full Code Here


  @Override
  public void init(IEditorSite site, IEditorInput input)
      throws PartInitException {
    super.init(site, input);
    if (!(input instanceof IFileEditorInput)) {
      throw new PartInitException("Invalid Input: Must be IFileEditorInput");
    }

    // load the graph
    file = ((IFileEditorInput) input).getFile();
View Full Code Here

        setPartName(calcPartName());
        setDirtyState(false);
      } catch (IOException e) {
        viewFile = null;
        viewInfo = null;
        throw new PartInitException(
            "Unable to load view from " + viewFile.getFullPath().toString());
      }
    } else {
      throw new PartInitException(
          "Input for editor is not suitable for the ViewEditor");
    }
  }
View Full Code Here

            new ObjectXmlPersist(XStreamFactory.getSharedRefXStream());

        migrationTask = loadMigrationTask(persist);
        this.setPartName(migrationTask.getName());
      } catch (IOException errIo) {
        throw new PartInitException("Unable to load migration task from " + uri, errIo);
      }
    }
  }
View Full Code Here

        sets = loadNamedRelationship(persist, file.getRawLocationURI());

        setDirtyState(false);
      } catch (IOException errIo) {
        throw new PartInitException(
            "Unable to load named relationship from "
            + file.getRawLocationURI(), errIo);
      }
    } else {
      throw new PartInitException(
      "Input for editor is not suitable for the NamedRelationshipEditor");
    }
  }
View Full Code Here

    final IDocumentProvider docProvider = sourcePage.getDocumentProvider();
    IDocument document = docProvider.getDocument(input);
    try {
      model.loadFrom(document);
    } catch (IOException e) {
      throw new PartInitException("Error reading editor input.", e);
    }
   
    // Ensure the field values are updated if the file content is replaced
        docProvider.addElementStateListener(new IElementStateListener() {
            public void elementMoved(Object originalElement, Object movedElement) {
View Full Code Here

   * Checks that the input is an instance of <code>IFileEditorInput</code>.
   * Sets the site, input and title
   */
  public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
    if (!(editorInput instanceof IFileEditorInput))
      throw new PartInitException("Invalid Input: Must be IFileEditorInput");
   
    setSite(site);
    setInput(editorInput);
    setPartName(editorInput.getName());
  }
View Full Code Here

   * checks that the input is an instance of <code>IFileEditorInput</code>.
   */
  public void init(IEditorSite site, IEditorInput editorInput)
    throws PartInitException {
    if (!(editorInput instanceof IFileEditorInput))
      throw new PartInitException("Invalid Input: Must be IFileEditorInput");
    super.init(site, editorInput);
  }
View Full Code Here

   */
  public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
    XMLInputSource input;

    if (!(editorInput instanceof IFileEditorInput))
      throw new PartInitException(Messages.getString("MultiPageEditor.invalidInputClass")); //$NON-NLS-1$
    fileNeedingContext = file = ((IFileEditorInput) editorInput).getFile();
    String filePathName = file.getLocation().toOSString();

    try {
      input = new XMLInputSource(filePathName);
    } catch (IOException e) {
      String m = Messages.getFormattedString("MultiPageEditor.IOError", //$NON-NLS-1$
              new String[] { AbstractSection.maybeShortenFileName(filePathName) })
              + Messages.getString("MultiPageEditor.10") + getMessagesToRootCause(e); //$NON-NLS-1$
      // skip showing a message because the partInitException
      // shows it
      throw new PartInitException(m);
    }

    super.init(site, editorInput); // to allow other editors to get site and editorInput
       
    // leaves isBadXML set, if it can't parse but isn't throwing
    isContextLoaded = false;
    try {
      parseSource(input, filePathName);
    } catch (MultilevelCancel e) {
      throw new PartInitException("Operation Cancelled");
    }

    isContextLoaded = true;

    // super.init(site, editorInput);
View Full Code Here

      } else {
        if (null == extensionEditor) {
          extensionEditor = getRequiredEditor(inputDescription);
        }
        if (null == extensionEditor) {
          throw new PartInitException(Messages.getFormattedString(
                  "MultiPageEditor.unrecognizedDescType", //$NON-NLS-1$
                  new String[] { AbstractSection.maybeShortenFileName(filePathName) })
                  + Messages.getString("MultiPageEditor.11")); //$NON-NLS-1$
        } else {
          extensionEditor.activateEditor(getEditorSite(), getEditorInput(), this, inputDescription);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.PartInitException

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.