Package org.eclipse.ui

Examples of org.eclipse.ui.PartInitException


    return true;
  }

  public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
    if (!(editorInput instanceof IFileEditorInput)){
      throw new PartInitException("Unsupported editor input.");
    }
    super.init(site, editorInput);
    setPartName(editorInput.getName());
  }
View Full Code Here


      editorDesc = editorReg.findEditor("org.eclipse.ui.DefaultTextEditor");
    }

    // if no valid editor found, bail out
    if (editorDesc == null) {
      throw new PartInitException(IDEWorkbenchMessages.IDE_noFileEditorFound);
    }

    return editorDesc;
  }
View Full Code Here

            attributes.put(IMarker.CHAR_START, new Integer(offset));
            attributes.put(IMarker.CHAR_END, new Integer(offset + length));
            marker.setAttributes(attributes);
            IDE.gotoMarker(editor, marker);
        } catch (CoreException e) {
            throw new PartInitException(SearchMessages.FileSearchPage_error_marker, e);
        } finally {
            if (marker != null)
                try {
                    marker.delete();
                } catch (CoreException e) {
View Full Code Here

     * The <code>MultiPageEditorExample</code> implementation of this method 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

          try {
            linkedFile = linkedFileHelper.obtainLink(uri, true);
            linkedFile.setPersistentProperty(TmpFileStoreEditorInput.UNTITLED_PROPERTY, "true");
          }
          catch(CoreException e) {
            throw new PartInitException(e.getStatus());
          }
        else {
          linkedFile = linkedFileHelper.obtainLink(uri, false);
        }
        IFileEditorInput linkedInput = new FileEditorInput(linkedFile);
View Full Code Here

          try {
            linkedFile = ExtLinkedFileHelper.obtainLink(uri, true);
            linkedFile.setPersistentProperty(TmpFileStoreEditorInput.UNTITLED_PROPERTY, "true");
          }
          catch(CoreException e) {
            throw new PartInitException(e.getStatus());
          }
        else {
          linkedFile = ExtLinkedFileHelper.obtainLink(uri, false);
        }
        IFileEditorInput linkedInput = new FileEditorInput(linkedFile);
View Full Code Here

        if (MessageDialog.openQuestion(null, Messages.ViewShare_VIEWSHARE_RECEIVED_REQUEST_TITLE, NLS.bind(Messages.ViewShare_VIEWSHARE_RECEIVED_REQUEST_MESSAGE, user))) {
          try {
            final IWorkbenchWindow ww = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            final IWorkbenchPage wp = ww.getActivePage();
            if (wp == null)
              throw new PartInitException(Messages.ViewShare_EXCEPTION_WORKBENCHPAGE_NULL);
            // Actually show view requested
            wp.showView(viewID, secondaryID, mode);

          } catch (final Exception e) {
            logError(Messages.ViewShare_VIEWSHARE_ERROR_LOG_MESSAGE, e);
View Full Code Here

  };

  @Override
  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 );
    try {
      IFileEditorInput i = (IFileEditorInput) editorInput;
      properties.load( i.getFile().getContents() );
      setPartName( editorInput.getName() );
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.