Package org.eclipse.core.runtime

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


   */
  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

   * 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

            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

     */
    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

    }

    protected InputStream createStream() throws CoreException {
        InputStream stream = JdtUtils.createInputStream(element);
        if (stream == null) {
            throw new CoreException(new Status(
                IStatus.ERROR, "de.loskutov.bco", -1,
                "cannot get bytecode from class file", null));
        }
        DecompiledClass decompiledClass = null;
        try {
            decompiledClass = DecompilerClassVisitor.getDecompiledClass(
                stream, null, methodName, modes, null);
        } catch (IOException e) {
            throw new CoreException(new Status(
                IStatus.ERROR, "de.loskutov.bco", -1,
                "cannot get bytecode dump", e));
        } catch (UnsupportedClassVersionError e){
            throw new CoreException(new Status(
                IStatus.ERROR, "de.loskutov.bco", -1,
                "Error caused by attempt to load class compiled with Java version which"
                + " is not supported by current JVM", e));
        } finally {
            try {
View Full Code Here

        InputStream stream= null;
        stream = new BufferedInputStream(file.getContents(true));
        try {
            return getInputStreamAsCharArray(stream, -1, encoding);
        } catch (IOException e) {
            throw new CoreException(new Status(IStatus.ERROR, DroolsIDEPlugin.PLUGIN_ID, IStatus.ERROR, "IOException", e));
        } finally {
            try {
                stream.close();
            } catch (IOException e) {
                // ignore
View Full Code Here

public String toString() {
  StringBuffer buffer= new StringBuffer();
  buffer.append("Java Model Exception: "); //$NON-NLS-1$
  if (getException() != null) {
    if (getException() instanceof CoreException) {
      CoreException c= (CoreException)getException();
      buffer.append("Core Exception [code "); //$NON-NLS-1$
      buffer.append(c.getStatus().getCode());
      buffer.append("] "); //$NON-NLS-1$
      buffer.append(c.getStatus().getMessage());
    } else {
      buffer.append(getException().toString());
    }
  } else {
    buffer.append(getStatus().toString());
View Full Code Here

    int curr= 0;
    do {
      try {
        curr= this.scanner.getNextToken();
        if (curr == ITerminalSymbols.TokenNameEOF) {
          throw new CoreException(createError(END_OF_FILE, "End Of File", null)); //$NON-NLS-1$
        }
      } catch (InvalidInputException e) {
        throw new CoreException(createError(LEXICAL_ERROR, e.getMessage(), e));
      }
    } while (ignoreComments && isComment(curr));
    return curr;
  }
View Full Code Here

  }

  private static void ensureResourceExists(IResource resource, String resourceName)
          throws CoreException {
    if (resource == null)
      throw new CoreException(new Status(IStatus.ERROR, LauncherPlugin.ID, "The " + resourceName
              + " does not exist!"));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.CoreException

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.