Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IStatus


  private void throwCoreException(String message) throws CoreException {
    throwCoreException(message, null);
  }
 
  private void throwCoreException(String message, Exception e) throws CoreException {
    IStatus status =
      new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, IStatus.OK, message, e);
    throw new CoreException(status);   
  }
View Full Code Here


      Charset charset;
      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()) {
View Full Code Here

      if (msg == null && e != null && e.getMessage() != null)
        msg = e.getMessage();

      Activator activator = Activator.getDefault();
      if (activator != null) {
        IStatus status = activator.createErrorStatus(msg, e);
        activator.getLog().log(status);
      }
    }
  }
View Full Code Here

        /* Perform the Operation if not yet Cancelled */
        if (!monitor.isCanceled()) {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              fCurrentTask = task.getName();
              IStatus status = task.run(monitor);

              /* Log anything that is an Error or Warning */
              if (status.getSeverity() == IStatus.ERROR || status.getSeverity() == IStatus.WARNING) {
                if (Activator.getDefault() != null)
                  Activator.getDefault().getLog().log(status);
              }
            }
          });
View Full Code Here

        e = (Exception) t;

      if (msg == null && e != null && e.getMessage() != null)
        msg = e.getMessage();

      IStatus status = Activator.getDefault().createErrorStatus(msg, e);
      Activator.getDefault().getLog().log(status);
    }
  }
View Full Code Here

      fShell = shell;
      fPriority = priority;
    }

    public IStatus run(IProgressMonitor monitor) {
      IStatus status = reload(fBookMark, fShell, monitor);
      return status;
    }
View Full Code Here

        /* Perform the Operation if not yet Cancelled */
        if (!monitor.isCanceled()) {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              fCurrentTask = task.getName();
              IStatus status = task.run(monitor);

              /* Log anything that is an Error or Warning */
              if (status.getSeverity() == IStatus.ERROR || status.getSeverity() == IStatus.WARNING)
                Activator.getDefault().getLog().log(status);
            }
          });

          /* Update Work Fields if not cancelled meanwhile */
 
View Full Code Here

      fShell = shell;
      fPriority = priority;
    }

    public IStatus run(IProgressMonitor monitor) {
      IStatus status = reload(fBookMark, fShell, monitor);
      return status;
    }
View Full Code Here

        /* Perform the Operation if not yet Cancelled */
        if (!monitor.isCanceled()) {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              IStatus status = task.run(monitor);

              /* Log anything that is an Error or Warning */
              if (status.getSeverity() == IStatus.ERROR || status.getSeverity() == IStatus.WARNING)
                Activator.getDefault().getLog().log(status);
            }
          });
        }

View Full Code Here

            handleLinkSupplied(link);
        }
      };

      /* Check Startup Status */
      IStatus startupStatus = Activator.getDefault().getStartupStatus();
      if (startupStatus.getSeverity() == IStatus.ERROR)
        return handleStartupError(startupStatus);

      /* Create the Workbench */
      fWorkbenchAdvisor = new ApplicationWorkbenchAdvisor(runAfterUIStartup);
      int returnCode = PlatformUI.createAndRunWorkbench(display, fWorkbenchAdvisor);
View Full Code Here

TOP

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

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.