Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.ISafeRunnable


      String message = Messages.CompositeEditor_2;
      monitor.beginTask(message, Math.max(1, editors.length));
      for (int i = 0; i < editors.length; i++) {
        final IProgressMonitor subMonitor = Policy.subMonitorFor(monitor, 1);
        final IEditorPart editor = editors[i];
        ISafeRunnable runnable = new ISafeRunnable() {
          public void run() throws Exception {
            editor.doSave(subMonitor);
          }
          public void handleException(Throwable exception) {
          }
View Full Code Here


    }
  }
 
  for (int i= 0; i < listeners.size(); i++) {
    final ITypeHierarchyChangedListener listener= (ITypeHierarchyChangedListener)listeners.get(i);
    SafeRunner.run(new ISafeRunnable() {
      public void handleException(Throwable exception) {
        Util.log(exception, "Exception occurred in listener of Type hierarchy change notification"); //$NON-NLS-1$
      }
      public void run() throws Exception {
        listener.typeHierarchyChanged(TypeHierarchy.this);
View Full Code Here

protected void notifyChanged(final BufferChangedEvent event) {
  ArrayList listeners = this.changeListeners;
  if (listeners != null) {
    for (int i = 0, size = listeners.size(); i < size; ++i) {
      final IBufferChangedListener listener = (IBufferChangedListener) listeners.get(i);
      SafeRunner.run(new ISafeRunnable() {
        public void handleException(Throwable exception) {
          Util.log(exception, "Exception occurred in listener of buffer change notification"); //$NON-NLS-1$
        }
        public void run() throws Exception {
          listener.bufferChanged(event);
View Full Code Here

   *
   * @param ex the exception
   * @since 3.6
   */
  private static void log(final Exception ex) {
    SafeRunner.run(new ISafeRunnable() {
      public void run() throws Exception {
        throw ex;
      }

      public void handleException(Throwable exception) {
View Full Code Here

   */
  public AbstractHyperlinkDetector createHyperlinkDetector() throws CoreException {
    final Throwable[] exception= new Throwable[1];
    final AbstractHyperlinkDetector[] result= new AbstractHyperlinkDetector[1];
    String message= NLSUtility.format(EditorMessages.Editor_error_HyperlinkDetector_couldNotCreate_message, new String[] { getId(), fElement.getContributor().getName() });
    ISafeRunnable code= new SafeRunnable(message) {
      /*
       * @see org.eclipse.core.runtime.ISafeRunnable#run()
       */
      public void run() throws Exception {
         String pluginId = fElement.getContributor().getName();
View Full Code Here

      collector.beginCollecting();
      if (fPreferences.getBoolean(PREFERENCE_SPELLING_ENABLED))
        try {
          final ISpellingEngine engine= createEngine(fPreferences);
          if (engine != null) {
            ISafeRunnable runnable= new ISafeRunnable() {
              public void run() throws Exception {
                engine.check(document, regions, context, collector, monitor);
              }
              public void handleException(Throwable x) {
              }
View Full Code Here

      final ListenerList listeners = getParticipants(console);
      if (listeners != null) {
        Object[] participants = listeners.getListeners();
          for (int i = 0; i < participants.length; i++) {
            final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
            SafeRunner.run(new ISafeRunnable() {
            public void run() throws Exception {
              participant.activated();
            }
            public void handleException(Throwable exception) {
              ConsolePlugin.log(exception);
View Full Code Here

    ListenerList listeners = (ListenerList) fConsoleToPageParticipants.remove(console);
    if (listeners != null) {
      Object[] participants = listeners.getListeners();
      for (int i = 0; i < participants.length; i++) {
              final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
              SafeRunner.run(new ISafeRunnable() {
          public void run() throws Exception {
            participant.dispose();
          }
          public void handleException(Throwable exception) {
            ConsolePlugin.log(exception);
View Full Code Here

    }
    fConsoleToPageParticipants.put(console, participants);
    Object[] listeners = participants.getListeners();
    for (int i = 0; i < listeners.length; i++) {
            final IConsolePageParticipant participant = (IConsolePageParticipant) listeners[i];
            SafeRunner.run(new ISafeRunnable() {
        public void run() throws Exception {
          participant.init(page, console);
        }
        public void handleException(Throwable exception) {
          ConsolePlugin.log(exception);
View Full Code Here

      final ListenerList listeners = getParticipants(console);
      if (listeners != null) {
        Object[] participants = listeners.getListeners();
          for (int i = 0; i < participants.length; i++) {
            final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
            SafeRunner.run(new ISafeRunnable() {
            public void run() throws Exception {
              participant.deactivated();
            }
            public void handleException(Throwable exception) {
              ConsolePlugin.log(exception);
View Full Code Here

TOP

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

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.