Examples of CoreException


Examples of org.eclipse.core.runtime.CoreException

        } else {
          _encoding = new WGADesignStructureHelper(((IFileEditorInput) element).getFile()).determineDesignEncoding();         
        }
        return super.createDocument(element)
      } else {
        throw new CoreException(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unsupported editorinput."))
      }
    } else {
      throw new CoreException(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unsupported editorinput. Please import files into an eclipse project first."));
    }   
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

      try {
        charset= Charset.forName(encoding);
      } catch (UnsupportedCharsetException ex) {
        String message= "Unsupported encoding '" + encoding + "'.";
        IStatus s= new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.OK, message, ex);
        throw new CoreException(s);
      } catch (IllegalCharsetNameException ex) {
        String message= "Unsupported encoding '" + encoding + "'.";
        IStatus s= new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.OK, message, ex);
        throw new CoreException(s);
      }

      CharsetEncoder encoder= charset.newEncoder();
      encoder.onMalformedInput(CodingErrorAction.REPLACE);
      encoder.onUnmappableCharacter(CodingErrorAction.REPORT);

      InputStream stream;

      try {
        byte[] bytes;
        ByteBuffer byteBuffer= encoder.encode(CharBuffer.wrap(document.get()));
        if (byteBuffer.hasArray())
          bytes= byteBuffer.array();
        else {
          bytes= new byte[byteBuffer.limit()];
          byteBuffer.get(bytes);
        }
        stream= new ByteArrayInputStream(bytes, 0, byteBuffer.limit());
      } catch (CharacterCodingException ex) {
        Assert.isTrue(ex instanceof UnmappableCharacterException);
        String message= "Charset mapping failed.";
        IStatus s= new Status(IStatus.ERROR, Plugin.PLUGIN_ID, EditorsUI.CHARSET_MAPPING_FAILED, message, null);
        throw new CoreException(s);
      }

      if (file.exists()) {

        if (info != null && !overwrite)
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

        }
      } else {       
        manager.createDeployment(getProject(), monitor);
      }
    } catch (Exception e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to create or update wga deployment.", e));
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

   * a <code>NullProgressMonitor</code> if no progress is to be reported.
   * @return Returns the Status of the Operation.
   */
  public IStatus reload(final IBookMark bookmark, final Shell shell, final IProgressMonitor monitor) {
    Assert.isNotNull(bookmark);
    CoreException ex = null;

    /* Keep URL of Feed as final var */
    final URI feedLink = bookmark.getFeedLinkReference().getLink();

    try {
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

   * a <code>NullProgressMonitor</code> if no progress is to be reported.
   * @return Returns the Status of the Operation.
   */
  public IStatus reload(final IBookMark bookmark, final Shell shell, final IProgressMonitor monitor) {
    Assert.isNotNull(bookmark);
    CoreException ex = null;

    /* Keep URL of Feed as final var */
    final URI feedLink = bookmark.getFeedLinkReference().getLink();

    try {
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

   */
  public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
    if (data instanceof String)
      fId = (String) data;
    else
      throw new CoreException(Activator.getDefault().createErrorStatus("Data argument must be a String for " + getClass(), null)); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

   */
  public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
    if (data instanceof String)
      fId = (String) data;
    else
      throw new CoreException(Activator.getDefault().createErrorStatus("Data argument must be a String for " + getClass(), null));
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

   * a <code>NullProgressMonitor</code> if no progress is to be reported.
   * @return Returns the Status of the Operation.
   */
  public IStatus reload(final IBookMark bookmark, Shell shell, final IProgressMonitor monitor) {
    Assert.isNotNull(bookmark);
    CoreException ex = null;

    /* Keep URL and Homepage of Feed as final var */
    final URI feedLink = bookmark.getFeedLinkReference().getLink();
    URI feedHomepage = null;

View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

            URL url = bundle.getEntry("/");
            return Platform.asLocalURL(url).getPath();
        } catch (IOException e) {
            IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK,
                    "Could not determine path", e); //$NON-NLS-1$
            throw new CoreException(status);
        }
    }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

     */
    protected void doSetInput(IEditorInput input) throws CoreException {

        input = transformEditorInput(input);
        if (!(input instanceof IClassFileEditorInput)) {
            throw new CoreException(JavaUIStatus.createError(
                IJavaModelStatusConstants.INVALID_RESOURCE_TYPE,
                "invalid input", // JavaEditorMessages.ClassFileEditor_error_invalid_input_message,
                null));
        }

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.