Exception Fact Sheet for "org-eclipse-ui-workbench"

The goal of an Exception Fact Sheet is to reveal the design of exception handling in an application.

--Maxence, Martin

For feedback, please contact Martin

Table of contents

Basic Statistics

Number of Classes 2743
Number of Domain Exception Types (Thrown or Caught) 10
Number of Domain Checked Exception Types 7
Number of Domain Runtime Exception Types 0
Number of Domain Unknown Exception Types 3
nTh = Number of Throw 522
nTh = Number of Throw in Catch 53
Number of Catch-Rethrow (may not be correct) 6
nC = Number of Catch 617
nCTh = Number of Catch with Throw 51
Number of Empty Catch (really Empty) 24
Number of Empty Catch (with comments) 131
Number of Empty Catch 155
nM = Number of Methods 13568
nbFunctionWithCatch = Number of Methods with Catch 426 / 13568
nbFunctionWithThrow = Number of Methods with Throw 398 / 13568
nbFunctionWithThrowS = Number of Methods with ThrowS 421 / 13568
nbFunctionTransmitting = Number of Methods with "Throws" but NO catch, NO throw (only transmitting) 351 / 13568
P1 = nCTh / nC 8.3% (0.083)
P2 = nMC / nM 3.1% (0.031)
P3 = nbFunctionWithThrow / nbFunction 2.9% (0.029)
P4 = nbFunctionTransmitting / nbFunction 2.6% (0.026)
P5 = nbThrowInCatch / nbThrow 10.2% (0.102)
R2 = nCatch / nThrow 1.182
A1 = Number of Caught Exception Types From External Libraries 34
A2 = Number of Reused Exception Types From External Libraries (thrown from application code) 13

W1 is a rough estimation of the richness of the exception model. It does not take into account the inheritance relationships between domain exceptions.

Proportion P1 measures the overall exception flow. According to our experience, it varies from 5% to 70%. Early-catch design generally yields a low P1, libraries that must warn clients about errors (e.g. databases) generally have a high P1.

Proportion P2 measures the dispersion of catch blocks in the application. According to our experience, it varies from 2% to 15%. A small P2 indicates a rather centralized management of errors.

R1 shows how many exceptions types from libraries (incl. JDK) are thrown from application code. For instance, IllegalArgumentException comes from the JDK but is used in many applications.

A1 measures the awareness of the application to library exceptions. A high value of A1 means either that the application is polluted with checked exceptions or that it is able to apply specific recovery depending on the library exception.

Exception Hierachy

Exception Map

Each exception that is used at least once in the project is a dot. A orange dot represents a domain exception that is defined in the application. A blue dot exception is defined in the JDK or in a library. The x-axis represents the number of times an exception is caught, the y-axis the number of times an exception is thrown.

Exceptions With State

State means fields. Number of exceptions with state: 3
MultiPartInitException
              package org.eclipse.ui;public class MultiPartInitException extends WorkbenchException {

	private IWorkbenchPartReference[] references;
	private PartInitException[] exceptions;

	/**
	 * Creates a new exception object. Note that as of 3.5, this constructor
	 * expects exactly one exception object in the given array, with all other
	 * array positions being <code>null</code>. The restriction may be lifted in
	 * the future, and clients of this class must not make this assumption.
	 * 
	 * @param references
	 * @param exceptions
	 */
	public MultiPartInitException(IWorkbenchPartReference[] references,
			PartInitException[] exceptions) {
		super(exceptions[findSingleException(exceptions)].getStatus());
		this.references = references;
		this.exceptions = exceptions;
	}

	/**
	 * Returns an array of part references, containing references of parts that
	 * were intialized correctly. Any number of elements of the returned array
	 * may have a <code>null</code> value.
	 * 
	 * @return the part reference array
	 */
	public IWorkbenchPartReference[] getReferences() {
		return references;
	}

	/**
	 * Returns an array of exceptions, corresponding to parts that could not be
	 * intialized correctly. At least one element of the returned array will
	 * have a non-<code>null</code> value.
	 * 
	 * @return the exception array
	 */
	public PartInitException[] getExceptions() {
		return exceptions;
	}

	private static int findSingleException(PartInitException[] exceptions) {
		int index = -1;
		for (int i = 0; i < exceptions.length; i++) {
			if (exceptions[i] != null) {
				if (index == -1) {
					index = i;
				} else
					throw new IllegalArgumentException();
			}
		}
		if (index == -1) {
			throw new IllegalArgumentException();
		}
		return index;
	}

	private static final long serialVersionUID = -9138185942975165490L;

}
            
CommandException
              package org.eclipse.ui.commands;public abstract class CommandException extends Exception {

	/**
	 * Generated serial version UID for this class.
	 * 
	 * @since 3.4
	 */
	private static final long serialVersionUID= 1776879459633730964L;
	
	
	private Throwable cause;

    /**
     * Creates a new instance of this class with the specified detail message.
     * 
     * @param message
     *            the detail message.
     */
    public CommandException(String message) {
        super(message);
    }

    /**
     * Creates a new instance of this class with the specified detail message
     * and cause.
     * 
     * @param message
     *            the detail message.
     * @param cause
     *            the cause.
     */
    public CommandException(String message, Throwable cause) {
        super(message);
        // don't pass the cause to super, to allow compilation against JCL Foundation
        this.cause = cause;
    }

    /**
     * Returns the cause of this throwable or <code>null</code> if the
     * cause is nonexistent or unknown. 
     *
     * @return the cause or <code>null</code>
     * @since 3.1
     */
    public Throwable getCause() {
        return cause;
    }
}
            
ContextException
              package org.eclipse.ui.contexts;public abstract class ContextException extends Exception {
	
	/**
	 * Generated serial version UID for this class.
	 * 
	 * @since 3.4
	 */
	private static final long serialVersionUID= -5143404124388080211L;
	
	
	private Throwable cause;

    /**
     * Creates a new instance of this class with the specified detail message.
     * 
     * @param message
     *            the detail message.
     */
    public ContextException(String message) {
        super(message);
    }

    /**
     * Creates a new instance of this class with the specified detail message
     * and cause.
     * 
     * @param message
     *            the detail message.
     * @param cause
     *            the cause.
     */
    public ContextException(String message, Throwable cause) {
        super(message);
        // don't pass the cause to super, to allow compilation against JCL Foundation
        this.cause = cause;
    }
    
    /**
     * Returns the cause of this throwable or <code>null</code> if the
     * cause is nonexistent or unknown. 
     *
     * @return the cause or <code>null</code>
     * @since 3.1
     */
    public Throwable getCause() {
        return cause;
    }

}
            

Thrown Exceptions Summary

A (Domain) exception is defined in the application. A (Lib) exception is defined in the JDK or in a library. An exception can be thrown, thrown from within a catch, or declared in the signature of a method (usually for checked exceptions). Hovering over a number triggers showing code snippets from the application code.

Type Exception Thrown Thrown
from Catch
Declared
- Unknown 40
              
//in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
throw exc[0];

              
//in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
throw core;

              
//in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw ex[0];

              
//in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw ex[0];

              
//in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw (RuntimeException) e.getTargetException();

              
//in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw (PartInitException) result[0];

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (Error) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (RuntimeException) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (WorkbenchException) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (Error) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (RuntimeException) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (PartInitException) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (Error) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (RuntimeException) throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
throw e;

              
//in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
throw (PartInitException) e;

              
//in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
throw e;

              
//in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
throw (RuntimeException)e.getTargetException();

              
//in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
throw e;

              
//in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw invokes[0];

              
//in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw interrupt[0];

              
//in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw (InvocationTargetException) exception;

              
//in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw (InterruptedException) exception;

              
//in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
throw (ThreadDeath) t;

              
//in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
throw (RuntimeException) t;

              
//in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
throw (Error) t;

              
//in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw exceptions[0];

              
//in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw (WorkbenchException) result[0];

              
//in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw (Error)throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw (Exception)throwable;

              
//in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
throw invokes[0];

              
//in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
throw interrupt[0];

              
//in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
throw exceptions[0];

              
//in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
throw exceptions[0];

              
//in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
throw (WorkbenchException) result[0];

              
//in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
throw (Error) e;

              
//in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
throw (Error)error[0];

              
//in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
throw (RuntimeException)error[0];

              
//in Eclipse UI/org/eclipse/ui/XMLMemento.java
throw exception;

            
- -
- Builder 2
              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw (RuntimeException) e.getTargetException();

              
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
throw (RuntimeException)e.getTargetException();

            
- -
- Variable 40
              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
throw exc[0];

              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
throw core;

              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw ex[0];

              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw ex[0];

              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw (RuntimeException) e.getTargetException();

              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
throw (PartInitException) result[0];

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (Error) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (RuntimeException) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (WorkbenchException) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (Error) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (RuntimeException) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (PartInitException) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (Error) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
throw (RuntimeException) throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
throw e;

              
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
throw (PartInitException) e;

              
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
throw e;

              
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
throw (RuntimeException)e.getTargetException();

              
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
throw e;

              
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw invokes[0];

              
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw interrupt[0];

              
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw (InvocationTargetException) exception;

              
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
throw (InterruptedException) exception;

              
// in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
throw (ThreadDeath) t;

              
// in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
throw (RuntimeException) t;

              
// in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
throw (Error) t;

              
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw exceptions[0];

              
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw (WorkbenchException) result[0];

              
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw (Error)throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
throw (Exception)throwable;

              
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
throw invokes[0];

              
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
throw interrupt[0];

              
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
throw exceptions[0];

              
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
throw exceptions[0];

              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
throw (WorkbenchException) result[0];

              
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
throw (Error) e;

              
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
throw (Error)error[0];

              
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
throw (RuntimeException)error[0];

              
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
throw exception;

            
- -
(Lib) NullPointerException 165
              
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void put(String key, String value) { checkRemoved(); if (key == null || value == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } temporarySettings.put(key, value); if (!value.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, value); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
private String internalGet(String key, String defaultValue) { if (key == null) { throw new NullPointerException(); } if (temporarySettings.containsKey(key)) { Object value = temporarySettings.get(key); return value == null ? defaultValue : (String) value; } return getOriginal().get(key, defaultValue); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void remove(String key) { checkRemoved(); if (key == null) { throw new NullPointerException(); } Object oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = temporarySettings.get(key); } else { oldValue = original.get(key, null); } if (oldValue == null) { return; } temporarySettings.put(key, null); firePropertyChangeEvent(key, oldValue, null); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putInt(String key, int value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Integer.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putLong(String key, long value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Long.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putBoolean(String key, boolean value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = String.valueOf(value); temporarySettings.put(key, newValue); if (!newValue.equalsIgnoreCase(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putFloat(String key, float value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Float.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putDouble(String key, double value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Double.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putByteArray(String key, byte[] value) { checkRemoved(); if (key == null || value == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = new String(Base64.encode(value)); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionCommandMappingService.java
public final String getCommandId(final String actionId) { if (actionId == null) { throw new NullPointerException( "Cannot get the command identifier for a null action id"); //$NON-NLS-1$ } return (String) mapping.get(actionId); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionCommandMappingService.java
public final void map(final String actionId, final String commandId) { if (actionId == null) { throw new NullPointerException("The action id cannot be null"); //$NON-NLS-1$ } if (commandId == null) { throw new NullPointerException("The command id cannot be null"); //$NON-NLS-1$ } mapping.put(actionId, commandId); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
public final void addCommandManagerListener( final ICommandManagerListener commandManagerListener) { if (commandManagerListener == null) { throw new NullPointerException("Cannot add a null listener."); //$NON-NLS-1$ } if (commandManagerListeners == null) { commandManagerListeners = new ArrayList(); this.commandManager.addCommandManagerListener(this); this.bindingManager.addBindingManagerListener(this); this.contextManager.addContextManagerListener(this); } if (!commandManagerListeners.contains(commandManagerListener)) { commandManagerListeners.add(commandManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
private void fireCommandManagerChanged( CommandManagerEvent commandManagerEvent) { if (commandManagerEvent == null) { throw new NullPointerException(); } if (commandManagerListeners != null) { for (int i = 0; i < commandManagerListeners.size(); i++) { ((ICommandManagerListener) commandManagerListeners.get(i)) .commandManagerChanged(commandManagerEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
public void removeCommandManagerListener( ICommandManagerListener commandManagerListener) { if (commandManagerListener == null) { throw new NullPointerException("Cannot remove a null listener"); //$NON-NLS-1$ } if (commandManagerListeners != null) { commandManagerListeners.remove(commandManagerListener); if (commandManagerListeners.isEmpty()) { commandManagerListeners = null; this.commandManager.removeCommandManagerListener(this); this.bindingManager.removeBindingManagerListener(this); this.contextManager.removeContextManagerListener(this); } } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
private final void fireManagerChanged(final CommandImageManagerEvent event) { if (event == null) { throw new NullPointerException(); } final Object[] listeners = getListeners(); for (int i = 0; i < listeners.length; i++) { final ICommandImageManagerListener listener = (ICommandImageManagerListener) listeners[i]; listener.commandImageManagerChanged(event); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
public final ImageDescriptor getImageDescriptor(final String commandId, final int type, final String style) { if (commandId == null) { throw new NullPointerException(); } final Object[] images = (Object[]) imagesById.get(commandId); if (images == null) { return null; } if ((type < 0) || (type >= images.length)) { throw new IllegalArgumentException( "The type must be one of TYPE_DEFAULT, TYPE_DISABLED and TYPE_HOVER."); //$NON-NLS-1$ } Object typedImage = images[type]; if (typedImage == null) { return null; } if (typedImage instanceof ImageDescriptor) { return (ImageDescriptor) typedImage; } if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; Object styledImage = styleMap.get(style); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } if (style != null) { styledImage = styleMap.get(null); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
public void addContextManagerListener( IContextManagerListener contextManagerListener) { if (contextManagerListener == null) { throw new NullPointerException(); } if (contextManagerListeners == null) { contextManagerListeners = new ArrayList(); } if (!contextManagerListeners.contains(contextManagerListener)) { contextManagerListeners.add(contextManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
protected void fireContextManagerChanged( ContextManagerEvent contextManagerEvent) { if (contextManagerEvent == null) { throw new NullPointerException(); } if (contextManagerListeners != null) { for (int i = 0; i < contextManagerListeners.size(); i++) { ((IContextManagerListener) contextManagerListeners.get(i)) .contextManagerChanged(contextManagerEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
public void removeContextManagerListener( IContextManagerListener contextManagerListener) { if (contextManagerListener == null) { throw new NullPointerException(); } if (contextManagerListeners != null) { contextManagerListeners.remove(contextManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java
public final boolean registerShell(final Shell shell, final int type) { // We do not allow null shell registration. It is reserved. if (shell == null) { throw new NullPointerException("The shell was null"); //$NON-NLS-1$ } // Debugging output if (DEBUG) { final StringBuffer buffer = new StringBuffer("register shell '"); //$NON-NLS-1$ buffer.append(shell); buffer.append("' as "); //$NON-NLS-1$ switch (type) { case IContextService.TYPE_DIALOG: buffer.append("dialog"); //$NON-NLS-1$ break; case IContextService.TYPE_WINDOW: buffer.append("window"); //$NON-NLS-1$ break; case IContextService.TYPE_NONE: buffer.append("none"); //$NON-NLS-1$ break; default: buffer.append("unknown"); //$NON-NLS-1$ break; } Tracing.printTrace(TRACING_COMPONENT, buffer.toString()); } // Build the list of submissions. final List activations = new ArrayList(); Expression expression; IContextActivation dialogWindowActivation; switch (type) { case IContextService.TYPE_DIALOG: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation dialogActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG, expression, contextService); activateContext(dialogActivation); activations.add(dialogActivation); break; case IContextService.TYPE_NONE: break; case IContextService.TYPE_WINDOW: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation windowActivation = new ContextActivation( IContextService.CONTEXT_ID_WINDOW, expression, contextService); activateContext(windowActivation); activations.add(windowActivation); break; default: throw new IllegalArgumentException("The type is not recognized: " //$NON-NLS-1$ + type); } // Check to see if the activations are already present. boolean returnValue = false; final Collection previousActivations = (Collection) registeredWindows .get(shell); if (previousActivations != null) { returnValue = true; final Iterator previousActivationItr = previousActivations .iterator(); while (previousActivationItr.hasNext()) { final IContextActivation activation = (IContextActivation) previousActivationItr .next(); deactivateContext(activation); } } // Add the new submissions, and force some reprocessing to occur. registeredWindows.put(shell, activations); /* * Remember the dispose listener so that we can remove it later if we * unregister the shell. */ final DisposeListener shellDisposeListener = new DisposeListener() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) */ public void widgetDisposed(DisposeEvent e) { registeredWindows.remove(shell); if (!shell.isDisposed()) { shell.removeDisposeListener(this); } /* * In the case where a dispose has happened, we are expecting an * activation event to arrive at some point in the future. If we * process the submissions now, then we will update the * activeShell before checkWindowType is called. This means that * dialogs won't be recognized as dialogs. */ final Iterator activationItr = activations.iterator(); while (activationItr.hasNext()) { deactivateContext((IContextActivation) activationItr.next()); } } }; // Make sure the submissions will be removed in event of disposal. shell.addDisposeListener(shellDisposeListener); shell.setData(DISPOSE_LISTENER, shellDisposeListener); return returnValue; }
// in Eclipse UI/org/eclipse/ui/internal/services/SourcePriorityNameMapping.java
public static final void addMapping(final String sourceName, final int sourcePriority) { if (sourceName == null) { throw new NullPointerException("The source name cannot be null."); //$NON-NLS-1$ } if (!sourcePrioritiesByName.containsKey(sourceName)) { final Integer priority = new Integer(sourcePriority); sourcePrioritiesByName.put(sourceName, priority); } }
// in Eclipse UI/org/eclipse/ui/internal/services/SourceProviderService.java
public final void registerProvider(final ISourceProvider sourceProvider) { if (sourceProvider == null) { throw new NullPointerException("The source provider cannot be null"); //$NON-NLS-1$ } final String[] sourceNames = sourceProvider.getProvidedSourceNames(); for (int i = 0; i < sourceNames.length; i++) { final String sourceName = sourceNames[i]; sourceProvidersByName.put(sourceName, sourceProvider); } sourceProviders.add(sourceProvider); }
// in Eclipse UI/org/eclipse/ui/internal/services/SourceProviderService.java
public final void unregisterProvider(ISourceProvider sourceProvider) { if (sourceProvider == null) { throw new NullPointerException("The source provider cannot be null"); //$NON-NLS-1$ } final String[] sourceNames = sourceProvider.getProvidedSourceNames(); for (int i = 0; i < sourceNames.length; i++) { sourceProvidersByName.remove(sourceNames[i]); } sourceProviders.remove(sourceProvider); }
// in Eclipse UI/org/eclipse/ui/internal/services/ServiceLocator.java
public final void registerService(final Class api, final Object service) { if (api == null) { throw new NullPointerException("The service key cannot be null"); //$NON-NLS-1$ } if (!api.isInstance(service)) { throw new IllegalArgumentException( "The service does not implement the given interface"); //$NON-NLS-1$ } if (services == null) { services = new HashMap(); } if (services.containsKey(api)) { final Object currentService = services.remove(api); if (currentService instanceof IDisposable) { final IDisposable disposable = (IDisposable) currentService; disposable.dispose(); } } if (service == null) { if (services.isEmpty()) { services = null; } } else { services.put(api, service); if (service instanceof INestable && activated) { ((INestable)service).activate(); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityRegistry.java
public void addActivityRegistryListener( IActivityRegistryListener activityRegistryListener) { if (activityRegistryListener == null) { throw new NullPointerException(); } if (activityRegistryListeners == null) { activityRegistryListeners = new ArrayList(); } if (!activityRegistryListeners.contains(activityRegistryListener)) { activityRegistryListeners.add(activityRegistryListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityRegistry.java
public void removeActivityRegistryListener( IActivityRegistryListener activityRegistryListener) { if (activityRegistryListener == null) { throw new NullPointerException(); } if (activityRegistryListeners != null) { activityRegistryListeners.remove(activityRegistryListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
public void addActivityManagerListener( IActivityManagerListener activityManagerListener) { if (activityManagerListener == null) { throw new NullPointerException(); } if (activityManagerListeners == null) { activityManagerListeners = new ArrayList(); } if (!activityManagerListeners.contains(activityManagerListener)) { activityManagerListeners.add(activityManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
protected void fireActivityManagerChanged( ActivityManagerEvent activityManagerEvent) { if (activityManagerEvent == null) { throw new NullPointerException(); } if (activityManagerListeners != null) { for (int i = 0; i < activityManagerListeners.size(); i++) { ((IActivityManagerListener) activityManagerListeners.get(i)) .activityManagerChanged(activityManagerEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
public void removeActivityManagerListener( IActivityManagerListener activityManagerListener) { if (activityManagerListener == null) { throw new NullPointerException(); } if (activityManagerListeners != null) { activityManagerListeners.remove(activityManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityPatternBindingDefinition.java
static Map activityPatternBindingDefinitionsByActivityId( Collection activityPatternBindingDefinitions) { if (activityPatternBindingDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityPatternBindingDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityPatternBindingDefinition.class); ActivityPatternBindingDefinition activityPatternBindingDefinition = (ActivityPatternBindingDefinition) object; String activityId = activityPatternBindingDefinition .getActivityId(); if (activityId != null) { Collection activityPatternBindingDefinitions2 = (Collection) map .get(activityId); if (activityPatternBindingDefinitions2 == null) { activityPatternBindingDefinitions2 = new ArrayList(); map.put(activityId, activityPatternBindingDefinitions2); } activityPatternBindingDefinitions2 .add(activityPatternBindingDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public void addActivityListener(IActivityListener activityListener) { if (activityListener == null) { throw new NullPointerException(); } if (activityListeners == null) { activityListeners = new ArrayList(); } if (!activityListeners.contains(activityListener)) { activityListeners.add(activityListener); } strongReferences.add(this); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
void fireActivityChanged(ActivityEvent activityEvent) { if (activityEvent == null) { throw new NullPointerException(); } if (activityListeners != null) { for (int i = 0; i < activityListeners.size(); i++) { ((IActivityListener) activityListeners.get(i)) .activityChanged(activityEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public void removeActivityListener(IActivityListener activityListener) { if (activityListener == null) { throw new NullPointerException(); } if (activityListeners != null) { activityListeners.remove(activityListener); } if (activityListeners.isEmpty()) { strongReferences.remove(this); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public void addCategoryListener(ICategoryListener categoryListener) { if (categoryListener == null) { throw new NullPointerException(); } if (categoryListeners == null) { categoryListeners = new ArrayList(); } if (!categoryListeners.contains(categoryListener)) { categoryListeners.add(categoryListener); } strongReferences.add(this); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
void fireCategoryChanged(CategoryEvent categoryEvent) { if (categoryEvent == null) { throw new NullPointerException(); } if (categoryListeners != null) { for (int i = 0; i < categoryListeners.size(); i++) { ((ICategoryListener) categoryListeners.get(i)) .categoryChanged(categoryEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public void removeCategoryListener(ICategoryListener categoryListener) { if (categoryListener == null) { throw new NullPointerException(); } if (categoryListeners != null) { categoryListeners.remove(categoryListener); } if (categoryListeners.isEmpty()) { strongReferences.remove(this); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityDefinition.java
static Map activityDefinitionsById(Collection activityDefinitions, boolean allowNullIds) { if (activityDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityDefinition.class); ActivityDefinition activityDefinition = (ActivityDefinition) object; String id = activityDefinition.getId(); if (allowNullIds || id != null) { map.put(id, activityDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityDefinition.java
static Map activityDefinitionsByName(Collection activityDefinitions, boolean allowNullNames) { if (activityDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityDefinition.class); ActivityDefinition activityDefinition = (ActivityDefinition) object; String name = activityDefinition.getName(); if (allowNullNames || name != null) { Collection activityDefinitions2 = (Collection) map.get(name); if (activityDefinitions2 == null) { activityDefinitions2 = new HashSet(); map.put(name, activityDefinitions2); } activityDefinitions2.add(activityDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityRequirementBindingDefinition.java
static Map activityRequirementBindingDefinitionsByActivityId( Collection activityRequirementBindingDefinitions) { if (activityRequirementBindingDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityRequirementBindingDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityRequirementBindingDefinition.class); ActivityRequirementBindingDefinition activityRequirementBindingDefinition = (ActivityRequirementBindingDefinition) object; String parentActivityId = activityRequirementBindingDefinition .getActivityId(); if (parentActivityId != null) { Collection activityRequirementBindingDefinitions2 = (Collection) map .get(parentActivityId); if (activityRequirementBindingDefinitions2 == null) { activityRequirementBindingDefinitions2 = new HashSet(); map.put(parentActivityId, activityRequirementBindingDefinitions2); } activityRequirementBindingDefinitions2 .add(activityRequirementBindingDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/CategoryDefinition.java
static Map categoryDefinitionsById(Collection categoryDefinitions, boolean allowNullIds) { if (categoryDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = categoryDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, CategoryDefinition.class); CategoryDefinition categoryDefinition = (CategoryDefinition) object; String id = categoryDefinition.getId(); if (allowNullIds || id != null) { map.put(id, categoryDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/CategoryDefinition.java
static Map categoryDefinitionsByName(Collection categoryDefinitions, boolean allowNullNames) { if (categoryDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = categoryDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, CategoryDefinition.class); CategoryDefinition categoryDefinition = (CategoryDefinition) object; String name = categoryDefinition.getName(); if (allowNullNames || name != null) { Collection categoryDefinitions2 = (Collection) map.get(name); if (categoryDefinitions2 == null) { categoryDefinitions2 = new HashSet(); map.put(name, categoryDefinitions2); } categoryDefinitions2.add(categoryDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/CategoryActivityBindingDefinition.java
static Map categoryActivityBindingDefinitionsByCategoryId( Collection categoryActivityBindingDefinitions) { if (categoryActivityBindingDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = categoryActivityBindingDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util .assertInstance(object, CategoryActivityBindingDefinition.class); CategoryActivityBindingDefinition categoryActivityBindingDefinition = (CategoryActivityBindingDefinition) object; String categoryId = categoryActivityBindingDefinition .getCategoryId(); if (categoryId != null) { Collection categoryActivityBindingDefinitions2 = (Collection) map .get(categoryId); if (categoryActivityBindingDefinitions2 == null) { categoryActivityBindingDefinitions2 = new HashSet(); map.put(categoryId, categoryActivityBindingDefinitions2); } categoryActivityBindingDefinitions2 .add(categoryActivityBindingDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
public void addIdentifierListener(IIdentifierListener identifierListener) { if (identifierListener == null) { throw new NullPointerException(); } if (identifierListeners == null) { identifierListeners = new ArrayList(); } if (!identifierListeners.contains(identifierListener)) { identifierListeners.add(identifierListener); } strongReferences.add(this); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
void fireIdentifierChanged(IdentifierEvent identifierEvent) { if (identifierEvent == null) { throw new NullPointerException(); } if (identifierListeners != null) { for (int i = 0; i < identifierListeners.size(); i++) { ((IIdentifierListener) identifierListeners.get(i)) .identifierChanged(identifierEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
public void removeIdentifierListener(IIdentifierListener identifierListener) { if (identifierListener == null) { throw new NullPointerException(); } if (identifierListeners != null) { identifierListeners.remove(identifierListener); if (identifierListeners.isEmpty()) { strongReferences.remove(this); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
synchronized public IActivity getActivity(String activityId) { if (activityId == null) { throw new NullPointerException(); } Activity activity = (Activity) activitiesById.get(activityId); if (activity == null) { activity = new Activity(activityId); updateActivity(activity); activitiesById.put(activityId, activity); } return activity; }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
synchronized public ICategory getCategory(String categoryId) { if (categoryId == null) { throw new NullPointerException(); } Category category = (Category) categoriesById.get(categoryId); if (category == null) { category = new Category(categoryId); updateCategory(category); categoriesById.put(categoryId, category); } return category; }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
synchronized public IIdentifier getIdentifier(String identifierId) { if (identifierId == null) { throw new NullPointerException(); } Identifier identifier = (Identifier) identifiersById.get(identifierId); if (identifier == null) { identifier = new Identifier(identifierId); updateIdentifier(identifier); identifiersById.put(identifierId, identifier); } return identifier; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void assertInstance(Object object, Class c, boolean allowNull) { if (object == null && allowNull) { return; } if (object == null || c == null) { throw new NullPointerException(); } else if (!c.isInstance(object)) { throw new IllegalArgumentException(); } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void diff(Map left, Map right, Set leftOnly, Set different, Set rightOnly) { if (left == null || right == null || leftOnly == null || different == null || rightOnly == null) { throw new NullPointerException(); } Iterator iterator = left.keySet().iterator(); while (iterator.hasNext()) { Object key = iterator.next(); if (!right.containsKey(key)) { leftOnly.add(key); } else if (!Util.equals(left.get(key), right.get(key))) { different.add(key); } } iterator = right.keySet().iterator(); while (iterator.hasNext()) { Object key = iterator.next(); if (!left.containsKey(key)) { rightOnly.add(key); } } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void diff(Set left, Set right, Set leftOnly, Set rightOnly) { if (left == null || right == null || leftOnly == null || rightOnly == null) { throw new NullPointerException(); } Iterator iterator = left.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); if (!right.contains(object)) { leftOnly.add(object); } } iterator = right.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); if (!left.contains(object)) { rightOnly.add(object); } } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static Collection safeCopy(Collection collection, Class c, boolean allowNullElements) { if (collection == null || c == null) { throw new NullPointerException(); } collection = Collections.unmodifiableCollection(new ArrayList( collection)); Iterator iterator = collection.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return collection; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static List safeCopy(List list, Class c, boolean allowNullElements) { if (list == null || c == null) { throw new NullPointerException(); } list = Collections.unmodifiableList(new ArrayList(list)); Iterator iterator = list.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return list; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static Map safeCopy(Map map, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues) { if (map == null || keyClass == null || valueClass == null) { throw new NullPointerException(); } map = Collections.unmodifiableMap(new HashMap(map)); Iterator iterator = map.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); assertInstance(entry.getKey(), keyClass, allowNullKeys); assertInstance(entry.getValue(), valueClass, allowNullValues); } return map; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static Set safeCopy(Set set, Class c, boolean allowNullElements) { if (set == null || c == null) { throw new NullPointerException(); } set = Collections.unmodifiableSet(new HashSet(set)); Iterator iterator = set.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return set; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static SortedMap safeCopy(SortedMap sortedMap, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues) { if (sortedMap == null || keyClass == null || valueClass == null) { throw new NullPointerException(); } sortedMap = Collections.unmodifiableSortedMap(new TreeMap(sortedMap)); Iterator iterator = sortedMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); assertInstance(entry.getKey(), keyClass, allowNullKeys); assertInstance(entry.getValue(), valueClass, allowNullValues); } return sortedMap; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static SortedSet safeCopy(SortedSet sortedSet, Class c, boolean allowNullElements) { if (sortedSet == null || c == null) { throw new NullPointerException(); } sortedSet = Collections.unmodifiableSortedSet(new TreeSet(sortedSet)); Iterator iterator = sortedSet.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return sortedSet; }
// in Eclipse UI/org/eclipse/ui/keys/KeyFormatterFactory.java
public static void setDefault(IKeyFormatter defaultKeyFormatter) { if (defaultKeyFormatter == null) { throw new NullPointerException(); } KeyFormatterFactory.defaultKeyFormatter = defaultKeyFormatter; }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(ModifierKey modifierKey, NaturalKey naturalKey) { if (modifierKey == null) { throw new NullPointerException(); } return new KeyStroke( new TreeSet(Collections.singletonList(modifierKey)), naturalKey); }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } SortedSet modifierKeys = new TreeSet(); NaturalKey naturalKey = null; StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_DELIMITERS, true); int i = 0; while (stringTokenizer.hasMoreTokens()) { String token = stringTokenizer.nextToken(); if (i % 2 == 0) { if (stringTokenizer.hasMoreTokens()) { token = token.toUpperCase(); ModifierKey modifierKey = (ModifierKey) ModifierKey.modifierKeysByName .get(token); if (modifierKey == null || !modifierKeys.add(modifierKey)) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token); } } else if (token.length() == 1) { naturalKey = CharacterKey.getInstance(token.charAt(0)); break; } else { token = token.toUpperCase(); naturalKey = (NaturalKey) CharacterKey.characterKeysByName .get(token); if (naturalKey == null) { naturalKey = (NaturalKey) SpecialKey.specialKeysByName .get(token); } if (naturalKey == null) { throw new ParseException( "Cannot create key stroke with invalid natural key: " //$NON-NLS-1$ + token); } } } i++; } try { return new KeyStroke(modifierKeys, naturalKey); } catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(KeySequence keySequence, KeyStroke keyStroke) { if (keySequence == null || keyStroke == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(keySequence.getKeyStrokes()); keyStrokes.add(keyStroke); return new KeySequence(keyStrokes); }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(); StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_STROKE_DELIMITERS); while (stringTokenizer.hasMoreTokens()) { keyStrokes.add(KeyStroke.getInstance(stringTokenizer.nextToken())); } try { return new KeySequence(keyStrokes); } catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public boolean endsWith(KeySequence keySequence, boolean equals) { if (keySequence == null) { throw new NullPointerException(); } return Util.endsWith(keyStrokes, keySequence.keyStrokes, equals); }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public boolean startsWith(KeySequence keySequence, boolean equals) { if (keySequence == null) { throw new NullPointerException(); } return Util.startsWith(keyStrokes, keySequence.keyStrokes, equals); }
// in Eclipse UI/org/eclipse/ui/SubActionBars.java
protected final void setServiceLocator(final IServiceLocator locator) { if (locator == null) { throw new NullPointerException("The service locator cannot be null"); //$NON-NLS-1$ } this.serviceLocator = locator; }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public void addHandlerListener( org.eclipse.ui.commands.IHandlerListener handlerListener) { if (handlerListener == null) { throw new NullPointerException(); } if (handlerListeners == null) { handlerListeners = new ArrayList(); } if (!handlerListeners.contains(handlerListener)) { handlerListeners.add(handlerListener); } }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
protected void fireHandlerChanged( final org.eclipse.ui.commands.HandlerEvent handlerEvent) { if (handlerEvent == null) { throw new NullPointerException(); } if (handlerListeners != null) { for (int i = 0; i < handlerListeners.size(); i++) { ((org.eclipse.ui.commands.IHandlerListener) handlerListeners .get(i)).handlerChanged(handlerEvent); } } if (super.hasListeners()) { final boolean enabledChanged; final boolean handledChanged; if (handlerEvent.haveAttributeValuesByNameChanged()) { Map previousAttributes = handlerEvent .getPreviousAttributeValuesByName(); Object attribute = previousAttributes.get("enabled"); //$NON-NLS-1$ if (attribute instanceof Boolean) { enabledChanged = ((Boolean) attribute).booleanValue(); } else { enabledChanged = false; } attribute = previousAttributes .get(IHandlerAttributes.ATTRIBUTE_HANDLED); if (attribute instanceof Boolean) { handledChanged = ((Boolean) attribute).booleanValue(); } else { handledChanged = false; } } else { enabledChanged = false; handledChanged = true; } final HandlerEvent newEvent = new HandlerEvent(this, enabledChanged, handledChanged); super.fireHandlerChanged(newEvent); } }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public void removeHandlerListener( org.eclipse.ui.commands.IHandlerListener handlerListener) { if (handlerListener == null) { throw new NullPointerException(); } if (handlerListeners == null) { return; } if (handlerListeners != null) { handlerListeners.remove(handlerListener); } if (handlerListeners.isEmpty()) { handlerListeners = null; } }
// in Eclipse UI/org/eclipse/ui/AbstractSourceProvider.java
public final void addSourceProviderListener( final ISourceProviderListener listener) { if (listener == null) { throw new NullPointerException("The listener cannot be null"); //$NON-NLS-1$ } if (listenerCount == listeners.length) { final ISourceProviderListener[] growArray = new ISourceProviderListener[listeners.length + 4]; System.arraycopy(listeners, 0, growArray, 0, listeners.length); listeners = growArray; } listeners[listenerCount++] = listener; }
// in Eclipse UI/org/eclipse/ui/AbstractSourceProvider.java
public final void removeSourceProviderListener( final ISourceProviderListener listener) { if (listener == null) { throw new NullPointerException("The listener cannot be null"); //$NON-NLS-1$ } int emptyIndex = -1; for (int i = 0; i < listenerCount; i++) { if (listeners[i] == listener) { listeners[i] = null; emptyIndex = i; } } if (emptyIndex != -1) { // Compact the array. for (int i = emptyIndex + 1; i < listenerCount; i++) { listeners[i - 1] = listeners[i]; } listenerCount--; } }
0 0
(Lib) IllegalArgumentException 150
              
// in Eclipse UI/org/eclipse/ui/preferences/WorkingCopyManager.java
public IEclipsePreferences getWorkingCopy(IEclipsePreferences original) { if (original instanceof WorkingCopyPreferences) { throw new IllegalArgumentException("Trying to get a working copy of a working copy"); //$NON-NLS-1$ } String absolutePath = original.absolutePath(); IEclipsePreferences preferences = (IEclipsePreferences) workingCopies.get(absolutePath); if (preferences == null) { preferences = new WorkingCopyPreferences(original, this); workingCopies.put(absolutePath, preferences); } return preferences; }
// in Eclipse UI/org/eclipse/ui/internal/preferences/Base64.java
static int decodeDigit(byte data) { char charData = (char) data; if (charData <= 'Z' && charData >= 'A') { return charData - 'A'; } if (charData <= 'z' && charData >= 'a') { return charData - 'a' + 26; } if (charData <= '9' && charData >= '0') { return charData - '0' + 52; } switch (charData) { case '+' : return 62; case '/' : return 63; default : throw new IllegalArgumentException("Invalid char to decode: " + data); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(final IEditorInput input, final String editorID, final boolean activate, final int matchFlags, final IMemento editorState) throws PartInitException { if (input == null || editorID == null) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditor(input, editorID, activate, matchFlags, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditorFromDescriptor(final IEditorInput input, final IEditorDescriptor editorDescriptor, final boolean activate, final IMemento editorState) throws PartInitException { if (input == null || !(editorDescriptor instanceof EditorDescriptor)) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditorFromDescriptor(input, (EditorDescriptor)editorDescriptor, activate, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(final String viewID, final String secondaryID, final int mode) throws PartInitException { if (secondaryID != null) { if (secondaryID.length() == 0 || secondaryID.indexOf(ViewFactory.ID_SEP) != -1) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalSecondaryId); } } if (!certifyMode(mode)) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalViewMode); } // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyShowView(viewID, secondaryID, mode); } catch (PartInitException e) { result[0] = e; } } }); if (result[0] instanceof IViewPart) { return (IViewPart) result[0]; } else if (result[0] instanceof PartInitException) { throw (PartInitException) result[0]; } else { throw new PartInitException(WorkbenchMessages.WorkbenchPage_AbnormalWorkbenchCondition); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void setWorkingSets(IWorkingSet[] newWorkingSets) { if (newWorkingSets != null) { WorkbenchPlugin .getDefault() .getWorkingSetManager() .addPropertyChangeListener(workingSetPropertyChangeListener); } else { WorkbenchPlugin.getDefault().getWorkingSetManager() .removePropertyChangeListener( workingSetPropertyChangeListener); } if (newWorkingSets == null) { newWorkingSets = new IWorkingSet[0]; } IWorkingSet[] oldWorkingSets = workingSets; // filter out any duplicates if necessary if (newWorkingSets.length > 1) { Set setOfSets = new HashSet(); for (int i = 0; i < newWorkingSets.length; i++) { if (newWorkingSets[i] == null) { throw new IllegalArgumentException(); } setOfSets.add(newWorkingSets[i]); } newWorkingSets = (IWorkingSet[]) setOfSets .toArray(new IWorkingSet[setOfSets.size()]); } workingSets = newWorkingSets; if (!Arrays.equals(oldWorkingSets, newWorkingSets)) { firePropertyChange(CHANGE_WORKING_SETS_REPLACE, oldWorkingSets, newWorkingSets); if (aggregateWorkingSet != null) { aggregateWorkingSet.setComponents(workingSets); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorReference[] openEditors(final IEditorInput[] inputs, final String[] editorIDs, final int matchFlags) throws MultiPartInitException { if (inputs == null) throw new IllegalArgumentException(); if (editorIDs == null) throw new IllegalArgumentException(); if (inputs.length != editorIDs.length) throw new IllegalArgumentException(); final IEditorReference[] results = new IEditorReference[inputs.length]; final PartInitException[] exceptions = new PartInitException[inputs.length]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } } }); boolean hasException = false; for(int i = 0 ; i < results.length; i++) { if (exceptions[i] != null) { hasException = true; } if (results[i] == null) { continue; } window.firePerspectiveChanged(this, getPerspective(), results[i], CHANGE_EDITOR_OPEN); } window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); if (hasException) { throw new MultiPartInitException(results, exceptions); } return results; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } }
// in Eclipse UI/org/eclipse/ui/internal/menus/ContributionRoot.java
public void addContributionItem(IContributionItem item, Expression visibleWhen) { if (item == null) throw new IllegalArgumentException(); topLevelItems.add(item); if (visibleWhen == null) visibleWhen = AlwaysEnabledExpression.INSTANCE; menuService.registerVisibleWhen(item, visibleWhen, restriction, createIdentifierId(item)); itemsToExpressions.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/menus/ContributionRoot.java
public void registerVisibilityForChild(IContributionItem item, Expression visibleWhen) { if (item == null) throw new IllegalArgumentException(); if (visibleWhen == null) visibleWhen = AlwaysEnabledExpression.INSTANCE; menuService.registerVisibleWhen(item, visibleWhen, restriction, createIdentifierId(item)); itemsToExpressions.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
public void registerVisibleWhen(final IContributionItem item, final Expression visibleWhen, final Set restriction, String identifierID) { if (item == null) { throw new IllegalArgumentException("item cannot be null"); //$NON-NLS-1$ } if (visibleWhen == null) { throw new IllegalArgumentException( "visibleWhen expression cannot be null"); //$NON-NLS-1$ } if (evaluationsByItem.get(item) != null) { final String id = item.getId(); WorkbenchPlugin.log("item is already registered: " //$NON-NLS-1$ + (id == null ? "no id" : id)); //$NON-NLS-1$ return; } IIdentifier identifier = null; if (identifierID != null) { identifier = PlatformUI.getWorkbench().getActivitySupport() .getActivityManager().getIdentifier(identifierID); } ContributionItemUpdater listener = new ContributionItemUpdater(item, identifier); if (visibleWhen != AlwaysEnabledExpression.INSTANCE) { IEvaluationReference ref = evaluationService.addEvaluationListener( visibleWhen, listener, PROP_VISIBLE); if (restriction != null) { restriction.add(ref); } evaluationsByItem.put(item, ref); } activityListenersByItem.put(item, listener); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
public final void bind(final String commandId, final int type, final String style, final ImageDescriptor descriptor) { Object[] images = (Object[]) imagesById.get(commandId); if (images == null) { images = new Object[3]; imagesById.put(commandId, images); } if ((type < 0) || (type >= images.length)) { throw new IllegalArgumentException( "The type must be one of TYPE_DEFAULT, TYPE_DISABLED and TYPE_HOVER."); //$NON-NLS-1$ } final Object typedImage = images[type]; if (style == null) { if ((typedImage == null) || (typedImage instanceof ImageDescriptor)) { images[type] = descriptor; } else if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; styleMap.put(style, descriptor); } } else { if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; styleMap.put(style, descriptor); } else if (typedImage instanceof ImageDescriptor || typedImage == null) { final Map styleMap = new HashMap(); styleMap.put(null, typedImage); styleMap.put(style, descriptor); images[type] = styleMap; } } fireManagerChanged(new CommandImageManagerEvent(this, new String[] { commandId }, type, style)); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
public final ImageDescriptor getImageDescriptor(final String commandId, final int type, final String style) { if (commandId == null) { throw new NullPointerException(); } final Object[] images = (Object[]) imagesById.get(commandId); if (images == null) { return null; } if ((type < 0) || (type >= images.length)) { throw new IllegalArgumentException( "The type must be one of TYPE_DEFAULT, TYPE_DISABLED and TYPE_HOVER."); //$NON-NLS-1$ } Object typedImage = images[type]; if (typedImage == null) { return null; } if (typedImage instanceof ImageDescriptor) { return (ImageDescriptor) typedImage; } if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; Object styledImage = styleMap.get(style); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } if (style != null) { styledImage = styleMap.get(null); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java
public final boolean registerShell(final Shell shell, final int type) { // We do not allow null shell registration. It is reserved. if (shell == null) { throw new NullPointerException("The shell was null"); //$NON-NLS-1$ } // Debugging output if (DEBUG) { final StringBuffer buffer = new StringBuffer("register shell '"); //$NON-NLS-1$ buffer.append(shell); buffer.append("' as "); //$NON-NLS-1$ switch (type) { case IContextService.TYPE_DIALOG: buffer.append("dialog"); //$NON-NLS-1$ break; case IContextService.TYPE_WINDOW: buffer.append("window"); //$NON-NLS-1$ break; case IContextService.TYPE_NONE: buffer.append("none"); //$NON-NLS-1$ break; default: buffer.append("unknown"); //$NON-NLS-1$ break; } Tracing.printTrace(TRACING_COMPONENT, buffer.toString()); } // Build the list of submissions. final List activations = new ArrayList(); Expression expression; IContextActivation dialogWindowActivation; switch (type) { case IContextService.TYPE_DIALOG: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation dialogActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG, expression, contextService); activateContext(dialogActivation); activations.add(dialogActivation); break; case IContextService.TYPE_NONE: break; case IContextService.TYPE_WINDOW: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation windowActivation = new ContextActivation( IContextService.CONTEXT_ID_WINDOW, expression, contextService); activateContext(windowActivation); activations.add(windowActivation); break; default: throw new IllegalArgumentException("The type is not recognized: " //$NON-NLS-1$ + type); } // Check to see if the activations are already present. boolean returnValue = false; final Collection previousActivations = (Collection) registeredWindows .get(shell); if (previousActivations != null) { returnValue = true; final Iterator previousActivationItr = previousActivations .iterator(); while (previousActivationItr.hasNext()) { final IContextActivation activation = (IContextActivation) previousActivationItr .next(); deactivateContext(activation); } } // Add the new submissions, and force some reprocessing to occur. registeredWindows.put(shell, activations); /* * Remember the dispose listener so that we can remove it later if we * unregister the shell. */ final DisposeListener shellDisposeListener = new DisposeListener() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) */ public void widgetDisposed(DisposeEvent e) { registeredWindows.remove(shell); if (!shell.isDisposed()) { shell.removeDisposeListener(this); } /* * In the case where a dispose has happened, we are expecting an * activation event to arrive at some point in the future. If we * process the submissions now, then we will update the * activeShell before checkWindowType is called. This means that * dialogs won't be recognized as dialogs. */ final Iterator activationItr = activations.iterator(); while (activationItr.hasNext()) { deactivateContext((IContextActivation) activationItr.next()); } } }; // Make sure the submissions will be removed in event of disposal. shell.addDisposeListener(shellDisposeListener); shell.setData(DISPOSE_LISTENER, shellDisposeListener); return returnValue; }
// in Eclipse UI/org/eclipse/ui/internal/services/ServiceLocator.java
public final void registerService(final Class api, final Object service) { if (api == null) { throw new NullPointerException("The service key cannot be null"); //$NON-NLS-1$ } if (!api.isInstance(service)) { throw new IllegalArgumentException( "The service does not implement the given interface"); //$NON-NLS-1$ } if (services == null) { services = new HashMap(); } if (services.containsKey(api)) { final Object currentService = services.remove(api); if (currentService instanceof IDisposable) { final IDisposable disposable = (IDisposable) currentService; disposable.dispose(); } } if (service == null) { if (services.isEmpty()) { services = null; } } else { services.put(api, service); if (service instanceof INestable && activated) { ((INestable)service).activate(); } } }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
public void displayContext(IContext context, int x, int y) { if (context == null) { throw new IllegalArgumentException(); } AbstractHelpUI helpUI = getHelpUI(); if (helpUI != null) { helpUI.displayContext(context, x, y); } }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
public void displayHelpResource(String href) { if (href == null) { throw new IllegalArgumentException(); } AbstractHelpUI helpUI = getHelpUI(); if (helpUI != null) { helpUI.displayHelpResource(href); } }
// in Eclipse UI/org/eclipse/ui/internal/misc/StringMatcher.java
public StringMatcher.Position find(String text, int start, int end) { if (text == null) { throw new IllegalArgumentException(); } int tlen = text.length(); if (start < 0) { start = 0; } if (end > tlen) { end = tlen; } if (end < 0 || start >= end) { return null; } if (fLength == 0) { return new Position(start, start); } if (fIgnoreWildCards) { int x = posIn(text, start, end); if (x < 0) { return null; } return new Position(x, x + fLength); } int segCount = fSegments.length; if (segCount == 0) { return new Position(start, end); } int curPos = start; int matchStart = -1; int i; for (i = 0; i < segCount && curPos < end; ++i) { String current = fSegments[i]; int nextMatch = regExpPosIn(text, curPos, end, current); if (nextMatch < 0) { return null; } if (i == 0) { matchStart = nextMatch; } curPos = nextMatch + current.length(); } if (i < segCount) { return null; } return new Position(matchStart, curPos); }
// in Eclipse UI/org/eclipse/ui/internal/misc/StringMatcher.java
public boolean match(String text, int start, int end) { if (null == text) { throw new IllegalArgumentException(); } if (start > end) { return false; } if (fIgnoreWildCards) { return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength); } int segCount = fSegments.length; if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) { return true; } if (start == end) { return fLength == 0; } if (fLength == 0) { return start == end; } int tlen = text.length(); if (start < 0) { start = 0; } if (end > tlen) { end = tlen; } int tCurPos = start; int bound = end - fBound; if (bound < 0) { return false; } int i = 0; String current = fSegments[i]; int segLength = current.length(); /* process first segment */ if (!fHasLeadingStar) { if (!regExpRegionMatches(text, start, current, 0, segLength)) { return false; } else { ++i; tCurPos = tCurPos + segLength; } } if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) { // only one segment to match, no wildcards specified return tCurPos == end; } /* process middle segments */ while (i < segCount) { current = fSegments[i]; int currentMatch; int k = current.indexOf(fSingleWildCard); if (k < 0) { currentMatch = textPosIn(text, tCurPos, end, current); if (currentMatch < 0) { return false; } } else { currentMatch = regExpPosIn(text, tCurPos, end, current); if (currentMatch < 0) { return false; } } tCurPos = currentMatch + current.length(); i++; } /* process final segment */ if (!fHasTrailingStar && tCurPos != end) { int clen = current.length(); return regExpRegionMatches(text, end - clen, current, 0, clen); } return i == segCount; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityLabelProvider.java
public String getText(Object element) { if (element instanceof String) { return getActivityText(activityManager .getActivity((String) element)); } else if (element instanceof IActivity) { return getActivityText((IActivity) element); } else { throw new IllegalArgumentException(); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditor(String editorId, IEditorInput input, boolean setVisible, IMemento editorState) throws PartInitException { if (editorId == null || input == null) { throw new IllegalArgumentException(); } IEditorDescriptor desc = getEditorRegistry().findEditor(editorId); if (desc != null && !desc.isOpenExternal() && isLargeDocument(input)) { desc = getAlternateEditor(); if (desc == null) { // the user pressed cancel in the editor selection dialog return null; } } if (desc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorId)); } IEditorReference result = openEditorFromDescriptor((EditorDescriptor) desc, input, editorState); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openSystemExternalEditor(final IPath location) throws PartInitException { if (location == null) { throw new IllegalArgumentException(); } final boolean result[] = { false }; BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { if (location != null) { result[0] = Program.launch(location.toOSString()); } } }); if (!result[0]) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unableToOpenExternalEditor, location)); } // We do not have an editor part for external editors return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public void declareImage(String symbolicName, ImageDescriptor descriptor, boolean shared) { if (symbolicName == null || descriptor == null) { throw new IllegalArgumentException(); } WorkbenchImages.declareImage(symbolicName, descriptor, shared); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public IWorkbenchWindowConfigurer getWindowConfigurer( IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return ((WorkbenchWindow) window).getWindowConfigurer(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public Object getData(String key) { if (key == null) { throw new IllegalArgumentException(); } return extraData.get(key); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public void setData(String key, Object data) { if (key == null) { throw new IllegalArgumentException(); } if (data != null) { extraData.put(key, data); } else { extraData.remove(key); } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void assertInstance(Object object, Class c, boolean allowNull) { if (object == null && allowNull) { return; } if (object == null || c == null) { throw new NullPointerException(); } else if (!c.isInstance(object)) { throw new IllegalArgumentException(); } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void arrayCopyWithRemoval(Object [] src, Object [] dst, int idxToRemove) { if (src == null || dst == null || src.length - 1 != dst.length || idxToRemove < 0 || idxToRemove >= src.length) { throw new IllegalArgumentException(); } if (idxToRemove == 0) { System.arraycopy(src, 1, dst, 0, src.length - 1); } else if (idxToRemove == src.length - 1) { System.arraycopy(src, 0, dst, 0, src.length - 1); } else { System.arraycopy(src, 0, dst, 0, idxToRemove); System.arraycopy(src, idxToRemove + 1, dst, idxToRemove, src.length - idxToRemove - 1); } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IPerspectiveDescriptor clonePerspective(String id, String label, IPerspectiveDescriptor originalDescriptor) { // Check for invalid labels if (label == null || !(label.trim().length() > 0)) { throw new IllegalArgumentException(); } // Check for duplicates IPerspectiveDescriptor desc = findPerspectiveWithId(id); if (desc != null) { throw new IllegalArgumentException(); } // Create descriptor. desc = new PerspectiveDescriptor(id, label, (PerspectiveDescriptor) originalDescriptor); add((PerspectiveDescriptor) desc); return desc; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
public static EditorDescriptor createForProgram(String filename) { if (filename == null) { throw new IllegalArgumentException(); } EditorDescriptor editor = new EditorDescriptor(); editor.setFileName(filename); editor.setID(filename); editor.setOpenMode(OPEN_EXTERNAL); //Isolate the program name (no directory or extension) int start = filename.lastIndexOf(File.separator); String name; if (start != -1) { name = filename.substring(start + 1); } else { name = filename; } int end = name.lastIndexOf('.'); if (end != -1) { name = name.substring(0, end); } editor.setName(name); // get the program icon without storing it in the registry ImageDescriptor imageDescriptor = new ProgramImageDescriptor(filename, 0); editor.setImageDescriptor(imageDescriptor); return editor; }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void set(Object value) { if (value != Boolean.TRUE && value != Boolean.FALSE) throw new IllegalArgumentException(); super.set(value); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void set(Object value) { if (value != Boolean.TRUE && value != Boolean.FALSE) throw new IllegalArgumentException(); if (value == Boolean.TRUE && ((Boolean)startupThread.get()).booleanValue()) { throw new IllegalStateException(); } super.set(value); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void setRecentWorkingSetsLength(int length) { if (length < 1 || length > 99) throw new IllegalArgumentException("Invalid recent working sets length: " + length); //$NON-NLS-1$ IPreferenceStore store = PrefUtil.getAPIPreferenceStore(); store.setValue(IWorkbenchPreferenceConstants.RECENTLY_USED_WORKINGSETS_SIZE, length); // adjust length sizeRecentWorkingSets(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public void setTitle(String title) { if (title == null) { throw new IllegalArgumentException(); } windowTitle = title; Shell shell = window.getShell(); if (shell != null && !shell.isDisposed()) { shell.setText(TextProcessor.process(title, WorkbenchWindow.TEXT_DELIMITERS)); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public Object getData(String key) { if (key == null) { throw new IllegalArgumentException(); } return extraData.get(key); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public void setData(String key, Object data) { if (key == null) { throw new IllegalArgumentException(); } if (data != null) { extraData.put(key, data); } else { extraData.remove(key); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public void setPresentationFactory(AbstractPresentationFactory factory) { if (factory == null) { throw new IllegalArgumentException(); } presentationFactory = factory; }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public static ImageDescriptor imageDescriptorFromPlugin(String pluginId, String imageFilePath) { if (pluginId == null || imageFilePath == null) { throw new IllegalArgumentException(); } IWorkbench workbench = PlatformUI.isWorkbenchRunning() ? PlatformUI.getWorkbench() : null; ImageDescriptor imageDescriptor = workbench == null ? null : workbench .getSharedImages().getImageDescriptor(imageFilePath); if (imageDescriptor != null) return imageDescriptor; // found in the shared images // if the bundle is not ready then there is no image Bundle bundle = Platform.getBundle(pluginId); if (!BundleUtility.isReady(bundle)) { return null; } // look for the image (this will check both the plugin and fragment folders URL fullPathString = BundleUtility.find(bundle, imageFilePath); if (fullPathString == null) { try { fullPathString = new URL(imageFilePath); } catch (MalformedURLException e) { return null; } } return ImageDescriptor.createFromURL(fullPathString); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(final IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } CommandContributionItemParameter parameter = new CommandContributionItemParameter( window, COMMAND_ID, COMMAND_ID, null, WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR), WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR_DISABLED), null, null, null, null, CommandContributionItem.STYLE_CHECK, null, false); final IPropertyChangeListener[] perfs = new IPropertyChangeListener[1]; final IPartListener partListener = new IPartListener() { public void partOpened(IWorkbenchPart part) { } public void partDeactivated(IWorkbenchPart part) { } public void partClosed(IWorkbenchPart part) { } public void partBroughtToTop(IWorkbenchPart part) { if (!(part instanceof IEditorPart)) { return; } ICommandService commandService = (ICommandService) window .getService(ICommandService.class); commandService.refreshElements(COMMAND_ID, null); } public void partActivated(IWorkbenchPart part) { } }; window.getPartService().addPartListener(partListener); final CommandContributionItem action = new CommandContributionItem( parameter) { public void dispose() { WorkbenchPlugin.getDefault().getPreferenceStore() .removePropertyChangeListener(perfs[0]); window.getPartService().removePartListener(partListener); super.dispose(); } }; perfs[0] = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals( IPreferenceConstants.REUSE_EDITORS_BOOLEAN)) { if (action.getParent() != null) { IPreferenceStore store = WorkbenchPlugin .getDefault().getPreferenceStore(); boolean reuseEditors = store .getBoolean(IPreferenceConstants.REUSE_EDITORS_BOOLEAN) || ((TabBehaviour) Tweaklets .get(TabBehaviour.KEY)) .alwaysShowPinAction(); action.setVisible(reuseEditors); action.getParent().markDirty(); if (window.getShell() != null && !window.getShell().isDisposed()) { // this property change notification could be // from a non-ui thread window.getShell().getDisplay().syncExec( new Runnable() { public void run() { action.getParent() .update(false); } }); } } } } }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new SwitchToWindowMenu(window, getId(), true); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new ShowViewMenu(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } ShowInMenu showInMenu = new ShowInMenu(); showInMenu.setId(getId()); showInMenu.initialize(window); return showInMenu; }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new ReopenEditorMenu(window, getId(), true); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new ChangeToPerspectiveMenu(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new BaseNewWizardMenu(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new HelpSearchContributionItem(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); IProduct product = Platform.getProduct(); String productName = null; if (product != null) { productName = product.getName(); } if (productName == null) { productName = ""; //$NON-NLS-1$ } action.setText(NLS.bind(WorkbenchMessages.AboutAction_text, productName)); action.setToolTipText(NLS.bind( WorkbenchMessages.AboutAction_toolTip, productName)); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.ABOUT_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ActivateEditorAction_text); action .setToolTipText(WorkbenchMessages.ActivateEditorAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(), WorkbenchMessages.Workbench_back); action.setToolTipText(WorkbenchMessages.Workbench_backToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new NavigationHistoryAction(window, false); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseEditorAction_text); action.setToolTipText(WorkbenchMessages.CloseEditorAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseAllAction_text); action.setToolTipText(WorkbenchMessages.CloseAllAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseOthersAction_text); action.setToolTipText(WorkbenchMessages.CloseOthersAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseAllPerspectivesAction_text); action.setToolTipText(WorkbenchMessages.CloseAllPerspectivesAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CLOSE_ALL_PAGES_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new CloseAllSavedAction(window); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages. ClosePerspectiveAction_text); action.setToolTipText(WorkbenchMessages. ClosePerspectiveAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CLOSE_PAGE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(IntroMessages.Intro_action_text); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.INTRO_ACTION); IntroDescriptor introDescriptor = ((Workbench) window.getWorkbench()) .getIntroDescriptor(); if (introDescriptor != null) action.setImageDescriptor(introDescriptor.getImageDescriptor()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_copy); action.setToolTipText(WorkbenchMessages.Workbench_copyToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_cut); action.setToolTipText(WorkbenchMessages.Workbench_cutToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_CUT)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_delete); action.setToolTipText(WorkbenchMessages.Workbench_deleteToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); action.enableAccelerator(false); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.DELETE_RETARGET_ACTION); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); action .setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.EditActionSetsAction_text); action.setToolTipText(WorkbenchMessages.EditActionSetsAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.EDIT_ACTION_SETS_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ExportResourcesAction_fileMenuText); action.setToolTipText(WorkbenchMessages.ExportResourcesAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.EXPORT_ACTION); action.setImageDescriptor(WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_EXPORT_WIZ)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_findReplace); action.setToolTipText(WorkbenchMessages.Workbench_findReplaceToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); // Find's images are commented out due to a conflict with Search. // See bug 16412. // action.setImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC)); // action.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_forward); action.setToolTipText(WorkbenchMessages.Workbench_forwardToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new NavigationHistoryAction(window, true); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_goInto); action.setToolTipText(WorkbenchMessages.Workbench_goIntoToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ImportResourcesAction_text); action.setToolTipText(WorkbenchMessages.ImportResourcesAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.IMPORT_ACTION); action.setImageDescriptor(WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_IMPORT_WIZ)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.LockToolBarAction_text); action.setToolTipText(WorkbenchMessages.LockToolBarAction_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.LOCK_TOOLBAR_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setToolTipText(WorkbenchMessages.MaximizePartAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.MAXIMIZE_PART_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setToolTipText(WorkbenchMessages.MinimizePartAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.MINIMIZE_PART_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_move); action.setToolTipText(WorkbenchMessages.Workbench_moveToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); ISharedImages images = window.getWorkbench().getSharedImages(); action.setImageDescriptor(images .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); action.setDisabledImageDescriptor(images .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED)); action.setText(WorkbenchMessages.NewWizardAction_text); action.setToolTipText(WorkbenchMessages.NewWizardAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.NEW_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new NewWizardDropDownAction(window); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_next); action.setToolTipText(WorkbenchMessages.Workbench_nextToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CycleEditorAction_next_text); action.setToolTipText(WorkbenchMessages.CycleEditorAction_next_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_EDITOR_FORWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePartAction_next_text); action.setToolTipText(WorkbenchMessages.CyclePartAction_next_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PART_FORWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePerspectiveAction_next_text); action.setToolTipText(WorkbenchMessages.CyclePerspectiveAction_next_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PERSPECTIVE_FORWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.OpenInNewWindowAction_text); action.setToolTipText(WorkbenchMessages.OpenInNewWindowAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.OPEN_NEW_WINDOW_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_paste); action.setToolTipText(WorkbenchMessages.Workbench_pasteToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.OpenPreferences_text); action.setToolTipText(WorkbenchMessages.OpenPreferences_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.OPEN_PREFERENCES_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_previous); action.setToolTipText(WorkbenchMessages.Workbench_previousToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CycleEditorAction_prev_text); action.setToolTipText(WorkbenchMessages.CycleEditorAction_prev_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_EDITOR_BACKWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePartAction_prev_text); action.setToolTipText(WorkbenchMessages.CyclePartAction_prev_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PART_BACKWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePerspectiveAction_prev_text); action.setToolTipText(WorkbenchMessages.CyclePerspectiveAction_prev_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PERSPECTIVE_BACKWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_print); action.setToolTipText(WorkbenchMessages.Workbench_printToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); action .setImageDescriptor(WorkbenchImages .getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT)); action .setDisabledImageDescriptor(WorkbenchImages .getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_properties); action.setToolTipText(WorkbenchMessages.Workbench_propertiesToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.Exit_text); action.setToolTipText(WorkbenchMessages.Exit_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.QUIT_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } LabelRetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_redo); action.setToolTipText(WorkbenchMessages.Workbench_redoToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_REDO)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_refresh); action.setToolTipText(WorkbenchMessages.Workbench_refreshToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_rename); action.setToolTipText(WorkbenchMessages.Workbench_renameToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ResetPerspective_text); action.setToolTipText(WorkbenchMessages.ResetPerspective_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.RESET_PERSPECTIVE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_revert); action.setToolTipText(WorkbenchMessages.Workbench_revertToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setText(WorkbenchMessages.SaveAction_text); action.setToolTipText(WorkbenchMessages.SaveAction_toolTip); action.setId(getId()); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction(getCommandId(), window); action.setText(WorkbenchMessages.SaveAll_text); action.setToolTipText(WorkbenchMessages.SaveAll_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_ALL_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction(getCommandId(), window); action.setText(WorkbenchMessages.SaveAs_text); action.setToolTipText(WorkbenchMessages.SaveAs_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_AS_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.SavePerspective_text); action.setToolTipText(WorkbenchMessages.SavePerspective_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_PERSPECTIVE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_selectAll); action.setToolTipText(WorkbenchMessages.Workbench_selectAllToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new ToggleEditorsVisibilityAction(window); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.switchToEditor", window); //$NON-NLS-1$ action.setId(getId()); action.setText(WorkbenchMessages.WorkbenchEditorsAction_label); // @issue missing action id window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.WORKBENCH_EDITORS_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.openEditorDropDown", window); //$NON-NLS-1$ action.setId(getId()); action.setText(WorkbenchMessages.WorkbookEditorsAction_label); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action=new WorkbenchCommandAction("org.eclipse.ui.window.showSystemMenu",window); //$NON-NLS-1$ action.setId(getId()); action.setText(WorkbenchMessages.ShowPartPaneMenuAction_text); action.setToolTipText(WorkbenchMessages.ShowPartPaneMenuAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ShowViewMenuAction_text); action.setToolTipText(WorkbenchMessages.ShowViewMenuAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } LabelRetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_undo); action.setToolTipText(WorkbenchMessages.Workbench_undoToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_up); action.setToolTipText(WorkbenchMessages.Workbench_upToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); // support for allowing a product to override the text for the // action String overrideText = PrefUtil.getAPIPreferenceStore().getString( IWorkbenchPreferenceConstants.HELP_CONTENTS_ACTION_TEXT); if ("".equals(overrideText)) { //$NON-NLS-1$ action.setText(WorkbenchMessages.HelpContentsAction_text); action.setToolTipText(WorkbenchMessages.HelpContentsAction_toolTip); } else { action.setText(overrideText); action.setToolTipText(Action.removeMnemonics(overrideText)); } window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.HELP_CONTENTS_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); // support for allowing a product to override the text for the // action String overrideText = PrefUtil.getAPIPreferenceStore().getString( IWorkbenchPreferenceConstants.HELP_SEARCH_ACTION_TEXT); if ("".equals(overrideText)) { //$NON-NLS-1$ action.setText(WorkbenchMessages.HelpSearchAction_text); action.setToolTipText(WorkbenchMessages.HelpSearchAction_toolTip); } else { action.setText(overrideText); action.setToolTipText(Action.removeMnemonics(overrideText)); } window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.HELP_SEARCH_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); // support for allowing a product to override the text for the // action String overrideText = PrefUtil.getAPIPreferenceStore().getString( IWorkbenchPreferenceConstants.DYNAMIC_HELP_ACTION_TEXT); if ("".equals(overrideText)) { //$NON-NLS-1$ action.setText(WorkbenchMessages.DynamicHelpAction_text); action.setToolTipText(WorkbenchMessages.DynamicHelpAction_toolTip); } else { action.setText(overrideText); action.setToolTipText(Action.removeMnemonics(overrideText)); } window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.DYNAMIC_HELP_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.OpenPerspectiveDialogAction_text); action.setToolTipText(WorkbenchMessages.OpenPerspectiveDialogAction_tooltip); action.setImageDescriptor(WorkbenchImages.getImageDescriptor( IWorkbenchGraphicConstants.IMG_ETOOL_NEW_PAGE)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.NewEditorAction_text); action.setToolTipText(WorkbenchMessages.NewEditorAction_tooltip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( "org.eclipse.ui.ToggleCoolbarAction", window); //$NON-NLS-1$ action.setId(getId()); // set the default text - this will be updated by the handler action.setText(WorkbenchMessages.ToggleCoolbarVisibilityAction_hide_text); action.setToolTipText(WorkbenchMessages.ToggleCoolbarVisibilityAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/MultiPartInitException.java
private static int findSingleException(PartInitException[] exceptions) { int index = -1; for (int i = 0; i < exceptions.length; i++) { if (exceptions[i] != null) { if (index == -1) { index = i; } else throw new IllegalArgumentException(); } } if (index == -1) { throw new IllegalArgumentException(); } return index; }
0 3
              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Shell getSplashShell(Display display) throws NumberFormatException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { Shell splashShell = (Shell) display.getData(DATA_SPLASH_SHELL); if (splashShell != null) return splashShell; String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); if (splashHandle == null) { return null; } // look for the 32 bit internal_new shell method try { Method method = Shell.class.getMethod( "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ // we're on a 32 bit platform so invoke it with splash // handle as an int splashShell = (Shell) method.invoke(null, new Object[] { display, new Integer(splashHandle) }); } catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } } display.setData(DATA_SPLASH_SHELL, splashShell); return splashShell; }
(Domain) PartInitException 29
              
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public IViewPart showView(String viewId, String secondaryId) throws PartInitException { ViewFactory factory = getViewFactory(); IViewReference ref = factory.createView(viewId, secondaryId); IViewPart part = (IViewPart) ref.getPart(true); if (part == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, ref.getId())); } ViewSite site = (ViewSite) part.getSite(); ViewPane pane = (ViewPane) site.getPane(); IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE); if (openViewMode == IPreferenceConstants.OVM_FAST && fastViewManager != null) { fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, true); setActiveFastView(ref); } else if (openViewMode == IPreferenceConstants.OVM_FLOAT && presentation.canDetach()) { presentation.addDetachedPart(pane); } else { if (useNewMinMax(this)) { // Is this view going to show in the trim? LayoutPart vPart = presentation.findPart(viewId, secondaryId); // Determine if there is a trim stack that should get the view String trimId = null; // If we can locate the correct trim stack then do so if (vPart != null) { String id = null; ILayoutContainer container = vPart.getContainer(); if (container instanceof ContainerPlaceholder) id = ((ContainerPlaceholder)container).getID(); else if (container instanceof ViewStack) id = ((ViewStack)container).getID(); else if (container instanceof DetachedPlaceHolder) { // Views in a detached window don't participate in the // minimize behavior so just revert to the default // behavior presentation.addPart(pane); return part; } // Is this place-holder in the trim? if (id != null && fastViewManager.getFastViews(id).size() > 0) { trimId = id; } } // No explicit trim found; If we're maximized then we either have to find an // arbitrary stack... if (trimId == null && presentation.getMaximizedStack() != null) { if (vPart == null) { ViewStackTrimToolBar blTrimStack = fastViewManager.getBottomRightTrimStack(); if (blTrimStack != null) { // OK, we've found a trim stack to add it to... trimId = blTrimStack.getId(); // Since there was no placeholder we have to add one LayoutPart blPart = presentation.findPart(trimId, null); if (blPart instanceof ContainerPlaceholder) { ContainerPlaceholder cph = (ContainerPlaceholder) blPart; if (cph.getRealContainer() instanceof ViewStack) { ViewStack vs = (ViewStack) cph.getRealContainer(); // Create a 'compound' id if this is a multi-instance part String compoundId = ref.getId(); if (ref.getSecondaryId() != null) compoundId = compoundId + ':' + ref.getSecondaryId(); // Add the new placeholder vs.add(new PartPlaceholder(compoundId)); } } } } } // If we have a trim stack located then add the view to it if (trimId != null) { fastViewManager.addViewReference(trimId, -1, ref, true); } else { boolean inMaximizedStack = vPart != null && vPart.getContainer() == presentation.getMaximizedStack(); // Do the default behavior presentation.addPart(pane); // Now, if we're maximized then we have to minimize the new stack if (presentation.getMaximizedStack() != null && !inMaximizedStack) { vPart = presentation.findPart(viewId, secondaryId); if (vPart != null && vPart.getContainer() instanceof ViewStack) { ViewStack vs = (ViewStack)vPart.getContainer(); vs.setState(IStackPresentationSite.STATE_MINIMIZED); // setting the state to minimized will create the trim toolbar // so we don't need a null pointer check here... fastViewManager.getViewStackTrimToolbar(vs.getID()).setRestoreOnUnzoom(true); } } } } else { presentation.addPart(pane); } } // Ensure that the newly showing part is enabled if (pane != null && pane.getControl() != null) pane.getControl().setEnabled(true); return part; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(final String viewID, final String secondaryID, final int mode) throws PartInitException { if (secondaryID != null) { if (secondaryID.length() == 0 || secondaryID.indexOf(ViewFactory.ID_SEP) != -1) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalSecondaryId); } } if (!certifyMode(mode)) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalViewMode); } // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyShowView(viewID, secondaryID, mode); } catch (PartInitException e) { result[0] = e; } } }); if (result[0] instanceof IViewPart) { return (IViewPart) result[0]; } else if (result[0] instanceof PartInitException) { throw (PartInitException) result[0]; } else { throw new PartInitException(WorkbenchMessages.WorkbenchPage_AbnormalWorkbenchCondition); } }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithPartInitExceptions(StartupRunnable r) throws PartInitException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (PartInitException) throwable; } else { throw new PartInitException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
public void openURL(URL url) throws PartInitException { // format the href for an html file (file:///<filename.html> // required for Mac only. String href = url.toString(); if (href.startsWith("file:")) { //$NON-NLS-1$ href = href.substring(5); while (href.startsWith("/")) { //$NON-NLS-1$ href = href.substring(1); } href = "file:///" + href; //$NON-NLS-1$ } final String localHref = href; final Display d = Display.getCurrent(); if (Util.isWindows()) { Program.launch(localHref); } else if (Util.isMac()) { try { Runtime.getRuntime().exec("/usr/bin/open " + localHref); //$NON-NLS-1$ } catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); } } else { Thread launcher = new Thread("About Link Launcher") {//$NON-NLS-1$ public void run() { try { /* * encoding the href as the browser does not open if * there is a space in the url. Bug 77840 */ String encodedLocalHref = urlEncodeForSpaces(localHref .toCharArray()); if (webBrowserOpened) { Runtime .getRuntime() .exec( webBrowser + " -remote openURL(" + encodedLocalHref + ")"); //$NON-NLS-1$ //$NON-NLS-2$ } else { Process p = openWebBrowser(encodedLocalHref); webBrowserOpened = true; try { if (p != null) { p.waitFor(); } } catch (InterruptedException e) { openWebBrowserError(d); } finally { webBrowserOpened = false; } } } catch (IOException e) { openWebBrowserError(d); } } }; launcher.start(); } }
// in Eclipse UI/org/eclipse/ui/internal/ViewFactory.java
public IViewReference createView(String id, String secondaryId) throws PartInitException { IViewDescriptor desc = viewReg.find(id); // ensure that the view id is valid if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, id )); } // ensure that multiple instances are allowed if a secondary id is given if (secondaryId != null) { if (!desc.getAllowMultiple()) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_noMultiple, id)); } } String key = getKey(id, secondaryId); IViewReference ref = (IViewReference) counter.get(key); if (ref == null) { IMemento memento = (IMemento) mementoTable.get(key); ref = new ViewReference(this, id, secondaryId, memento); mementoTable.remove(key); counter.put(key, ref); getWorkbenchPage().partAdded((ViewReference)ref); } else { counter.addRef(key); } return ref; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditor(String editorId, IEditorInput input, boolean setVisible, IMemento editorState) throws PartInitException { if (editorId == null || input == null) { throw new IllegalArgumentException(); } IEditorDescriptor desc = getEditorRegistry().findEditor(editorId); if (desc != null && !desc.isOpenExternal() && isLargeDocument(input)) { desc = getAlternateEditor(); if (desc == null) { // the user pressed cancel in the editor selection dialog return null; } } if (desc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorId)); } IEditorReference result = openEditorFromDescriptor((EditorDescriptor) desc, input, editorState); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditorFromDescriptor(EditorDescriptor desc, IEditorInput input, IMemento editorState) throws PartInitException { IEditorReference result = null; if (desc.isInternal()) { result = reuseInternalEditor(desc, input); if (result == null) { result = new EditorReference(this, input, desc, editorState); } } else if (desc.getId() .equals(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { if (ComponentSupport.inPlaceEditorSupported()) { result = new EditorReference(this, input, desc); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)) { IPathEditorInput pathInput = getPathEditorInput(input); if (pathInput != null) { result = openSystemExternalEditor(pathInput.getPath()); } else { throw new PartInitException( WorkbenchMessages.EditorManager_systemEditorError); } } else if (desc.isOpenExternal()) { result = openExternalEditor(desc, input); } else { // this should never happen throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_invalidDescriptor, desc .getId())); } if (result != null) { createEditorTab((EditorReference) result, ""); //$NON-NLS-1$ } Workbench wb = (Workbench) window.getWorkbench(); wb.getEditorHistory().add(input, desc); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorReference[] openMultiEditor(final IEditorReference ref, final AbstractMultiEditor part, final MultiEditorInput input) throws PartInitException { String[] editorArray = input.getEditors(); IEditorInput[] inputArray = input.getInput(); // find all descriptors EditorDescriptor[] descArray = new EditorDescriptor[editorArray.length]; IEditorReference refArray[] = new IEditorReference[editorArray.length]; IEditorPart partArray[] = new IEditorPart[editorArray.length]; IEditorRegistry reg = getEditorRegistry(); for (int i = 0; i < editorArray.length; i++) { EditorDescriptor innerDesc = (EditorDescriptor) reg .findEditor(editorArray[i]); if (innerDesc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorArray[i])); } descArray[i] = innerDesc; InnerEditor innerRef = new InnerEditor(ref, part, inputArray[i], descArray[i]); refArray[i] = innerRef; partArray[i] = innerRef.getEditor(true); } part.setChildren(partArray); return refArray; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
EditorSite createSite(final IEditorReference ref, final IEditorPart part, final EditorDescriptor desc, final IEditorInput input) throws PartInitException { EditorSite site = new EditorSite(ref, part, page, desc); if (desc != null) { site.setActionBars(createEditorActionBars(desc, site)); } else { site.setActionBars(createEmptyEditorActionBars(site)); } final String label = part.getTitle(); // debugging only try { try { UIStats.start(UIStats.INIT_PART, label); part.init(site, input); } finally { UIStats.end(UIStats.INIT_PART, part, label); } // Sanity-check the site if (part.getSite() != site || part.getEditorSite() != site) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_siteIncorrect, desc .getId())); } } catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); } return site; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorPart createPart(final EditorDescriptor desc) throws PartInitException { try { IEditorPart result = desc.createEditor(); IConfigurationElement element = desc.getConfigurationElement(); if (element != null) { page.getExtensionTracker().registerObject( element.getDeclaringExtension(), result, IExtensionTracker.REF_WEAK); } return result; } catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openSystemExternalEditor(final IPath location) throws PartInitException { if (location == null) { throw new IllegalArgumentException(); } final boolean result[] = { false }; BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { if (location != null) { result[0] = Program.launch(location.toOSString()); } } }); if (!result[0]) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unableToOpenExternalEditor, location)); } // We do not have an editor part for external editors return null; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorInput getRestoredInput() throws PartInitException { if (restoredInput != null) { return restoredInput; } // Get the input factory. IMemento editorMem = getMemento(); if (editorMem == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_persisted_state, getId(), getName())); } IMemento inputMem = editorMem .getChild(IWorkbenchConstants.TAG_INPUT); String factoryID = null; if (inputMem != null) { factoryID = inputMem .getString(IWorkbenchConstants.TAG_FACTORY_ID); } if (factoryID == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_input_factory_ID, getId(), getName())); } IAdaptable input = null; String label = null; // debugging only if (UIStats.isDebugging(UIStats.CREATE_PART_INPUT)) { label = getName() != null ? getName() : factoryID; } try { UIStats.start(UIStats.CREATE_PART_INPUT, label); IElementFactory factory = PlatformUI.getWorkbench() .getElementFactory(factoryID); if (factory == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_bad_element_factory, new Object[] { factoryID, getId(), getName() })); } // Get the input element. input = factory.createElement(inputMem); if (input == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_create_element_returned_null, new Object[] { factoryID, getId(), getName() })); } } finally { UIStats.end(UIStats.CREATE_PART_INPUT, input, label); } if (!(input instanceof IEditorInput)) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_wrong_createElement_result, new Object[] { factoryID, getId(), getName() })); } restoredInput = (IEditorInput) input; return restoredInput; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorPart createPartHelper() throws PartInitException { // Things that will need to be disposed if an exception occurs (listed // in the order they // need to be disposed, and set to null if they haven't been created yet) Composite content = null; IEditorPart part = null; EditorActionBars actionBars = null; EditorSite site = null; try { IEditorInput editorInput = getEditorInput(); // Get the editor descriptor. String editorID = getId(); EditorDescriptor desc = getDescriptor(); if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_missing_editor_descriptor, editorID)); } if (desc.isInternal()) { // Create an editor instance. try { UIStats.start(UIStats.CREATE_PART, editorID); part = manager.createPart(desc); // MultiEditor backwards compatibility if (part != null && part instanceof MultiEditor) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } if (part instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)part); } } finally { UIStats.end(UIStats.CREATE_PART, this, editorID); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { part = ComponentSupport.getSystemInPlaceEditor(); if (part == null) { throw new PartInitException(WorkbenchMessages.EditorManager_no_in_place_support); } } else { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_invalid_editor_descriptor, editorID)); } // Create a pane for this part PartPane pane = getPane(); pane.createControl(getPaneControlContainer()); // Create controls int style = SWT.NONE; if(part instanceof IWorkbenchPartOrientation){ style = ((IWorkbenchPartOrientation) part).getOrientation(); } // Link everything up to the part reference (the part reference itself should not have // been modified until this point) site = manager.createSite(this, part, desc, editorInput); // if there is saved state that's appropriate, pass it on if (part instanceof IPersistableEditor && editorState != null) { ((IPersistableEditor) part).restoreState(editorState); } // Remember the site and the action bars (now that we've created them, we'll need to dispose // them if an exception occurs) actionBars = (EditorActionBars) site.getActionBars(); Composite parent = (Composite)pane.getControl(); EditorDescriptor descriptor = getDescriptor(); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_Editor, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, editorID); part.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, part, editorID); } // Create the inner editors of an AbstractMultiEditor (but not MultiEditor) here // MultiEditor backwards compatibility if (part != null && part instanceof AbstractMultiEditor && !(part instanceof MultiEditor)) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } // The editor should now be fully created. Exercise its public interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave badly, it's much better // that it does so now while we can still cancel creation of the part. PartTester.testEditor(part); return part; } catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); } }
// in Eclipse UI/org/eclipse/ui/internal/FolderLayout.java
public void addView(String viewId) { if (pageLayout.checkPartInLayout(viewId)) { return; } try { IViewDescriptor descriptor = viewFactory.getViewRegistry().find( ViewFactory.extractPrimaryId(viewId)); if (descriptor == null) { throw new PartInitException("View descriptor not found: " + viewId); //$NON-NLS-1$ } if (WorkbenchActivityHelper.filterItem(descriptor)) { //create a placeholder instead. addPlaceholder(viewId); LayoutHelper.addViewActivator(pageLayout, viewId); } else { ViewPane newPart = LayoutHelper.createView(pageLayout .getViewFactory(), viewId); linkPartToPageLayout(viewId, newPart); folder.add(newPart); } } catch (PartInitException e) { // cannot safely open the dialog so log the problem WorkbenchPlugin.log(getClass(), "addView(String)", e); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
private IWorkbenchPart createPartHelper() throws PartInitException { IWorkbenchPart result = null; IMemento stateMem = null; if (memento != null) { stateMem = memento.getChild(IWorkbenchConstants.TAG_VIEW_STATE); } IViewDescriptor desc = factory.viewReg.find(getId()); if (desc == null) { throw new PartInitException( NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, getId())); } // Create the part pane PartPane pane = getPane(); // Create the pane's top-level control pane.createControl(factory.page.getClientComposite()); String label = desc.getLabel(); // debugging only // Things that will need to be disposed if an exception occurs (they are // listed here // in the order they should be disposed) Composite content = null; IViewPart initializedView = null; ViewSite site = null; ViewActionBars actionBars = null; // End of things that need to be explicitly disposed from the try block try { IViewPart view = null; try { UIStats.start(UIStats.CREATE_PART, label); view = desc.createView(); } finally { UIStats.end(UIStats.CREATE_PART, view, label); } if (view instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)view); } // Create site site = new ViewSite(this, view, factory.page, desc); actionBars = new ViewActionBars(factory.page.getActionBars(), site, (ViewPane) pane); site.setActionBars(actionBars); try { UIStats.start(UIStats.INIT_PART, label); view.init(site, stateMem); // Once we've called init, we MUST dispose the view. Remember // the fact that // we've initialized the view in case an exception is thrown. initializedView = view; } finally { UIStats.end(UIStats.INIT_PART, view, label); } if (view.getSite() != site) { throw new PartInitException( WorkbenchMessages.ViewFactory_siteException, null); } int style = SWT.NONE; if (view instanceof IWorkbenchPartOrientation) { style = ((IWorkbenchPartOrientation) view).getOrientation(); } // Create the top-level composite { Composite parent = (Composite) pane.getControl(); ViewDescriptor descriptor = (ViewDescriptor) this.factory.viewReg.find(getId()); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_View, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, label); view.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, view, label); } } // Install the part's tools and menu { // // 3.3 start // IMenuService menuService = (IMenuService) site .getService(IMenuService.class); menuService.populateContributionManager( (ContributionManager) site.getActionBars() .getMenuManager(), "menu:" //$NON-NLS-1$ + site.getId()); menuService .populateContributionManager((ContributionManager) site .getActionBars().getToolBarManager(), "toolbar:" + site.getId()); //$NON-NLS-1$ // 3.3 end actionBuilder = new ViewActionBuilder(); actionBuilder.readActionExtensions(view); ActionDescriptor[] actionDescriptors = actionBuilder .getExtendedActions(); IKeyBindingService keyBindingService = view.getSite() .getKeyBindingService(); if (actionDescriptors != null) { for (int i = 0; i < actionDescriptors.length; i++) { ActionDescriptor actionDescriptor = actionDescriptors[i]; if (actionDescriptor != null) { IAction action = actionDescriptors[i].getAction(); if (action != null && action.getActionDefinitionId() != null) { keyBindingService.registerAction(action); } } } } site.getActionBars().updateActionBars(); } // The editor should now be fully created. Exercise its public // interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave // badly, it's much better // that it does so now while we can still cancel creation of the // part. PartTester.testView(view); result = view; IConfigurationElement element = (IConfigurationElement) Util.getAdapter(desc, IConfigurationElement.class); if (element != null) { factory.page.getExtensionTracker().registerObject( element.getDeclaringExtension(), view, IExtensionTracker.REF_WEAK); } } catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); } return result; }
5
              
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
50
              
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
private final void openView(final String viewId, final String secondaryId, final IWorkbenchWindow activeWorkbenchWindow) throws PartInitException { final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage == null) { return; } if (makeFast) { WorkbenchPage wp = (WorkbenchPage) activePage; Perspective persp = wp.getActivePerspective(); // If we're making a fast view then use the new mechanism directly boolean useNewMinMax = Perspective.useNewMinMax(persp); if (useNewMinMax) { IViewReference ref = persp.getViewReference(viewId, secondaryId); if (ref == null) return; persp.getFastViewManager().addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, true); wp.activate(ref.getPart(true)); return; } IViewReference ref = wp.findViewReference(viewId, secondaryId); if (ref == null) { IViewPart part = wp.showView(viewId, secondaryId, IWorkbenchPage.VIEW_CREATE); ref = (IViewReference)wp.getReference(part); } if (!wp.isFastView(ref)) { wp.addFastView(ref); } wp.activate(ref.getPart(true)); } else { activePage.showView(viewId, secondaryId, IWorkbenchPage.VIEW_ACTIVATE); } }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public IViewPart showView(String viewId, String secondaryId) throws PartInitException { ViewFactory factory = getViewFactory(); IViewReference ref = factory.createView(viewId, secondaryId); IViewPart part = (IViewPart) ref.getPart(true); if (part == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, ref.getId())); } ViewSite site = (ViewSite) part.getSite(); ViewPane pane = (ViewPane) site.getPane(); IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE); if (openViewMode == IPreferenceConstants.OVM_FAST && fastViewManager != null) { fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, true); setActiveFastView(ref); } else if (openViewMode == IPreferenceConstants.OVM_FLOAT && presentation.canDetach()) { presentation.addDetachedPart(pane); } else { if (useNewMinMax(this)) { // Is this view going to show in the trim? LayoutPart vPart = presentation.findPart(viewId, secondaryId); // Determine if there is a trim stack that should get the view String trimId = null; // If we can locate the correct trim stack then do so if (vPart != null) { String id = null; ILayoutContainer container = vPart.getContainer(); if (container instanceof ContainerPlaceholder) id = ((ContainerPlaceholder)container).getID(); else if (container instanceof ViewStack) id = ((ViewStack)container).getID(); else if (container instanceof DetachedPlaceHolder) { // Views in a detached window don't participate in the // minimize behavior so just revert to the default // behavior presentation.addPart(pane); return part; } // Is this place-holder in the trim? if (id != null && fastViewManager.getFastViews(id).size() > 0) { trimId = id; } } // No explicit trim found; If we're maximized then we either have to find an // arbitrary stack... if (trimId == null && presentation.getMaximizedStack() != null) { if (vPart == null) { ViewStackTrimToolBar blTrimStack = fastViewManager.getBottomRightTrimStack(); if (blTrimStack != null) { // OK, we've found a trim stack to add it to... trimId = blTrimStack.getId(); // Since there was no placeholder we have to add one LayoutPart blPart = presentation.findPart(trimId, null); if (blPart instanceof ContainerPlaceholder) { ContainerPlaceholder cph = (ContainerPlaceholder) blPart; if (cph.getRealContainer() instanceof ViewStack) { ViewStack vs = (ViewStack) cph.getRealContainer(); // Create a 'compound' id if this is a multi-instance part String compoundId = ref.getId(); if (ref.getSecondaryId() != null) compoundId = compoundId + ':' + ref.getSecondaryId(); // Add the new placeholder vs.add(new PartPlaceholder(compoundId)); } } } } } // If we have a trim stack located then add the view to it if (trimId != null) { fastViewManager.addViewReference(trimId, -1, ref, true); } else { boolean inMaximizedStack = vPart != null && vPart.getContainer() == presentation.getMaximizedStack(); // Do the default behavior presentation.addPart(pane); // Now, if we're maximized then we have to minimize the new stack if (presentation.getMaximizedStack() != null && !inMaximizedStack) { vPart = presentation.findPart(viewId, secondaryId); if (vPart != null && vPart.getContainer() instanceof ViewStack) { ViewStack vs = (ViewStack)vPart.getContainer(); vs.setState(IStackPresentationSite.STATE_MINIMIZED); // setting the state to minimized will create the trim toolbar // so we don't need a null pointer check here... fastViewManager.getViewStackTrimToolbar(vs.getID()).setRestoreOnUnzoom(true); } } } } else { presentation.addPart(pane); } } // Ensure that the newly showing part is enabled if (pane != null && pane.getControl() != null) pane.getControl().setEnabled(true); return part; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IViewPart busyShowView(String viewID, String secondaryID, int mode) throws PartInitException { Perspective persp = getActivePerspective(); if (persp == null) { return null; } // If this view is already visible just return. IViewReference ref = persp.findView(viewID, secondaryID); IViewPart view = null; if (ref != null) { view = ref.getView(true); } if (view != null) { busyShowView(view, mode); return view; } // Show the view. view = persp.showView(viewID, secondaryID); if (view != null) { busyShowView(view, mode); IWorkbenchPartReference partReference = getReference(view); PartPane partPane = getPane(partReference); partPane.setInLayout(true); window.firePerspectiveChanged(this, getPerspective(), partReference, CHANGE_VIEW_SHOW); window.firePerspectiveChanged(this, getPerspective(), CHANGE_VIEW_SHOW); } return view; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(IEditorInput input, String editorID) throws PartInitException { return openEditor(input, editorID, true, MATCH_INPUT); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(IEditorInput input, String editorID, boolean activate) throws PartInitException { return openEditor(input, editorID, activate, MATCH_INPUT); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(final IEditorInput input, final String editorID, final boolean activate, final int matchFlags) throws PartInitException { return openEditor(input, editorID, activate, matchFlags, null); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(final IEditorInput input, final String editorID, final boolean activate, final int matchFlags, final IMemento editorState) throws PartInitException { if (input == null || editorID == null) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditor(input, editorID, activate, matchFlags, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditorFromDescriptor(final IEditorInput input, final IEditorDescriptor editorDescriptor, final boolean activate, final IMemento editorState) throws PartInitException { if (input == null || !(editorDescriptor instanceof EditorDescriptor)) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditorFromDescriptor(input, (EditorDescriptor)editorDescriptor, activate, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorPart busyOpenEditor(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { final Workbench workbench = (Workbench) getWorkbenchWindow() .getWorkbench(); workbench.largeUpdateStart(); try { return busyOpenEditorBatched(input, editorID, activate, matchFlags, editorState); } finally { workbench.largeUpdateEnd(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorPart busyOpenEditorFromDescriptor(IEditorInput input, EditorDescriptor editorDescriptor, boolean activate, IMemento editorState) throws PartInitException { final Workbench workbench = (Workbench) getWorkbenchWindow() .getWorkbench(); workbench.largeUpdateStart(); try { return busyOpenEditorFromDescriptorBatched(input, editorDescriptor, activate, editorState); } finally { workbench.largeUpdateEnd(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IEditorPart busyOpenEditorBatched(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { // If an editor already exists for the input, use it. IEditorPart editor = null; // Reuse an existing open editor, unless we are in "new editor tab management" mode editor = getEditorManager().findEditor(editorID, input, ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).getReuseEditorMatchFlags(matchFlags)); if (editor != null) { if (IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID.equals(editorID)) { if (editor.isDirty()) { MessageDialog dialog = new MessageDialog( getWorkbenchWindow().getShell(), WorkbenchMessages.Save, null, // accept the default window icon NLS.bind(WorkbenchMessages.WorkbenchPage_editorAlreadyOpenedMsg, input.getName()), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; int saveFile = dialog.open(); if (saveFile == 0) { try { final IEditorPart editorToSave = editor; getWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); } }); } catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); } catch (InterruptedException e) { return null; } } else if (saveFile == 2) { return null; } } } else { // do the IShowEditorInput notification before showing the editor // to reduce flicker if (editor instanceof IShowEditorInput) { ((IShowEditorInput) editor).showEditorInput(input); } showEditor(activate, editor); return editor; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorPart busyOpenEditorFromDescriptorBatched(IEditorInput input, EditorDescriptor editorDescriptor, boolean activate, IMemento editorState) throws PartInitException { IEditorPart editor = null; // Create a new one. This may cause the new editor to // become the visible (i.e top) editor. IEditorReference ref = null; ref = getEditorManager().openEditorFromDescriptor(editorDescriptor, input, editorState); if (ref != null) { editor = ref.getEditor(true); } if (editor != null) { setEditorAreaVisible(true); if (activate) { if (editor instanceof AbstractMultiEditor) { activate(((AbstractMultiEditor) editor).getActiveEditor()); } else { activate(editor); } } else { bringToTop(editor); } window.firePerspectiveChanged(this, getPerspective(), ref, CHANGE_EDITOR_OPEN); window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); } return editor; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(String viewID) throws PartInitException { return showView(viewID, null, VIEW_ACTIVATE); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(final String viewID, final String secondaryID, final int mode) throws PartInitException { if (secondaryID != null) { if (secondaryID.length() == 0 || secondaryID.indexOf(ViewFactory.ID_SEP) != -1) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalSecondaryId); } } if (!certifyMode(mode)) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalViewMode); } // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyShowView(viewID, secondaryID, mode); } catch (PartInitException e) { result[0] = e; } } }); if (result[0] instanceof IViewPart) { return (IViewPart) result[0]; } else if (result[0] instanceof PartInitException) { throw (PartInitException) result[0]; } else { throw new PartInitException(WorkbenchMessages.WorkbenchPage_AbnormalWorkbenchCondition); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorReference batchOpenEditor(IEditorInput input, String editorID, boolean activate) throws PartInitException { IEditorPart editor = null; IEditorReference ref; try { partBeingOpened = true; ref = getEditorManager().openEditor(editorID, input, true, null); if (ref != null) editor = ref.getEditor(activate); } finally { partBeingOpened = false; } if (editor != null) { setEditorAreaVisible(true); if (activate) { if (editor instanceof AbstractMultiEditor) activate(((AbstractMultiEditor) editor).getActiveEditor()); else activate(editor); } else bringToTop(editor); } return ref; }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithPartInitExceptions(StartupRunnable r) throws PartInitException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (PartInitException) throwable; } else { throw new PartInitException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
public void openURL(URL url) throws PartInitException { // format the href for an html file (file:///<filename.html> // required for Mac only. String href = url.toString(); if (href.startsWith("file:")) { //$NON-NLS-1$ href = href.substring(5); while (href.startsWith("/")) { //$NON-NLS-1$ href = href.substring(1); } href = "file:///" + href; //$NON-NLS-1$ } final String localHref = href; final Display d = Display.getCurrent(); if (Util.isWindows()) { Program.launch(localHref); } else if (Util.isMac()) { try { Runtime.getRuntime().exec("/usr/bin/open " + localHref); //$NON-NLS-1$ } catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); } } else { Thread launcher = new Thread("About Link Launcher") {//$NON-NLS-1$ public void run() { try { /* * encoding the href as the browser does not open if * there is a space in the url. Bug 77840 */ String encodedLocalHref = urlEncodeForSpaces(localHref .toCharArray()); if (webBrowserOpened) { Runtime .getRuntime() .exec( webBrowser + " -remote openURL(" + encodedLocalHref + ")"); //$NON-NLS-1$ //$NON-NLS-2$ } else { Process p = openWebBrowser(encodedLocalHref); webBrowserOpened = true; try { if (p != null) { p.waitFor(); } } catch (InterruptedException e) { openWebBrowserError(d); } finally { webBrowserOpened = false; } } } catch (IOException e) { openWebBrowserError(d); } } }; launcher.start(); } }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
public IWebBrowser createBrowser(int style, String browserId, String name, String tooltip) throws PartInitException { return getActiveSupport() .createBrowser(style, browserId, name, tooltip); }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
public IWebBrowser createBrowser(String browserId) throws PartInitException { return getActiveSupport().createBrowser(browserId); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java
protected IWebBrowser doCreateBrowser(int style, String browserId, String name, String tooltip) throws PartInitException { return new DefaultWebBrowser(this, browserId); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java
public IWebBrowser createBrowser(int style, String browserId, String name, String tooltip) throws PartInitException { String id = browserId == null? getDefaultId():browserId; IWebBrowser browser = findBrowser(id); if (browser != null) { return browser; } browser = doCreateBrowser(style, id, name, tooltip); registerBrowser(browser); return browser; }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java
public IWebBrowser createBrowser(String browserId) throws PartInitException { return createBrowser(AS_EXTERNAL, browserId, null, null); }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
private LayoutPart createView(String partID) throws PartInitException { if (partID.equals(ID_EDITOR_AREA)) { return editorFolder; } IViewDescriptor viewDescriptor = null; IViewRegistry viewRegistry = viewFactory.getViewRegistry(); String primaryId = ViewFactory.extractPrimaryId(partID); if (viewRegistry instanceof ViewRegistry) { viewDescriptor = ((ViewRegistry) viewRegistry).findInternal(primaryId); if (viewDescriptor != null && WorkbenchActivityHelper.restrictUseOf(viewDescriptor)) { return null; } } else { viewDescriptor = viewRegistry.find(primaryId); } if (WorkbenchActivityHelper.filterItem(viewDescriptor)) { return null; } return LayoutHelper.createView(getViewFactory(), partID); }
// in Eclipse UI/org/eclipse/ui/internal/ViewFactory.java
public IViewReference createView(final String id) throws PartInitException { return createView(id, null); }
// in Eclipse UI/org/eclipse/ui/internal/ViewFactory.java
public IViewReference createView(String id, String secondaryId) throws PartInitException { IViewDescriptor desc = viewReg.find(id); // ensure that the view id is valid if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, id )); } // ensure that multiple instances are allowed if a secondary id is given if (secondaryId != null) { if (!desc.getAllowMultiple()) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_noMultiple, id)); } } String key = getKey(id, secondaryId); IViewReference ref = (IViewReference) counter.get(key); if (ref == null) { IMemento memento = (IMemento) mementoTable.get(key); ref = new ViewReference(this, id, secondaryId, memento); mementoTable.remove(key); counter.put(key, ref); getWorkbenchPage().partAdded((ViewReference)ref); } else { counter.addRef(key); } return ref; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditor(String editorId, IEditorInput input, boolean setVisible, IMemento editorState) throws PartInitException { if (editorId == null || input == null) { throw new IllegalArgumentException(); } IEditorDescriptor desc = getEditorRegistry().findEditor(editorId); if (desc != null && !desc.isOpenExternal() && isLargeDocument(input)) { desc = getAlternateEditor(); if (desc == null) { // the user pressed cancel in the editor selection dialog return null; } } if (desc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorId)); } IEditorReference result = openEditorFromDescriptor((EditorDescriptor) desc, input, editorState); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditorFromDescriptor(EditorDescriptor desc, IEditorInput input, IMemento editorState) throws PartInitException { IEditorReference result = null; if (desc.isInternal()) { result = reuseInternalEditor(desc, input); if (result == null) { result = new EditorReference(this, input, desc, editorState); } } else if (desc.getId() .equals(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { if (ComponentSupport.inPlaceEditorSupported()) { result = new EditorReference(this, input, desc); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)) { IPathEditorInput pathInput = getPathEditorInput(input); if (pathInput != null) { result = openSystemExternalEditor(pathInput.getPath()); } else { throw new PartInitException( WorkbenchMessages.EditorManager_systemEditorError); } } else if (desc.isOpenExternal()) { result = openExternalEditor(desc, input); } else { // this should never happen throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_invalidDescriptor, desc .getId())); } if (result != null) { createEditorTab((EditorReference) result, ""); //$NON-NLS-1$ } Workbench wb = (Workbench) window.getWorkbench(); wb.getEditorHistory().add(input, desc); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openExternalEditor(final EditorDescriptor desc, IEditorInput input) throws PartInitException { final CoreException ex[] = new CoreException[1]; final IPathEditorInput pathInput = getPathEditorInput(input); if (pathInput != null && pathInput.getPath() != null) { BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { try { if (desc.getLauncher() != null) { // open using launcher Object launcher = WorkbenchPlugin.createExtension( desc.getConfigurationElement(), "launcher"); //$NON-NLS-1$ ((IEditorLauncher) launcher).open(pathInput .getPath()); } else { // open using command ExternalEditor oEditor = new ExternalEditor( pathInput.getPath(), desc); oEditor.open(); } } catch (CoreException e) { ex[0] = e; } } }); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorReference[] openMultiEditor(final IEditorReference ref, final AbstractMultiEditor part, final MultiEditorInput input) throws PartInitException { String[] editorArray = input.getEditors(); IEditorInput[] inputArray = input.getInput(); // find all descriptors EditorDescriptor[] descArray = new EditorDescriptor[editorArray.length]; IEditorReference refArray[] = new IEditorReference[editorArray.length]; IEditorPart partArray[] = new IEditorPart[editorArray.length]; IEditorRegistry reg = getEditorRegistry(); for (int i = 0; i < editorArray.length; i++) { EditorDescriptor innerDesc = (EditorDescriptor) reg .findEditor(editorArray[i]); if (innerDesc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorArray[i])); } descArray[i] = innerDesc; InnerEditor innerRef = new InnerEditor(ref, part, inputArray[i], descArray[i]); refArray[i] = innerRef; partArray[i] = innerRef.getEditor(true); } part.setChildren(partArray); return refArray; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private void createEditorTab(final EditorReference ref, final String workbookId) throws PartInitException { editorPresentation.addEditor(ref, workbookId, true); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
EditorSite createSite(final IEditorReference ref, final IEditorPart part, final EditorDescriptor desc, final IEditorInput input) throws PartInitException { EditorSite site = new EditorSite(ref, part, page, desc); if (desc != null) { site.setActionBars(createEditorActionBars(desc, site)); } else { site.setActionBars(createEmptyEditorActionBars(site)); } final String label = part.getTitle(); // debugging only try { try { UIStats.start(UIStats.INIT_PART, label); part.init(site, input); } finally { UIStats.end(UIStats.INIT_PART, part, label); } // Sanity-check the site if (part.getSite() != site || part.getEditorSite() != site) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_siteIncorrect, desc .getId())); } } catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); } return site; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference reuseInternalEditor(EditorDescriptor desc, IEditorInput input) throws PartInitException { Assert.isNotNull(desc, "descriptor must not be null"); //$NON-NLS-1$ Assert.isNotNull(input, "input must not be null"); //$NON-NLS-1$ IEditorReference reusableEditorRef = findReusableEditor(desc); if (reusableEditorRef != null) { return ((TabBehaviour) Tweaklets.get(TabBehaviour.KEY)) .reuseInternalEditor(page, this, editorPresentation, desc, input, reusableEditorRef); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorPart createPart(final EditorDescriptor desc) throws PartInitException { try { IEditorPart result = desc.createEditor(); IConfigurationElement element = desc.getConfigurationElement(); if (element != null) { page.getExtensionTracker().registerObject( element.getDeclaringExtension(), result, IExtensionTracker.REF_WEAK); } return result; } catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openSystemExternalEditor(final IPath location) throws PartInitException { if (location == null) { throw new IllegalArgumentException(); } final boolean result[] = { false }; BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { if (location != null) { result[0] = Program.launch(location.toOSString()); } } }); if (!result[0]) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unableToOpenExternalEditor, location)); } // We do not have an editor part for external editors return null; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
public IEditorInput getEditorInput() throws PartInitException { if (isDisposed()) { if (!(restoredInput instanceof NullEditorInput)) { restoredInput = new NullEditorInput(); } return restoredInput; } IEditorPart part = getEditor(false); if (part != null) { return part.getEditorInput(); } return getRestoredInput(); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorInput getRestoredInput() throws PartInitException { if (restoredInput != null) { return restoredInput; } // Get the input factory. IMemento editorMem = getMemento(); if (editorMem == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_persisted_state, getId(), getName())); } IMemento inputMem = editorMem .getChild(IWorkbenchConstants.TAG_INPUT); String factoryID = null; if (inputMem != null) { factoryID = inputMem .getString(IWorkbenchConstants.TAG_FACTORY_ID); } if (factoryID == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_input_factory_ID, getId(), getName())); } IAdaptable input = null; String label = null; // debugging only if (UIStats.isDebugging(UIStats.CREATE_PART_INPUT)) { label = getName() != null ? getName() : factoryID; } try { UIStats.start(UIStats.CREATE_PART_INPUT, label); IElementFactory factory = PlatformUI.getWorkbench() .getElementFactory(factoryID); if (factory == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_bad_element_factory, new Object[] { factoryID, getId(), getName() })); } // Get the input element. input = factory.createElement(inputMem); if (input == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_create_element_returned_null, new Object[] { factoryID, getId(), getName() })); } } finally { UIStats.end(UIStats.CREATE_PART_INPUT, input, label); } if (!(input instanceof IEditorInput)) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_wrong_createElement_result, new Object[] { factoryID, getId(), getName() })); } restoredInput = (IEditorInput) input; return restoredInput; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorPart createPartHelper() throws PartInitException { // Things that will need to be disposed if an exception occurs (listed // in the order they // need to be disposed, and set to null if they haven't been created yet) Composite content = null; IEditorPart part = null; EditorActionBars actionBars = null; EditorSite site = null; try { IEditorInput editorInput = getEditorInput(); // Get the editor descriptor. String editorID = getId(); EditorDescriptor desc = getDescriptor(); if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_missing_editor_descriptor, editorID)); } if (desc.isInternal()) { // Create an editor instance. try { UIStats.start(UIStats.CREATE_PART, editorID); part = manager.createPart(desc); // MultiEditor backwards compatibility if (part != null && part instanceof MultiEditor) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } if (part instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)part); } } finally { UIStats.end(UIStats.CREATE_PART, this, editorID); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { part = ComponentSupport.getSystemInPlaceEditor(); if (part == null) { throw new PartInitException(WorkbenchMessages.EditorManager_no_in_place_support); } } else { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_invalid_editor_descriptor, editorID)); } // Create a pane for this part PartPane pane = getPane(); pane.createControl(getPaneControlContainer()); // Create controls int style = SWT.NONE; if(part instanceof IWorkbenchPartOrientation){ style = ((IWorkbenchPartOrientation) part).getOrientation(); } // Link everything up to the part reference (the part reference itself should not have // been modified until this point) site = manager.createSite(this, part, desc, editorInput); // if there is saved state that's appropriate, pass it on if (part instanceof IPersistableEditor && editorState != null) { ((IPersistableEditor) part).restoreState(editorState); } // Remember the site and the action bars (now that we've created them, we'll need to dispose // them if an exception occurs) actionBars = (EditorActionBars) site.getActionBars(); Composite parent = (Composite)pane.getControl(); EditorDescriptor descriptor = getDescriptor(); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_Editor, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, editorID); part.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, part, editorID); } // Create the inner editors of an AbstractMultiEditor (but not MultiEditor) here // MultiEditor backwards compatibility if (part != null && part instanceof AbstractMultiEditor && !(part instanceof MultiEditor)) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } // The editor should now be fully created. Exercise its public interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave badly, it's much better // that it does so now while we can still cancel creation of the part. PartTester.testEditor(part); return part; } catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); } }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
public static final ViewPane createView(ViewFactory factory, String viewId) throws PartInitException { WorkbenchPartReference ref = (WorkbenchPartReference) factory .createView(ViewFactory.extractPrimaryId(viewId), ViewFactory .extractSecondaryId(viewId)); ViewPane newPart = (ViewPane) ref.getPane(); return newPart; }
// in Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
public void init(IViewSite site, IMemento memento) throws PartInitException { super.init(site); Workbench workbench = (Workbench) site.getWorkbenchWindow() .getWorkbench(); try { introPart = workbench.getWorkbenchIntroManager() .createNewIntroPart(); // reset the part name of this view to be that of the intro title setPartName(introPart.getTitle()); introPart.addPropertyListener(new IPropertyListener() { public void propertyChanged(Object source, int propId) { firePropertyChange(propId); } }); introSite = new ViewIntroAdapterSite(site, workbench .getIntroDescriptor()); introPart.init(introSite, memento); } catch (CoreException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
private IWorkbenchPart createPartHelper() throws PartInitException { IWorkbenchPart result = null; IMemento stateMem = null; if (memento != null) { stateMem = memento.getChild(IWorkbenchConstants.TAG_VIEW_STATE); } IViewDescriptor desc = factory.viewReg.find(getId()); if (desc == null) { throw new PartInitException( NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, getId())); } // Create the part pane PartPane pane = getPane(); // Create the pane's top-level control pane.createControl(factory.page.getClientComposite()); String label = desc.getLabel(); // debugging only // Things that will need to be disposed if an exception occurs (they are // listed here // in the order they should be disposed) Composite content = null; IViewPart initializedView = null; ViewSite site = null; ViewActionBars actionBars = null; // End of things that need to be explicitly disposed from the try block try { IViewPart view = null; try { UIStats.start(UIStats.CREATE_PART, label); view = desc.createView(); } finally { UIStats.end(UIStats.CREATE_PART, view, label); } if (view instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)view); } // Create site site = new ViewSite(this, view, factory.page, desc); actionBars = new ViewActionBars(factory.page.getActionBars(), site, (ViewPane) pane); site.setActionBars(actionBars); try { UIStats.start(UIStats.INIT_PART, label); view.init(site, stateMem); // Once we've called init, we MUST dispose the view. Remember // the fact that // we've initialized the view in case an exception is thrown. initializedView = view; } finally { UIStats.end(UIStats.INIT_PART, view, label); } if (view.getSite() != site) { throw new PartInitException( WorkbenchMessages.ViewFactory_siteException, null); } int style = SWT.NONE; if (view instanceof IWorkbenchPartOrientation) { style = ((IWorkbenchPartOrientation) view).getOrientation(); } // Create the top-level composite { Composite parent = (Composite) pane.getControl(); ViewDescriptor descriptor = (ViewDescriptor) this.factory.viewReg.find(getId()); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_View, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, label); view.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, view, label); } } // Install the part's tools and menu { // // 3.3 start // IMenuService menuService = (IMenuService) site .getService(IMenuService.class); menuService.populateContributionManager( (ContributionManager) site.getActionBars() .getMenuManager(), "menu:" //$NON-NLS-1$ + site.getId()); menuService .populateContributionManager((ContributionManager) site .getActionBars().getToolBarManager(), "toolbar:" + site.getId()); //$NON-NLS-1$ // 3.3 end actionBuilder = new ViewActionBuilder(); actionBuilder.readActionExtensions(view); ActionDescriptor[] actionDescriptors = actionBuilder .getExtendedActions(); IKeyBindingService keyBindingService = view.getSite() .getKeyBindingService(); if (actionDescriptors != null) { for (int i = 0; i < actionDescriptors.length; i++) { ActionDescriptor actionDescriptor = actionDescriptors[i]; if (actionDescriptor != null) { IAction action = actionDescriptors[i].getAction(); if (action != null && action.getActionDefinitionId() != null) { keyBindingService.registerAction(action); } } } } site.getActionBars().updateActionBars(); } // The editor should now be fully created. Exercise its public // interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave // badly, it's much better // that it does so now while we can still cancel creation of the // part. PartTester.testView(view); result = view; IConfigurationElement element = (IConfigurationElement) Util.getAdapter(desc, IConfigurationElement.class); if (element != null) { factory.page.getExtensionTracker().registerObject( element.getDeclaringExtension(), view, IExtensionTracker.REF_WEAK); } } catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); } return result; }
// in Eclipse UI/org/eclipse/ui/browser/AbstractWorkbenchBrowserSupport.java
public IWebBrowser getExternalBrowser() throws PartInitException { return createBrowser(AS_EXTERNAL, SHARED_EXTERNAL_BROWSER_ID, null, null); }
// in Eclipse UI/org/eclipse/ui/part/ViewPart.java
public void init(IViewSite site) throws PartInitException { setSite(site); setDefaultContentDescription(); }
// in Eclipse UI/org/eclipse/ui/part/ViewPart.java
public void init(IViewSite site, IMemento memento) throws PartInitException { /* * Initializes this view with the given view site. A memento is passed to * the view which contains a snapshot of the views state from a previous * session. Where possible, the view should try to recreate that state * within the part controls. * <p> * This implementation will ignore the memento and initialize the view in * a fresh state. Subclasses may override the implementation to perform any * state restoration as needed. */ init(site); }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public int addPage(IEditorPart editor, IEditorInput input) throws PartInitException { int index = getPageCount(); addPage(index, editor, input); return index; }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public void addPage(int index, IEditorPart editor, IEditorInput input) throws PartInitException { IEditorSite site = createSite(editor); // call init first so that if an exception is thrown, we have created no // new widgets editor.init(site, input); Composite parent2 = new Composite(getContainer(), getOrientation(editor)); parent2.setLayout(new FillLayout()); editor.createPartControl(parent2); editor.addPropertyListener(new IPropertyListener() { public void propertyChanged(Object source, int propertyId) { MultiPageEditorPart.this.handlePropertyChange(propertyId); } }); // create item for page only after createPartControl has succeeded Item item = createItem(index, parent2); // remember the editor, as both data on the item, and in the list of // editors (see field comment) item.setData(editor); nestedEditors.add(editor); }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public void init(IEditorSite site, IEditorInput input) throws PartInitException { setSite(site); setInput(input); site.setSelectionProvider(new MultiPageSelectionProvider(this)); }
// in Eclipse UI/org/eclipse/ui/part/IntroPart.java
public void init(IIntroSite site, IMemento memento) throws PartInitException { setSite(site); }
// in Eclipse UI/org/eclipse/ui/part/AbstractMultiEditor.java
public void init(IEditorSite site, IEditorInput input) throws PartInitException { init(site, (MultiEditorInput) input); }
// in Eclipse UI/org/eclipse/ui/part/AbstractMultiEditor.java
public void init(IEditorSite site, MultiEditorInput input) throws PartInitException { setInput(input); setSite(site); setPartName(input.getName()); setTitleToolTip(input.getToolTipText()); setupEvents(); }
// in Eclipse UI/org/eclipse/ui/part/PageBookView.java
public void init(IViewSite site) throws PartInitException { site.setSelectionProvider(selectionProvider); super.init(site); }
(Domain) ExecutionException 24
              
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void noVariableFound(ExecutionEvent event, String name) throws ExecutionException { throw new ExecutionException("No " + name //$NON-NLS-1$ + " found while executing " + event.getCommand().getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void incorrectTypeFound(ExecutionEvent event, String name, Class expectedType, Class wrongType) throws ExecutionException { throw new ExecutionException("Incorrect type for " //$NON-NLS-1$ + name + " found while executing " //$NON-NLS-1$ + event.getCommand().getId() + ", expected " + expectedType.getName() //$NON-NLS-1$ + " found " + wrongType.getName()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean toggleCommandState(Command command) throws ExecutionException { State state = command.getState(RegistryToggleState.STATE_ID); if(state == null) throw new ExecutionException("The command does not have a toggle state"); //$NON-NLS-1$ if(!(state.getValue() instanceof Boolean)) throw new ExecutionException("The command's toggle state doesn't contain a boolean value"); //$NON-NLS-1$ boolean oldValue = ((Boolean) state.getValue()).booleanValue(); state.setValue(new Boolean(!oldValue)); return oldValue; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean matchesRadioState(ExecutionEvent event) throws ExecutionException { String parameter = event.getParameter(RadioState.PARAMETER_ID); if (parameter == null) throw new ExecutionException( "The event does not have the radio state parameter"); //$NON-NLS-1$ Command command = event.getCommand(); State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ if (!(state.getValue() instanceof String)) throw new ExecutionException( "The command's radio state doesn't contain a String value"); //$NON-NLS-1$ return parameter.equals(state.getValue()); }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static void updateRadioState(Command command, String newState) throws ExecutionException { State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ state.setValue(newState); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private final void openPerspective(final String perspectiveId, final IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final IWorkbench workbench = PlatformUI.getWorkbench(); final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); IPerspectiveDescriptor desc = activeWorkbenchWindow.getWorkbench() .getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); if (desc == null) { throw new ExecutionException("Perspective " + perspectiveId //$NON-NLS-1$ + " cannot be found."); //$NON-NLS-1$ } try { if (activePage != null) { activePage.setPerspective(desc); } else { IAdaptable input = ((Workbench) workbench) .getDefaultPageInput(); activeWorkbenchWindow.openPage(perspectiveId, input); } } catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); // Get the view identifier, if any. final Map parameters = event.getParameters(); final Object viewId = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_ID); final Object secondary = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_SECONDARY_ID); makeFast = "true".equals(parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_FASTVIEW)); //$NON-NLS-1$ if (viewId == null) { openOther(window); } else { try { openView((String) viewId, (String) secondary, window); } catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else { methodToExecute.invoke(focusControl, null); } } catch (IllegalAccessException e) { // The method is protected, so do nothing. } catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); final int numParams = methodToExecute.getParameterTypes().length; if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { // we only support selectAll for swing components if (numParams != 0) { return null; } /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); // and back to the UI thread :-) focusControl.getDisplay().asyncExec( new Runnable() { public void run() { if (!focusControl .isDisposed()) { focusControl .notifyListeners( SWT.Selection, null); } } }); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else if (numParams == 0) { // This is a no-argument selectAll method. methodToExecute.invoke(focusControl, null); focusControl.notifyListeners(SWT.Selection, null); } else if (numParams == 1) { // This is a single-point selection method. final Method textLimitAccessor = focusControl.getClass() .getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$ final Integer textLimit = (Integer) textLimitAccessor .invoke(focusControl, null); final Object[] parameters = { new Point(0, textLimit .intValue()) }; methodToExecute.invoke(focusControl, parameters); if (!(focusControl instanceof Combo)) { focusControl.notifyListeners(SWT.Selection, null); } } else { /* * This means that getMethodToExecute() has been changed, * while this method hasn't. */ throw new ExecutionException( "Too many parameters on select all", new Exception()); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { // Debugging output if (DEBUG_HANDLERS) { final StringBuffer buffer = new StringBuffer("Executing LegacyHandlerWrapper for "); //$NON-NLS-1$ if (handler == null) { buffer.append("no handler"); //$NON-NLS-1$ } else { buffer.append('\''); buffer.append(handler.getClass().getName()); buffer.append('\''); } Tracing.printTrace("HANDLERS", buffer.toString()); //$NON-NLS-1$ } try { return handler.execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String wizardId = event.getParameter(getWizardIdParameterId()); IWorkbenchWindow activeWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); if (wizardId == null) { executeHandler(event); } else { IWizardRegistry wizardRegistry = getWizardRegistry(); IWizardDescriptor wizardDescriptor = wizardRegistry .findWizard(wizardId); if (wizardDescriptor == null) { throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$ } try { IWorkbenchWizard wizard = wizardDescriptor.createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelectionToUse(event)); if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) { wizard.performFinish(); return null; } Shell parent = activeWindow.getShell(); WizardDialog dialog = new WizardDialog(parent, wizard); dialog.create(); dialog.open(); } catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/QuickMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { locationURI = event.getParameter("org.eclipse.ui.window.quickMenu.uri"); //$NON-NLS-1$ if (locationURI == null) { throw new ExecutionException("locatorURI must not be null"); //$NON-NLS-1$ } creator.createMenu(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { if (loadHandler()) { if (!isEnabled()) { MessageDialog.openInformation(Util.getShellToParentOn(), WorkbenchMessages.Information, WorkbenchMessages.PluginAction_disabledMessage); return null; } return handler.execute(event); } if(loadException !=null) throw new ExecutionException("Exception occured when loading the handler", loadException); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String targetId = event .getParameter(IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_PARM_TARGET); if (targetId == null) { throw new ExecutionException("No targetId specified"); //$NON-NLS-1$ } final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindowChecked(event); ISourceProviderService sps = (ISourceProviderService)activeWorkbenchWindow.getService(ISourceProviderService.class); if (sps != null) { ISourceProvider sp = sps.getSourceProvider(ISources.SHOW_IN_SELECTION); if (sp instanceof WorkbenchSourceProvider) { ((WorkbenchSourceProvider)sp).checkActivePart(true); } } ShowInContext context = getContext(HandlerUtil .getShowInSelection(event), HandlerUtil.getShowInInput(event)); if (context == null) { return null; } IWorkbenchPage page= activeWorkbenchWindow.getActivePage(); try { IViewPart view = page.showView(targetId); IShowInTarget target = getShowInTarget(view); if (!(target != null && target.show(context))) { page.getWorkbenchWindow().getShell().getDisplay().beep(); } ((WorkbenchPage) page).performedShowIn(targetId); // TODO: move // back up } catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ } return null; }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { try { return execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
public Object execute(Map parameterValuesByName) throws ExecutionException { if ((action.getStyle() == IAction.AS_CHECK_BOX) || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { action.setChecked(!action.isChecked()); } try { action.runWithEvent(new Event()); } catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ } return null; }
10
              
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ }
72
              
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void noVariableFound(ExecutionEvent event, String name) throws ExecutionException { throw new ExecutionException("No " + name //$NON-NLS-1$ + " found while executing " + event.getCommand().getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void incorrectTypeFound(ExecutionEvent event, String name, Class expectedType, Class wrongType) throws ExecutionException { throw new ExecutionException("Incorrect type for " //$NON-NLS-1$ + name + " found while executing " //$NON-NLS-1$ + event.getCommand().getId() + ", expected " + expectedType.getName() //$NON-NLS-1$ + " found " + wrongType.getName()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Object getVariableChecked(ExecutionEvent event, String name) throws ExecutionException { Object o = getVariable(event, name); if (o == null) { noVariableFound(event, name); } return o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Collection getActiveContextsChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_CONTEXT_NAME); if (!(o instanceof Collection)) { incorrectTypeFound(event, ISources.ACTIVE_CONTEXT_NAME, Collection.class, o.getClass()); } return (Collection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Shell getActiveShellChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_SHELL_NAME); if (!(o instanceof Shell)) { incorrectTypeFound(event, ISources.ACTIVE_SHELL_NAME, Shell.class, o.getClass()); } return (Shell) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IWorkbenchWindow getActiveWorkbenchWindowChecked( ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_WORKBENCH_WINDOW_NAME); if (!(o instanceof IWorkbenchWindow)) { incorrectTypeFound(event, ISources.ACTIVE_WORKBENCH_WINDOW_NAME, IWorkbenchWindow.class, o.getClass()); } return (IWorkbenchWindow) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IEditorPart getActiveEditorChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_EDITOR_NAME); if (!(o instanceof IEditorPart)) { incorrectTypeFound(event, ISources.ACTIVE_EDITOR_NAME, IEditorPart.class, o.getClass()); } return (IEditorPart) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static String getActiveEditorIdChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_EDITOR_ID_NAME); if (!(o instanceof String)) { incorrectTypeFound(event, ISources.ACTIVE_EDITOR_ID_NAME, String.class, o.getClass()); } return (String) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IEditorInput getActiveEditorInputChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_EDITOR_INPUT_NAME); if (!(o instanceof IEditorInput)) { incorrectTypeFound(event, ISources.ACTIVE_EDITOR_INPUT_NAME, IEditorInput.class, o.getClass()); } return (IEditorInput) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IWorkbenchPart getActivePartChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_PART_NAME); if (!(o instanceof IWorkbenchPart)) { incorrectTypeFound(event, ISources.ACTIVE_PART_NAME, IWorkbenchPart.class, o.getClass()); } return (IWorkbenchPart) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static String getActivePartIdChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_PART_ID_NAME); if (!(o instanceof String)) { incorrectTypeFound(event, ISources.ACTIVE_PART_ID_NAME, String.class, o.getClass()); } return (String) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IWorkbenchSite getActiveSiteChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_SITE_NAME); if (!(o instanceof IWorkbenchSite)) { incorrectTypeFound(event, ISources.ACTIVE_SITE_NAME, IWorkbenchSite.class, o.getClass()); } return (IWorkbenchSite) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getCurrentSelectionChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_CURRENT_SELECTION_NAME); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.ACTIVE_CURRENT_SELECTION_NAME, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Collection getActiveMenusChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_MENU_NAME); if (!(o instanceof Collection)) { incorrectTypeFound(event, ISources.ACTIVE_MENU_NAME, Collection.class, o.getClass()); } return (Collection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getActiveMenuSelectionChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_MENU_SELECTION_NAME); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.ACTIVE_MENU_SELECTION_NAME, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getActiveMenuEditorInputChecked( ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_MENU_EDITOR_INPUT_NAME); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.ACTIVE_MENU_EDITOR_INPUT_NAME, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getShowInSelectionChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.SHOW_IN_SELECTION); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.SHOW_IN_SELECTION, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Object getShowInInputChecked(ExecutionEvent event) throws ExecutionException { Object var = getVariableChecked(event, ISources.SHOW_IN_INPUT); return var; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean toggleCommandState(Command command) throws ExecutionException { State state = command.getState(RegistryToggleState.STATE_ID); if(state == null) throw new ExecutionException("The command does not have a toggle state"); //$NON-NLS-1$ if(!(state.getValue() instanceof Boolean)) throw new ExecutionException("The command's toggle state doesn't contain a boolean value"); //$NON-NLS-1$ boolean oldValue = ((Boolean) state.getValue()).booleanValue(); state.setValue(new Boolean(!oldValue)); return oldValue; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean matchesRadioState(ExecutionEvent event) throws ExecutionException { String parameter = event.getParameter(RadioState.PARAMETER_ID); if (parameter == null) throw new ExecutionException( "The event does not have the radio state parameter"); //$NON-NLS-1$ Command command = event.getCommand(); State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ if (!(state.getValue() instanceof String)) throw new ExecutionException( "The command's radio state doesn't contain a String value"); //$NON-NLS-1$ return parameter.equals(state.getValue()); }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static void updateRadioState(Command command, String newState) throws ExecutionException { State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ state.setValue(newState); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); // Get the view identifier, if any. final Map parameters = event.getParameters(); final Object value = parameters .get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_ID); final String newWindow = (String) parameters .get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_NEWWINDOW); if (value == null) { openOther(window); } else { if (newWindow == null || newWindow.equalsIgnoreCase("false")) { //$NON-NLS-1$ openPerspective((String) value, window); } else { openNewWindowPerspective((String) value, window); } } return null; }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private void openNewWindowPerspective(String perspectiveId, IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final IWorkbench workbench = PlatformUI.getWorkbench(); try { IAdaptable input = ((Workbench) workbench).getDefaultPageInput(); workbench.openWorkbenchWindow(perspectiveId, input); } catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private final void openOther(final IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final SelectPerspectiveDialog dialog = new SelectPerspectiveDialog( activeWorkbenchWindow.getShell(), WorkbenchPlugin.getDefault() .getPerspectiveRegistry()); dialog.open(); if (dialog.getReturnCode() == Window.CANCEL) { return; } final IPerspectiveDescriptor descriptor = dialog.getSelection(); if (descriptor != null) { int openPerspMode = WorkbenchPlugin.getDefault().getPreferenceStore() .getInt(IPreferenceConstants.OPEN_PERSP_MODE); IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); IPerspectiveDescriptor persp = page == null ? null : page.getPerspective(); String perspectiveId = descriptor.getId(); // only open it in a new window if the preference is set and the // current workbench page doesn't have an active perspective if (IPreferenceConstants.OPM_NEW_WINDOW == openPerspMode && persp != null) { openNewWindowPerspective(perspectiveId, activeWorkbenchWindow); } else { openPerspective(perspectiveId, activeWorkbenchWindow); } } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private final void openPerspective(final String perspectiveId, final IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final IWorkbench workbench = PlatformUI.getWorkbench(); final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); IPerspectiveDescriptor desc = activeWorkbenchWindow.getWorkbench() .getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); if (desc == null) { throw new ExecutionException("Perspective " + perspectiveId //$NON-NLS-1$ + " cannot be found."); //$NON-NLS-1$ } try { if (activePage != null) { activePage.setPerspective(desc); } else { IAdaptable input = ((Workbench) workbench) .getDefaultPageInput(); activeWorkbenchWindow.openPage(perspectiveId, input); } } catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); // Get the view identifier, if any. final Map parameters = event.getParameters(); final Object viewId = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_ID); final Object secondary = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_SECONDARY_ID); makeFast = "true".equals(parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_FASTVIEW)); //$NON-NLS-1$ if (viewId == null) { openOther(window); } else { try { openView((String) viewId, (String) secondary, window); } catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/ShowPartPaneMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePart(event); if (part != null) { IWorkbenchPartSite site = part.getSite(); if (site instanceof PartSite) { PartPane pane = ((PartSite) site).getPane(); pane.showSystemMenu(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/CloseAllHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { page.closeAllEditors(true); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/CloseOthersHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorReference[] refArray = page.getEditorReferences(); if (refArray != null && refArray.length > 1) { IEditorReference[] otherEditors = new IEditorReference[refArray.length - 1]; IEditorReference activeEditor = (IEditorReference) page .getReference(page.getActiveEditor()); for (int i = 0; i < refArray.length; i++) { if (refArray[i] != activeEditor) continue; System.arraycopy(refArray, 0, otherEditors, 0, i); System.arraycopy(refArray, i + 1, otherEditors, i, refArray.length - 1 - i); break; } page.closeEditors(otherEditors, true); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LockToolBarHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { WorkbenchWindow workbenchWindow = (WorkbenchWindow) HandlerUtil .getActiveWorkbenchWindow(event); if (workbenchWindow != null) { ICoolBarManager coolBarManager = workbenchWindow.getCoolBarManager2(); if (coolBarManager != null) { boolean oldValue = HandlerUtil.toggleCommandState(event.getCommand()); coolBarManager.setLockLayout(!oldValue); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/EditActionSetsHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { WorkbenchPage page = (WorkbenchPage) activeWorkbenchWindow .getActivePage(); if (page != null) { page.editActionSets(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ToggleCoolbarHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); if (activeWorkbenchWindow instanceof WorkbenchWindow) { WorkbenchWindow window = (WorkbenchWindow) activeWorkbenchWindow; window.toggleToolbarVisibility(); ICommandService commandService = (ICommandService) activeWorkbenchWindow .getService(ICommandService.class); Map filter = new HashMap(); filter.put(IServiceScopes.WINDOW_SCOPE, window); commandService.refreshElements(event.getCommand().getId(), filter); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/MaximizePartHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); if (page != null) { IWorkbenchPartReference partRef = page.getActivePartReference(); if (partRef != null) { page.toggleZoom(partRef); } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/QuitHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow == null) { // action has been disposed return null; } activeWorkbenchWindow.getWorkbench().close(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CloseAllPerspectivesHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { page.closeAllPerspectives(true, true); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/PropertyDialogHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { PreferenceDialog dialog; Object element = null; ISelection currentSelection = HandlerUtil.getCurrentSelection(event); IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event); Shell shell; if (currentSelection instanceof IStructuredSelection) { element = ((IStructuredSelection) currentSelection) .getFirstElement(); } else { return null; } if (activeWorkbenchWindow != null){ shell = activeWorkbenchWindow.getShell(); dialog = PropertyDialog.createDialogOn(shell, initialPageId, element); if (dialog != null) { dialog.open(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SaveAllHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { ((WorkbenchPage) page).saveAllEditors(false, true); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ClosePerspectiveHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { WorkbenchPage page = (WorkbenchPage) activeWorkbenchWindow .getActivePage(); if (page != null) { Map parameters = event.getParameters(); String value = (String) parameters .get(IWorkbenchCommandConstants.WINDOW_CLOSE_PERSPECTIVE_PARM_ID); if (value == null) { page.closePerspective(page.getPerspective(), true, true); } else { IPerspectiveDescriptor perspective = activeWorkbenchWindow .getWorkbench().getPerspectiveRegistry() .findPerspectiveWithId(value); if (perspective != null) { page.closePerspective(perspective, true, true); } } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); if (page == null) { return null; } IEditorPart editor = page.getActiveEditor(); if (editor == null) { return null; } String editorId = editor.getSite().getId(); if (editorId == null) { return null; } try { if (editor instanceof IPersistableEditor) { XMLMemento editorState = XMLMemento .createWriteRoot(IWorkbenchConstants.TAG_EDITOR_STATE); ((IPersistableEditor) editor).saveState(editorState); ((WorkbenchPage) page).openEditor(editor.getEditorInput(), editorId, true, IWorkbenchPage.MATCH_NONE, editorState); } else { page.openEditor(editor.getEditorInput(), editorId, true, IWorkbenchPage.MATCH_NONE); } } catch (PartInitException e) { DialogUtil.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.Error, e.getMessage(), e); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/OpenInNewWindowHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow == null) { return null; } try { String perspId = null; IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); IAdaptable pageInput = ((Workbench) activeWorkbenchWindow .getWorkbench()).getDefaultPageInput(); if (page != null && page.getPerspective() != null) { perspId = page.getPerspective().getId(); pageInput = page.getInput(); } else { perspId = activeWorkbenchWindow.getWorkbench() .getPerspectiveRegistry().getDefaultPerspective(); } activeWorkbenchWindow.getWorkbench().openWorkbenchWindow(perspId, pageInput); } catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ClosePartHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePartChecked(event); IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); if (part instanceof IEditorPart) { window.getActivePage().closeEditor((IEditorPart) part, true); } else if (part instanceof IViewPart) { window.getActivePage().hideView((IViewPart) part); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
public Object execute(Map parameters) throws ExecutionException { if (loadHandler()) { return handler.execute(parameters); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else { methodToExecute.invoke(focusControl, null); } } catch (IllegalAccessException e) { // The method is protected, so do nothing. } catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); final int numParams = methodToExecute.getParameterTypes().length; if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { // we only support selectAll for swing components if (numParams != 0) { return null; } /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); // and back to the UI thread :-) focusControl.getDisplay().asyncExec( new Runnable() { public void run() { if (!focusControl .isDisposed()) { focusControl .notifyListeners( SWT.Selection, null); } } }); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else if (numParams == 0) { // This is a no-argument selectAll method. methodToExecute.invoke(focusControl, null); focusControl.notifyListeners(SWT.Selection, null); } else if (numParams == 1) { // This is a single-point selection method. final Method textLimitAccessor = focusControl.getClass() .getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$ final Integer textLimit = (Integer) textLimitAccessor .invoke(focusControl, null); final Object[] parameters = { new Point(0, textLimit .intValue()) }; methodToExecute.invoke(focusControl, parameters); if (!(focusControl instanceof Combo)) { focusControl.notifyListeners(SWT.Selection, null); } } else { /* * This means that getMethodToExecute() has been changed, * while this method hasn't. */ throw new ExecutionException( "Too many parameters on select all", new Exception()); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { // Debugging output if (DEBUG_HANDLERS) { final StringBuffer buffer = new StringBuffer("Executing LegacyHandlerWrapper for "); //$NON-NLS-1$ if (handler == null) { buffer.append("no handler"); //$NON-NLS-1$ } else { buffer.append('\''); buffer.append(handler.getClass().getName()); buffer.append('\''); } Tracing.printTrace("HANDLERS", buffer.toString()); //$NON-NLS-1$ } try { return handler.execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String wizardId = event.getParameter(getWizardIdParameterId()); IWorkbenchWindow activeWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); if (wizardId == null) { executeHandler(event); } else { IWizardRegistry wizardRegistry = getWizardRegistry(); IWizardDescriptor wizardDescriptor = wizardRegistry .findWizard(wizardId); if (wizardDescriptor == null) { throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$ } try { IWorkbenchWizard wizard = wizardDescriptor.createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelectionToUse(event)); if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) { wizard.performFinish(); return null; } Shell parent = activeWindow.getShell(); WizardDialog dialog = new WizardDialog(parent, wizard); dialog.create(); dialog.open(); } catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(command, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final String commandId, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(commandId, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public Object executeCommandInContext(ParameterizedCommand command, Event event, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommandInContext(command, event, context); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/QuickMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { locationURI = event.getParameter("org.eclipse.ui.window.quickMenu.uri"); //$NON-NLS-1$ if (locationURI == null) { throw new ExecutionException("locatorURI must not be null"); //$NON-NLS-1$ } creator.createMenu(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { if (loadHandler()) { if (!isEnabled()) { MessageDialog.openInformation(Util.getShellToParentOn(), WorkbenchMessages.Information, WorkbenchMessages.PluginAction_disabledMessage); return null; } return handler.execute(event); } if(loadException !=null) throw new ExecutionException("Exception occured when loading the handler", loadException); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return command.executeWithChecks(trigger, getCurrentState()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final String commandId, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { final Command command = commandService.getCommand(commandId); final ExecutionEvent event = new ExecutionEvent(command, Collections.EMPTY_MAP, trigger, getCurrentState()); return command.executeWithChecks(event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommandInContext( final ParameterizedCommand command, final Event trigger, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { IHandler oldHandler = command.getCommand().getHandler(); IHandler handler = findHandler(command.getId(), context); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(context); } try { command.getCommand().setHandler(handler); return command.executeWithChecks(trigger, context); } finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/MinimizePartHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); if (page != null) { IWorkbenchPartReference partRef = page.getActivePartReference(); if (partRef != null) { page.setPartState(partRef, IStackPresentationSite.STATE_MINIMIZED); } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CyclePageHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { if (event.getCommand().getId().equals(IWorkbenchCommandConstants.NAVIGATE_NEXT_PAGE)) { gotoDirection = true; } else { gotoDirection = false; } super.execute(event); if (lrm != null) { lrm.dispose(); lrm = null; } return null; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/CloseEditorHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IEditorPart part = HandlerUtil.getActiveEditorChecked(event); window.getActivePage().closeEditor(part, true); return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbookEditorsHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow workbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (workbenchWindow == null) { // action has been disposed return null; } IWorkbenchPage page = workbenchWindow.getActivePage(); if (page != null) { WorkbenchPage wbp = (WorkbenchPage) page; EditorAreaHelper eah = wbp.getEditorPresentation(); if (eah != null) { eah.displayEditorList(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { new AboutDialog(HandlerUtil.getActiveShellChecked(event)).open(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage == null) { return null; } try { activePage.showView(viewId); } catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/ActivateEditorHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorPart part = HandlerUtil.getActiveEditor(event); if (part != null) { page.activate(part); } else { IWorkbenchPartReference ref = page.getActivePartReference(); if (ref instanceof IViewReference) { if (((WorkbenchPage) page).isFastView((IViewReference) ref)) { ((WorkbenchPage) page) .toggleFastView((IViewReference) ref); } } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchEditorsHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow workbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (workbenchWindow == null) { // action has been disposed return null; } IWorkbenchPage page = workbenchWindow.getActivePage(); if (page != null) { new WorkbenchEditorsDialog(workbenchWindow).open(); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { window = HandlerUtil.getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); IWorkbenchPart activePart= page.getActivePart(); getTriggers(); openDialog((WorkbenchPage) page, activePart); clearTriggers(); activate(page, selection); return null; }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePart(event); if (part != null) { IWorkbenchPartSite site = part.getSite(); if (site instanceof PartSite) { PartPane pane = ((PartSite) site).getPane(); pane.showPaneMenu(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String targetId = event .getParameter(IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_PARM_TARGET); if (targetId == null) { throw new ExecutionException("No targetId specified"); //$NON-NLS-1$ } final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindowChecked(event); ISourceProviderService sps = (ISourceProviderService)activeWorkbenchWindow.getService(ISourceProviderService.class); if (sps != null) { ISourceProvider sp = sps.getSourceProvider(ISources.SHOW_IN_SELECTION); if (sp instanceof WorkbenchSourceProvider) { ((WorkbenchSourceProvider)sp).checkActivePart(true); } } ShowInContext context = getContext(HandlerUtil .getShowInSelection(event), HandlerUtil.getShowInInput(event)); if (context == null) { return null; } IWorkbenchPage page= activeWorkbenchWindow.getActivePage(); try { IViewPart view = page.showView(targetId); IShowInTarget target = getShowInTarget(view); if (!(target != null && target.show(context))) { page.getWorkbenchWindow().getShell().getDisplay().beep(); } ((WorkbenchPage) page).performedShowIn(targetId); // TODO: move // back up } catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ } return null; }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { try { return execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
public Object execute(Map parameterValuesByName) throws ExecutionException { if ((action.getStyle() == IAction.AS_CHECK_BOX) || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { action.setChecked(!action.isChecked()); } try { action.runWithEvent(new Event()); } catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ } return null; }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
private void initializeSubTabSwitching() { IHandlerService service = (IHandlerService) getSite().getService(IHandlerService.class); service.activateHandler(COMMAND_NEXT_SUB_TAB, new AbstractHandler() { /** * {@inheritDoc} * @throws ExecutionException * if an exception occurred during execution */ public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() + 1; if (i >= n) i= 0; setActivePage(i); return null; } }); service.activateHandler(COMMAND_PREVIOUS_SUB_TAB, new AbstractHandler() { /** * {@inheritDoc} * @throws ExecutionException * if an exception occurred during execution */ public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() - 1; if (i < 0) i= n - 1; setActivePage(i); return null; } }); }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() + 1; if (i >= n) i= 0; setActivePage(i); return null; }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() - 1; if (i < 0) i= n - 1; setActivePage(i); return null; }
// in Eclipse UI/org/eclipse/ui/operations/RedoActionHandler.java
IStatus runCommand(IProgressMonitor pm) throws ExecutionException { return getHistory().redo(getUndoContext(), pm, this); }
// in Eclipse UI/org/eclipse/ui/operations/UndoActionHandler.java
IStatus runCommand(IProgressMonitor pm) throws ExecutionException { return getHistory().undo(getUndoContext(), pm, this); }
(Domain) WorkbenchException 20
              
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
protected void loadPredefinedPersp(PerspectiveDescriptor persp) throws WorkbenchException { // Create layout engine. IPerspectiveFactory factory = null; try { factory = persp.createFactory(); } catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } /* * IPerspectiveFactory#createFactory() can return null */ if (factory == null) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } // Create layout factory. ViewSashContainer container = new ViewSashContainer(page, getClientComposite()); layout = new PageLayout(container, getViewFactory(), editorArea, descriptor); layout.setFixed(descriptor.getFixed()); // add the placeholders for the sticky folders and their contents IPlaceholderFolderLayout stickyFolderRight = null, stickyFolderLeft = null, stickyFolderTop = null, stickyFolderBottom = null; IStickyViewDescriptor[] descs = WorkbenchPlugin.getDefault() .getViewRegistry().getStickyViews(); for (int i = 0; i < descs.length; i++) { IStickyViewDescriptor stickyViewDescriptor = descs[i]; String id = stickyViewDescriptor.getId(); switch (stickyViewDescriptor.getLocation()) { case IPageLayout.RIGHT: if (stickyFolderRight == null) { stickyFolderRight = layout .createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_RIGHT, IPageLayout.RIGHT, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderRight.addPlaceholder(id); break; case IPageLayout.LEFT: if (stickyFolderLeft == null) { stickyFolderLeft = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_LEFT, IPageLayout.LEFT, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderLeft.addPlaceholder(id); break; case IPageLayout.TOP: if (stickyFolderTop == null) { stickyFolderTop = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_TOP, IPageLayout.TOP, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderTop.addPlaceholder(id); break; case IPageLayout.BOTTOM: if (stickyFolderBottom == null) { stickyFolderBottom = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_BOTTOM, IPageLayout.BOTTOM, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderBottom.addPlaceholder(id); break; } //should never be null as we've just added the view above IViewLayout viewLayout = layout.getViewLayout(id); viewLayout.setCloseable(stickyViewDescriptor.isCloseable()); viewLayout.setMoveable(stickyViewDescriptor.isMoveable()); } // Run layout engine. factory.createInitialLayout(layout); PerspectiveExtensionReader extender = new PerspectiveExtensionReader(); extender.extendLayout(page.getExtensionTracker(), descriptor.getId(), layout); // Retrieve view layout info stored in the page layout. mapIDtoViewLayoutRec.putAll(layout.getIDtoViewLayoutRecMap()); // Create action sets. List temp = new ArrayList(); createInitialActionSets(temp, layout.getActionSets()); IContextService service = null; if (page != null) { service = (IContextService) page.getWorkbenchWindow().getService( IContextService.class); } try { if (service!=null) { service.deferUpdates(true); } for (Iterator iter = temp.iterator(); iter.hasNext();) { IActionSetDescriptor descriptor = (IActionSetDescriptor) iter .next(); addAlwaysOn(descriptor); } } finally { if (service!=null) { service.deferUpdates(false); } } newWizardShortcuts = layout.getNewWizardShortcuts(); showViewShortcuts = layout.getShowViewShortcuts(); perspectiveShortcuts = layout.getPerspectiveShortcuts(); showInPartIds = layout.getShowInPartIds(); hideMenuIDs = layout.getHiddenMenuItems(); hideToolBarIDs = layout.getHiddenToolBarItems(); // Retrieve fast views if (fastViewManager != null) { ArrayList fastViews = layout.getFastViews(); for (Iterator fvIter = fastViews.iterator(); fvIter.hasNext();) { IViewReference ref = (IViewReference) fvIter.next(); fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, !fvIter.hasNext()); } } // Is the layout fixed fixed = layout.isFixed(); // Create presentation. presentation = new PerspectiveHelper(page, container, this); // Hide editor area if requested by factory if (!layout.isEditorAreaVisible()) { hideEditorArea(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private void init(WorkbenchWindow w, String layoutID, IAdaptable input, boolean openExtras) throws WorkbenchException { // Save args. this.window = w; this.input = input; actionSets = new ActionSetManager(w); // Create presentation. createClientComposite(); editorPresentation = new EditorAreaHelper(this); editorMgr = new EditorManager(window, this, editorPresentation); // add this page as a client to be notified when the UI has re-orded perspectives // so that the order can be properly maintained in the receiver. // E.g. a UI might support drag-and-drop and will need to make this known to ensure // #saveState and #restoreState do not lose this re-ordering w.addPerspectiveReorderListener(new IReorderListener() { public void reorder(Object perspective, int newLoc) { perspList.reorder((IPerspectiveDescriptor)perspective, newLoc); } }); if (openExtras) { openPerspectiveExtras(); } // Get perspective descriptor. if (layoutID != null) { PerspectiveDescriptor desc = (PerspectiveDescriptor) WorkbenchPlugin .getDefault().getPerspectiveRegistry() .findPerspectiveWithId(layoutID); if (desc == null) { throw new WorkbenchException( NLS.bind(WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,layoutID )); } Perspective persp = findPerspective(desc); if (persp == null) { persp = createPerspective(desc, true); } perspList.setActive(persp); window.firePerspectiveActivated(this, desc); } getExtensionTracker() .registerHandler( perspectiveChangeHandler, ExtensionTracker .createExtensionPointFilter(getPerspectiveExtensionPoint())); }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithWorkbenchExceptions(StartupRunnable r) throws WorkbenchException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (WorkbenchException) throwable; } else { throw new WorkbenchException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowActionDelegate) { return (IWorkbenchWindowActionDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IEditorActionDelegate) { return (IEditorActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IEditorActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/ViewPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IViewActionDelegate) { return (IViewActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IViewActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
private void loadCustom() { Reader reader = null; /* Get the entries from the Preference store */ IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); /* Get the space-delimited list of custom perspective ids */ String customPerspectives = store .getString(IPreferenceConstants.PERSPECTIVES); String[] perspectivesList = StringConverter.asArray(customPerspectives); for (int i = 0; i < perspectivesList.length; i++) { try { String xmlString = store.getString(perspectivesList[i] + PERSP); if (xmlString != null && xmlString.length() != 0) { reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, perspectivesList[i]))); } // Restore the layout state. XMLMemento memento = XMLMemento.createReadRoot(reader); PerspectiveDescriptor newPersp = new PerspectiveDescriptor( null, null, null); newPersp.restoreState(memento); String id = newPersp.getId(); IPerspectiveDescriptor oldPersp = findPerspectiveWithId(id); if (oldPersp == null) { add(newPersp); } reader.close(); } catch (IOException e) { unableToLoadPerspective(null); } catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); } } // Get the entries from files, if any // if -data @noDefault specified the state location may not be // initialized IPath path = WorkbenchPlugin.getDefault().getDataLocation(); if (path == null) { return; } File folder = path.toFile(); if (folder.isDirectory()) { File[] fileList = folder.listFiles(); int nSize = fileList.length; for (int nX = 0; nX < nSize; nX++) { File file = fileList[nX]; if (file.getName().endsWith(EXT)) { // get the memento InputStream stream = null; try { stream = new FileInputStream(file); reader = new BufferedReader(new InputStreamReader( stream, "utf-8")); //$NON-NLS-1$ // Restore the layout state. XMLMemento memento = XMLMemento.createReadRoot(reader); PerspectiveDescriptor newPersp = new PerspectiveDescriptor( null, null, null); newPersp.restoreState(memento); IPerspectiveDescriptor oldPersp = findPerspectiveWithId(newPersp .getId()); if (oldPersp == null) { add(newPersp); } // save to the preference store saveCustomPersp(newPersp, memento); // delete the file file.delete(); reader.close(); stream.close(); } catch (IOException e) { unableToLoadPerspective(null); } catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); } } } } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IMemento getCustomPersp(String id) throws WorkbenchException, IOException { Reader reader = null; IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); String xmlString = store.getString(id + PERSP); if (xmlString != null && xmlString.length() != 0) { // defined in store reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, id))); } XMLMemento memento = XMLMemento.createReadRoot(reader); reader.close(); return memento; }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IActionDelegate) { return (IActionDelegate) obj; } throw new WorkbenchException( "Action must implement IActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchWindow openWorkbenchWindow(final String perspID, final IAdaptable input) throws WorkbenchException { // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenWorkbenchWindow(perspID, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchWindow) { return (IWorkbenchWindow) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.Abnormal_Workbench_Conditi); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open, then the // window // is given focus and the perspective is shown. The page's input is // ignored. WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } // If another window that has the workspace root as input and the // requested // perpective open and active, then the window is given focus. IAdaptable input = getDefaultPageInput(); IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { Shell shell = win.getShell(); shell.open(); if (shell.getMinimized()) { shell.setMinimized(false); } return page; } } } } } } } // Otherwise the requested perspective is opened and shown in the // specified // window or in a new window depending on the current user preference // for opening // perspectives, and that window is given focus. win = (WorkbenchWindow) window; if (win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } // Only open a new window if user preference is set and the window // has an active perspective. if (IPreferenceConstants.OPM_NEW_WINDOW == mode && persp != null) { IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); } IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } // Just throw an exception.... throw new WorkbenchException(NLS .bind(WorkbenchMessages.Workbench_showPerspectiveError, perspectiveId)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window, IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open and the // same requested // input, then the window is given focus and the perspective is shown. boolean inputSameAsWindow = false; WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { inputSameAsWindow = true; IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } } // If another window has the requested input and the requested // perpective open and active, then that window is given focus. IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { win.getShell().open(); return page; } } } } } } } // If the specified window has the same requested input but not the // requested // perspective, then the window is given focus and the perspective is // opened and shown // on condition that the user preference is not to open perspectives in // a new window. win = (WorkbenchWindow) window; if (inputSameAsWindow && win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); if (IPreferenceConstants.OPM_NEW_WINDOW != mode) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // If the specified window has no active perspective, then open the // requested perspective and show the specified window. if (win != null) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } if (persp == null) { IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // Otherwise the requested perspective is opened and shown in a new // window, and the // window is given focus. IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public IWorkbenchPage openPage(final String perspId, final IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspId); // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenPage(perspId, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchPage) { return (IWorkbenchPage) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.WorkbenchWindow_exceptionMessage); } }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginPulldown.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowPulldownDelegate) { return (IWorkbenchWindowPulldownDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowPulldownDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createReadRoot(Reader reader, String baseDir) throws WorkbenchException { String errorMessage = null; Exception exception = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); InputSource source = new InputSource(reader); if (baseDir != null) { source.setSystemId(baseDir); } parser.setErrorHandler(new ErrorHandler() { /** * @throws SAXException */ public void warning(SAXParseException exception) throws SAXException { // ignore } /** * @throws SAXException */ public void error(SAXParseException exception) throws SAXException { // ignore } public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }); Document document = parser.parse(source); NodeList list = document.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); if (node instanceof Element) { return new XMLMemento(document, (Element) node); } } } catch (ParserConfigurationException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; } catch (IOException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_ioError; } catch (SAXException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_formatError; } String problemText = null; if (exception != null) { problemText = exception.getMessage(); } if (problemText == null || problemText.length() == 0) { problemText = errorMessage != null ? errorMessage : WorkbenchMessages.XMLMemento_noElement; } throw new WorkbenchException(problemText, exception); }
1
              
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
37
              
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
private void createPresentation(PerspectiveDescriptor persp) throws WorkbenchException { if (persp.hasCustomDefinition()) { loadCustomPersp(persp); } else { loadPredefinedPersp(persp); } }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
protected void loadPredefinedPersp(PerspectiveDescriptor persp) throws WorkbenchException { // Create layout engine. IPerspectiveFactory factory = null; try { factory = persp.createFactory(); } catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } /* * IPerspectiveFactory#createFactory() can return null */ if (factory == null) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } // Create layout factory. ViewSashContainer container = new ViewSashContainer(page, getClientComposite()); layout = new PageLayout(container, getViewFactory(), editorArea, descriptor); layout.setFixed(descriptor.getFixed()); // add the placeholders for the sticky folders and their contents IPlaceholderFolderLayout stickyFolderRight = null, stickyFolderLeft = null, stickyFolderTop = null, stickyFolderBottom = null; IStickyViewDescriptor[] descs = WorkbenchPlugin.getDefault() .getViewRegistry().getStickyViews(); for (int i = 0; i < descs.length; i++) { IStickyViewDescriptor stickyViewDescriptor = descs[i]; String id = stickyViewDescriptor.getId(); switch (stickyViewDescriptor.getLocation()) { case IPageLayout.RIGHT: if (stickyFolderRight == null) { stickyFolderRight = layout .createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_RIGHT, IPageLayout.RIGHT, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderRight.addPlaceholder(id); break; case IPageLayout.LEFT: if (stickyFolderLeft == null) { stickyFolderLeft = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_LEFT, IPageLayout.LEFT, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderLeft.addPlaceholder(id); break; case IPageLayout.TOP: if (stickyFolderTop == null) { stickyFolderTop = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_TOP, IPageLayout.TOP, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderTop.addPlaceholder(id); break; case IPageLayout.BOTTOM: if (stickyFolderBottom == null) { stickyFolderBottom = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_BOTTOM, IPageLayout.BOTTOM, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderBottom.addPlaceholder(id); break; } //should never be null as we've just added the view above IViewLayout viewLayout = layout.getViewLayout(id); viewLayout.setCloseable(stickyViewDescriptor.isCloseable()); viewLayout.setMoveable(stickyViewDescriptor.isMoveable()); } // Run layout engine. factory.createInitialLayout(layout); PerspectiveExtensionReader extender = new PerspectiveExtensionReader(); extender.extendLayout(page.getExtensionTracker(), descriptor.getId(), layout); // Retrieve view layout info stored in the page layout. mapIDtoViewLayoutRec.putAll(layout.getIDtoViewLayoutRecMap()); // Create action sets. List temp = new ArrayList(); createInitialActionSets(temp, layout.getActionSets()); IContextService service = null; if (page != null) { service = (IContextService) page.getWorkbenchWindow().getService( IContextService.class); } try { if (service!=null) { service.deferUpdates(true); } for (Iterator iter = temp.iterator(); iter.hasNext();) { IActionSetDescriptor descriptor = (IActionSetDescriptor) iter .next(); addAlwaysOn(descriptor); } } finally { if (service!=null) { service.deferUpdates(false); } } newWizardShortcuts = layout.getNewWizardShortcuts(); showViewShortcuts = layout.getShowViewShortcuts(); perspectiveShortcuts = layout.getPerspectiveShortcuts(); showInPartIds = layout.getShowInPartIds(); hideMenuIDs = layout.getHiddenMenuItems(); hideToolBarIDs = layout.getHiddenToolBarItems(); // Retrieve fast views if (fastViewManager != null) { ArrayList fastViews = layout.getFastViews(); for (Iterator fvIter = fastViews.iterator(); fvIter.hasNext();) { IViewReference ref = (IViewReference) fvIter.next(); fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, !fvIter.hasNext()); } } // Is the layout fixed fixed = layout.isFixed(); // Create presentation. presentation = new PerspectiveHelper(page, container, this); // Hide editor area if requested by factory if (!layout.isEditorAreaVisible()) { hideEditorArea(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private void init(WorkbenchWindow w, String layoutID, IAdaptable input, boolean openExtras) throws WorkbenchException { // Save args. this.window = w; this.input = input; actionSets = new ActionSetManager(w); // Create presentation. createClientComposite(); editorPresentation = new EditorAreaHelper(this); editorMgr = new EditorManager(window, this, editorPresentation); // add this page as a client to be notified when the UI has re-orded perspectives // so that the order can be properly maintained in the receiver. // E.g. a UI might support drag-and-drop and will need to make this known to ensure // #saveState and #restoreState do not lose this re-ordering w.addPerspectiveReorderListener(new IReorderListener() { public void reorder(Object perspective, int newLoc) { perspList.reorder((IPerspectiveDescriptor)perspective, newLoc); } }); if (openExtras) { openPerspectiveExtras(); } // Get perspective descriptor. if (layoutID != null) { PerspectiveDescriptor desc = (PerspectiveDescriptor) WorkbenchPlugin .getDefault().getPerspectiveRegistry() .findPerspectiveWithId(layoutID); if (desc == null) { throw new WorkbenchException( NLS.bind(WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,layoutID )); } Perspective persp = findPerspective(desc); if (persp == null) { persp = createPerspective(desc, true); } perspList.setActive(persp); window.firePerspectiveActivated(this, desc); } getExtensionTracker() .registerHandler( perspectiveChangeHandler, ExtensionTracker .createExtensionPointFilter(getPerspectiveExtensionPoint())); }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithWorkbenchExceptions(StartupRunnable r) throws WorkbenchException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (WorkbenchException) throwable; } else { throw new WorkbenchException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/application/CompatibilityWorkbenchWindowAdvisor.java
public void postWindowRestore() throws WorkbenchException { wbAdvisor.postWindowRestore(getWindowConfigurer()); }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowActionDelegate) { return (IWorkbenchWindowActionDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IEditorActionDelegate) { return (IEditorActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IEditorActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Workbench3xImplementation.java
public WorkbenchPage createWorkbenchPage(WorkbenchWindow workbenchWindow, String perspID, IAdaptable input) throws WorkbenchException { return new WorkbenchPage(workbenchWindow, perspID, input); }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Workbench3xImplementation.java
public WorkbenchPage createWorkbenchPage(WorkbenchWindow workbenchWindow, IAdaptable finalInput) throws WorkbenchException { return new WorkbenchPage(workbenchWindow, finalInput); }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Workbench3xImplementation.java
public Perspective createPerspective(PerspectiveDescriptor desc, WorkbenchPage workbenchPage) throws WorkbenchException { return new Perspective(desc, workbenchPage); }
// in Eclipse UI/org/eclipse/ui/internal/ViewPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IViewActionDelegate) { return (IViewActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IViewActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public IWorkbenchWindowConfigurer restoreWorkbenchWindow(IMemento memento) throws WorkbenchException { return getWindowConfigurer(((Workbench) getWorkbench()).restoreWorkbenchWindow(memento)); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IMemento getCustomPersp(String id) throws WorkbenchException, IOException { Reader reader = null; IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); String xmlString = store.getString(id + PERSP); if (xmlString != null && xmlString.length() != 0) { // defined in store reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, id))); } XMLMemento memento = XMLMemento.createReadRoot(reader); reader.close(); return memento; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
public void readResources(Map editorTable, Reader reader) throws WorkbenchException { XMLMemento memento = XMLMemento.createReadRoot(reader); String versionString = memento.getString(IWorkbenchConstants.TAG_VERSION); boolean versionIs31 = "3.1".equals(versionString); //$NON-NLS-1$ IMemento[] extMementos = memento .getChildren(IWorkbenchConstants.TAG_INFO); for (int i = 0; i < extMementos.length; i++) { String name = extMementos[i] .getString(IWorkbenchConstants.TAG_NAME); if (name == null) { name = "*"; //$NON-NLS-1$ } String extension = extMementos[i] .getString(IWorkbenchConstants.TAG_EXTENSION); IMemento[] idMementos = extMementos[i] .getChildren(IWorkbenchConstants.TAG_EDITOR); String[] editorIDs = new String[idMementos.length]; for (int j = 0; j < idMementos.length; j++) { editorIDs[j] = idMementos[j] .getString(IWorkbenchConstants.TAG_ID); } idMementos = extMementos[i] .getChildren(IWorkbenchConstants.TAG_DELETED_EDITOR); String[] deletedEditorIDs = new String[idMementos.length]; for (int j = 0; j < idMementos.length; j++) { deletedEditorIDs[j] = idMementos[j] .getString(IWorkbenchConstants.TAG_ID); } FileEditorMapping mapping = getMappingFor(name + "." + extension); //$NON-NLS-1$ if (mapping == null) { mapping = new FileEditorMapping(name, extension); } List editors = new ArrayList(); for (int j = 0; j < editorIDs.length; j++) { if (editorIDs[j] != null) { EditorDescriptor editor = (EditorDescriptor) editorTable .get(editorIDs[j]); if (editor != null) { editors.add(editor); } } } List deletedEditors = new ArrayList(); for (int j = 0; j < deletedEditorIDs.length; j++) { if (deletedEditorIDs[j] != null) { EditorDescriptor editor = (EditorDescriptor) editorTable .get(deletedEditorIDs[j]); if (editor != null) { deletedEditors.add(editor); } } } List defaultEditors = new ArrayList(); if (versionIs31) { // parse the new format idMementos = extMementos[i] .getChildren(IWorkbenchConstants.TAG_DEFAULT_EDITOR); String[] defaultEditorIds = new String[idMementos.length]; for (int j = 0; j < idMementos.length; j++) { defaultEditorIds[j] = idMementos[j] .getString(IWorkbenchConstants.TAG_ID); } for (int j = 0; j < defaultEditorIds.length; j++) { if (defaultEditorIds[j] != null) { EditorDescriptor editor = (EditorDescriptor) editorTable .get(defaultEditorIds[j]); if (editor != null) { defaultEditors.add(editor); } } } } else { // guess at pre 3.1 format defaults if (!editors.isEmpty()) { EditorDescriptor editor = (EditorDescriptor) editors.get(0); if (editor != null) { defaultEditors.add(editor); } } defaultEditors.addAll(Arrays.asList(mapping.getDeclaredDefaultEditors())); } // Add any new editors that have already been read from the registry // which were not deleted. IEditorDescriptor[] editorsArray = mapping.getEditors(); for (int j = 0; j < editorsArray.length; j++) { if (!contains(editors, editorsArray[j]) && !deletedEditors.contains(editorsArray[j])) { editors.add(editorsArray[j]); } } // Map the editor(s) to the file type mapping.setEditorsList(editors); mapping.setDeletedEditorsList(deletedEditors); mapping.setDefaultEditors(defaultEditors); typeEditorMappings.put(mappingKeyFor(mapping), mapping); } }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IActionDelegate) { return (IActionDelegate) obj; } throw new WorkbenchException( "Action must implement IActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private IWorkbenchWindow busyOpenWorkbenchWindow(final String perspID, final IAdaptable input) throws WorkbenchException { // Create a workbench window (becomes active window) final WorkbenchWindow newWindowArray[] = new WorkbenchWindow[1]; StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() { public void runWithException() { newWindowArray[0] = newWorkbenchWindow(); } }); final WorkbenchWindow newWindow = newWindowArray[0]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { newWindow.create(); // must be created before adding to window // manager } }); windowManager.add(newWindow); final WorkbenchException [] exceptions = new WorkbenchException[1]; // Create the initial page. if (perspID != null) { StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() { public void runWithException() { try { newWindow.busyOpenPage(perspID, input); } catch (WorkbenchException e) { windowManager.remove(newWindow); exceptions[0] = e; } }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchWindow openWorkbenchWindow(IAdaptable input) throws WorkbenchException { return openWorkbenchWindow(getPerspectiveRegistry() .getDefaultPerspective(), input); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchWindow openWorkbenchWindow(final String perspID, final IAdaptable input) throws WorkbenchException { // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenWorkbenchWindow(perspID, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchWindow) { return (IWorkbenchWindow) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.Abnormal_Workbench_Conditi); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
IWorkbenchWindow restoreWorkbenchWindow(IMemento memento) throws WorkbenchException { WorkbenchWindow newWindow = newWorkbenchWindow(); newWindow.create(); windowManager.add(newWindow); // whether the window was opened boolean opened = false; try { newWindow.restoreState(memento, null); newWindow.fireWindowRestored(); newWindow.open(); opened = true; } finally { if (!opened) { newWindow.close(); } } return newWindow; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open, then the // window // is given focus and the perspective is shown. The page's input is // ignored. WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } // If another window that has the workspace root as input and the // requested // perpective open and active, then the window is given focus. IAdaptable input = getDefaultPageInput(); IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { Shell shell = win.getShell(); shell.open(); if (shell.getMinimized()) { shell.setMinimized(false); } return page; } } } } } } } // Otherwise the requested perspective is opened and shown in the // specified // window or in a new window depending on the current user preference // for opening // perspectives, and that window is given focus. win = (WorkbenchWindow) window; if (win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } // Only open a new window if user preference is set and the window // has an active perspective. if (IPreferenceConstants.OPM_NEW_WINDOW == mode && persp != null) { IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); } IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } // Just throw an exception.... throw new WorkbenchException(NLS .bind(WorkbenchMessages.Workbench_showPerspectiveError, perspectiveId)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window, IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open and the // same requested // input, then the window is given focus and the perspective is shown. boolean inputSameAsWindow = false; WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { inputSameAsWindow = true; IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } } // If another window has the requested input and the requested // perpective open and active, then that window is given focus. IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { win.getShell().open(); return page; } } } } } } } // If the specified window has the same requested input but not the // requested // perspective, then the window is given focus and the perspective is // opened and shown // on condition that the user preference is not to open perspectives in // a new window. win = (WorkbenchWindow) window; if (inputSameAsWindow && win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); if (IPreferenceConstants.OPM_NEW_WINDOW != mode) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // If the specified window has no active perspective, then open the // requested perspective and show the specified window. if (win != null) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } if (persp == null) { IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // Otherwise the requested perspective is opened and shown in a new // window, and the // window is given focus. IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
protected IWorkbenchPage busyOpenPage(String perspID, IAdaptable input) throws WorkbenchException { IWorkbenchPage newPage = null; if (pageList.isEmpty()) { newPage = ((WorkbenchImplementation) Tweaklets .get(WorkbenchImplementation.KEY)).createWorkbenchPage(this, perspID, input); pageList.add(newPage); firePageOpened(newPage); setActivePage(newPage); } else { IWorkbenchWindow window = getWorkbench().openWorkbenchWindow( perspID, input); newPage = window.getActivePage(); } return newPage; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
void fireWindowRestored() throws WorkbenchException { StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() { public void runWithException() throws Throwable { getWindowAdvisor().postWindowRestore(); } }); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public IWorkbenchPage openPage(final String perspId, final IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspId); // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenPage(perspId, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchPage) { return (IWorkbenchPage) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.WorkbenchWindow_exceptionMessage); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public IWorkbenchPage openPage(IAdaptable input) throws WorkbenchException { String perspId = getWorkbenchImpl().getPerspectiveRegistry() .getDefaultPerspective(); return openPage(perspId, input); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws WorkbenchException { newPage[0] = ((WorkbenchImplementation) Tweaklets .get(WorkbenchImplementation.KEY)).createWorkbenchPage(WorkbenchWindow.this, finalInput); }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginPulldown.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowPulldownDelegate) { return (IWorkbenchWindowPulldownDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowPulldownDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java
public void postWindowRestore() throws WorkbenchException { // do nothing }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
public void postWindowRestore(IWorkbenchWindowConfigurer configurer) throws WorkbenchException { // do nothing }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
private EditorInputData readEditorInput(DataInputStream dataIn) throws IOException, WorkbenchException { String editorId = dataIn.readUTF(); String factoryId = dataIn.readUTF(); String xmlString = dataIn.readUTF(); if (xmlString == null || xmlString.length() == 0) { return null; } StringReader reader = new StringReader(xmlString); // Restore the editor input XMLMemento memento = XMLMemento.createReadRoot(reader); IElementFactory factory = PlatformUI.getWorkbench().getElementFactory( factoryId); if (factory != null) { IAdaptable adaptable = factory.createElement(memento); if (adaptable != null && (adaptable instanceof IEditorInput)) { return new EditorInputData(editorId, (IEditorInput) adaptable); } } return null; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createReadRoot(Reader reader) throws WorkbenchException { return createReadRoot(reader, null); }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createReadRoot(Reader reader, String baseDir) throws WorkbenchException { String errorMessage = null; Exception exception = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); InputSource source = new InputSource(reader); if (baseDir != null) { source.setSystemId(baseDir); } parser.setErrorHandler(new ErrorHandler() { /** * @throws SAXException */ public void warning(SAXParseException exception) throws SAXException { // ignore } /** * @throws SAXException */ public void error(SAXParseException exception) throws SAXException { // ignore } public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }); Document document = parser.parse(source); NodeList list = document.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); if (node instanceof Element) { return new XMLMemento(document, (Element) node); } } } catch (ParserConfigurationException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; } catch (IOException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_ioError; } catch (SAXException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_formatError; } String problemText = null; if (exception != null) { problemText = exception.getMessage(); } if (problemText == null || problemText.length() == 0) { problemText = errorMessage != null ? errorMessage : WorkbenchMessages.XMLMemento_noElement; } throw new WorkbenchException(problemText, exception); }
(Lib) IllegalStateException 18
              
// in Eclipse UI/org/eclipse/ui/PlatformUI.java
public static IWorkbench getWorkbench() { if (Workbench.getInstance() == null) { // app forgot to call createAndRunWorkbench beforehand throw new IllegalStateException(WorkbenchMessages.PlatformUI_NoWorkbench); } return Workbench.getInstance(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
private void checkRemoved() { if (removed) { String message = "Preference node: " + absolutePath() + " has been removed."; //$NON-NLS-1$ //$NON-NLS-2$ throw new IllegalStateException(message); } }
// in Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
private static AbstractExpression createExpression( IConfigurationElement element) throws IllegalStateException { String tag = element.getName(); if (tag.equals(EXP_TYPE_OR)) { return new OrExpression(element); } if (tag.equals(EXP_TYPE_AND)) { return new AndExpression(element); } if (tag.equals(EXP_TYPE_NOT)) { return new NotExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_STATE)) { return new ObjectStateExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_CLASS)) { return new ObjectClassExpression(element); } if (tag.equals(EXP_TYPE_PLUG_IN_STATE)) { return new PluginStateExpression(element); } if (tag.equals(EXP_TYPE_SYSTEM_PROPERTY)) { return new SystemPropertyExpression(element); } throw new IllegalStateException( "Action expression unrecognized element: " + tag); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
public boolean isSigned() throws IllegalStateException { if (isSignedDetermined) return isSigned; BundleContext bundleContext = WorkbenchPlugin.getDefault() .getBundleContext(); ServiceReference factoryRef = bundleContext .getServiceReference(SignedContentFactory.class.getName()); if (factoryRef == null) throw new IllegalStateException(); SignedContentFactory contentFactory = (SignedContentFactory) bundleContext .getService(factoryRef); try { isSignedDetermined = true; SignedContent signedContent = contentFactory.getSignedContent(bundle); isSigned = signedContent != null && signedContent.isSigned(); } catch (IOException e) { isSigned = false; } catch (GeneralSecurityException e){ isSigned = false; } finally { bundleContext.ungetService(factoryRef); } return isSigned; }
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
private void constructElements(boolean fireEvent) { if (inElementConstruction) { String msg = NLS.bind(WorkbenchMessages.ProblemCyclicDependency, getName()); WorkbenchPlugin.log(msg); throw new IllegalStateException(msg); } inElementConstruction = true; try { Set elements = new HashSet(); IWorkingSet[] localComponents = getComponentsInternal(); for (int i = 0; i < localComponents.length; i++) { IWorkingSet workingSet = localComponents[i]; try { IAdaptable[] componentElements = workingSet.getElements(); elements.addAll(Arrays.asList(componentElements)); } catch (IllegalStateException e) { // an invalid component; remove it IWorkingSet[] tmp = new IWorkingSet[components.length - 1]; if (i > 0) System.arraycopy(components, 0, tmp, 0, i); if (components.length - i - 1 > 0) System.arraycopy(components, i + 1, tmp, i, components.length - i - 1); components = tmp; workingSetMemento = null; // toss cached info fireWorkingSetChanged(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); continue; } } internalSetElements((IAdaptable[]) elements .toArray(new IAdaptable[elements.size()])); if (fireEvent) { fireWorkingSetChanged( IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); } } finally { inElementConstruction = false; } }
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
void restoreWorkingSet() { IWorkingSetManager manager = getManager(); if (manager == null) { throw new IllegalStateException(); } IMemento[] workingSetReferences = workingSetMemento .getChildren(IWorkbenchConstants.TAG_WORKING_SET); ArrayList list = new ArrayList(workingSetReferences.length); for (int i = 0; i < workingSetReferences.length; i++) { IMemento setReference = workingSetReferences[i]; String setId = setReference.getID(); IWorkingSet set = manager.getWorkingSet(setId); if (set != null) { list.add(set); } } internalSetComponents((IWorkingSet[]) list .toArray(new IWorkingSet[list.size()])); constructElements(false); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void set(Object value) { if (value != Boolean.TRUE && value != Boolean.FALSE) throw new IllegalArgumentException(); if (value == Boolean.TRUE && ((Boolean)startupThread.get()).booleanValue()) { throw new IllegalStateException(); } super.set(value); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void started() { synchronized (this) { if (!isStarting) throw new IllegalStateException(); isStarting = false; for (Iterator i = pendingStartup.iterator(); i.hasNext();) { Runnable runnable = (Runnable) i.next(); try { //queue up all pending asyncs super.asyncExec(runnable); } catch (RuntimeException e) { // do nothing } } pendingStartup = null; // wake up all pending syncExecs this.notifyAll(); } }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
public final void internalBasicInitialize(IWorkbenchConfigurer configurer) { if (workbenchConfigurer != null) { throw new IllegalStateException(); } this.workbenchConfigurer = configurer; initialize(configurer); }
0 14
              
// in Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
private static AbstractExpression createExpression( IConfigurationElement element) throws IllegalStateException { String tag = element.getName(); if (tag.equals(EXP_TYPE_OR)) { return new OrExpression(element); } if (tag.equals(EXP_TYPE_AND)) { return new AndExpression(element); } if (tag.equals(EXP_TYPE_NOT)) { return new NotExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_STATE)) { return new ObjectStateExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_CLASS)) { return new ObjectClassExpression(element); } if (tag.equals(EXP_TYPE_PLUG_IN_STATE)) { return new PluginStateExpression(element); } if (tag.equals(EXP_TYPE_SYSTEM_PROPERTY)) { return new SystemPropertyExpression(element); } throw new IllegalStateException( "Action expression unrecognized element: " + tag); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
public void closeTray() throws IllegalStateException { if (getTray() != null) { super.closeTray(); } //preserve state during modality switch if (!getBooleanValue(IStatusDialogConstants.MODALITY_SWITCH)) { dialogState.put(IStatusDialogConstants.TRAY_OPENED, Boolean.FALSE); } if (launchTrayLink != null && !launchTrayLink.isDisposed()) { launchTrayLink.setEnabled(providesSupport() && !getBooleanValue(IStatusDialogConstants.TRAY_OPENED)); } }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
public void openTray(DialogTray tray) throws IllegalStateException, UnsupportedOperationException { if (launchTrayLink != null && !launchTrayLink.isDisposed()) { launchTrayLink.setEnabled(false); } if (providesSupport()) { super.openTray(tray); } dialogState.put(IStatusDialogConstants.TRAY_OPENED, Boolean.TRUE); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
public boolean isSigned() throws IllegalStateException { if (isSignedDetermined) return isSigned; BundleContext bundleContext = WorkbenchPlugin.getDefault() .getBundleContext(); ServiceReference factoryRef = bundleContext .getServiceReference(SignedContentFactory.class.getName()); if (factoryRef == null) throw new IllegalStateException(); SignedContentFactory contentFactory = (SignedContentFactory) bundleContext .getService(factoryRef); try { isSignedDetermined = true; SignedContent signedContent = contentFactory.getSignedContent(bundle); isSigned = signedContent != null && signedContent.isSigned(); } catch (IOException e) { isSigned = false; } catch (GeneralSecurityException e){ isSigned = false; } finally { bundleContext.ungetService(factoryRef); } return isSigned; }
(Domain) NotDefinedException 16
              
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getDescription() throws NotDefinedException { try { return scheme.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getName() throws NotDefinedException { try { return scheme.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return scheme.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getCategoryId() throws NotDefinedException { try { return command.getCategory().getId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getDescription() throws NotDefinedException { try { return command.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getName() throws NotDefinedException { try { return command.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getName() throws NotDefinedException { try { return wrappedContext.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return wrappedContext.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
8
              
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
29
              
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(command, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final String commandId, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(commandId, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public Object executeCommandInContext(ParameterizedCommand command, Event event, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommandInContext(command, event, context); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return command.executeWithChecks(trigger, getCurrentState()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final String commandId, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { final Command command = commandService.getCommand(commandId); final ExecutionEvent event = new ExecutionEvent(command, Collections.EMPTY_MAP, trigger, getCurrentState()); return command.executeWithChecks(event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommandInContext( final ParameterizedCommand command, final Event trigger, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { IHandler oldHandler = command.getCommand().getHandler(); IHandler handler = findHandler(command.getId(), context); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(context); } try { command.getCommand().setHandler(handler); return command.executeWithChecks(trigger, context); } finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getDescription() throws NotDefinedException { try { return scheme.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getName() throws NotDefinedException { try { return scheme.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return scheme.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getCategoryId() throws NotDefinedException { try { return command.getCategory().getId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getDescription() throws NotDefinedException { try { return command.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getName() throws NotDefinedException { try { return command.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public ParameterizedCommand deserialize( String serializedParameterizedCommand) throws NotDefinedException, SerializationException { return fParentService.deserialize(serializedParameterizedCommand); }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public final String getHelpContextId(final Command command) throws NotDefinedException { return fParentService.getHelpContextId(command); }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public final String getHelpContextId(final String commandId) throws NotDefinedException { return fParentService.getHelpContextId(commandId); }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final ParameterizedCommand deserialize( final String serializedParameterizedCommand) throws NotDefinedException, SerializationException { return commandManager.deserialize(serializedParameterizedCommand); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final String getHelpContextId(final Command command) throws NotDefinedException { return commandManager.getHelpContextId(command); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final String getHelpContextId(final String commandId) throws NotDefinedException { final Command command = getCommand(commandId); return commandManager.getHelpContextId(command); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getName() throws NotDefinedException { try { return wrappedContext.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return wrappedContext.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/CategorizedActivity.java
public String getName() throws NotDefinedException { return activity.getName(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/CategorizedActivity.java
public String getDescription() throws NotDefinedException { return activity.getDescription(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/CategorizedActivity.java
public boolean isDefaultEnabled() throws NotDefinedException { return activity.isDefaultEnabled(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
(Lib) CoreException 14
              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException { try { // If plugin has been loaded create extension. // Otherwise, show busy cursor then create extension. if (BundleUtility.isActivated(element.getDeclaringExtension() .getNamespace())) { return element.createExecutableExtension(classAttribute); } final Object[] ret = new Object[1]; final CoreException[] exc = new CoreException[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { ret[0] = element .createExecutableExtension(classAttribute); } catch (CoreException e) { exc[0] = e; } } }); if (exc[0] != null) { throw exc[0]; } return ret[0]; } catch (CoreException core) { throw core; } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); } }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
public IPreferencePage createPage(Object element) throws CoreException { IPreferencePage ppage = null; ppage = (IPreferencePage) WorkbenchPlugin.createExtension( pageElement, IWorkbenchRegistryConstants.ATT_CLASS); ppage.setTitle(getPageName()); Object[] elements = getObjects(element); IAdaptable[] adapt = new IAdaptable[elements.length]; for (int i = 0; i < elements.length; i++) { Object adapted = elements[i]; if (adaptable) { adapted = getAdaptedElement(adapted); if (adapted == null) { String message = "Error adapting selection to Property page " + pageId + " is being ignored"; //$NON-NLS-1$ //$NON-NLS-2$ throw new CoreException(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, message, null)); } } adapt[i] = (IAdaptable) ((adapted instanceof IAdaptable) ? adapted : new AdaptableForwarder(adapted)); } if (supportsMultiSelect) { if ((ppage instanceof IWorkbenchPropertyPageMulti)) ((IWorkbenchPropertyPageMulti) ppage).setElements(adapt); else throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Property page must implement IWorkbenchPropertyPageMulti: " + getPageName(), //$NON-NLS-1$ null)); } else ((IWorkbenchPropertyPage) ppage).setElement(adapt[0]); return ppage; }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void open() throws CoreException { Program program = this.descriptor.getProgram(); if (program == null) { openWithUserDefinedProgram(); } else { String path = ""; //$NON-NLS-1$ if (filePath != null) { path = filePath.toOSString(); if (program.execute(path)) { return; } } throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage, path), null)); } }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void openWithUserDefinedProgram() throws CoreException { // We need to determine if the command refers to a program in the plugin // install directory. Otherwise we assume the program is on the path. String programFileName = null; IConfigurationElement configurationElement = descriptor .getConfigurationElement(); // Check if we have a config element (if we don't it is an // external editor created on the resource associations page). if (configurationElement != null) { try { Bundle bundle = Platform.getBundle(configurationElement .getNamespace()); // See if the program file is in the plugin directory URL entry = bundle.getEntry(descriptor.getFileName()); if (entry != null) { // this will bring the file local if the plugin is on a server URL localName = Platform.asLocalURL(entry); File file = new File(localName.getFile()); //Check that it exists before we assert it is valid if (file.exists()) { programFileName = file.getAbsolutePath(); } } } catch (IOException e) { // Program file is not in the plugin directory } } if (programFileName == null) { // Program file is not in the plugin directory therefore // assume it is on the path programFileName = descriptor.getFileName(); } // Get the full path of the file to open if (filePath == null) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), null)); } String path = filePath.toOSString(); // Open the file // ShellCommand was removed in response to PR 23888. If an exception was // thrown, it was not caught in time, and no feedback was given to user try { if (Util.isMac()) { Runtime.getRuntime().exec( new String[] { "open", "-a", programFileName, path }); //$NON-NLS-1$ //$NON-NLS-2$ } else { Runtime.getRuntime().exec( new String[] { programFileName, path }); } } catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); } }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
private void loadFromExtension() throws CoreException { id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); String category = configElement.getAttribute(IWorkbenchRegistryConstants.TAG_CATEGORY); // Sanity check. if ((configElement.getAttribute(IWorkbenchRegistryConstants.ATT_NAME) == null) || (RegistryReader.getClassValue(configElement, IWorkbenchRegistryConstants.ATT_CLASS) == null)) { throw new CoreException(new Status(IStatus.ERROR, configElement .getNamespace(), 0, "Invalid extension (missing label or class name): " + id, //$NON-NLS-1$ null)); } if (category != null) { StringTokenizer stok = new StringTokenizer(category, "/"); //$NON-NLS-1$ categoryPath = new String[stok.countTokens()]; // Parse the path tokens and store them for (int i = 0; stok.hasMoreTokens(); i++) { categoryPath[i] = stok.nextToken(); } } String ratio = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_FAST_VIEW_WIDTH_RATIO); if (ratio != null) { try { fastViewWidthRatio = new Float(ratio).floatValue(); if (fastViewWidthRatio > IPageLayout.RATIO_MAX) { fastViewWidthRatio = IPageLayout.RATIO_MAX; } if (fastViewWidthRatio < IPageLayout.RATIO_MIN) { fastViewWidthRatio = IPageLayout.RATIO_MIN; } } catch (NumberFormatException e) { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } } else { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public Object create() throws CoreException { if (APPEARANCE_PREFERENCE_PAGE.equals(id)) { return configure(new ViewsPreferencePage()); } if (COLORS_AND_FONTS_PREFERENCE_PAGE.equals(id)) { return configure(new ColorsAndFontsPreferencePage()); } if (DECORATORS_PREFERENCE_PAGE.equals(id)) { return configure(new DecoratorsPreferencePage()); } if (EDITORS_PREFERENCE_PAGE.equals(id)) { return configure(new EditorsPreferencePage()); } if (FILE_ASSOCIATIONS_PREFERENCE_PAGE.equals(id)) { return configure(new FileEditorsPreferencePage()); } if (KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new KeysPreferencePage()); } if (NEW_KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new NewKeysPreferencePage()); } if (PERSPECTIVES_PREFERENCE_PAGE.equals(id)) { return configure(new PerspectivesPreferencePage()); } if (PREFERENCES_EXPORT_WIZARD.equals(id)) { return configure(new PreferencesExportWizard()); } if (PREFERENCES_IMPORT_WIZARD.equals(id)) { return configure(new PreferencesImportWizard()); } if (PROGRESS_VIEW.equals(id)) { return configure(new ProgressView()); } if (WORKBENCH_PREFERENCE_PAGE.equals(id)) { return configure(new WorkbenchPreferencePage()); } if (CONTENT_TYPES_PREFERENCE_PAGE.equals(id)) { return configure(new ContentTypesPreferencePage()); } if (SHOW_IN_CONTRIBUTION.equals(id)) { ShowInMenu showInMenu = new ShowInMenu(); return showInMenu; } throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Unknown id in data argument for " + getClass(), null)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof String) { id = (String) data; } else { throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Data argument must be a String for " + getClass(), null)); //$NON-NLS-1$ } this.config = config; this.propertyName = propertyName; }
2
              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
66
              
// in Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceTransferElement.java
public IPreferenceFilter getFilter() throws CoreException { if (filter == null) { IConfigurationElement[] mappingConfigurations = PreferenceTransferRegistryReader .getMappings(configurationElement); int size = mappingConfigurations.length; Set scopes = new HashSet(size); Map mappingsMap = new HashMap(size); for (int i = 0; i < size; i++) { String scope = PreferenceTransferRegistryReader .getScope(mappingConfigurations[i]); scopes.add(scope); Map mappings; if (!mappingsMap.containsKey(scope)) { mappings = new HashMap(size); mappingsMap.put(scope, mappings); } else { mappings = (Map) mappingsMap.get(scope); if (mappings == null) { continue; } } Map entries = PreferenceTransferRegistryReader .getEntry(mappingConfigurations[i]); if (entries == null) { mappingsMap.put(scope, null); } else { mappings.putAll(entries); } } filter = new PreferenceFilter((String[]) scopes .toArray(new String[scopes.size()]), mappingsMap); } return filter; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException { try { // If plugin has been loaded create extension. // Otherwise, show busy cursor then create extension. if (BundleUtility.isActivated(element.getDeclaringExtension() .getNamespace())) { return element.createExecutableExtension(classAttribute); } final Object[] ret = new Object[1]; final CoreException[] exc = new CoreException[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { ret[0] = element .createExecutableExtension(classAttribute); } catch (CoreException e) { exc[0] = e; } } }); if (exc[0] != null) { throw exc[0]; } return ret[0]; } catch (CoreException core) { throw core; } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); } }
// in Eclipse UI/org/eclipse/ui/internal/ShowPartPaneMenuHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_PART_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/ShowPartPaneMenuHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/CloseAllHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_EDITOR_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/CloseAllHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/CloseOthersHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorReference[] refArray = page .getEditorReferences(); if (refArray != null && refArray.length > 1) { return EvaluationResult.TRUE; } } } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info .addVariableNameAccess(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/CloseOthersHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorReference[] refArray = page .getEditorReferences(); if (refArray != null && refArray.length > 1) { return EvaluationResult.TRUE; } } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ExecutableExtensionHandler.java
public void setInitializationData(final IConfigurationElement config, final String propertyName, final Object data) throws CoreException { // Do nothing, by default }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
private boolean eval(IEvaluationContext context, IHandlerActivation activation) throws CoreException { Expression expression = activation.getExpression(); if (expression == null) { return true; } return expression.evaluate(context) == EvaluationResult.TRUE; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
private void updateWizardSelection(IWizardDescriptor selectedObject) { selectedElement = selectedObject; WorkbenchWizardNode selectedNode; if (selectedWizards.containsKey(selectedObject)) { selectedNode = (WorkbenchWizardNode) selectedWizards .get(selectedObject); } else { selectedNode = new WorkbenchWizardNode(page, selectedObject) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; selectedWizards.put(selectedObject, selectedNode); } page.setCanFinishEarly(selectedObject.canFinishEarly()); page.setHasPages(selectedObject.hasPages()); page.selectWizardNode(selectedNode); updateDescription(selectedObject); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ExportWizard.java
protected IWizardNode createWizardNode(WorkbenchWizardElement element) { return new WorkbenchWizardNode(this, element) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ExportWizard.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportExportPage.java
private IWizardNode createWizardNode(IWizardDescriptor element) { return new WorkbenchWizardNode(this, element) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportExportPage.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportWizard.java
public IWizardNode createWizardNode(WorkbenchWizardElement element) { return new WorkbenchWizardNode(this, element) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportWizard.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
public IPreferencePage createPage(Object element) throws CoreException { IPreferencePage ppage = null; ppage = (IPreferencePage) WorkbenchPlugin.createExtension( pageElement, IWorkbenchRegistryConstants.ATT_CLASS); ppage.setTitle(getPageName()); Object[] elements = getObjects(element); IAdaptable[] adapt = new IAdaptable[elements.length]; for (int i = 0; i < elements.length; i++) { Object adapted = elements[i]; if (adaptable) { adapted = getAdaptedElement(adapted); if (adapted == null) { String message = "Error adapting selection to Property page " + pageId + " is being ignored"; //$NON-NLS-1$ //$NON-NLS-2$ throw new CoreException(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, message, null)); } } adapt[i] = (IAdaptable) ((adapted instanceof IAdaptable) ? adapted : new AdaptableForwarder(adapted)); } if (supportsMultiSelect) { if ((ppage instanceof IWorkbenchPropertyPageMulti)) ((IWorkbenchPropertyPageMulti) ppage).setElements(adapt); else throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Property page must implement IWorkbenchPropertyPageMulti: " + getPageName(), //$NON-NLS-1$ null)); } else ((IWorkbenchPropertyPage) ppage).setElement(adapt[0]); return ppage; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardElement.java
public Object createExecutableExtension() throws CoreException { return WorkbenchPlugin.createExtension(configurationElement, IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardElement.java
public IWorkbenchWizard createWizard() throws CoreException { return (IWorkbenchWizard) createExecutableExtension(); }
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object s = context.getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (s == null || s == IEvaluationContext.UNDEFINED_VARIABLE) { return EvaluationResult.FALSE; } if (adapt) { int status = Platform.getAdapterManager().queryAdapter(s, objectClass); switch (status) { case IAdapterManager.LOADED: return EvaluationResult.TRUE; case IAdapterManager.NOT_LOADED: return EvaluationResult.NOT_LOADED; default: break; } } else { if (objectClass.equals(s.getClass().getName())) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
public IIntroPart createIntro() throws CoreException { return (IIntroPart) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
public IntroContentDetector getIntroContentDetector() throws CoreException { if (element.getAttribute(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR) == null) { return null; } return (IntroContentDetector) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusHandlerDescriptor.java
public synchronized AbstractStatusHandler getStatusHandler() throws CoreException { if (cachedInstance == null) { AbstractStatusHandler statusHandler = (AbstractStatusHandler) configElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); statusHandler.setId(configElement .getAttribute(IWorkbenchRegistryConstants.ATT_ID)); IConfigurationElement parameters[] = configElement .getChildren(IWorkbenchRegistryConstants.TAG_PARAMETER); Map params = new HashMap(); for (int i = 0; i < parameters.length; i++) { params .put( parameters[i] .getAttribute(IWorkbenchRegistryConstants.ATT_NAME), parameters[i] .getAttribute(IWorkbenchRegistryConstants.ATT_VALUE)); } statusHandler.setParams(params); cachedInstance = statusHandler; } return cachedInstance; }
// in Eclipse UI/org/eclipse/ui/internal/CloseEditorHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_EDITOR_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/CloseEditorHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void open() throws CoreException { Program program = this.descriptor.getProgram(); if (program == null) { openWithUserDefinedProgram(); } else { String path = ""; //$NON-NLS-1$ if (filePath != null) { path = filePath.toOSString(); if (program.execute(path)) { return; } } throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage, path), null)); } }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void openWithUserDefinedProgram() throws CoreException { // We need to determine if the command refers to a program in the plugin // install directory. Otherwise we assume the program is on the path. String programFileName = null; IConfigurationElement configurationElement = descriptor .getConfigurationElement(); // Check if we have a config element (if we don't it is an // external editor created on the resource associations page). if (configurationElement != null) { try { Bundle bundle = Platform.getBundle(configurationElement .getNamespace()); // See if the program file is in the plugin directory URL entry = bundle.getEntry(descriptor.getFileName()); if (entry != null) { // this will bring the file local if the plugin is on a server URL localName = Platform.asLocalURL(entry); File file = new File(localName.getFile()); //Check that it exists before we assert it is valid if (file.exists()) { programFileName = file.getAbsolutePath(); } } } catch (IOException e) { // Program file is not in the plugin directory } } if (programFileName == null) { // Program file is not in the plugin directory therefore // assume it is on the path programFileName = descriptor.getFileName(); } // Get the full path of the file to open if (filePath == null) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), null)); } String path = filePath.toOSString(); // Open the file // ShellCommand was removed in response to PR 23888. If an exception was // thrown, it was not caught in time, and no feedback was given to user try { if (Util.isMac()) { Runtime.getRuntime().exec( new String[] { "open", "-a", programFileName, path }); //$NON-NLS-1$ //$NON-NLS-2$ } else { Runtime.getRuntime().exec( new String[] { programFileName, path }); } } catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorDescriptor.java
public ITriggerPointAdvisor createAdvisor() throws CoreException { return (ITriggerPointAdvisor) element .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
IIntroPart createNewIntroPart() throws CoreException { IntroDescriptor introDescriptor = workbench.getIntroDescriptor(); introPart = introDescriptor == null ? null : introDescriptor.createIntro(); if (introPart != null) { workbench.getExtensionTracker().registerObject( introDescriptor.getConfigurationElement() .getDeclaringExtension(), introPart, IExtensionTracker.REF_WEAK); } return introPart; }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
private Object getExecutableExtension(IConfigurationElement element) throws CoreException { String classname = element.getAttribute(IWorkbenchConstants.TAG_CLASS); // if class attribute is absent then try to use the compatibility // bundle to return the plugin object if (classname == null || classname.length() <= 0) { return getPluginForCompatibility(); } // otherwise the 3.0 runtime should be able to do it return WorkbenchPlugin.createExtension(element, IWorkbenchConstants.TAG_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveDescriptor.java
public IPerspectiveFactory createFactory() throws CoreException { // if there is an originalId, then use that descriptor instead if (originalId != null) { // Get the original descriptor to create the factory. If the // original is gone then nothing can be done. IPerspectiveDescriptor target = ((PerspectiveRegistry) WorkbenchPlugin .getDefault().getPerspectiveRegistry()) .findPerspectiveWithId(originalId); return target == null ? null : ((PerspectiveDescriptor) target) .createFactory(); } // otherwise try to create the executable extension if (configElement != null) { try { return (IPerspectiveFactory) configElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); } catch (CoreException e) { // do nothing } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
public IViewPart createView() throws CoreException { Object extension = WorkbenchPlugin.createExtension( getConfigurationElement(), IWorkbenchRegistryConstants.ATT_CLASS); return ((InterceptContributions) Tweaklets .get(InterceptContributions.KEY)).tweakView(extension); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
private void loadFromExtension() throws CoreException { id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); String category = configElement.getAttribute(IWorkbenchRegistryConstants.TAG_CATEGORY); // Sanity check. if ((configElement.getAttribute(IWorkbenchRegistryConstants.ATT_NAME) == null) || (RegistryReader.getClassValue(configElement, IWorkbenchRegistryConstants.ATT_CLASS) == null)) { throw new CoreException(new Status(IStatus.ERROR, configElement .getNamespace(), 0, "Invalid extension (missing label or class name): " + id, //$NON-NLS-1$ null)); } if (category != null) { StringTokenizer stok = new StringTokenizer(category, "/"); //$NON-NLS-1$ categoryPath = new String[stok.countTokens()]; // Parse the path tokens and store them for (int i = 0; stok.hasMoreTokens(); i++) { categoryPath[i] = stok.nextToken(); } } String ratio = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_FAST_VIEW_WIDTH_RATIO); if (ratio != null) { try { fastViewWidthRatio = new Float(ratio).floatValue(); if (fastViewWidthRatio > IPageLayout.RATIO_MAX) { fastViewWidthRatio = IPageLayout.RATIO_MAX; } if (fastViewWidthRatio < IPageLayout.RATIO_MIN) { fastViewWidthRatio = IPageLayout.RATIO_MIN; } } catch (NumberFormatException e) { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } } else { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
public IEditorPart createEditor() throws CoreException { Object extension = WorkbenchPlugin.createExtension(getConfigurationElement(), IWorkbenchRegistryConstants.ATT_CLASS); return ((InterceptContributions)Tweaklets.get(InterceptContributions.KEY)).tweakEditor(extension); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ActionSetDescriptor.java
public IActionSet createActionSet() throws CoreException { return new PluginActionSet(this); }
// in Eclipse UI/org/eclipse/ui/internal/ActivateEditorHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { if (window.getActivePage() != null) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info .addVariableNameAccess(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/ActivateEditorHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { if (window.getActivePage() != null) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/AndExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { return evaluateAnd(context); }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyActionSetExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } // Check the action sets. final Object variable = context .getVariable(ISources.ACTIVE_ACTION_SETS_NAME); if (variable instanceof IActionSetDescriptor[]) { final IActionSetDescriptor[] descriptors = (IActionSetDescriptor[]) variable; for (int i = 0; i < descriptors.length; i++) { final IActionSetDescriptor descriptor = descriptors[i]; final String currentId = descriptor.getId(); if (actionSetId.equals(currentId)) { return EvaluationResult.TRUE; } } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/WorkbenchWindowExpression.java
public EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { if (window != null) { Object value = context .getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); if (window.equals(value)) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacySelectionEnablerWrapper.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object defaultVariable = context .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); if (defaultVariable instanceof ISelection) { final ISelection selection = (ISelection) defaultVariable; if (enabler.isEnabledForSelection(selection)) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyActionExpressionWrapper.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object defaultVariable = context .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); if (defaultVariable instanceof IStructuredSelection) { final IStructuredSelection selection = (IStructuredSelection) defaultVariable; if (expression.isEnabledFor(selection)) { return EvaluationResult.TRUE; } } else if (expression.isEnabledFor(defaultVariable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyViewContributionExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object variable = context .getVariable(ISources.ACTIVE_PART_ID_NAME); if (equals(activePartId, variable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyViewerContributionExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object value = context.getVariable(ISources.ACTIVE_MENU_NAME); if (value instanceof String) { final String menuId = (String) value; if (targetId.equals(menuId)) { if (expression == null) { return EvaluationResult.TRUE; } return expression.evaluate(context); } } else if (value instanceof Collection) { final Collection menuIds = (Collection) value; if (menuIds.contains(targetId)) { if (expression == null) { return EvaluationResult.TRUE; } return expression.evaluate(context); } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/CompositeExpression.java
protected EvaluationResult evaluateAnd(IEvaluationContext scope) throws CoreException { if (fExpressions == null) { return EvaluationResult.TRUE; } EvaluationResult result = EvaluationResult.TRUE; for (Iterator iter = fExpressions.iterator(); iter.hasNext();) { Expression expression = (Expression) iter.next(); result = result.and(expression.evaluate(scope)); // keep iterating even if we have a not loaded found. It can be // that we find a false which will result in a better result. if (result == EvaluationResult.FALSE) { return result; } } return result; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/CompositeExpression.java
protected EvaluationResult evaluateOr(IEvaluationContext scope) throws CoreException { if (fExpressions == null) { return EvaluationResult.TRUE; } EvaluationResult result = EvaluationResult.FALSE; for (Iterator iter = fExpressions.iterator(); iter.hasNext();) { Expression expression = (Expression) iter.next(); result = result.or(expression.evaluate(scope)); if (result == EvaluationResult.TRUE) { return result; } } return result; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorContributionExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object variable = context .getVariable(ISources.ACTIVE_PART_ID_NAME); if (equals(activeEditorId, variable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { gotoDirection = "true".equals(data); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/themes/ThemeElementCategory.java
public IThemePreview createPreview() throws CoreException { String classString = element.getAttribute(IWorkbenchRegistryConstants.ATT_CLASS); if (classString == null || "".equals(classString)) { //$NON-NLS-1$ return null; } return (IThemePreview) WorkbenchPlugin.createExtension(element, IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
private IThemePreview getThemePreview(ThemeElementCategory category) throws CoreException { IThemePreview preview = category.createPreview(); if (preview != null) return preview; if (category.getParentId() != null) { int idx = Arrays.binarySearch(themeRegistry.getCategories(), category.getParentId(), IThemeRegistry.ID_COMPARATOR); if (idx >= 0) return getThemePreview(themeRegistry.getCategories()[idx]); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/themes/RGBContrastFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof Hashtable) { Hashtable table = (Hashtable) data; fg = (String) table.get("foreground"); //$NON-NLS-1$ bg1 = (String) table.get("background1"); //$NON-NLS-1$ bg2 = (String) table.get("background2"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
protected ILabelDecorator internalGetDecorator() throws CoreException { if (labelProviderCreationFailed) { return null; } final CoreException[] exceptions = new CoreException[1]; if (decorator == null) { Platform .run(new SafeRunnable( NLS.bind(WorkbenchMessages.DecoratorManager_ErrorActivatingDecorator, getName() )) { public void run() { try { decorator = (ILabelDecorator) WorkbenchPlugin .createExtension( definingElement, DecoratorDefinition.ATT_CLASS); decorator.addListener(WorkbenchPlugin .getDefault().getDecoratorManager()); } catch (CoreException exception) { exceptions[0] = exception; } } }); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
protected IBaseLabelProvider internalGetLabelProvider() throws CoreException { return internalGetDecorator(); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
protected ILightweightLabelDecorator internalGetDecorator() throws CoreException { if (labelProviderCreationFailed) { return null; } final CoreException[] exceptions = new CoreException[1]; if (decorator == null) { if (isDeclarative()) { decorator = new DeclarativeDecorator(definingElement, getIconLocation()); } else { Platform.run(new ISafeRunnable() { public void run() { try { decorator = (ILightweightLabelDecorator) WorkbenchPlugin .createExtension(definingElement, DecoratorDefinition.ATT_CLASS); decorator.addListener(WorkbenchPlugin.getDefault() .getDecoratorManager()); } catch (CoreException exception) { exceptions[0] = exception; } } /* * (non-Javadoc) Method declared on ISafeRunnable. */ public void handleException(Throwable e) { // Do nothing as Core will handle the logging } }); } }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
protected IBaseLabelProvider internalGetLabelProvider() throws CoreException { return internalGetDecorator(); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenuHandler.java
protected Expression getEnabledWhenExpression() { // TODO Auto-generated method stub if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { PartPane pane = ((PartSite) part.getSite()).getPane(); if ((pane instanceof ViewPane) && ((ViewPane) pane).hasViewMenu()) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_PART_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenuHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { PartPane pane = ((PartSite) part.getSite()).getPane(); if ((pane instanceof ViewPane) && ((ViewPane) pane).hasViewMenu()) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
private void internalRun(GranualProgressMonitor monitor) throws CoreException { try { if (monitor.isCanceled()) return; this.itemsFilter = filter; if (filter.getPattern().length() != 0) { filterContent(monitor); } if (monitor.isCanceled()) return; contentProvider.refresh(); } finally { monitor.done(); } }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
protected void filterContent(GranualProgressMonitor monitor) throws CoreException { if (lastCompletedFilter != null && lastCompletedFilter.isSubFilter(this.itemsFilter)) { int length = lastCompletedResult.size() / 500; monitor .beginTask( WorkbenchMessages.FilteredItemsSelectionDialog_cacheSearchJob_taskName, length); for (int pos = 0; pos < lastCompletedResult.size(); pos++) { Object item = lastCompletedResult.get(pos); if (monitor.isCanceled()) break; contentProvider.add(item, itemsFilter); if ((pos % 500) == 0) { monitor.worked(1); } } } else { lastCompletedFilter = null; lastCompletedResult = null; SubProgressMonitor subMonitor = null; if (monitor != null) { monitor .beginTask( WorkbenchMessages.FilteredItemsSelectionDialog_searchJob_taskName, 100); subMonitor = new SubProgressMonitor(monitor, 95); } fillContentProvider(contentProvider, itemsFilter, subMonitor); if (monitor != null && !monitor.isCanceled()) { monitor.worked(2); contentProvider.rememberResult(itemsFilter); monitor.worked(3); } } }
// in Eclipse UI/org/eclipse/ui/menus/ExtensionContributionFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { locationURI = config .getAttribute(IWorkbenchRegistryConstants.TAG_LOCATION_URI); namespace = config.getNamespaceIdentifier(); }
// in Eclipse UI/org/eclipse/ui/Saveable.java
public IJobRunnable doSave(IProgressMonitor monitor, IShellProvider shellProvider) throws CoreException { doSave(monitor); return null; }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public void startup() throws CoreException { // this method no longer does anything // the code that used to be here in 2.1 has moved to start(BundleContext) super.startup(); }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public void shutdown() throws CoreException { // this method no longer does anything interesting // the code that used to be here in 2.1 has moved to stop(BundleContext), // which is called regardless of whether the plug-in being instantiated // requires org.eclipse.core.runtime.compatibility super.shutdown(); }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
private Object configure(Object obj) throws CoreException { if (obj instanceof IExecutableExtension) { ((IExecutableExtension) obj).setInitializationData(config, propertyName, null); } return obj; }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public Object create() throws CoreException { if (APPEARANCE_PREFERENCE_PAGE.equals(id)) { return configure(new ViewsPreferencePage()); } if (COLORS_AND_FONTS_PREFERENCE_PAGE.equals(id)) { return configure(new ColorsAndFontsPreferencePage()); } if (DECORATORS_PREFERENCE_PAGE.equals(id)) { return configure(new DecoratorsPreferencePage()); } if (EDITORS_PREFERENCE_PAGE.equals(id)) { return configure(new EditorsPreferencePage()); } if (FILE_ASSOCIATIONS_PREFERENCE_PAGE.equals(id)) { return configure(new FileEditorsPreferencePage()); } if (KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new KeysPreferencePage()); } if (NEW_KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new NewKeysPreferencePage()); } if (PERSPECTIVES_PREFERENCE_PAGE.equals(id)) { return configure(new PerspectivesPreferencePage()); } if (PREFERENCES_EXPORT_WIZARD.equals(id)) { return configure(new PreferencesExportWizard()); } if (PREFERENCES_IMPORT_WIZARD.equals(id)) { return configure(new PreferencesImportWizard()); } if (PROGRESS_VIEW.equals(id)) { return configure(new ProgressView()); } if (WORKBENCH_PREFERENCE_PAGE.equals(id)) { return configure(new WorkbenchPreferencePage()); } if (CONTENT_TYPES_PREFERENCE_PAGE.equals(id)) { return configure(new ContentTypesPreferencePage()); } if (SHOW_IN_CONTRIBUTION.equals(id)) { ShowInMenu showInMenu = new ShowInMenu(); return showInMenu; } throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Unknown id in data argument for " + getClass(), null)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof String) { id = (String) data; } else { throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Data argument must be a String for " + getClass(), null)); //$NON-NLS-1$ } this.config = config; this.propertyName = propertyName; }
// in Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java
protected static IDropActionDelegate getPluginAdapter( PluginTransferData data) throws CoreException { IExtensionRegistry registry = Platform.getExtensionRegistry(); String adapterName = data.getExtensionId(); IExtensionPoint xpt = registry.getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_DROP_ACTIONS); IExtension[] extensions = xpt.getExtensions(); for (int i = 0; i < extensions.length; i++) { IConfigurationElement[] configs = extensions[i].getConfigurationElements(); if (configs != null && configs.length > 0) { for (int j=0; j < configs.length; j++) { String id = configs[j].getAttribute("id");//$NON-NLS-1$ if (id != null && id.equals(adapterName)) { return (IDropActionDelegate) WorkbenchPlugin .createExtension(configs[j], ATT_CLASS); } } } } return null; }
// in Eclipse UI/org/eclipse/ui/themes/RGBBlendColorFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof Hashtable) { Hashtable table = (Hashtable) data; color1 = (String) table.get("color1"); //$NON-NLS-1$ color2 = (String) table.get("color2"); //$NON-NLS-1$ } }
(Lib) UnsupportedOperationException 13
              
// in Eclipse UI/org/eclipse/ui/internal/preferences/ThemeAdapter.java
public void setValue(String propertyId, Object newValue) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java
public Set keySet() { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/ThemeManagerAdapter.java
public void setValue(String propertyId, Object newValue) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PopupMenuExtender.java
public void addSelectionChangedListener( ISelectionChangedListener listener) { throw new UnsupportedOperationException( "This ISelectionProvider is static, and cannot be modified."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PopupMenuExtender.java
public void removeSelectionChangedListener( ISelectionChangedListener listener) { throw new UnsupportedOperationException( "This ISelectionProvider is static, and cannot be modified."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PopupMenuExtender.java
public void setSelection(ISelection selection) { throw new UnsupportedOperationException( "This ISelectionProvider is static, and cannot be modified."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(Composite parent) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(CoolBar parent, int index) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(Menu parent, int index) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(ToolBar parent, int index) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/databinding/WorkbenchProperties.java
protected void doSetValue(Object source, Object value) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/databinding/WorkbenchProperties.java
protected void doSetValue(Object source, Object value) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/databinding/WorkbenchProperties.java
protected void doSetList(Object source, List list, ListDiff diff) { throw new UnsupportedOperationException(); }
0 1
              
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
public void openTray(DialogTray tray) throws IllegalStateException, UnsupportedOperationException { if (launchTrayLink != null && !launchTrayLink.isDisposed()) { launchTrayLink.setEnabled(false); } if (providesSupport()) { super.openTray(tray); } dialogState.put(IStatusDialogConstants.TRAY_OPENED, Boolean.TRUE); }
(Lib) Error 12
              
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else { methodToExecute.invoke(focusControl, null); } } catch (IllegalAccessException e) { // The method is protected, so do nothing. } catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected Method getMethodToExecute() { Display display = Display.getCurrent(); if (display == null) return null; final Control focusControl = display.getFocusControl(); Method method = null; if (focusControl != null) { final Class clazz = focusControl.getClass(); try { method = clazz.getMethod(methodName, NO_PARAMETERS); } catch (NoSuchMethodException e) { // Fall through... } } if ((method == null) && (focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * We couldn't find the appropriate method on the current focus * control. It is possible that the current focus control is an * embedded SWT composite, which could be containing some Swing * components. If this is the case, then we should try to pass * through to the underlying Swing component hierarchy. Insha'allah, * this will work. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { final Class clazz = focusComponent.getClass(); try { method = clazz.getMethod(methodName, NO_PARAMETERS); } catch (NoSuchMethodException e) { // Do nothing. } } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } return method; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); final int numParams = methodToExecute.getParameterTypes().length; if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { // we only support selectAll for swing components if (numParams != 0) { return null; } /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); // and back to the UI thread :-) focusControl.getDisplay().asyncExec( new Runnable() { public void run() { if (!focusControl .isDisposed()) { focusControl .notifyListeners( SWT.Selection, null); } } }); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else if (numParams == 0) { // This is a no-argument selectAll method. methodToExecute.invoke(focusControl, null); focusControl.notifyListeners(SWT.Selection, null); } else if (numParams == 1) { // This is a single-point selection method. final Method textLimitAccessor = focusControl.getClass() .getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$ final Integer textLimit = (Integer) textLimitAccessor .invoke(focusControl, null); final Object[] parameters = { new Point(0, textLimit .intValue()) }; methodToExecute.invoke(focusControl, parameters); if (!(focusControl instanceof Combo)) { focusControl.notifyListeners(SWT.Selection, null); } } else { /* * This means that getMethodToExecute() has been changed, * while this method hasn't. */ throw new ExecutionException( "Too many parameters on select all", new Exception()); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
public final void setVisible(final boolean visible) { if (visible == true) { Map contextsByName = new HashMap(); for (Iterator iterator = contextService.getDefinedContextIds() .iterator(); iterator.hasNext();) { Context context = contextService.getContext((String) iterator .next()); try { String name = context.getName(); Collection contexts = (Collection) contextsByName.get(name); if (contexts == null) { contexts = new HashSet(); contextsByName.put(name, contexts); } contexts.add(context); } catch (final NotDefinedException e) { // Do nothing. } } Map commandsByName = new HashMap(); for (Iterator iterator = commandService.getDefinedCommandIds() .iterator(); iterator.hasNext();) { Command command = commandService.getCommand((String) iterator .next()); if (!isActive(command)) { continue; } try { String name = command.getName(); Collection commands = (Collection) commandsByName.get(name); if (commands == null) { commands = new HashSet(); commandsByName.put(name, commands); } commands.add(command); } catch (NotDefinedException eNotDefined) { // Do nothing } } // moved here to allow us to remove any empty categories commandIdsByCategoryId = new HashMap(); for (Iterator iterator = commandService.getDefinedCommandIds() .iterator(); iterator.hasNext();) { final Command command = commandService .getCommand((String) iterator.next()); if (!isActive(command)) { continue; } try { String categoryId = command.getCategory().getId(); Collection commandIds = (Collection) commandIdsByCategoryId .get(categoryId); if (commandIds == null) { commandIds = new HashSet(); commandIdsByCategoryId.put(categoryId, commandIds); } commandIds.add(command.getId()); } catch (NotDefinedException eNotDefined) { // Do nothing } } Map categoriesByName = new HashMap(); for (Iterator iterator = commandService.getDefinedCategoryIds() .iterator(); iterator.hasNext();) { Category category = commandService .getCategory((String) iterator.next()); try { if (commandIdsByCategoryId.containsKey(category.getId())) { String name = category.getName(); Collection categories = (Collection) categoriesByName .get(name); if (categories == null) { categories = new HashSet(); categoriesByName.put(name, categories); } categories.add(category); } } catch (NotDefinedException eNotDefined) { // Do nothing } } Map schemesByName = new HashMap(); final Scheme[] definedSchemes = bindingService.getDefinedSchemes(); for (int i = 0; i < definedSchemes.length; i++) { final Scheme scheme = definedSchemes[i]; try { String name = scheme.getName(); Collection schemes = (Collection) schemesByName.get(name); if (schemes == null) { schemes = new HashSet(); schemesByName.put(name, schemes); } schemes.add(scheme); } catch (final NotDefinedException e) { // Do nothing. } } contextIdsByUniqueName = new HashMap(); contextUniqueNamesById = new HashMap(); for (Iterator iterator = contextsByName.entrySet().iterator(); iterator .hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); Set contexts = (Set) entry.getValue(); Iterator iterator2 = contexts.iterator(); if (contexts.size() == 1) { Context context = (Context) iterator2.next(); contextIdsByUniqueName.put(name, context.getId()); contextUniqueNamesById.put(context.getId(), name); } else { while (iterator2.hasNext()) { Context context = (Context) iterator2.next(); String uniqueName = MessageFormat.format( Util.translateString(RESOURCE_BUNDLE, "uniqueName"), new Object[] { name, //$NON-NLS-1$ context.getId() }); contextIdsByUniqueName.put(uniqueName, context.getId()); contextUniqueNamesById.put(context.getId(), uniqueName); } } } categoryIdsByUniqueName = new HashMap(); categoryUniqueNamesById = new HashMap(); for (Iterator iterator = categoriesByName.entrySet().iterator(); iterator .hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); Set categories = (Set) entry.getValue(); Iterator iterator2 = categories.iterator(); if (categories.size() == 1) { Category category = (Category) iterator2.next(); categoryIdsByUniqueName.put(name, category.getId()); categoryUniqueNamesById.put(category.getId(), name); } else { while (iterator2.hasNext()) { Category category = (Category) iterator2.next(); String uniqueName = MessageFormat.format( Util.translateString(RESOURCE_BUNDLE, "uniqueName"), new Object[] { name, //$NON-NLS-1$ category.getId() }); categoryIdsByUniqueName.put(uniqueName, category .getId()); categoryUniqueNamesById.put(category.getId(), uniqueName); } } } schemeIdsByUniqueName = new HashMap(); schemeUniqueNamesById = new HashMap(); for (Iterator iterator = schemesByName.entrySet().iterator(); iterator .hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); Set keyConfigurations = (Set) entry.getValue(); Iterator iterator2 = keyConfigurations.iterator(); if (keyConfigurations.size() == 1) { Scheme scheme = (Scheme) iterator2.next(); schemeIdsByUniqueName.put(name, scheme.getId()); schemeUniqueNamesById.put(scheme.getId(), name); } else { while (iterator2.hasNext()) { Scheme scheme = (Scheme) iterator2.next(); String uniqueName = MessageFormat.format( Util.translateString(RESOURCE_BUNDLE, "uniqueName"), new Object[] { name, //$NON-NLS-1$ scheme.getId() }); schemeIdsByUniqueName.put(uniqueName, scheme.getId()); schemeUniqueNamesById.put(scheme.getId(), uniqueName); } } } Scheme activeScheme = bindingService.getActiveScheme(); // Make an internal copy of the binding manager, for local changes. try { for (int i = 0; i < definedSchemes.length; i++) { final Scheme scheme = definedSchemes[i]; final Scheme copy = localChangeManager.getScheme(scheme .getId()); copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId()); } localChangeManager.setActiveScheme(bindingService .getActiveScheme()); } catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ } localChangeManager.setLocale(bindingService.getLocale()); localChangeManager.setPlatform(bindingService.getPlatform()); localChangeManager.setBindings(bindingService.getBindings()); // Populate the category combo box. List categoryNames = new ArrayList(categoryIdsByUniqueName.keySet()); Collections.sort(categoryNames, Collator.getInstance()); if (commandIdsByCategoryId.containsKey(null)) { categoryNames.add(0, Util.translateString(RESOURCE_BUNDLE, "other")); //$NON-NLS-1$ } comboCategory.setItems((String[]) categoryNames .toArray(new String[categoryNames.size()])); comboCategory.clearSelection(); comboCategory.deselectAll(); if (commandIdsByCategoryId.containsKey(null) || !categoryNames.isEmpty()) { comboCategory.select(0); } // Populate the scheme combo box. List schemeNames = new ArrayList(schemeIdsByUniqueName.keySet()); Collections.sort(schemeNames, Collator.getInstance()); comboScheme.setItems((String[]) schemeNames .toArray(new String[schemeNames.size()])); setScheme(activeScheme); // Update the entire page. update(true); } super.setVisible(visible); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
private final void updateComboCommand() { // Remember the current selection, so we can restore it later. final ParameterizedCommand command = getParameterizedCommand(); // Figure out where command identifiers apply to the selected category. final String categoryId = getCategoryId(); Set commandIds = (Set) commandIdsByCategoryId.get(categoryId); if (commandIds==null) { commandIds = Collections.EMPTY_SET; } /* * Generate an array of parameterized commands based on these * identifiers. The parameterized commands will be sorted based on their * names. */ List commands = new ArrayList(); final Iterator commandIdItr = commandIds.iterator(); while (commandIdItr.hasNext()) { final String currentCommandId = (String) commandIdItr.next(); final Command currentCommand = commandService .getCommand(currentCommandId); try { commands.addAll(ParameterizedCommand .generateCombinations(currentCommand)); } catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. } } // sort the commands with a collator, so they appear in the // combo correctly commands = sortParameterizedCommands(commands); final int commandCount = commands.size(); this.commands = (ParameterizedCommand[]) commands .toArray(new ParameterizedCommand[commandCount]); /* * Generate an array of command names based on this array of * parameterized commands. */ final String[] commandNames = new String[commandCount]; for (int i = 0; i < commandCount; i++) { try { commandNames[i] = this.commands[i].getName(); } catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ } } /* * Copy the command names into the combo box, but only if they've * changed. We do this to try to avoid unnecessary calls out to the * operating system, as well as to defend against bugs in SWT's event * mechanism. */ final String[] currentItems = comboCommand.getItems(); if (!Arrays.equals(currentItems, commandNames)) { comboCommand.setItems(commandNames); } // Try to restore the selection. setParameterizedCommand(command); /* * Just to be extra careful, make sure that we have a selection at this * point. This line could probably be removed, but it makes the code a * bit more robust. */ if ((comboCommand.getSelectionIndex() == -1) && (commandCount > 0)) { comboCommand.select(0); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
private final void updateTableBindingsForTriggerSequence( final TriggerSequence triggerSequence) { // Clear the table of its existing items. tableBindingsForTriggerSequence.removeAll(); // Get the collection of bindings for the current command. final Map activeBindings = localChangeManager .getActiveBindingsDisregardingContext(); final Collection bindings = (Collection) activeBindings .get(triggerSequence); if (bindings == null) { return; } // Add each of the bindings. final Iterator bindingItr = bindings.iterator(); while (bindingItr.hasNext()) { final Binding binding = (Binding) bindingItr.next(); final Context context = contextService.getContext(binding .getContextId()); final ParameterizedCommand parameterizedCommand = binding .getParameterizedCommand(); final Command command = parameterizedCommand.getCommand(); if ((!context.isDefined()) && (!command.isDefined())) { continue; } final TableItem tableItem = new TableItem( tableBindingsForTriggerSequence, SWT.NULL); tableItem.setData(ITEM_DATA_KEY, binding); /* * Set the associated image based on the type of binding. Either it * is a user binding or a system binding. * * TODO Identify more image types. */ if (binding.getType() == Binding.SYSTEM) { tableItem.setImage(0, IMAGE_BLANK); } else { tableItem.setImage(0, IMAGE_CHANGE); } try { tableItem.setText(1, context.getName()); tableItem.setText(2, parameterizedCommand.getName()); } catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
public final int compare(final Object object1, final Object object2) { final Binding binding1 = (Binding) object1; final Binding binding2 = (Binding) object2; /* * Get the category name, command name, formatted key sequence * and context name for the first binding. */ final Command command1 = binding1.getParameterizedCommand() .getCommand(); String categoryName1 = Util.ZERO_LENGTH_STRING; String commandName1 = Util.ZERO_LENGTH_STRING; try { commandName1 = command1.getName(); categoryName1 = command1.getCategory().getName(); } catch (final NotDefinedException e) { // Just use the zero-length string. } final String triggerSequence1 = binding1.getTriggerSequence() .format(); final String contextId1 = binding1.getContextId(); String contextName1 = Util.ZERO_LENGTH_STRING; if (contextId1 != null) { final Context context = contextService .getContext(contextId1); try { contextName1 = context.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. } } /* * Get the category name, command name, formatted key sequence * and context name for the first binding. */ final Command command2 = binding2.getParameterizedCommand() .getCommand(); String categoryName2 = Util.ZERO_LENGTH_STRING; String commandName2 = Util.ZERO_LENGTH_STRING; try { commandName2 = command2.getName(); categoryName2 = command2.getCategory().getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. } final String keySequence2 = binding2.getTriggerSequence() .format(); final String contextId2 = binding2.getContextId(); String contextName2 = Util.ZERO_LENGTH_STRING; if (contextId2 != null) { final Context context = contextService .getContext(contextId2); try { contextName2 = context.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. } } // Compare the items in the current sort order. int compare = 0; for (int i = 0; i < sortOrder.length; i++) { switch (sortOrder[i]) { case VIEW_CATEGORY_COLUMN_INDEX: compare = Util.compare(categoryName1, categoryName2); if (compare != 0) { return compare; } break; case VIEW_COMMAND_COLUMN_INDEX: compare = Util.compare(commandName1, commandName2); if (compare != 0) { return compare; } break; case VIEW_KEY_SEQUENCE_COLUMN_INDEX: compare = Util.compare(triggerSequence1, keySequence2); if (compare != 0) { return compare; } break; case VIEW_CONTEXT_COLUMN_INDEX: compare = Util.compare(contextName1, contextName2); if (compare != 0) { return compare; } break; default: throw new Error( "Programmer error: added another sort column without modifying the comparator."); //$NON-NLS-1$ } } return compare; }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
private static final void readActiveScheme( final IConfigurationElement[] configurationElements, final int configurationElementCount, final IMemento preferences, final BindingManager bindingManager) { // A non-default preference. final IPreferenceStore store = PlatformUI.getPreferenceStore(); final String defaultActiveSchemeId = store .getDefaultString(IWorkbenchPreferenceConstants.KEY_CONFIGURATION_ID); final String preferenceActiveSchemeId = store .getString(IWorkbenchPreferenceConstants.KEY_CONFIGURATION_ID); if ((preferenceActiveSchemeId != null) && (!preferenceActiveSchemeId.equals(defaultActiveSchemeId))) { try { bindingManager.setActiveScheme(bindingManager .getScheme(preferenceActiveSchemeId)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } // A legacy preference XML memento. if (preferences != null) { final IMemento[] preferenceMementos = preferences .getChildren(TAG_ACTIVE_KEY_CONFIGURATION); int preferenceMementoCount = preferenceMementos.length; for (int i = preferenceMementoCount - 1; i >= 0; i--) { final IMemento memento = preferenceMementos[i]; String id = memento.getString(ATT_KEY_CONFIGURATION_ID); if (id != null) { try { bindingManager.setActiveScheme(bindingManager .getScheme(id)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } } } // A default preference value that is different than the default. if ((defaultActiveSchemeId != null && defaultActiveSchemeId.length() > 0) && (!defaultActiveSchemeId .equals(IBindingService.DEFAULT_DEFAULT_ACTIVE_SCHEME_ID))) { try { bindingManager.setActiveScheme(bindingManager .getScheme(defaultActiveSchemeId)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } // The registry. for (int i = configurationElementCount - 1; i >= 0; i--) { final IConfigurationElement configurationElement = configurationElements[i]; String id = configurationElement .getAttribute(ATT_KEY_CONFIGURATION_ID); if (id != null) { try { bindingManager .setActiveScheme(bindingManager.getScheme(id)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } id = configurationElement.getAttribute(ATT_VALUE); if (id != null) { try { bindingManager .setActiveScheme(bindingManager.getScheme(id)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } } // The default default active scheme id. try { bindingManager .setActiveScheme(bindingManager .getScheme(IBindingService.DEFAULT_DEFAULT_ACTIVE_SCHEME_ID)); } catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createWriteRoot(String type) throws DOMException { Document document; try { document = DocumentBuilderFactory.newInstance() .newDocumentBuilder().newDocument(); Element element = document.createElement(type); document.appendChild(element); return new XMLMemento(document, element); } catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); } }
10
              
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }
0
(Domain) ParseException 4
              
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } SortedSet modifierKeys = new TreeSet(); NaturalKey naturalKey = null; StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_DELIMITERS, true); int i = 0; while (stringTokenizer.hasMoreTokens()) { String token = stringTokenizer.nextToken(); if (i % 2 == 0) { if (stringTokenizer.hasMoreTokens()) { token = token.toUpperCase(); ModifierKey modifierKey = (ModifierKey) ModifierKey.modifierKeysByName .get(token); if (modifierKey == null || !modifierKeys.add(modifierKey)) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token); } } else if (token.length() == 1) { naturalKey = CharacterKey.getInstance(token.charAt(0)); break; } else { token = token.toUpperCase(); naturalKey = (NaturalKey) CharacterKey.characterKeysByName .get(token); if (naturalKey == null) { naturalKey = (NaturalKey) SpecialKey.specialKeysByName .get(token); } if (naturalKey == null) { throw new ParseException( "Cannot create key stroke with invalid natural key: " //$NON-NLS-1$ + token); } } } i++; } try { return new KeyStroke(modifierKeys, naturalKey); } catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(); StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_STROKE_DELIMITERS); while (stringTokenizer.hasMoreTokens()) { keyStrokes.add(KeyStroke.getInstance(stringTokenizer.nextToken())); } try { return new KeySequence(keyStrokes); } catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } }
2
              
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); }
4
              
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
private static void getBindingForPlatform(KeySequence keySequence, String platform, ParameterizedCommand parameterizedCommand, String schemeId, String contextId, String locale, List bindings, String modifiedSequence, String[] platforms) throws ParseException { int j = 0; for (; j < platforms.length; j++) { if(platforms[j].equals(SWT.getPlatform())) { KeyBinding newBinding = new KeyBinding(KeySequence .getInstance(modifiedSequence), parameterizedCommand, schemeId, contextId, locale, platforms[j], null, Binding.SYSTEM); bindings.add(newBinding); break; } } if(j == platforms.length) { // platform doesn't match. use the unmodified sequence KeyBinding newBinding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, null, null, Binding.SYSTEM); bindings.add(newBinding); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
private static void addGenericBindings(KeySequence keySequence, ParameterizedCommand parameterizedCommand, String schemeId, String contextId, String locale, List bindings, String modifiedSequence, String[] platforms) throws ParseException { KeyBinding originalBinding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, null, null, Binding.SYSTEM); bindings.add(originalBinding); String platform = SWT.getPlatform(); boolean modifierExists = false; for (int i = 0; i < platforms.length; i++) { if(platforms[i].equals(platform)) { modifierExists = true; break; } } if(modifierExists) { KeyBinding newBinding = new KeyBinding(KeySequence.getInstance(modifiedSequence), parameterizedCommand, schemeId, contextId, locale, SWT.getPlatform(), null, Binding.SYSTEM); KeyBinding deleteBinding = new KeyBinding(keySequence, null, schemeId, contextId, locale, SWT.getPlatform(), null, Binding.SYSTEM); bindings.add(newBinding); bindings.add(deleteBinding); } }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } SortedSet modifierKeys = new TreeSet(); NaturalKey naturalKey = null; StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_DELIMITERS, true); int i = 0; while (stringTokenizer.hasMoreTokens()) { String token = stringTokenizer.nextToken(); if (i % 2 == 0) { if (stringTokenizer.hasMoreTokens()) { token = token.toUpperCase(); ModifierKey modifierKey = (ModifierKey) ModifierKey.modifierKeysByName .get(token); if (modifierKey == null || !modifierKeys.add(modifierKey)) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token); } } else if (token.length() == 1) { naturalKey = CharacterKey.getInstance(token.charAt(0)); break; } else { token = token.toUpperCase(); naturalKey = (NaturalKey) CharacterKey.characterKeysByName .get(token); if (naturalKey == null) { naturalKey = (NaturalKey) SpecialKey.specialKeysByName .get(token); } if (naturalKey == null) { throw new ParseException( "Cannot create key stroke with invalid natural key: " //$NON-NLS-1$ + token); } } } i++; } try { return new KeyStroke(modifierKeys, naturalKey); } catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(); StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_STROKE_DELIMITERS); while (stringTokenizer.hasMoreTokens()) { keyStrokes.add(KeyStroke.getInstance(stringTokenizer.nextToken())); } try { return new KeySequence(keyStrokes); } catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } }
(Domain) CommandNotMappedException 3 0 1
(Lib) RuntimeException 3
              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithoutExceptions(StartupRunnable r) throws RuntimeException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RuntimeException(throwable); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
protected void checkReference() { if (state == STATE_DISPOSED) { throw new RuntimeException("Error: IWorkbenchPartReference disposed"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
public void handleException(Throwable t) { try { // Ignore ThreadDeath error as its normal to get this when thread dies if (t instanceof ThreadDeath) { throw (ThreadDeath) t; } // Check to avoid recursive errors exceptionCount++; if (exceptionCount > 2) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } else if (t instanceof Error) { throw (Error) t; } else { throw new RuntimeException(t); } } // Let the advisor handle this now Workbench wb = Workbench.getInstance(); if (wb != null) { wb.getAdvisor().eventLoopException(t); } } finally { exceptionCount--; } }
0 1
              
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithoutExceptions(StartupRunnable r) throws RuntimeException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RuntimeException(throwable); } } }
(Lib) InterruptedException 2
              
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void runInUI(final IRunnableContext context, final IRunnableWithProgress runnable, final ISchedulingRule rule) throws InvocationTargetException, InterruptedException { final RunnableWithStatus runnableWithStatus = new RunnableWithStatus( context, runnable, rule); final Display display = Display.getDefault(); display.syncExec(new Runnable() { public void run() { BusyIndicator.showWhile(display, runnableWithStatus); } }); IStatus status = runnableWithStatus.getStatus(); if (!status.isOK()) { Throwable exception = status.getException(); if (exception instanceof InvocationTargetException) throw (InvocationTargetException) exception; else if (exception instanceof InterruptedException) throw (InterruptedException) exception; else // should be OperationCanceledException throw new InterruptedException(exception.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/Semaphore.java
public synchronized boolean acquire(long delay) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } long start = System.currentTimeMillis(); long timeLeft = delay; while (true) { if (notifications > 0) { notifications--; return true; } if (timeLeft <= 0) { return false; } wait(timeLeft); timeLeft = start + delay - System.currentTimeMillis(); } }
0 14
              
// in Eclipse UI/org/eclipse/ui/preferences/WizardPropertyPage.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); dialog.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IEditorPart busyOpenEditorBatched(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { // If an editor already exists for the input, use it. IEditorPart editor = null; // Reuse an existing open editor, unless we are in "new editor tab management" mode editor = getEditorManager().findEditor(editorID, input, ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).getReuseEditorMatchFlags(matchFlags)); if (editor != null) { if (IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID.equals(editorID)) { if (editor.isDirty()) { MessageDialog dialog = new MessageDialog( getWorkbenchWindow().getShell(), WorkbenchMessages.Save, null, // accept the default window icon NLS.bind(WorkbenchMessages.WorkbenchPage_editorAlreadyOpenedMsg, input.getName()), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; int saveFile = dialog.open(); if (saveFile == 0) { try { final IEditorPart editorToSave = editor; getWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); } }); } catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); } catch (InterruptedException e) { return null; } } else if (saveFile == 2) { return null; } } } else { // do the IShowEditorInput notification before showing the editor // to reduce flicker if (editor instanceof IShowEditorInput) { ((IShowEditorInput) editor).showEditorInput(input); } showEditor(activate, editor); return editor; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
static boolean runProgressMonitorOperation(String opName, final IRunnableWithProgress progressOp, final IRunnableContext runnableContext, final IShellProvider shellProvider) { final boolean[] success = new boolean[] { false }; IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; } }; try { runnableContext.run(false, true, runnable); } catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure } catch (InterruptedException e) { // The user pressed cancel. Fall through to return failure } catch (OperationCanceledException e) { // The user pressed cancel. Fall through to return failure } return success[0]; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public static boolean waitForBackgroundSaveJobs(final List modelsToSave) { // block if any of the saveables is still saving in the background try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InterruptedException { Job.getJobManager().join(new DynamicFamily(modelsToSave), monitor); } }); } catch (InvocationTargetException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); } catch (InterruptedException e) { return true; } // remove saveables that are no longer dirty from the list for (Iterator it = modelsToSave.iterator(); it.hasNext();) { Saveable model = (Saveable) it.next(); if (!model.isDirty()) { it.remove(); } } return false; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public void run(IProgressMonitor monitor) throws InterruptedException { Job.getJobManager().join(new DynamicFamily(modelsToSave), monitor); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorJobsDialog.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { //if it is run in the UI Thread don't do anything. if (!fork) { enableDetails(false); } super.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void busyCursorWhile(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void runInUI(IRunnableContext context, IRunnableWithProgress runnable, ISchedulingRule rule) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().runInUI(context, runnable, rule); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void busyCursorWhile(final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( ProgressManagerUtil.getDefaultParent()); dialog.setOpenOnRun(false); final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; // show a busy cursor until the dialog opens Runnable dialogWaitRunnable = new Runnable() { public void run() { try { dialog.setOpenOnRun(false); setUserInterfaceActive(false); dialog.run(true, true, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0] = e; } finally { setUserInterfaceActive(true); } } }; busyCursorWhile(dialogWaitRunnable, dialog); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { if (fork == false || cancelable == false) { // backward compatible code final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( null); dialog.run(fork, cancelable, runnable); return; } busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void runInUI(final IRunnableContext context, final IRunnableWithProgress runnable, final ISchedulingRule rule) throws InvocationTargetException, InterruptedException { final RunnableWithStatus runnableWithStatus = new RunnableWithStatus( context, runnable, rule); final Display display = Display.getDefault(); display.syncExec(new Runnable() { public void run() { BusyIndicator.showWhile(display, runnableWithStatus); } }); IStatus status = runnableWithStatus.getStatus(); if (!status.isOK()) { Throwable exception = status.getException(); if (exception instanceof InvocationTargetException) throw (InvocationTargetException) exception; else if (exception instanceof InterruptedException) throw (InterruptedException) exception; else // should be OperationCanceledException throw new InterruptedException(exception.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/Semaphore.java
public synchronized boolean acquire(long delay) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } long start = System.currentTimeMillis(); long timeLeft = delay; while (true) { if (notifications > 0) { notifications--; return true; } if (timeLeft <= 0) { return false; } wait(timeLeft); timeLeft = start + delay - System.currentTimeMillis(); } }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
public void run(final boolean fork, final boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; Runnable dialogWaitRunnable = new Runnable() { public void run() { try { TimeTriggeredProgressMonitorDialog.super.run(fork, cancelable, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0]= e; } } }; final Display display = PlatformUI.getWorkbench().getDisplay(); if (display == null) { return; } //show a busy cursor until the dialog opens BusyIndicator.showWhile(display, dialogWaitRunnable); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { IWorkbenchContextSupport contextSupport = getWorkbench() .getContextSupport(); final boolean keyFilterEnabled = contextSupport.isKeyFilterEnabled(); Control fastViewBarControl = getFastViewBar() == null ? null : getFastViewBar().getControl(); boolean fastViewBarWasEnabled = fastViewBarControl == null ? false : fastViewBarControl.getEnabled(); Control perspectiveBarControl = getPerspectiveBar() == null ? null : getPerspectiveBar().getControl(); boolean perspectiveBarWasEnabled = perspectiveBarControl == null ? false : perspectiveBarControl.getEnabled(); // Cache for any disabled trim controls List disabledControls = null; try { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(false); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(false); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(false); } // Disable all trim -except- the StatusLine if (defaultLayout != null) disabledControls = defaultLayout.disableTrim(getStatusLineTrim()); super.run(fork, cancelable, runnable); } finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); } }
(Lib) ParameterValueConversionException 2
              
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
private AbstractParameterValueConverter getConverter() throws ParameterValueConversionException { if (parameterValueConverter == null) { try { parameterValueConverter = (AbstractParameterValueConverter) converterConfigurationElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONVERTER); } catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ } } return parameterValueConverter; }
2
              
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ }
3
              
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
public final Object convertToObject(final String parameterValue) throws ParameterValueConversionException { return getConverter().convertToObject(parameterValue); }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
public final String convertToString(final Object parameterValue) throws ParameterValueConversionException { return getConverter().convertToString(parameterValue); }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
private AbstractParameterValueConverter getConverter() throws ParameterValueConversionException { if (parameterValueConverter == null) { try { parameterValueConverter = (AbstractParameterValueConverter) converterConfigurationElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONVERTER); } catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ } } return parameterValueConverter; }
(Lib) ParameterValuesException 2
              
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
public final IParameterValues getValues() throws ParameterValuesException { if (values == null) { try { values = (IParameterValues) valuesConfigurationElement .createExecutableExtension(ATTRIBUTE_VALUES); } catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ } } return values; }
2
              
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ }
1
              
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
public final IParameterValues getValues() throws ParameterValuesException { if (values == null) { try { values = (IParameterValues) valuesConfigurationElement .createExecutableExtension(ATTRIBUTE_VALUES); } catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ } } return values; }
(Lib) IOException 1
              
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
public void save() throws IOException { try { getStorePreferences().flush(); dirty = false; } catch (BackingStoreException e) { throw new IOException(e.getMessage()); } }
1
              
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
13
              
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
public void save() throws IOException { try { getStorePreferences().flush(); dirty = false; } catch (BackingStoreException e) { throw new IOException(e.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
public void exportCSV(Shell shell) { final FileDialog fileDialog = new FileDialog(shell, SWT.SAVE | SWT.SHEET); fileDialog.setFilterExtensions(new String[] { "*.csv" }); //$NON-NLS-1$ fileDialog.setFilterNames(new String[] { Util.translateString( RESOURCE_BUNDLE, "csvFilterName") }); //$NON-NLS-1$ fileDialog.setOverwrite(true); final String filePath = fileDialog.open(); if (filePath == null) { return; } final SafeRunnable runnable = new SafeRunnable() { public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(filePath), "UTF-8")); //$NON-NLS-1$ final Object[] bindingElements = bindingModel.getBindings() .toArray(); for (int i = 0; i < bindingElements.length; i++) { final BindingElement be = (BindingElement) bindingElements[i]; if (be.getTrigger() == null || be.getTrigger().isEmpty() || be.getContext() == null || be.getContext().getName() == null) { continue; } StringBuffer buffer = new StringBuffer(); buffer.append(ESCAPED_QUOTE + Util.replaceAll(be.getCategory(), ESCAPED_QUOTE, REPLACEMENT) + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getName() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getTrigger().format() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getContext().getName() + ESCAPED_QUOTE); buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$ fileWriter.write(buffer.toString()); } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } } }; SafeRunner.run(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(filePath), "UTF-8")); //$NON-NLS-1$ final Object[] bindingElements = bindingModel.getBindings() .toArray(); for (int i = 0; i < bindingElements.length; i++) { final BindingElement be = (BindingElement) bindingElements[i]; if (be.getTrigger() == null || be.getTrigger().isEmpty() || be.getContext() == null || be.getContext().getName() == null) { continue; } StringBuffer buffer = new StringBuffer(); buffer.append(ESCAPED_QUOTE + Util.replaceAll(be.getCategory(), ESCAPED_QUOTE, REPLACEMENT) + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getName() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getTrigger().format() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getContext().getName() + ESCAPED_QUOTE); buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$ fileWriter.write(buffer.toString()); } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
private final void selectedButtonExport() { final FileDialog fileDialog = new FileDialog(getShell(), SWT.SAVE | SWT.SHEET); fileDialog.setFilterExtensions(new String[] { "*.csv" }); //$NON-NLS-1$ fileDialog.setFilterNames(new String[] { Util.translateString( RESOURCE_BUNDLE, "csvFilterName") }); //$NON-NLS-1$ final String filePath = fileDialog.open(); if (filePath == null) { return; } final SafeRunnable runnable = new SafeRunnable() { public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new FileWriter(filePath)); final TableItem[] items = tableBindings.getItems(); final int numColumns = tableBindings.getColumnCount(); for (int i = 0; i < items.length; i++) { final TableItem item = items[i]; for (int j = 0; j < numColumns; j++) { String buf = Util.replaceAll(item.getText(j), "\"", //$NON-NLS-1$ "\"\""); //$NON-NLS-1$ fileWriter.write("\"" + buf + "\""); //$NON-NLS-1$//$NON-NLS-2$ if (j < numColumns - 1) { fileWriter.write(','); } } fileWriter.write(System.getProperty("line.separator")); //$NON-NLS-1$ } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } } }; SafeRunner.run(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new FileWriter(filePath)); final TableItem[] items = tableBindings.getItems(); final int numColumns = tableBindings.getColumnCount(); for (int i = 0; i < items.length; i++) { final TableItem item = items[i]; for (int j = 0; j < numColumns; j++) { String buf = Util.replaceAll(item.getText(j), "\"", //$NON-NLS-1$ "\"\""); //$NON-NLS-1$ fileWriter.write("\"" + buf + "\""); //$NON-NLS-1$//$NON-NLS-2$ if (j < numColumns - 1) { fileWriter.write(','); } } fileWriter.write(System.getProperty("line.separator")); //$NON-NLS-1$ } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
static final void write(final Scheme activeScheme, final Binding[] bindings) throws IOException { // Print out debugging information, if requested. if (DEBUG) { Tracing.printTrace("BINDINGS", "Persisting active scheme '" //$NON-NLS-1$ //$NON-NLS-2$ + activeScheme.getId() + '\''); Tracing.printTrace("BINDINGS", "Persisting bindings"); //$NON-NLS-1$ //$NON-NLS-2$ } // Write the simple preference key to the UI preference store. writeActiveScheme(activeScheme); // Build the XML block for writing the bindings and active scheme. final XMLMemento xmlMemento = XMLMemento .createWriteRoot(EXTENSION_COMMANDS); if (activeScheme != null) { writeActiveSchemeToPreferences(xmlMemento, activeScheme); } if (bindings != null) { final int bindingsLength = bindings.length; for (int i = 0; i < bindingsLength; i++) { final Binding binding = bindings[i]; if (binding.getType() == Binding.USER) { writeBindingToPreferences(xmlMemento, binding); } } } // Write the XML block to the workbench preference store. final IPreferenceStore preferenceStore = WorkbenchPlugin.getDefault() .getPreferenceStore(); final Writer writer = new StringWriter(); try { xmlMemento.save(writer); preferenceStore.setValue(EXTENSION_COMMANDS, writer.toString()); } finally { writer.close(); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
public final void savePreferences(final Scheme activeScheme, final Binding[] bindings) throws IOException { BindingPersistence.write(activeScheme, bindings); try { bindingManager.setActiveScheme(activeScheme); } catch (final NotDefinedException e) { WorkbenchPlugin.log("The active scheme is not currently defined.", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); } bindingManager.setBindings(bindings); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
private Process openWebBrowser(String href) throws IOException { Process p = null; if (webBrowser == null) { try { webBrowser = "firefox"; //$NON-NLS-1$ p = Runtime.getRuntime().exec(webBrowser + " " + href); //$NON-NLS-1$; } catch (IOException e) { p = null; webBrowser = "mozilla"; //$NON-NLS-1$ } } if (p == null) { try { p = Runtime.getRuntime().exec(webBrowser + " " + href); //$NON-NLS-1$; } catch (IOException e) { p = null; webBrowser = "netscape"; //$NON-NLS-1$ } } if (p == null) { try { p = Runtime.getRuntime().exec(webBrowser + " " + href); //$NON-NLS-1$; } catch (IOException e) { p = null; throw e; } } return p; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
private void load() throws IOException { if (activityRequirementBindingDefinitions == null) { activityRequirementBindingDefinitions = new ArrayList(); } else { activityRequirementBindingDefinitions.clear(); } if (activityDefinitions == null) { activityDefinitions = new ArrayList(); } else { activityDefinitions.clear(); } if (activityPatternBindingDefinitions == null) { activityPatternBindingDefinitions = new ArrayList(); } else { activityPatternBindingDefinitions.clear(); } if (categoryActivityBindingDefinitions == null) { categoryActivityBindingDefinitions = new ArrayList(); } else { categoryActivityBindingDefinitions.clear(); } if (categoryDefinitions == null) { categoryDefinitions = new ArrayList(); } else { categoryDefinitions.clear(); } if (defaultEnabledActivities == null) { defaultEnabledActivities = new ArrayList(); } else { defaultEnabledActivities.clear(); } IConfigurationElement[] configurationElements = extensionRegistry .getConfigurationElementsFor(Persistence.PACKAGE_FULL); for (int i = 0; i < configurationElements.length; i++) { IConfigurationElement configurationElement = configurationElements[i]; String name = configurationElement.getName(); if (Persistence.TAG_ACTIVITY_REQUIREMENT_BINDING.equals(name)) { readActivityRequirementBindingDefinition(configurationElement); } else if (Persistence.TAG_ACTIVITY.equals(name)) { readActivityDefinition(configurationElement); } else if (Persistence.TAG_ACTIVITY_PATTERN_BINDING.equals(name)) { readActivityPatternBindingDefinition(configurationElement); } else if (Persistence.TAG_CATEGORY_ACTIVITY_BINDING.equals(name)) { readCategoryActivityBindingDefinition(configurationElement); } else if (Persistence.TAG_CATEGORY.equals(name)) { readCategoryDefinition(configurationElement); } else if (Persistence.TAG_DEFAULT_ENABLEMENT.equals(name)) { readDefaultEnablement(configurationElement); } } // merge enablement overrides from plugin_customization.ini IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); for (Iterator i = activityDefinitions.iterator(); i.hasNext();) { ActivityDefinition activityDef = (ActivityDefinition) i.next(); String id = activityDef.getId(); String preferenceKey = createPreferenceKey(id); if ("".equals(store.getDefaultString(preferenceKey))) //$NON-NLS-1$ continue; if (store.getDefaultBoolean(preferenceKey)) { if (!defaultEnabledActivities.contains(id) && activityDef.getEnabledWhen() == null) defaultEnabledActivities.add(id); } else { defaultEnabledActivities.remove(id); } } // Removal of all defaultEnabledActivites which target to expression // controlled activities. for (int i = 0; i < defaultEnabledActivities.size();) { String id = (String) defaultEnabledActivities.get(i); ActivityDefinition activityDef = getActivityDefinitionById(id); if (activityDef != null && activityDef.getEnabledWhen() != null) { defaultEnabledActivities.remove(i); StatusManager .getManager() .handle( new Status( IStatus.WARNING, PlatformUI.PLUGIN_ID, "Default enabled activity declarations will be ignored (id: " + id + ")")); //$NON-NLS-1$ //$NON-NLS-2$ } else { i++; } } // remove all requirement bindings that reference expression-bound activities for (Iterator i = activityRequirementBindingDefinitions.iterator(); i .hasNext();) { ActivityRequirementBindingDefinition bindingDef = (ActivityRequirementBindingDefinition) i .next(); ActivityDefinition activityDef = getActivityDefinitionById(bindingDef .getRequiredActivityId()); if (activityDef != null && activityDef.getEnabledWhen() != null) { i.remove(); StatusManager .getManager() .handle( new Status( IStatus.WARNING, PlatformUI.PLUGIN_ID, "Expression activity cannot have requirements (id: " + activityDef.getId() + ")")); //$NON-NLS-1$ //$NON-NLS-2$ continue; } activityDef = getActivityDefinitionById(bindingDef.getActivityId()); if (activityDef != null && activityDef.getEnabledWhen() != null) { i.remove(); StatusManager .getManager() .handle( new Status( IStatus.WARNING, PlatformUI.PLUGIN_ID, "Expression activity cannot be required (id: " + activityDef.getId() + ")")); //$NON-NLS-1$ //$NON-NLS-2$ } } boolean activityRegistryChanged = false; if (!activityRequirementBindingDefinitions .equals(super.activityRequirementBindingDefinitions)) { super.activityRequirementBindingDefinitions = Collections .unmodifiableList(new ArrayList(activityRequirementBindingDefinitions)); activityRegistryChanged = true; } if (!activityDefinitions.equals(super.activityDefinitions)) { super.activityDefinitions = Collections .unmodifiableList(new ArrayList(activityDefinitions)); activityRegistryChanged = true; } if (!activityPatternBindingDefinitions .equals(super.activityPatternBindingDefinitions)) { super.activityPatternBindingDefinitions = Collections .unmodifiableList(new ArrayList(activityPatternBindingDefinitions)); activityRegistryChanged = true; } if (!categoryActivityBindingDefinitions .equals(super.categoryActivityBindingDefinitions)) { super.categoryActivityBindingDefinitions = Collections .unmodifiableList(new ArrayList(categoryActivityBindingDefinitions)); activityRegistryChanged = true; } if (!categoryDefinitions.equals(super.categoryDefinitions)) { super.categoryDefinitions = Collections .unmodifiableList(new ArrayList(categoryDefinitions)); activityRegistryChanged = true; } if (!defaultEnabledActivities.equals(super.defaultEnabledActivities)) { super.defaultEnabledActivities = Collections .unmodifiableList(new ArrayList(defaultEnabledActivities)); activityRegistryChanged = true; } if (activityRegistryChanged) { fireActivityRegistryChanged(); } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public void saveCustomPersp(PerspectiveDescriptor desc, XMLMemento memento) throws IOException { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); // Save it to the preference store. Writer writer = new StringWriter(); memento.save(writer); writer.close(); store.setValue(desc.getId() + PERSP, writer.toString()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IMemento getCustomPersp(String id) throws WorkbenchException, IOException { Reader reader = null; IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); String xmlString = store.getString(id + PERSP); if (xmlString != null && xmlString.length() != 0) { // defined in store reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, id))); } XMLMemento memento = XMLMemento.createReadRoot(reader); reader.close(); return memento; }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void saveState(File stateFile) throws IOException { XMLMemento memento = XMLMemento .createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET_MANAGER); saveWorkingSetState(memento); saveMruList(memento); FileOutputStream stream = new FileOutputStream(stateFile); OutputStreamWriter writer = new OutputStreamWriter(stream, "utf-8"); //$NON-NLS-1$ memento.save(writer); writer.close(); }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
private EditorInputData readEditorInput(DataInputStream dataIn) throws IOException, WorkbenchException { String editorId = dataIn.readUTF(); String factoryId = dataIn.readUTF(); String xmlString = dataIn.readUTF(); if (xmlString == null || xmlString.length() == 0) { return null; } StringReader reader = new StringReader(xmlString); // Restore the editor input XMLMemento memento = XMLMemento.createReadRoot(reader); IElementFactory factory = PlatformUI.getWorkbench().getElementFactory( factoryId); if (factory != null) { IAdaptable adaptable = factory.createElement(memento); if (adaptable != null && (adaptable instanceof IEditorInput)) { return new EditorInputData(editorId, (IEditorInput) adaptable); } } return null; }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
private void writeEditorInput(DataOutputStream dataOut, EditorInputData editorInputData) throws IOException { //write the id of the editor dataOut.writeUTF(editorInputData.editorId); //write the information needed to recreate the editor input if (editorInputData.input != null) { // Capture the editor information XMLMemento memento = XMLMemento.createWriteRoot("IEditorInput");//$NON-NLS-1$ IPersistableElement element = editorInputData.input .getPersistable(); if (element != null) { //get the IEditorInput to save its state element.saveState(memento); //convert memento to String StringWriter writer = new StringWriter(); memento.save(writer); writer.close(); //write the factor ID and state information dataOut.writeUTF(element.getFactoryId()); dataOut.writeUTF(writer.toString()); } } }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public void save(Writer writer) throws IOException { DOMWriter out = new DOMWriter(writer); try { out.print(element); } finally { out.close(); } }
(Lib) InvocationTargetException 1
              
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
public void run(IProgressMonitor pm) throws InvocationTargetException { try { runCommand(pm); } catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); } }
1
              
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
16
              
// in Eclipse UI/org/eclipse/ui/preferences/WizardPropertyPage.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); dialog.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Shell getSplashShell(Display display) throws NumberFormatException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { Shell splashShell = (Shell) display.getData(DATA_SPLASH_SHELL); if (splashShell != null) return splashShell; String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); if (splashHandle == null) { return null; } // look for the 32 bit internal_new shell method try { Method method = Shell.class.getMethod( "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ // we're on a 32 bit platform so invoke it with splash // handle as an int splashShell = (Shell) method.invoke(null, new Object[] { display, new Integer(splashHandle) }); } catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } } display.setData(DATA_SPLASH_SHELL, splashShell); return splashShell; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IEditorPart busyOpenEditorBatched(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { // If an editor already exists for the input, use it. IEditorPart editor = null; // Reuse an existing open editor, unless we are in "new editor tab management" mode editor = getEditorManager().findEditor(editorID, input, ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).getReuseEditorMatchFlags(matchFlags)); if (editor != null) { if (IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID.equals(editorID)) { if (editor.isDirty()) { MessageDialog dialog = new MessageDialog( getWorkbenchWindow().getShell(), WorkbenchMessages.Save, null, // accept the default window icon NLS.bind(WorkbenchMessages.WorkbenchPage_editorAlreadyOpenedMsg, input.getName()), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; int saveFile = dialog.open(); if (saveFile == 0) { try { final IEditorPart editorToSave = editor; getWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); } }); } catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); } catch (InterruptedException e) { return null; } } else if (saveFile == 2) { return null; } } } else { // do the IShowEditorInput notification before showing the editor // to reduce flicker if (editor instanceof IShowEditorInput) { ((IShowEditorInput) editor).showEditorInput(input); } showEditor(activate, editor); return editor; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected void swingInvokeLater(Runnable methodRunnable) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final Class swingUtilitiesClass = Class .forName("javax.swing.SwingUtilities"); //$NON-NLS-1$ final Method swingUtilitiesInvokeLaterMethod = swingUtilitiesClass .getMethod("invokeLater", //$NON-NLS-1$ new Class[] { Runnable.class }); swingUtilitiesInvokeLaterMethod.invoke(swingUtilitiesClass, new Object[] { methodRunnable }); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected Object getFocusComponent() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { /* * Before JRE 1.4, one has to use * javax.swing.FocusManager.getCurrentManager().getFocusOwner(). Since * JRE 1.4, one has to use * java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager * ().getFocusOwner(); the use of the older API would install a * LegacyGlueFocusTraversalPolicy which causes endless recursions in * some situations. */ Class keyboardFocusManagerClass = null; try { keyboardFocusManagerClass = Class .forName("java.awt.KeyboardFocusManager"); //$NON-NLS-1$ } catch (ClassNotFoundException e) { // switch to the old guy } if (keyboardFocusManagerClass != null) { // Use JRE 1.4 API final Method keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod = keyboardFocusManagerClass .getMethod("getCurrentKeyboardFocusManager", null); //$NON-NLS-1$ final Object keyboardFocusManager = keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod .invoke(keyboardFocusManagerClass, null); final Method keyboardFocusManagerGetFocusOwner = keyboardFocusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = keyboardFocusManagerGetFocusOwner .invoke(keyboardFocusManager, null); return focusComponent; } // Use JRE 1.3 API final Class focusManagerClass = Class .forName("javax.swing.FocusManager"); //$NON-NLS-1$ final Method focusManagerGetCurrentManagerMethod = focusManagerClass .getMethod("getCurrentManager", null); //$NON-NLS-1$ final Object focusManager = focusManagerGetCurrentManagerMethod .invoke(focusManagerClass, null); final Method focusManagerGetFocusOwner = focusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = focusManagerGetFocusOwner .invoke(focusManager, null); return focusComponent; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
static boolean runProgressMonitorOperation(String opName, final IRunnableWithProgress progressOp, final IRunnableContext runnableContext, final IShellProvider shellProvider) { final boolean[] success = new boolean[] { false }; IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; } }; try { runnableContext.run(false, true, runnable); } catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure } catch (InterruptedException e) { // The user pressed cancel. Fall through to return failure } catch (OperationCanceledException e) { // The user pressed cancel. Fall through to return failure } return success[0]; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorJobsDialog.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { //if it is run in the UI Thread don't do anything. if (!fork) { enableDetails(false); } super.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void busyCursorWhile(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void runInUI(IRunnableContext context, IRunnableWithProgress runnable, ISchedulingRule rule) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().runInUI(context, runnable, rule); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void busyCursorWhile(final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( ProgressManagerUtil.getDefaultParent()); dialog.setOpenOnRun(false); final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; // show a busy cursor until the dialog opens Runnable dialogWaitRunnable = new Runnable() { public void run() { try { dialog.setOpenOnRun(false); setUserInterfaceActive(false); dialog.run(true, true, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0] = e; } finally { setUserInterfaceActive(true); } } }; busyCursorWhile(dialogWaitRunnable, dialog); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { if (fork == false || cancelable == false) { // backward compatible code final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( null); dialog.run(fork, cancelable, runnable); return; } busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void runInUI(final IRunnableContext context, final IRunnableWithProgress runnable, final ISchedulingRule rule) throws InvocationTargetException, InterruptedException { final RunnableWithStatus runnableWithStatus = new RunnableWithStatus( context, runnable, rule); final Display display = Display.getDefault(); display.syncExec(new Runnable() { public void run() { BusyIndicator.showWhile(display, runnableWithStatus); } }); IStatus status = runnableWithStatus.getStatus(); if (!status.isOK()) { Throwable exception = status.getException(); if (exception instanceof InvocationTargetException) throw (InvocationTargetException) exception; else if (exception instanceof InterruptedException) throw (InterruptedException) exception; else // should be OperationCanceledException throw new InterruptedException(exception.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
public void run(final boolean fork, final boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; Runnable dialogWaitRunnable = new Runnable() { public void run() { try { TimeTriggeredProgressMonitorDialog.super.run(fork, cancelable, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0]= e; } } }; final Display display = PlatformUI.getWorkbench().getDisplay(); if (display == null) { return; } //show a busy cursor until the dialog opens BusyIndicator.showWhile(display, dialogWaitRunnable); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { IWorkbenchContextSupport contextSupport = getWorkbench() .getContextSupport(); final boolean keyFilterEnabled = contextSupport.isKeyFilterEnabled(); Control fastViewBarControl = getFastViewBar() == null ? null : getFastViewBar().getControl(); boolean fastViewBarWasEnabled = fastViewBarControl == null ? false : fastViewBarControl.getEnabled(); Control perspectiveBarControl = getPerspectiveBar() == null ? null : getPerspectiveBar().getControl(); boolean perspectiveBarWasEnabled = perspectiveBarControl == null ? false : perspectiveBarControl.getEnabled(); // Cache for any disabled trim controls List disabledControls = null; try { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(false); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(false); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(false); } // Disable all trim -except- the StatusLine if (defaultLayout != null) disabledControls = defaultLayout.disableTrim(getStatusLineTrim()); super.run(fork, cancelable, runnable); } finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); } }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
public final void run() { if (isInvalid()) { return; } Shell parent = getWorkbenchWindow().getShell(); progressDialog = new TimeTriggeredProgressMonitorDialog(parent, getWorkbenchWindow().getWorkbench().getProgressService() .getLongOperationTime()); IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor pm) throws InvocationTargetException { try { runCommand(pm); } catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); } } }; try { boolean runInBackground = false; if (getOperation() instanceof IAdvancedUndoableOperation2) { runInBackground = ((IAdvancedUndoableOperation2) getOperation()) .runInBackground(); } progressDialog.run(runInBackground, true, runnable); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t == null) { reportException(e); } else { reportException(t); } } catch (InterruptedException e) { // Operation was cancelled and acknowledged by runnable with this // exception. // Do nothing. } catch (OperationCanceledException e) { // the operation was cancelled. Do nothing. } finally { progressDialog = null; } }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
public void run(IProgressMonitor pm) throws InvocationTargetException { try { runCommand(pm); } catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); } }
(Domain) MultiPartInitException 1
              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorReference[] openEditors(final IEditorInput[] inputs, final String[] editorIDs, final int matchFlags) throws MultiPartInitException { if (inputs == null) throw new IllegalArgumentException(); if (editorIDs == null) throw new IllegalArgumentException(); if (inputs.length != editorIDs.length) throw new IllegalArgumentException(); final IEditorReference[] results = new IEditorReference[inputs.length]; final PartInitException[] exceptions = new PartInitException[inputs.length]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } } }); boolean hasException = false; for(int i = 0 ; i < results.length; i++) { if (exceptions[i] != null) { hasException = true; } if (results[i] == null) { continue; } window.firePerspectiveChanged(this, getPerspective(), results[i], CHANGE_EDITOR_OPEN); } window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); if (hasException) { throw new MultiPartInitException(results, exceptions); } return results; }
0 1
              
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorReference[] openEditors(final IEditorInput[] inputs, final String[] editorIDs, final int matchFlags) throws MultiPartInitException { if (inputs == null) throw new IllegalArgumentException(); if (editorIDs == null) throw new IllegalArgumentException(); if (inputs.length != editorIDs.length) throw new IllegalArgumentException(); final IEditorReference[] results = new IEditorReference[inputs.length]; final PartInitException[] exceptions = new PartInitException[inputs.length]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } } }); boolean hasException = false; for(int i = 0 ; i < results.length; i++) { if (exceptions[i] != null) { hasException = true; } if (results[i] == null) { continue; } window.firePerspectiveChanged(this, getPerspective(), results[i], CHANGE_EDITOR_OPEN); } window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); if (hasException) { throw new MultiPartInitException(results, exceptions); } return results; }
(Domain) NotHandledException 1
              
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
1
              
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); }
7
              
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(command, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final String commandId, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(commandId, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public Object executeCommandInContext(ParameterizedCommand command, Event event, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommandInContext(command, event, context); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return command.executeWithChecks(trigger, getCurrentState()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final String commandId, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { final Command command = commandService.getCommand(commandId); final ExecutionEvent event = new ExecutionEvent(command, Collections.EMPTY_MAP, trigger, getCurrentState()); return command.executeWithChecks(event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommandInContext( final ParameterizedCommand command, final Event trigger, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { IHandler oldHandler = command.getCommand().getHandler(); IHandler handler = findHandler(command.getId(), context); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(context); } try { command.getCommand().setHandler(handler); return command.executeWithChecks(trigger, context); } finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
(Lib) SWTError 1
              
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
protected ImageRegistry createImageRegistry() { //If we are in the UI Thread use that if(Display.getCurrent() != null) { return new ImageRegistry(Display.getCurrent()); } if(PlatformUI.isWorkbenchRunning()) { return new ImageRegistry(PlatformUI.getWorkbench().getDisplay()); } //Invalid thread access if it is not the UI Thread //and the workbench is not created. throw new SWTError(SWT.ERROR_THREAD_INVALID_ACCESS); }
0 0
Explicit thrown (throw new...): 482/522
Explicit thrown ratio: 92.3%
Builder thrown ratio: 0.4%
Variable thrown ratio: 7.7%
Checked Runtime Total
Domain 48 0 48
Lib 1 361 362
Total 49 361

Caught Exceptions Summary

A (Domain) exception is defined in the application. A (Lib) exception is defined in the JDK or in a library. An exception can be caught, and it happens that the catch block contains a throw (e.g. for wrapping a low-level exception). Hovering over a number triggers showing code snippets from the application code.

Type Exception Caught
(directly)
Caught
with Thrown
(Domain) NotDefinedException 95
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ActivityPersistanceHelper.java
catch (NotDefinedException e) { // can't happen - we're iterating over defined activities }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { // Not defined, so leave as null. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { // Not defined, so leave as null. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandProvider.java
catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (NotDefinedException e) { label.append(command.toString()); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (NotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final NotDefinedException e) { // At least we tried.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/SchemeElement.java
catch (NotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingModel.java
catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java
catch (NotDefinedException e) { // No parentId to check }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java
catch (NotDefinedException e) { // No parentId to check }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setName(NewKeysPreferenceMessages.Undefined_Command); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setDescription(Util.ZERO_LENGTH_STRING); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setCategory(NewKeysPreferenceMessages.Unavailable_Category); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/ContextElement.java
catch (NotDefinedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { return; // no name }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // At least we tried.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Oh, well. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException eNotDefined) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException eNotDefined) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException eNotDefined) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException e) { return -1; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException e) { return 1; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (NotDefinedException e) { // regular condition; do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (final NotDefinedException e) { WorkbenchPlugin.log("The active scheme is not currently defined.", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/keys/CategoryPatternFilter.java
catch (NotDefinedException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotDefinedException e) { // The command is not defined. Forwarded to the IExecutionListener. }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotDefinedException nde) { // Fall through (message == null) }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (NotDefinedException e) { // Not much to do, but this shouldn't really happen. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final NotDefinedException e) { // should not happen return 0; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final NotDefinedException e) { // should not happen return 0; }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
catch (final NotDefinedException e) { // Do nothing. Stop ascending the ancestry. }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
catch (final NotDefinedException e) { // Do nothing. Stop ascending the ancestry. }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/services/RegistryPersistence.java
catch (final NotDefinedException e) { // This should not happen. }
// in Eclipse UI/org/eclipse/ui/internal/services/PreferencePersistence.java
catch (final NotDefinedException e) { // This should not happen. }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityEnabler.java
catch (NotDefinedException e) { descriptionText.setText(""); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityEnabler.java
catch (NotDefinedException e) { // this can't happen - we're iterating over defined activities. }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityLabelProvider.java
catch (NotDefinedException e) { return activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e) { activityText = activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e1) { name = selectedActivity; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e) { desc = RESOURCE_BUNDLE.getString("noDescAvailable"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (NotDefinedException e) { return activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (NotDefinedException e) { return category.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/actions/CommandAction.java
catch (NotDefinedException e) { // if we get this far it shouldn't be a problem }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (NotDefinedException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotDefinedException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotDefinedException e) { // this should never happen }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { // it's OK to not have a helpContextId }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager .getManager() .handle( StatusUtil .newStatus( IStatus.ERROR, "Unable to register menu item \"" + getId() //$NON-NLS-1$ + "\", command \"" + contributionParameters.commandId + "\" not defined", //$NON-NLS-1$ //$NON-NLS-2$ null)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { name = category.getId(); }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { descriptionText.setText(""); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { // this can't happen - we're iterating over defined activities. }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (NotDefinedException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
12
            
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
(Lib) CoreException 85
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { exc[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException core) { throw core; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log( "Unable to create element factory.", e.getStatus()); //$NON-NLS-1$ factory = null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log("Unable to create extension: " + targetID //$NON-NLS-1$ + " in extension point: " + extensionPointId //$NON-NLS-1$ + ", status: ", e.getStatus()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" //$NON-NLS-1$ + element.getAttribute(delegateAttributeName) + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
catch (CoreException e) { // the evalution failed }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
catch (CoreException e) { // OK, this one is out of the running }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
catch (final CoreException e) { /* * TODO If it can't be instantiated, should future attempts to * instantiate be blocked? */ final String message = "The proxied handler for '" + configurationElement.getAttribute(HANDLER_ATTRIBUTE_NAME) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (CoreException e) { // TODO should we log this exception, or just treat it as // a failure }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final CoreException e) { final String message = "The proxied handler for '" + configurationElement.getAttribute(handlerAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/ConfigurationInfo.java
catch (CoreException e) { WorkbenchPlugin.log( "could not create class attribute for extension", //$NON-NLS-1$ e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardNode.java
catch (CoreException e) { IPluginContribution contribution = (IPluginContribution) Util.getAdapter(wizardElement, IPluginContribution.class); statuses[0] = new Status( IStatus.ERROR, contribution != null ? contribution.getPluginId() : WorkbenchPlugin.PI_WORKBENCH, IStatus.OK, WorkbenchMessages.WorkbenchWizard_errorMessage, e); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e1) { StatusUtil.handleStatus(e1.getStatus(), StatusManager.SHOW, parent.getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e) { result.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PropertyPageNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW); page = new EmptyPropertyPage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
catch (CoreException ex) { WorkbenchPlugin.log( "Unable to create action set " + actionSetDesc.getId(), ex); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PreferenceNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW | StatusManager.LOG); page = new ErrorPreferencePage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); return false; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" + configurationElement.getAttribute(delegateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final CoreException e) { final String message = "The proxied widget for '" + configurationElement.getAttribute(widgetAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (CoreException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to instantiate browser support" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesPage.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { //Do not log core exceptions, they indicate the chosen file is not valid //WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_descriptor, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final CoreException e) { final String message = "The proxied state for '" + configurationElement.getAttribute(stateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/services/RegistryPersistence.java
catch (final CoreException e) { // There when expression could not be created. addWarning( warningsToLog, "Problem creating when element", //$NON-NLS-1$ parentElement, id, "whenElementName", whenElementName); //$NON-NLS-1$ return ERROR_EXPRESSION; }
// in Eclipse UI/org/eclipse/ui/internal/services/EvaluationResultCache.java
catch (final CoreException e) { /* * Swallow the exception. It simply means the variable is not * valid it some (most frequently, that the value is null). This * kind of information is not really useful to us, so we can * just treat it as null. */ evaluationResult = EvaluationResult.FALSE; return false; }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
catch (CoreException e) { WorkbenchPlugin.log( "Unable to instantiate help UI" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (CoreException e) { WorkbenchPlugin.log("could not create trigger point advisor", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (CoreException e) { StatusUtil.handleStatus(e.getStatus(), StatusManager.SHOW, shellProvider.getShell()); progressMonitor.setCanceled(true); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { ex[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
// in Eclipse UI/org/eclipse/ui/internal/actions/NewWizardShortcutAction.java
catch (CoreException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.NewWizardShortcutAction_errorTitle, WorkbenchMessages.NewWizardShortcutAction_errorMessage, e.getStatus()); return; }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Tweaklets.java
catch (CoreException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Error with extension " + elements[i], e), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (CoreException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java
catch (CoreException e1) { Label label = new Label(pageComposite, SWT.NONE); label.setText(e1.getMessage()); item.setData(null); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (CoreException ex) { WorkbenchPlugin.log(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IStatus.WARNING, "Could not load intro content detector", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (final CoreException e) { // TODO: give more info (eg plugin id).... // Gather formatting info final String classDef = element.getAttribute(attName); final String message = "Class load Failure: '" + classDef + "'"; //$NON-NLS-1$//$NON-NLS-2$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create layout descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ActionSetRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create action set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WizardsRegistryReader.java
catch (CoreException e) { WorkbenchPlugin.log("Cannot create category: ", e.getStatus());//$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to show a dialog here WorkbenchPlugin.log( "Unable to create view category.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create sticky view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveDescriptor.java
catch (CoreException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create working set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set page: " + //$NON-NLS-1$ pageClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set element adapter: " + //$NON-NLS-1$ result, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set updater: " + //$NON-NLS-1$ updaterClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Unable to create editor contributor: " + //$NON-NLS-1$ id, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Error creating editor management policy for editor id " + getId(), e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to create ActionSet: " + desc.getId(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
catch (CoreException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
catch (CoreException e) { enablement = null; WorkbenchPlugin.log(e); result = false; }
// in Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); return false; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { exceptions[0] = exception; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorManager.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
catch (CoreException exception) { exceptions[0] = exception; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (CoreException e) { cancel(); return new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_jobError, e); }
// in Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
catch (CoreException ex) { logError("Errors during the default handler creating", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java
catch (CoreException e) { WorkbenchPlugin.log("Drop Failed", e.getStatus());//$NON-NLS-1$ }
6
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException core) { throw core; }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
(Lib) IOException 62
            
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingSetSettingsTransfer.java
catch (IOException e) { new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, WorkbenchMessages.ProblemSavingWorkingSetState_message, e); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (IOException e) { unableToOpenPerspective(persp, null); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (IOException e) { perspRegistry.deletePerspective(realDesc); MessageDialog.openError((Shell) null, WorkbenchMessages.Perspective_problemSavingTitle, WorkbenchMessages.Perspective_problemSavingMessage); }
// in Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
catch (IOException e) { bundle = null; }
// in Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
catch (IOException e) { // do nothing if we fail to close }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerActivation.java
catch (IOException e) { // we're a string buffer, there should be no IO exception }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
catch (IOException e) { // should never get this. }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final IOException e) { // At least I tried. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { // At least I tried. }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { openWebBrowserError(d); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; webBrowser = "mozilla"; //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; webBrowser = "netscape"; //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; throw e; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (IOException e) { // Program file is not in the plugin directory }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (IOException eIO) { }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (IOException eIO) { }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleGroupData.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleGroupData.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
catch (IOException e) { isSigned = false; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (IOException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (IOException e) { // default "unsigned info" is ok for the user, but log the // problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (IOException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutPluginsPage.java
catch (IOException e) { // skip the about dir if its not found or there are other // problems. }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutPluginsPage.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutData.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (IOException exception) { ProgressManagerUtil.logException(exception); return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (IOException e) { handleInternalError( e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (IOException e) { stateFile.delete(); handleInternalError(e, WorkbenchMessages.ProblemSavingWorkingSetState_title, WorkbenchMessages.ProblemSavingWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (IOException e) { unableToLoadPerspective(null); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (IOException e) { unableToLoadPerspective(null); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { //Ignore this as the workbench may not yet have saved any state return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { WorkbenchPlugin.log("Error reading editors: Could not close steam", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { MessageDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { WorkbenchPlugin.log("Error reading resources: Could not close steam", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Saving Problems", //$NON-NLS-1$ "Unable to save resource associations."); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { ex.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Error", "Unable to save resource associations."); //$NON-NLS-1$ //$NON-NLS-2$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { ex.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchLayoutSettingsTransfer.java
catch (IOException e) { return new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, WorkbenchMessages.Workbench_problemsSavingMsg, e); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { // he's done for }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { stateFile.delete(); MessageDialog.openError((Shell) null, WorkbenchMessages.SavingProblem, WorkbenchMessages.ProblemSavingState); return false; }
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (IOException e) { // Simply don't store the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_storeError, e)); }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // load failed so ensure we have an empty settings dialogSettings = new DialogSettings("Workbench"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // load failed so ensure we have an empty settings dialogSettings = new DialogSettings("Workbench"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // spec'ed to ignore problems }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
catch (IOException e) { }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/part/PluginTransfer.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/part/PluginTransfer.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (IOException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_ioError; }
2
            
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; throw e; }
(Domain) PartInitException 40
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.ShowView_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { childMem.putString(IWorkbenchConstants.TAG_REMOVED, "true"); //$NON-NLS-1$ result.add(StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e)); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { IStatus status = StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e); StatusUtil.handleStatus(status, "Failed to create view: id=" + viewId, //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { WorkbenchPlugin.log("Could not restore intro", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { ex[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { ex[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { result[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { exceptions[i] = e; results[i] = null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
catch (PartInitException e) { DialogUtil.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.Error, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java
catch (PartInitException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/ViewElement.java
catch (PartInitException e) { }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchEditorsDialog.java
catch (PartInitException e) { }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager32.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addEditorArea()", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addFastView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "stackView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e1) { WorkbenchPlugin.log(e1); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException ex) { result.add(ex.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (PartInitException e) { openWebBrowserError(shell, href, e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open intro", new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open intro", e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_part, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_part, e)); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManagerUtil.java
catch (PartInitException exception) { logException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (PartInitException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (PartInitException e1) { input = new NullEditorInput(this); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewAction.java
catch (PartInitException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.ShowView_errorTitle, e.getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "identifierChanged", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "perspectiveActivated", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/NavigationHistoryEntry.java
catch (PartInitException e) { // ignore for now }
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
catch (PartInitException e2) { String title = WorkbenchMessages.OpenRecent_errorTitle; MessageDialog.openWarning(window.getShell(), title, e2 .getMessage()); history.remove(item); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
catch (PartInitException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/FolderLayout.java
catch (PartInitException e) { // cannot safely open the dialog so log the problem WorkbenchPlugin.log(getClass(), "addView(String)", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (PartInitException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (PartInitException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); return null; }
// in Eclipse UI/org/eclipse/ui/part/PageBookView.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "initPage", e); //$NON-NLS-1$ }
2
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ }
(Lib) Exception 30
            
// in Eclipse UI/org/eclipse/ui/internal/splash/EclipseSplashHandler.java
catch (Exception ex) { foregroundColorInteger = 0xD2D7FF; // off white }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/HeapStatus.java
catch (Exception e) { // ignore if method missing or if there are other failures trying to determine the max }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (Exception e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (Exception ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (Exception ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityPropertyTester.java
catch (Exception e) { // workbench not yet activated; nothing enabled yet }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityPropertyTester.java
catch (Exception e) { // workbench not yet activated; nothing enabled yet }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
catch (Exception e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { // ignore exceptions return false; }
// in Eclipse UI/org/eclipse/ui/internal/actions/CommandAction.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractSelectionService.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractSelectionService.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
catch (Exception ex) { // protecting against assertion failures WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doRemove", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doAdd", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { content.dispose(); StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); return null; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING, "Could not start styling support.", //$NON-NLS-1$ ex)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final Exception e) { if (!display.isDisposed()) { handler.handleException(e); } else { String msg = "Exception in Workbench.runUI after display was disposed"; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, "Exceptions during shutdown", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.java
catch (Exception e) { WorkbenchPlugin.log(RESOURCE_BUNDLE .getString("Colors.badFactory"), //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (Exception ex) { WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Exception e) { content.dispose(); StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); return null; }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (Exception e) { // ignore }
6
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ }
(Domain) WorkbenchException 28
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (WorkbenchException e) { unableToOpenPerspective(persp, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/OpenInNewWindowHandler.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
catch (WorkbenchException e) { IStatus errorStatus = WorkbenchPlugin.newError(NLS.bind( WorkbenchMessages.Workbench_showPerspectiveError, descriptor.getLabel()), e); StatusManager.getManager().handle(errorStatus, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final WorkbenchException e) { // Could not initialize the preference memento. }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (WorkbenchException e) { handleInternalError( e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { windowManager.remove(newWindow); exceptions[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { String msg = "Workbench exception showing specified command line perspective on startup."; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final WorkbenchException e) { // Don't use the window's shell as the dialog parent, // as the window is not open yet (bug 76724). StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { result[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { status.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
catch (WorkbenchException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { result[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to restore perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); continue; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (WorkbenchException e) { // Simply don't restore the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_restoreError, e)); }
// in Eclipse UI/org/eclipse/ui/actions/OpenPerspectiveMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( PAGE_PROBLEMS_TITLE + ": " + e.getMessage(), e, //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewWindowMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewWindowMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenInNewWindowAction.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewPageMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewPageMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
catch (WorkbenchException e) { return null; }
1
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ }
(Lib) InvocationTargetException 23
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (InvocationTargetException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (InvocationTargetException e) { log(e); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (InvocationTargetException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (InvocationTargetException e) { if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException)e.getTargetException(); } WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InvocationTargetException e) { invokes[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InvocationTargetException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (InvocationTargetException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (InvocationTargetException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (InvocationTargetException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (InvocationTargetException e) { reportException(e, uiInfo); return IOperationHistory.OPERATION_INVALID_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
catch (InvocationTargetException e) { invokes[0] = e; }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (InvocationTargetException e) { // should not happen - fall through if it does }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (InvocationTargetException e) { // Method.invoke can throw InvocationTargetException if there is // an exception in the invoked method. // Charset.isSupported() is specified to throw IllegalCharsetNameException only // which we want to return false for. return false; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t == null) { reportException(e); } else { reportException(t); } }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (InvocationTargetException exception) { return false; }
5
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (InvocationTargetException e) { if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException)e.getTargetException(); } WorkbenchPlugin.log(e); return; }
(Lib) NumberFormatException 22
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return DOUBLE_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return FLOAT_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return INT_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return LONG_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NumberFormatException e) { // leave size value at MIN_DEFAULT_WIDTH }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (NumberFormatException e) { // skip this one }
// in Eclipse UI/org/eclipse/ui/internal/ActionDescriptor.java
catch (NumberFormatException e) { WorkbenchPlugin.log("Invalid accelerator declaration for action: " + id, e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/layout/TrimDragPreferenceDialog.java
catch (NumberFormatException e) { // If it fails...just leave it... }
// in Eclipse UI/org/eclipse/ui/internal/presentations/PresentationSerializer.java
catch (NumberFormatException e) { }
// in Eclipse UI/org/eclipse/ui/internal/misc/UIStats.java
catch (NumberFormatException e) { //this is just debugging code -- ok to swallow exception }
// in Eclipse UI/org/eclipse/ui/internal/util/ConfigurationElementMemento.java
catch (NumberFormatException eNumberFormat) { }
// in Eclipse UI/org/eclipse/ui/internal/util/ConfigurationElementMemento.java
catch (NumberFormatException eNumberFormat) { }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
catch (NumberFormatException e) { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveExtensionReader.java
catch (NumberFormatException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/themes/Theme.java
catch (NumberFormatException e) { return 0; }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (NumberFormatException e) { mode = UNKNOWN; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (NumberFormatException e) { WorkbenchPlugin.log("Memento problem - Invalid float for key: " //$NON-NLS-1$ + key + " value: " + strValue, e); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (NumberFormatException e) { WorkbenchPlugin .log("Memento problem - invalid integer for key: " + key //$NON-NLS-1$ + " value: " + strValue, e); //$NON-NLS-1$ return null; }
0
(Domain) ExecutionException 21
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final ExecutionException e) { firePropertyChange(IAction.RESULT, null, Boolean.FALSE); // TODO Should this be logged? }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WorkbenchWindowHandlerDelegate.java
catch (final ExecutionException e) { // TODO Do something meaningful and poignant. }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (ExecutionException ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (ExecutionException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (final ExecutionException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (ExecutionException e) { reportException(e, uiInfo); status = IOperationHistory.OPERATION_INVALID_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (ExecutionException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (ExecutionException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
// in Eclipse UI/org/eclipse/ui/operations/LinearUndoViolationUserApprover.java
catch (ExecutionException e) { // flush the redo history here because it failed. history.dispose(context, false, true, false); return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/LinearUndoViolationUserApprover.java
catch (ExecutionException e) { // flush the undo history here because something went wrong. history.dispose(context, true, false, false); return Status.CANCEL_STATUS; }
4
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
(Lib) NoSuchMethodException 18
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoSuchMethodException e2) { // cant find either method - don't do anything. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (NoSuchMethodException e) { // Fall through... }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (NoSuchMethodException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (NoSuchMethodException e) { // I can't get the text limit. Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (NoSuchMethodException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/TraversePageHandler.java
catch (NoSuchMethodException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (NoSuchMethodException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (NoSuchMethodException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (NoSuchMethodException e) { WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (NoSuchMethodException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (NoSuchMethodException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (NoSuchMethodException e) { // do nothing - play it safe }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (NoSuchMethodException e) { // should not happen - fall through if it does }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (NoSuchMethodException exception) { //Couldn't find the method so return false return false; }
3
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
(Lib) InterruptedException 17
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InterruptedException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (InterruptedException e) { openWebBrowserError(d); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (InterruptedException e) { log(e); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InterruptedException e) { // The user pressed cancel. Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InterruptedException e) { return true; }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/testing/WorkbenchTestable.java
catch (InterruptedException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java
catch (InterruptedException e) { // Do not log as this is a common operation from the // lock listener }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InterruptedException e) { interrupt[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InterruptedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/AnimationEngine.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (InterruptedException e) { // Operation was cancelled and acknowledged by runnable with this // exception. Do nothing. return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
catch (InterruptedException e) { interrupt[0]= e; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
catch (InterruptedException e) { // Cancel and try again if there was an error schedule(); return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (InterruptedException e) { // Operation was cancelled and acknowledged by runnable with this // exception. // Do nothing. }
0
(Lib) IllegalAccessException 16
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final IllegalAccessException e) { // The method is protected, so do // nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The method is protected, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final IllegalAccessException e) { // The method is protected, so do // nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (IllegalAccessException e) { // The method is protected, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (IllegalAccessException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (IllegalAccessException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalAccessException e) { WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalAccessException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalAccessException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalAccessException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (IllegalAccessException e) { // should not happen - fall through if it does }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (IllegalAccessException e) { // fall through }
// in Eclipse UI/org/eclipse/ui/themes/ColorUtil.java
catch (IllegalAccessException e) { // no op - shouldnt happen. We check for public before calling // getInt(null) }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (IllegalAccessException exception) { return null; }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (IllegalAccessException exception) { return false; }
1
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
(Lib) IllegalArgumentException 16
            
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plugin \'" //$NON-NLS-1$ + menuElement.getContributor().getName() + "\' invalid Menu Extension (Group \'" //$NON-NLS-1$ + group + "\' is missing): " + id); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() + "' contributed an invalid Menu Extension (Group: '" + mgroup + "' is missing): " + ad.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() //$NON-NLS-1$ + "' invalid Toolbar Extension (Group \'" //$NON-NLS-1$ + tgroup + "\' is missing): " + ad.getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final IllegalArgumentException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement, commandId, "keySequence", //$NON-NLS-1$ keySequenceText); return null; }
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
catch (IllegalArgumentException e) { addWarning(warningsToLog, "invalid keybinding: " + e.getMessage(), element, //$NON-NLS-1$ command.getCommand().getId()); }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (IllegalArgumentException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorRegistry.java
catch (IllegalArgumentException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "invalid trigger point advisor extension", //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e .getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutTextManager.java
catch (IllegalArgumentException ex) { // leave value as -1 }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalArgumentException e) { throw e; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalArgumentException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalArgumentException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalArgumentException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
catch (IllegalArgumentException e) { m.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
catch (IllegalArgumentException e) { m.add(item); }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (IllegalArgumentException e) { //fall through }
// in Eclipse UI/org/eclipse/ui/themes/ColorUtil.java
catch (IllegalArgumentException e) { // no op - shouldnt happen. We check for static before calling // getInt(null) }
1
            
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalArgumentException e) { throw e; }
(Lib) Throwable 16
            
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
catch (Throwable t) { this.throwable = t; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/EventLoopProgressMonitor.java
catch (Throwable e) {//Handle the exception the same way as the workbench handler.handleException(e); break; }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dock.", e); //$NON-NLS-1$ } StatusUtil.handleStatus(status, "widget delegate failed on dock: id = " + proxy.getId(), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Throwable t) { // The exception is already logged. result .add(new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, WorkbenchMessages.EditorManager_exceptionRestoringEditor, t)); }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
catch (Throwable e) { runAttribute = null; IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in action delegate error on creation.", e); //$NON-NLS-1$ } String id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); WorkbenchPlugin .log( "Could not create action delegate for id: " + id, status); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Throwable e) { error[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Throwable t) { handler.handleException(t); // In case Display was closed under us if (display.isDisposed()) runEventLoop = false; }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
catch (Throwable e) { // One of the log listeners probably failed. Core should have logged // the // exception since its the first listener. System.err.println("Error while logging event loop exception:"); //$NON-NLS-1$ exception.printStackTrace(); System.err.println("Logging exception:"); //$NON-NLS-1$ e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
catch (Throwable e) { error[0] = e; }
// in Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
catch (Throwable ex) { // The used status handler failed logError(statusAdapter.getStatus()); logError("Error occurred during status handling", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/progress/UIJob.java
catch(Throwable t){ throwable = t; }
4
            
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); }
(Domain) NotHandledException 15
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e) { }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotHandledException e) { firePropertyChange(IAction.RESULT, null, Boolean.FALSE); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (NotHandledException e) { // regular condition; do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotHandledException e) { // There is no handler. Forwarded to the IExecutionListener. }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (NotHandledException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotHandledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotHandledException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotHandledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (NotHandledException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
1
            
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); }
(Lib) RuntimeException 14
            
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (RuntimeException e) { activeFastView = null; }
// in Eclipse UI/org/eclipse/ui/internal/PartPane.java
catch (RuntimeException ex) { StatusUtil.handleStatus(ex, StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
catch (RuntimeException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (RuntimeException e) { WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorDisposePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
catch (RuntimeException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
catch (RuntimeException e) { WorkbenchPlugin.log(e); }
0
            
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
(Lib) NotEnabledException 13
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (NotEnabledException e) { // regular condition; do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotEnabledException e) { // The command is not enabled. Forwarded to the IExecutionListener. }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (NotEnabledException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotEnabledException e) { status = new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotEnabledException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotEnabledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (NotEnabledException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
0
(Lib) ClassNotFoundException 10
            
// in Eclipse UI/org/eclipse/ui/BasicWorkingSetElementAdapter.java
catch (ClassNotFoundException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (ClassNotFoundException e) { // switch to the old guy }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (ClassNotFoundException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (ClassNotFoundException e) { // unable to load the class - sounds pretty serious // treat as if the plug-in were unavailable resourceAdapterPossible = false; return null; }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (ClassNotFoundException e) { // unable to load ITextSelection - sounds pretty serious // treat as if JFace text plug-in were unavailable textSelectionPossible = false; return null; }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (ClassNotFoundException exception) { return null; }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (ClassNotFoundException exception) { //Couldn't ask so return false return false; }
0
(Domain) ParseException 9
            
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final ParseException e) { addWarning(warningsToLog, "Could not parse", null, //$NON-NLS-1$ commandId, "keySequence", keySequenceText); //$NON-NLS-1$ continue; }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch(ParseException e) { bindings.clear(); addWarning( warningsToLog, "Cannot create modified sequence for key binding", //$NON-NLS-1$ sequenceModifier, parameterizedCommand.getId(), ATT_REPLACE, replaceSequence); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final ParseException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement, commandId, "keySequence", //$NON-NLS-1$ keySequenceText); return null; }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (ParseException e) { outOfOrderKeys = KeySequence.getInstance(); String message = "Could not parse out-of-order keys definition: 'ESC DEL'. Continuing with no out-of-order keys."; //$NON-NLS-1$ WorkbenchPlugin.log(message, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e)); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return new HashMap(); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final org.eclipse.ui.keys.ParseException e) { return new HashMap(); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return false; }
0
(Lib) ClassCastException 7
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied handler was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied widget was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final ClassCastException e) { final String message = "The proxied state was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
2
            
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ }
(Lib) DeviceResourceException 7
            
// in Eclipse UI/org/eclipse/ui/model/WorkbenchPartLabelProvider.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(getClass(), "getImage", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
catch (final DeviceResourceException e) { final String message = "Problem retrieving image for a command '" //$NON-NLS-1$ + commandId + '\''; final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (DeviceResourceException e) { //ignore }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (DeviceResourceException e1) { WorkbenchPlugin.log(e1); return; }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(e); }
0
(Lib) IllegalStateException 6
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (IllegalStateException e) { // This occurs if -data=@none is explicitly specified, so ignore this silently. // Is this OK? See bug 85071. return null; }
// in Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
catch (IllegalStateException e) { e.printStackTrace(); root = null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutPluginsPage.java
catch (IllegalStateException e) { // the bundle we're testing has been unloaded. Do // nothing. }
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
catch (IllegalStateException e) { // an invalid component; remove it IWorkingSet[] tmp = new IWorkingSet[components.length - 1]; if (i > 0) System.arraycopy(components, 0, tmp, 0, i); if (components.length - i - 1 > 0) System.arraycopy(components, i + 1, tmp, i, components.length - i - 1); components = tmp; workingSetMemento = null; // toss cached info fireWorkingSetChanged(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); continue; }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IllegalStateException e) { // spec'ed to ignore problems }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IllegalStateException e) { // This occurs if -data=@none is explicitly specified, so ignore this silently. // Is this OK? See bug 85071. return null; }
0
(Lib) OperationCanceledException 6
            
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (OperationCanceledException e) { // The user pressed cancel. Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (OperationCanceledException e) { }
// in Eclipse UI/org/eclipse/ui/internal/testing/WorkbenchTestable.java
catch (OperationCanceledException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (OperationCanceledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (OperationCanceledException e) { return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (OperationCanceledException e) { // the operation was cancelled. Do nothing. }
0
(Lib) BackingStoreException 5
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { return;// No need to report here as the node won't have the // listener }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
catch (BackingStoreException e) { String msg = e.getMessage(); if (msg == null) { msg = WorkbenchMessages.FilteredPreferenceDialog_PreferenceSaveFailed; } StatusUtil .handleStatus( WorkbenchMessages.PreferencesExportDialog_ErrorDialogTitle + ": " + msg, e, StatusManager.SHOW, //$NON-NLS-1$ getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/util/PrefUtil.java
catch (BackingStoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
1
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
(Lib) FileNotFoundException 5
            
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (FileNotFoundException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (FileNotFoundException exception) { ProgressManagerUtil.logException(exception); return null; }
0
(Lib) MalformedURLException 5
            
// in Eclipse UI/org/eclipse/ui/internal/BrandingProperties.java
catch (MalformedURLException e) { if (definingBundle != null) { return Platform.find(definingBundle, new Path(value)); } }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (MalformedURLException e) { openWebBrowserError(shell, href, e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManagerUtil.java
catch (MalformedURLException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (MalformedURLException e) { ProgressManagerUtil.logException(e); }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (MalformedURLException e) { return null; }
0
(Lib) SecurityException 4
            
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (SecurityException e) { throw e; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (SecurityException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (SecurityException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (SecurityException e) { // do nothing - play it safe }
1
            
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (SecurityException e) { throw e; }
(Domain) CommandException 3
            
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final CommandException e) { logException(e, binding.getParameterizedCommand()); return true; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final CommandException e) { workbenchKeyboard.logException(e, binding .getParameterizedCommand()); }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final CommandException e) { /* * TODO There should be an API on IHandlerService that handles * the exceptions. */ }
0
(Lib) DataFormatException 2
            
// in Eclipse UI/org/eclipse/ui/internal/themes/Theme.java
catch (DataFormatException e) { //no-op }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorDefinition.java
catch (DataFormatException e) { parsedValue = DEFAULT_COLOR_VALUE; IStatus status = StatusUtil.newStatus(IStatus.WARNING, "Could not parse value for theme color " + id, e); //$NON-NLS-1$ StatusManager.getManager().handle(status, StatusManager.LOG); }
0
(Lib) GeneralSecurityException 2
            
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
catch (GeneralSecurityException e){ isSigned = false; }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (GeneralSecurityException e) { // default "unsigned info is ok, but log the problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
0
(Lib) InvalidRegistryObjectException 2
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (InvalidRegistryObjectException e) { buffer.append(actionId); }
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (InvalidRegistryObjectException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
0
(Lib) MissingResourceException 2
            
// in Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
catch (MissingResourceException e) { found = false; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (MissingResourceException eMissingResource) { if (signal) { WorkbenchPlugin.log(eMissingResource); } }
0
(Lib) ParserConfigurationException 2
            
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }
1
            
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }
(Lib) SWTException 2
            
// in Eclipse UI/org/eclipse/ui/internal/ImageCycleFeedbackBase.java
catch (SWTException ex) { IStatus status = StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, ex); StatusManager.getManager().handle(status); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (SWTException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
0
(Lib) BundleException 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (BundleException e) { WorkbenchPlugin.log("Unable to load UI activator", e); //$NON-NLS-1$ }
0
(Lib) CloneNotSupportedException 1
            
// in Eclipse UI/org/eclipse/ui/internal/registry/FileEditorMapping.java
catch (CloneNotSupportedException e) { return null; }
0
(Lib) InstantiationException 1
            
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (InstantiationException exception) { return null; }
0
(Lib) InvalidSyntaxException 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (InvalidSyntaxException e) { return null; }
0
(Lib) LinkageError 1
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (LinkageError e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
0
(Lib) NoClassDefFoundError 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoClassDefFoundError e) { // the ICU Base bundle used in place of ICU? return null; }
0
(Lib) SAXException 1
            
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (SAXException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_formatError; }
0

Exception Recast Summary

There is a common practice of throwing exceptions from within a catch block (e.g. for wrapping a low-level exception). The following table summarizes the usage of this practice in the application. The last column gives the number of times it happens for a pair of exceptions. The graph below the table graphically renders the same information. For a given node, its color represents its origin (blue means library exception, orange means domain exception); the left-most number is the number of times it is thrown, the right-most is the number of times it is caught.

Catch Throw
(Lib) BackingStoreException
(Lib) IOException
1
                    
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
(Lib) IOException
(Domain) PartInitException
Unknown
1
                    
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; throw e; }
(Lib) IllegalArgumentException
Unknown
1
                    
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalArgumentException e) { throw e; }
(Domain) ExecutionException
(Domain) ExecutionException
(Lib) InvocationTargetException
3
                    
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
1
                    
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
(Domain) WorkbenchException
(Domain) ExecutionException
1
                    
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ }
(Domain) PartInitException
(Domain) ExecutionException
2
                    
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ }
(Lib) Exception
(Lib) CoreException
(Domain) PartInitException
(Domain) ExecutionException
Unknown
2
                    
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
2
                    
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
1
                    
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
(Domain) NotDefinedException
(Lib) Error
(Domain) NotDefinedException
4
                    
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ }
8
                    
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
(Domain) NotHandledException
(Domain) NotHandledException
1
                    
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); }
(Lib) CoreException
(Domain) WorkbenchException
(Domain) ExecutionException
(Lib) ParameterValuesException
(Lib) ParameterValueConversionException
(Domain) PartInitException
Unknown
1
                    
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException core) { throw core; }
(Lib) NoSuchMethodException
(Lib) Error
3
                    
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
(Lib) InvocationTargetException
(Domain) ExecutionException
(Lib) Error
Unknown
2
                    
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
2
                    
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (InvocationTargetException e) { if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException)e.getTargetException(); } WorkbenchPlugin.log(e); return; }
(Lib) Throwable
(Domain) PartInitException
(Domain) ParseException
Unknown
1
                    
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
2
                    
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
(Lib) ClassCastException
(Lib) ParameterValuesException
(Lib) ParameterValueConversionException
1
                    
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ }
1
                    
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ }
(Lib) IllegalAccessException
(Lib) Error
1
                    
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
(Lib) SecurityException
Unknown
1
                    
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (SecurityException e) { throw e; }
(Lib) ParserConfigurationException
(Lib) Error
1
                    
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }

Caught / Thrown Exception

Not all exceptions are thrown AND caught in the same project. The following table gives the exceptions types with respect to this. The lower left hand side sell lists all exceptions thrown but not caught (prevalent for libraries), the upper right-hand side lists all exceptions caught but not thrown (usually coming from external dependencies).

Thrown Not Thrown
Caught
Type Name
(Lib) IOException
(Lib) IllegalArgumentException
(Lib) IllegalStateException
(Domain) ExecutionException
(Domain) WorkbenchException
(Domain) PartInitException
(Domain) ParseException
(Domain) NotDefinedException
(Domain) NotHandledException
(Lib) CoreException
(Lib) RuntimeException
(Lib) InvocationTargetException
(Lib) InterruptedException
Type Name
(Lib) NumberFormatException
(Lib) BackingStoreException
(Lib) ClassNotFoundException
(Lib) DeviceResourceException
(Lib) Exception
(Domain) CommandException
(Lib) NotEnabledException
(Lib) BundleException
(Lib) NoClassDefFoundError
(Lib) InvalidSyntaxException
(Lib) NoSuchMethodException
(Lib) SWTException
(Lib) MissingResourceException
(Lib) MalformedURLException
(Lib) Throwable
(Lib) ClassCastException
(Lib) InvalidRegistryObjectException
(Lib) IllegalAccessException
(Lib) LinkageError
(Lib) FileNotFoundException
(Lib) OperationCanceledException
(Lib) GeneralSecurityException
(Lib) SecurityException
(Lib) CloneNotSupportedException
(Lib) DataFormatException
(Lib) ParserConfigurationException
(Lib) SAXException
(Lib) InstantiationException
Not caught
Type Name
(Lib) UnsupportedOperationException
(Lib) NullPointerException
(Domain) MultiPartInitException
(Lib) Error
(Lib) ParameterValuesException
(Lib) ParameterValueConversionException
(Lib) SWTError
(Domain) CommandNotMappedException

Methods called in Catch and Finally Blocks

The following shows the methods that are called inside catch blocks (first column) and finally blocks (second column). For each method, we give the number of times it is called in a catch block (second sub-column), and the total number of calls (third sub-column). If the method name is red, it means that it is only called from catch/finally blocks. Hovering over a number triggers showing code snippets from the application code.

Catch Finally
Method Nbr Nbr total
log 118
                  
// in Eclipse UI/org/eclipse/ui/BasicWorkingSetElementAdapter.java
catch (ClassNotFoundException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/model/WorkbenchPartLabelProvider.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(getClass(), "getImage", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log( "Unable to create element factory.", e.getStatus()); //$NON-NLS-1$ factory = null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log("Unable to create extension: " + targetID //$NON-NLS-1$ + " in extension point: " + extensionPointId //$NON-NLS-1$ + ", status: ", e.getStatus()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (BundleException e) { WorkbenchPlugin.log("Unable to load UI activator", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ActionDescriptor.java
catch (NumberFormatException e) { WorkbenchPlugin.log("Invalid accelerator declaration for action: " + id, e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plugin \'" //$NON-NLS-1$ + menuElement.getContributor().getName() + "\' invalid Menu Extension (Group \'" //$NON-NLS-1$ + group + "\' is missing): " + id); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() + "' contributed an invalid Menu Extension (Group: '" + mgroup + "' is missing): " + ad.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() //$NON-NLS-1$ + "' invalid Toolbar Extension (Group \'" //$NON-NLS-1$ + tgroup + "\' is missing): " + ad.getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { WorkbenchPlugin.log("Could not restore intro", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" //$NON-NLS-1$ + element.getAttribute(delegateAttributeName) + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
catch (final CoreException e) { /* * TODO If it can't be instantiated, should future attempts to * instantiate be blocked? */ final String message = "The proxied handler for '" + configurationElement.getAttribute(HANDLER_ATTRIBUTE_NAME) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (Exception e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (LinkageError e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied handler was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final CoreException e) { final String message = "The proxied handler for '" + configurationElement.getAttribute(handlerAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/ConfigurationInfo.java
catch (CoreException e) { WorkbenchPlugin.log( "could not create class attribute for extension", //$NON-NLS-1$ e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (final NotDefinedException e) { WorkbenchPlugin.log("The active scheme is not currently defined.", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (ParseException e) { outOfOrderKeys = KeySequence.getInstance(); String message = "Could not parse out-of-order keys definition: 'ESC DEL'. Continuing with no out-of-order keys."; //$NON-NLS-1$ WorkbenchPlugin.log(message, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e)); }
// in Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
catch (final DeviceResourceException e) { final String message = "Problem retrieving image for a command '" //$NON-NLS-1$ + commandId + '\''; final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
catch (CoreException ex) { WorkbenchPlugin.log( "Unable to create action set " + actionSetDesc.getId(), ex); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); return false; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" + configurationElement.getAttribute(delegateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied widget was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final CoreException e) { final String message = "The proxied widget for '" + configurationElement.getAttribute(widgetAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to instantiate browser support" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesPage.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_descriptor, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager32.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final ClassCastException e) { final String message = "The proxied state was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final CoreException e) { final String message = "The proxied state for '" + configurationElement.getAttribute(stateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addEditorArea()", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addFastView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "stackView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
catch (CoreException e) { WorkbenchPlugin.log( "Unable to instantiate help UI" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorRegistry.java
catch (IllegalArgumentException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "invalid trigger point advisor extension", //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e .getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (InvocationTargetException e) { log(e); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (InterruptedException e) { log(e); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (CoreException e) { WorkbenchPlugin.log("could not create trigger point advisor", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e1) { WorkbenchPlugin.log(e1); }
// in Eclipse UI/org/eclipse/ui/internal/actions/CommandAction.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open intro", new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open intro", e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_part, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_part, e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (CoreException ex) { WorkbenchPlugin.log(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IStatus.WARNING, "Could not load intro content detector", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/AbstractSelectionService.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractSelectionService.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (DeviceResourceException e1) { WorkbenchPlugin.log(e1); return; }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalAccessException e) { WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (InvocationTargetException e) { if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException)e.getTargetException(); } WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (NoSuchMethodException e) { WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (MissingResourceException eMissingResource) { if (signal) { WorkbenchPlugin.log(eMissingResource); } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (final CoreException e) { // TODO: give more info (eg plugin id).... // Gather formatting info final String classDef = element.getAttribute(attName); final String message = "Class load Failure: '" + classDef + "'"; //$NON-NLS-1$//$NON-NLS-2$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/util/PrefUtil.java
catch (BackingStoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
catch (Exception ex) { // protecting against assertion failures WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create layout descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ActionSetRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create action set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WizardsRegistryReader.java
catch (CoreException e) { WorkbenchPlugin.log("Cannot create category: ", e.getStatus());//$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to show a dialog here WorkbenchPlugin.log( "Unable to create view category.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create sticky view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create working set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { WorkbenchPlugin.log("Error reading editors: Could not close steam", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { WorkbenchPlugin.log("Error reading resources: Could not close steam", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set page: " + //$NON-NLS-1$ pageClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set element adapter: " + //$NON-NLS-1$ result, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set updater: " + //$NON-NLS-1$ updaterClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doRemove", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doAdd", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Unable to create editor contributor: " + //$NON-NLS-1$ id, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Error creating editor management policy for editor id " + getId(), e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to create ActionSet: " + desc.getId(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
catch (Throwable e) { runAttribute = null; IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in action delegate error on creation.", e); //$NON-NLS-1$ } String id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); WorkbenchPlugin .log( "Could not create action delegate for id: " + id, status); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "identifierChanged", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "perspectiveActivated", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
catch (CoreException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
catch (CoreException e) { enablement = null; WorkbenchPlugin.log(e); result = false; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { String msg = "Workbench exception showing specified command line perspective on startup."; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING, "Could not start styling support.", //$NON-NLS-1$ ex)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final Exception e) { if (!display.isDisposed()) { handler.handleException(e); } else { String msg = "Exception in Workbench.runUI after display was disposed"; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (RuntimeException e) { WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorDisposePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.java
catch (Exception e) { WorkbenchPlugin.log(RESOURCE_BUNDLE .getString("Colors.badFactory"), //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorManager.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (Exception ex) { WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to restore perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); continue; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
// in Eclipse UI/org/eclipse/ui/internal/FolderLayout.java
catch (PartInitException e) { // cannot safely open the dialog so log the problem WorkbenchPlugin.log(getClass(), "addView(String)", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java
catch (CoreException e) { WorkbenchPlugin.log("Drop Failed", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
catch (RuntimeException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
catch (RuntimeException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/part/PageBookView.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "initPage", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (NumberFormatException e) { WorkbenchPlugin.log("Memento problem - Invalid float for key: " //$NON-NLS-1$ + key + " value: " + strValue, e); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (NumberFormatException e) { WorkbenchPlugin .log("Memento problem - invalid integer for key: " + key //$NON-NLS-1$ + " value: " + strValue, e); //$NON-NLS-1$ return null; }
261
Status 59
                  
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingSetSettingsTransfer.java
catch (IOException e) { new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, WorkbenchMessages.ProblemSavingWorkingSetState_message, e); }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" //$NON-NLS-1$ + element.getAttribute(delegateAttributeName) + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
catch (final CoreException e) { /* * TODO If it can't be instantiated, should future attempts to * instantiate be blocked? */ final String message = "The proxied handler for '" + configurationElement.getAttribute(HANDLER_ATTRIBUTE_NAME) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied handler was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final CoreException e) { final String message = "The proxied handler for '" + configurationElement.getAttribute(handlerAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (ParseException e) { outOfOrderKeys = KeySequence.getInstance(); String message = "Could not parse out-of-order keys definition: 'ESC DEL'. Continuing with no out-of-order keys."; //$NON-NLS-1$ WorkbenchPlugin.log(message, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e)); }
// in Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
catch (final DeviceResourceException e) { final String message = "Problem retrieving image for a command '" //$NON-NLS-1$ + commandId + '\''; final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardNode.java
catch (CoreException e) { IPluginContribution contribution = (IPluginContribution) Util.getAdapter(wizardElement, IPluginContribution.class); statuses[0] = new Status( IStatus.ERROR, contribution != null ? contribution.getPluginId() : WorkbenchPlugin.PI_WORKBENCH, IStatus.OK, WorkbenchMessages.WorkbenchWizard_errorMessage, e); }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" + configurationElement.getAttribute(delegateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied widget was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final CoreException e) { final String message = "The proxied widget for '" + configurationElement.getAttribute(widgetAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager32.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final ClassCastException e) { final String message = "The proxied state was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final CoreException e) { final String message = "The proxied state for '" + configurationElement.getAttribute(stateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Throwable t) { // The exception is already logged. result .add(new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, WorkbenchMessages.EditorManager_exceptionRestoringEditor, t)); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (IOException e) { // default "unsigned info" is ok for the user, but log the // problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (GeneralSecurityException e) { // default "unsigned info is ok, but log the problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open intro", new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open intro", e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_part, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_part, e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (CoreException ex) { WorkbenchPlugin.log(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IStatus.WARNING, "Could not load intro content detector", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (final CoreException e) { // TODO: give more info (eg plugin id).... // Gather formatting info final String classDef = element.getAttribute(attName); final String message = "Class load Failure: '" + classDef + "'"; //$NON-NLS-1$//$NON-NLS-2$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotEnabledException e) { status = new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotHandledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InvocationTargetException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InterruptedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (OperationCanceledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
catch (CoreException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchLayoutSettingsTransfer.java
catch (IOException e) { return new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, WorkbenchMessages.Workbench_problemsSavingMsg, e); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { String msg = "Workbench exception showing specified command line perspective on startup."; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final Exception e) { if (!display.isDisposed()) { handler.handleException(e); } else { String msg = "Exception in Workbench.runUI after display was disposed"; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (WorkbenchException e) { // Simply don't restore the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_restoreError, e)); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (IOException e) { // Simply don't store the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_storeError, e)); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (CoreException e) { cancel(); return new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_jobError, e); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
146
getStatus 55
                  
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.ShowView_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log( "Unable to create element factory.", e.getStatus()); //$NON-NLS-1$ factory = null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log("Unable to create extension: " + targetID //$NON-NLS-1$ + " in extension point: " + extensionPointId //$NON-NLS-1$ + ", status: ", e.getStatus()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (WorkbenchException e) { unableToOpenPerspective(persp, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { WorkbenchPlugin.log("Could not restore intro", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/OpenInNewWindowHandler.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/ConfigurationInfo.java
catch (CoreException e) { WorkbenchPlugin.log( "could not create class attribute for extension", //$NON-NLS-1$ e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (final NotDefinedException e) { WorkbenchPlugin.log("The active scheme is not currently defined.", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e1) { StatusUtil.handleStatus(e1.getStatus(), StatusManager.SHOW, parent.getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e) { result.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PropertyPageNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW); page = new EmptyPropertyPage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PreferenceNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW | StatusManager.LOG); page = new ErrorPreferencePage(); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dock.", e); //$NON-NLS-1$ } StatusUtil.handleStatus(status, "widget delegate failed on dock: id = " + proxy.getId(), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to instantiate browser support" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_descriptor, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
catch (CoreException e) { WorkbenchPlugin.log( "Unable to instantiate help UI" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (CoreException e) { StatusUtil.handleStatus(e.getStatus(), StatusManager.SHOW, shellProvider.getShell()); progressMonitor.setCanceled(true); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException ex) { result.add(ex.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/actions/NewWizardShortcutAction.java
catch (CoreException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.NewWizardShortcutAction_errorTitle, WorkbenchMessages.NewWizardShortcutAction_errorMessage, e.getStatus()); return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create layout descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ActionSetRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create action set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WizardsRegistryReader.java
catch (CoreException e) { WorkbenchPlugin.log("Cannot create category: ", e.getStatus());//$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to show a dialog here WorkbenchPlugin.log( "Unable to create view category.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create sticky view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create working set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set page: " + //$NON-NLS-1$ pageClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set element adapter: " + //$NON-NLS-1$ result, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set updater: " + //$NON-NLS-1$ updaterClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Unable to create editor contributor: " + //$NON-NLS-1$ id, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewAction.java
catch (PartInitException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.ShowView_errorTitle, e.getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
catch (Throwable e) { runAttribute = null; IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in action delegate error on creation.", e); //$NON-NLS-1$ } String id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); WorkbenchPlugin .log( "Could not create action delegate for id: " + id, status); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final WorkbenchException e) { // Don't use the window's shell as the dialog parent, // as the window is not open yet (bug 76724). StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { status.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.java
catch (Exception e) { WorkbenchPlugin.log(RESOURCE_BUNDLE .getString("Colors.badFactory"), //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to restore perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); continue; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
catch (Throwable ex) { // The used status handler failed logError(statusAdapter.getStatus()); logError("Error occurred during status handling", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/OpenInNewWindowAction.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java
catch (CoreException e) { WorkbenchPlugin.log("Drop Failed", e.getStatus());//$NON-NLS-1$ }
87
getMessage 52
                  
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.ShowView_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { childMem.putString(IWorkbenchConstants.TAG_REMOVED, "true"); //$NON-NLS-1$ result.add(StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e)); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { IStatus status = StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e); StatusUtil.handleStatus(status, "Failed to create view: id=" + viewId, //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
catch (PartInitException e) { DialogUtil.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.Error, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/OpenInNewWindowHandler.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
catch (BackingStoreException e) { String msg = e.getMessage(); if (msg == null) { msg = WorkbenchMessages.FilteredPreferenceDialog_PreferenceSaveFailed; } StatusUtil .handleStatus( WorkbenchMessages.PreferencesExportDialog_ErrorDialogTitle + ": " + msg, e, StatusManager.SHOW, //$NON-NLS-1$ getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
catch (IllegalArgumentException e) { addWarning(warningsToLog, "invalid keybinding: " + e.getMessage(), element, //$NON-NLS-1$ command.getCommand().getId()); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesPage.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorRegistry.java
catch (IllegalArgumentException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "invalid trigger point advisor extension", //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e .getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (IOException e) { // default "unsigned info" is ok for the user, but log the // problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (GeneralSecurityException e) { // default "unsigned info is ok, but log the problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java
catch (CoreException e1) { Label label = new Label(pageComposite, SWT.NONE); label.setText(e1.getMessage()); item.setData(null); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotEnabledException e) { status = new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotHandledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InvocationTargetException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InterruptedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (OperationCanceledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewAction.java
catch (PartInitException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.ShowView_errorTitle, e.getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final WorkbenchException e) { // Don't use the window's shell as the dialog parent, // as the window is not open yet (bug 76724). StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }}); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (RuntimeException e) { WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorDisposePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
catch (PartInitException e2) { String title = WorkbenchMessages.OpenRecent_errorTitle; MessageDialog.openWarning(window.getShell(), title, e2 .getMessage()); history.remove(item); }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/actions/OpenPerspectiveMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( PAGE_PROBLEMS_TITLE + ": " + e.getMessage(), e, //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewWindowMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewWindowMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenInNewWindowAction.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewPageMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewPageMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }
110
getManager 47
                  
// in Eclipse UI/org/eclipse/ui/internal/ImageCycleFeedbackBase.java
catch (SWTException ex) { IStatus status = StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, ex); StatusManager.getManager().handle(status); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
catch (WorkbenchException e) { IStatus errorStatus = WorkbenchPlugin.newError(NLS.bind( WorkbenchMessages.Workbench_showPerspectiveError, descriptor.getLabel()), e); StatusManager.getManager().handle(errorStatus, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PropertyPageNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW); page = new EmptyPropertyPage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PreferenceNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW | StatusManager.LOG); page = new ErrorPreferencePage(); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Tweaklets.java
catch (CoreException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Error with extension " + elements[i], e), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (IOException e) { // default "unsigned info" is ok for the user, but log the // problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (GeneralSecurityException e) { // default "unsigned info is ok, but log the problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { content.dispose(); StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); return null; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (SWTException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, "Exceptions during shutdown", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorDefinition.java
catch (DataFormatException e) { parsedValue = DEFAULT_COLOR_VALUE; IStatus status = StatusUtil.newStatus(IStatus.WARNING, "Could not parse value for theme color " + id, e); //$NON-NLS-1$ StatusManager.getManager().handle(status, StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (WorkbenchException e) { // Simply don't restore the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_restoreError, e)); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (IOException e) { // Simply don't store the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_storeError, e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager .getManager() .handle( StatusUtil .newStatus( IStatus.ERROR, "Unable to register menu item \"" + getId() //$NON-NLS-1$ + "\", command \"" + contributionParameters.commandId + "\" not defined", //$NON-NLS-1$ //$NON-NLS-2$ null)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (ExecutionException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotEnabledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotHandledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
104
handle 47
                  
// in Eclipse UI/org/eclipse/ui/internal/ImageCycleFeedbackBase.java
catch (SWTException ex) { IStatus status = StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, ex); StatusManager.getManager().handle(status); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
catch (WorkbenchException e) { IStatus errorStatus = WorkbenchPlugin.newError(NLS.bind( WorkbenchMessages.Workbench_showPerspectiveError, descriptor.getLabel()), e); StatusManager.getManager().handle(errorStatus, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PropertyPageNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW); page = new EmptyPropertyPage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PreferenceNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW | StatusManager.LOG); page = new ErrorPreferencePage(); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Tweaklets.java
catch (CoreException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Error with extension " + elements[i], e), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (IOException e) { // default "unsigned info" is ok for the user, but log the // problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (GeneralSecurityException e) { // default "unsigned info is ok, but log the problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { content.dispose(); StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); return null; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (SWTException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, "Exceptions during shutdown", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorDefinition.java
catch (DataFormatException e) { parsedValue = DEFAULT_COLOR_VALUE; IStatus status = StatusUtil.newStatus(IStatus.WARNING, "Could not parse value for theme color " + id, e); //$NON-NLS-1$ StatusManager.getManager().handle(status, StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (WorkbenchException e) { // Simply don't restore the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_restoreError, e)); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (IOException e) { // Simply don't store the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_storeError, e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager .getManager() .handle( StatusUtil .newStatus( IStatus.ERROR, "Unable to register menu item \"" + getId() //$NON-NLS-1$ + "\", command \"" + contributionParameters.commandId + "\" not defined", //$NON-NLS-1$ //$NON-NLS-2$ null)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (ExecutionException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotEnabledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotHandledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
96
newStatus 38
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { childMem.putString(IWorkbenchConstants.TAG_REMOVED, "true"); //$NON-NLS-1$ result.add(StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e)); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { IStatus status = StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e); StatusUtil.handleStatus(status, "Failed to create view: id=" + viewId, //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/ImageCycleFeedbackBase.java
catch (SWTException ex) { IStatus status = StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, ex); StatusManager.getManager().handle(status); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PropertyPageNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW); page = new EmptyPropertyPage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PreferenceNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW | StatusManager.LOG); page = new ErrorPreferencePage(); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dock.", e); //$NON-NLS-1$ } StatusUtil.handleStatus(status, "widget delegate failed on dock: id = " + proxy.getId(), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorRegistry.java
catch (IllegalArgumentException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "invalid trigger point advisor extension", //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e .getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Tweaklets.java
catch (CoreException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Error with extension " + elements[i], e), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { content.dispose(); StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); return null; }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
catch (Throwable e) { runAttribute = null; IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in action delegate error on creation.", e); //$NON-NLS-1$ } String id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); WorkbenchPlugin .log( "Could not create action delegate for id: " + id, status); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (SWTException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING, "Could not start styling support.", //$NON-NLS-1$ ex)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, "Exceptions during shutdown", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorDefinition.java
catch (DataFormatException e) { parsedValue = DEFAULT_COLOR_VALUE; IStatus status = StatusUtil.newStatus(IStatus.WARNING, "Could not parse value for theme color " + id, e); //$NON-NLS-1$ StatusManager.getManager().handle(status, StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (RuntimeException e) { WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorDisposePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager .getManager() .handle( StatusUtil .newStatus( IStatus.ERROR, "Unable to register menu item \"" + getId() //$NON-NLS-1$ + "\", command \"" + contributionParameters.commandId + "\" not defined", //$NON-NLS-1$ //$NON-NLS-2$ null)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (ExecutionException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotEnabledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotHandledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
70
getId 25
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() + "' contributed an invalid Menu Extension (Group: '" + mgroup + "' is missing): " + ad.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() //$NON-NLS-1$ + "' invalid Toolbar Extension (Group \'" //$NON-NLS-1$ + tgroup + "\' is missing): " + ad.getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch(ParseException e) { bindings.clear(); addWarning( warningsToLog, "Cannot create modified sequence for key binding", //$NON-NLS-1$ sequenceModifier, parameterizedCommand.getId(), ATT_REPLACE, replaceSequence); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
catch (CoreException ex) { WorkbenchPlugin.log( "Unable to create action set " + actionSetDesc.getId(), ex); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dock.", e); //$NON-NLS-1$ } StatusUtil.handleStatus(status, "widget delegate failed on dock: id = " + proxy.getId(), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
catch (IllegalArgumentException e) { addWarning(warningsToLog, "invalid keybinding: " + e.getMessage(), element, //$NON-NLS-1$ command.getCommand().getId()); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityLabelProvider.java
catch (NotDefinedException e) { return activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e) { activityText = activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (NotDefinedException e) { return activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (NotDefinedException e) { return category.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Error creating editor management policy for editor id " + getId(), e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to create ActionSet: " + desc.getId(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager .getManager() .handle( StatusUtil .newStatus( IStatus.ERROR, "Unable to register menu item \"" + getId() //$NON-NLS-1$ + "\", command \"" + contributionParameters.commandId + "\" not defined", //$NON-NLS-1$ //$NON-NLS-2$ null)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (ExecutionException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotEnabledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotHandledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { name = category.getId(); }
831
handleStatus 23
                  
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.ShowView_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { IStatus status = StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e); StatusUtil.handleStatus(status, "Failed to create view: id=" + viewId, //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/OpenInNewWindowHandler.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (Exception ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (Exception ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (ExecutionException ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
catch (BackingStoreException e) { String msg = e.getMessage(); if (msg == null) { msg = WorkbenchMessages.FilteredPreferenceDialog_PreferenceSaveFailed; } StatusUtil .handleStatus( WorkbenchMessages.PreferencesExportDialog_ErrorDialogTitle + ": " + msg, e, StatusManager.SHOW, //$NON-NLS-1$ getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e1) { StatusUtil.handleStatus(e1.getStatus(), StatusManager.SHOW, parent.getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dock.", e); //$NON-NLS-1$ } StatusUtil.handleStatus(status, "widget delegate failed on dock: id = " + proxy.getId(), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PartPane.java
catch (RuntimeException ex) { StatusUtil.handleStatus(ex, StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (CoreException e) { StatusUtil.handleStatus(e.getStatus(), StatusManager.SHOW, shellProvider.getShell()); progressMonitor.setCanceled(true); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (PartInitException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); return null; }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Exception e) { content.dispose(); StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); return null; }
// in Eclipse UI/org/eclipse/ui/actions/OpenPerspectiveMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( PAGE_PROBLEMS_TITLE + ": " + e.getMessage(), e, //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewWindowMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewWindowMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenInNewWindowAction.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewPageMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewPageMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
37
getShell 18
                  
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
catch (PartInitException e) { DialogUtil.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.Error, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
catch (BackingStoreException e) { String msg = e.getMessage(); if (msg == null) { msg = WorkbenchMessages.FilteredPreferenceDialog_PreferenceSaveFailed; } StatusUtil .handleStatus( WorkbenchMessages.PreferencesExportDialog_ErrorDialogTitle + ": " + msg, e, StatusManager.SHOW, //$NON-NLS-1$ getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e1) { StatusUtil.handleStatus(e1.getStatus(), StatusManager.SHOW, parent.getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (CoreException e) { StatusUtil.handleStatus(e.getStatus(), StatusManager.SHOW, shellProvider.getShell()); progressMonitor.setCanceled(true); }
// in Eclipse UI/org/eclipse/ui/internal/actions/NewWizardShortcutAction.java
catch (CoreException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.NewWizardShortcutAction_errorTitle, WorkbenchMessages.NewWizardShortcutAction_errorMessage, e.getStatus()); return; }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewAction.java
catch (PartInitException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.ShowView_errorTitle, e.getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
catch (PartInitException e2) { String title = WorkbenchMessages.OpenRecent_errorTitle; MessageDialog.openWarning(window.getShell(), title, e2 .getMessage()); history.remove(item); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
372
printStackTrace 15
                  
// in Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
catch (IllegalStateException e) { e.printStackTrace(); root = null; }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (NotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/SchemeElement.java
catch (NotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (InvalidRegistryObjectException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (CoreException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Saving Problems", //$NON-NLS-1$ "Unable to save resource associations."); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { ex.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Error", "Unable to save resource associations."); //$NON-NLS-1$ //$NON-NLS-2$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { ex.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
catch (PartInitException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
catch (WorkbenchException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
catch (Throwable e) { // One of the log listeners probably failed. Core should have logged // the // exception since its the first listener. System.err.println("Error while logging event loop exception:"); //$NON-NLS-1$ exception.printStackTrace(); System.err.println("Logging exception:"); //$NON-NLS-1$ e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/part/PluginTransfer.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/part/PluginTransfer.java
catch (IOException e) { e.printStackTrace(); }
17
dispose 13
                  
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { content.dispose(); StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); return null; }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Exception e) { content.dispose(); StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); return null; }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/operations/LinearUndoViolationUserApprover.java
catch (ExecutionException e) { // flush the redo history here because it failed. history.dispose(context, false, true, false); return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/LinearUndoViolationUserApprover.java
catch (ExecutionException e) { // flush the undo history here because something went wrong. history.dispose(context, true, false, false); return Status.CANCEL_STATUS; }
573
openError 13
                  
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (IOException e) { perspRegistry.deletePerspective(realDesc); MessageDialog.openError((Shell) null, WorkbenchMessages.Perspective_problemSavingTitle, WorkbenchMessages.Perspective_problemSavingMessage); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
catch (PartInitException e) { DialogUtil.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.Error, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/actions/NewWizardShortcutAction.java
catch (CoreException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.NewWizardShortcutAction_errorTitle, WorkbenchMessages.NewWizardShortcutAction_errorMessage, e.getStatus()); return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { MessageDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Saving Problems", //$NON-NLS-1$ "Unable to save resource associations."); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Error", "Unable to save resource associations."); //$NON-NLS-1$ //$NON-NLS-2$ return; }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewAction.java
catch (PartInitException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.ShowView_errorTitle, e.getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final WorkbenchException e) { // Don't use the window's shell as the dialog parent, // as the window is not open yet (bug 76724). StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { stateFile.delete(); MessageDialog.openError((Shell) null, WorkbenchMessages.SavingProblem, WorkbenchMessages.ProblemSavingState); return false; }
25
getClass 11
                  
// in Eclipse UI/org/eclipse/ui/model/WorkbenchPartLabelProvider.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(getClass(), "getImage", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addEditorArea()", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addFastView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "stackView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doRemove", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doAdd", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "identifierChanged", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "perspectiveActivated", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/FolderLayout.java
catch (PartInitException e) { // cannot safely open the dialog so log the problem WorkbenchPlugin.log(getClass(), "addView(String)", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/part/PageBookView.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "initPage", e); //$NON-NLS-1$ }
101
add 9
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { childMem.putString(IWorkbenchConstants.TAG_REMOVED, "true"); //$NON-NLS-1$ result.add(StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e)); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e) { result.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Throwable t) { // The exception is already logged. result .add(new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, WorkbenchMessages.EditorManager_exceptionRestoringEditor, t)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException ex) { result.add(ex.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { status.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
catch (IllegalArgumentException e) { m.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to restore perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); continue; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
// in Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
catch (IllegalArgumentException e) { m.add(item); }
1116
getAttribute 9
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" //$NON-NLS-1$ + element.getAttribute(delegateAttributeName) + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
catch (final CoreException e) { /* * TODO If it can't be instantiated, should future attempts to * instantiate be blocked? */ final String message = "The proxied handler for '" + configurationElement.getAttribute(HANDLER_ATTRIBUTE_NAME) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final CoreException e) { final String message = "The proxied handler for '" + configurationElement.getAttribute(handlerAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" + configurationElement.getAttribute(delegateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final CoreException e) { final String message = "The proxied widget for '" + configurationElement.getAttribute(widgetAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final CoreException e) { final String message = "The proxied state for '" + configurationElement.getAttribute(stateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (final CoreException e) { // TODO: give more info (eg plugin id).... // Gather formatting info final String classDef = element.getAttribute(attName); final String message = "Class load Failure: '" + classDef + "'"; //$NON-NLS-1$//$NON-NLS-2$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
catch (Throwable e) { runAttribute = null; IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in action delegate error on creation.", e); //$NON-NLS-1$ } String id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); WorkbenchPlugin .log( "Could not create action delegate for id: " + id, status); //$NON-NLS-1$ return; }
361
getTargetException
9
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (InvocationTargetException e) { if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException)e.getTargetException(); } WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t == null) { reportException(e); } else { reportException(t); } }
9
handleException 9
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/dialogs/EventLoopProgressMonitor.java
catch (Throwable e) {//Handle the exception the same way as the workbench handler.handleException(e); break; }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (ClassNotFoundException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (IllegalAccessException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (InvocationTargetException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (NoSuchMethodException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final Exception e) { if (!display.isDisposed()) { handler.handleException(e); } else { String msg = "Exception in Workbench.runUI after display was disposed"; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Throwable t) { handler.handleException(t); // In case Display was closed under us if (display.isDisposed()) runEventLoop = false; }
10
getLocalizedMessage 8
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
13
String 6
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
31
addWarning 6
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final ParseException e) { addWarning(warningsToLog, "Could not parse", null, //$NON-NLS-1$ commandId, "keySequence", keySequenceText); //$NON-NLS-1$ continue; }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch(ParseException e) { bindings.clear(); addWarning( warningsToLog, "Cannot create modified sequence for key binding", //$NON-NLS-1$ sequenceModifier, parameterizedCommand.getId(), ATT_REPLACE, replaceSequence); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final IllegalArgumentException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement, commandId, "keySequence", //$NON-NLS-1$ keySequenceText); return null; }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final ParseException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement, commandId, "keySequence", //$NON-NLS-1$ keySequenceText); return null; }
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
catch (IllegalArgumentException e) { addWarning(warningsToLog, "invalid keybinding: " + e.getMessage(), element, //$NON-NLS-1$ command.getCommand().getId()); }
// in Eclipse UI/org/eclipse/ui/internal/services/RegistryPersistence.java
catch (final CoreException e) { // There when expression could not be created. addWarning( warningsToLog, "Problem creating when element", //$NON-NLS-1$ parentElement, id, "whenElementName", whenElementName); //$NON-NLS-1$ return ERROR_EXPRESSION; }
33
getControl 6
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
446
handleCoreException
6
                  
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); return false; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
6
logException
6
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final CommandException e) { logException(e, binding.getParameterizedCommand()); return true; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final CommandException e) { workbenchKeyboard.logException(e, binding .getParameterizedCommand()); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManagerUtil.java
catch (PartInitException exception) { logException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (MalformedURLException e) { ProgressManagerUtil.logException(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (FileNotFoundException exception) { ProgressManagerUtil.logException(exception); return null; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (IOException exception) { ProgressManagerUtil.logException(exception); return null; }
6
open 6
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
121
append 5
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (InvalidRegistryObjectException e) { buffer.append(actionId); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (NotDefinedException e) { label.append(command.toString()); }
423
bind 5
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
catch (WorkbenchException e) { IStatus errorStatus = WorkbenchPlugin.newError(NLS.bind( WorkbenchMessages.Workbench_showPerspectiveError, descriptor.getLabel()), e); StatusManager.getManager().handle(errorStatus, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
199
getString 5
                  
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e) { desc = RESOURCE_BUNDLE.getString("noDescAvailable"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (RuntimeException e) { WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorDisposePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.java
catch (Exception e) { WorkbenchPlugin.log(RESOURCE_BUNDLE .getString("Colors.badFactory"), //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
226
setText 5
                  
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityEnabler.java
catch (NotDefinedException e) { descriptionText.setText(""); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java
catch (CoreException e1) { Label label = new Label(pageComposite, SWT.NONE); label.setText(e1.getMessage()); item.setData(null); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { descriptionText.setText(""); //$NON-NLS-1$ }
532
unableToLoadPerspective
5
                  
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (IOException e) { unableToLoadPerspective(null); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (IOException e) { unableToLoadPerspective(null); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
5
getName 4
                  
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plugin \'" //$NON-NLS-1$ + menuElement.getContributor().getName() + "\' invalid Menu Extension (Group \'" //$NON-NLS-1$ + group + "\' is missing): " + id); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
441
openWebBrowserError
4
                  
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (InterruptedException e) { openWebBrowserError(d); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { openWebBrowserError(d); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (MalformedURLException e) { openWebBrowserError(shell, href, e); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (PartInitException e) { openWebBrowserError(shell, href, e); }
4
println 4
                  
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (CoreException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (IOException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
catch (Throwable e) { // One of the log listeners probably failed. Core should have logged // the // exception since its the first listener. System.err.println("Error while logging event loop exception:"); //$NON-NLS-1$ exception.printStackTrace(); System.err.println("Logging exception:"); //$NON-NLS-1$ e.printStackTrace(); }
60
reportException
4
                  
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (ExecutionException e) { reportException(e, uiInfo); status = IOperationHistory.OPERATION_INVALID_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (InvocationTargetException e) { reportException(e, uiInfo); return IOperationHistory.OPERATION_INVALID_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t == null) { reportException(e); } else { reportException(t); } }
4
toString 4
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (NotDefinedException e) { label.append(command.toString()); }
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (CoreException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (IOException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
261
getCause 3
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
11
getDefault 3
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
302
getInstance 3
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (ParseException e) { outOfOrderKeys = KeySequence.getInstance(); String message = "Could not parse out-of-order keys definition: 'ESC DEL'. Continuing with no out-of-order keys."; //$NON-NLS-1$ WorkbenchPlugin.log(message, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e)); }
166
getPluginId 3
                  
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() + "' contributed an invalid Menu Extension (Group: '" + mgroup + "' is missing): " + ad.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() //$NON-NLS-1$ + "' invalid Toolbar Extension (Group \'" //$NON-NLS-1$ + tgroup + "\' is missing): " + ad.getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardNode.java
catch (CoreException e) { IPluginContribution contribution = (IPluginContribution) Util.getAdapter(wizardElement, IPluginContribution.class); statuses[0] = new Status( IStatus.ERROR, contribution != null ? contribution.getPluginId() : WorkbenchPlugin.PI_WORKBENCH, IStatus.OK, WorkbenchMessages.WorkbenchWizard_errorMessage, e); }
28
handleInternalError
3
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (IOException e) { handleInternalError( e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (WorkbenchException e) { handleInternalError( e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (IOException e) { stateFile.delete(); handleInternalError(e, WorkbenchMessages.ProblemSavingWorkingSetState_title, WorkbenchMessages.ProblemSavingWorkingSetState_message); }
3
logError 3
                  
// in Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
catch (CoreException ex) { logError("Errors during the default handler creating", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
catch (Throwable ex) { // The used status handler failed logError(statusAdapter.getStatus()); logError("Error occurred during status handling", ex); //$NON-NLS-1$ }
15
logPreferenceStoreException
3
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { logPreferenceStoreException(e); }
3
DialogSettings 2
                  
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // load failed so ensure we have an empty settings dialogSettings = new DialogSettings("Workbench"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // load failed so ensure we have an empty settings dialogSettings = new DialogSettings("Workbench"); //$NON-NLS-1$ }
4
HashMap 2
                  
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return new HashMap(); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final org.eclipse.ui.keys.ParseException e) { return new HashMap(); }
260
arraycopy 2
                  
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
catch (IllegalStateException e) { // an invalid component; remove it IWorkingSet[] tmp = new IWorkingSet[components.length - 1]; if (i > 0) System.arraycopy(components, 0, tmp, 0, i); if (components.length - i - 1 > 0) System.arraycopy(components, i + 1, tmp, i, components.length - i - 1); components = tmp; workingSetMemento = null; // toss cached info fireWorkingSetChanged(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); continue; }
71
asyncExec 2
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
40
close 2
                  
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Saving Problems", //$NON-NLS-1$ "Unable to save resource associations."); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Error", "Unable to save resource associations."); //$NON-NLS-1$ //$NON-NLS-2$ return; }
118
delete 2
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (IOException e) { stateFile.delete(); handleInternalError(e, WorkbenchMessages.ProblemSavingWorkingSetState_title, WorkbenchMessages.ProblemSavingWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { stateFile.delete(); MessageDialog.openError((Shell) null, WorkbenchMessages.SavingProblem, WorkbenchMessages.ProblemSavingState); return false; }
7
disposeEditorActionBars 2
                  
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
3
firePropertyChange 2
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotHandledException e) { firePropertyChange(IAction.RESULT, null, Boolean.FALSE); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final ExecutionException e) { firePropertyChange(IAction.RESULT, null, Boolean.FALSE); // TODO Should this be logged? }
117
getCommandId 2
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (Exception e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (LinkageError e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
88
getDisplay 2
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
256
getParameterizedCommand 2
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final CommandException e) { logException(e, binding.getParameterizedCommand()); return true; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final CommandException e) { workbenchKeyboard.logException(e, binding .getParameterizedCommand()); }
52
isDisposed 2
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final Exception e) { if (!display.isDisposed()) { handler.handleException(e); } else { String msg = "Exception in Workbench.runUI after display was disposed"; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Throwable t) { handler.handleException(t); // In case Display was closed under us if (display.isDisposed()) runEventLoop = false; }
261
put 2
                  
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (InvalidRegistryObjectException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (CoreException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
633
remove 2
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { windowManager.remove(newWindow); exceptions[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
catch (PartInitException e2) { String title = WorkbenchMessages.OpenRecent_errorTitle; MessageDialog.openWarning(window.getShell(), title, e2 .getMessage()); history.remove(item); }
449
unableToOpenPerspective 2
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (IOException e) { unableToOpenPerspective(persp, null); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (WorkbenchException e) { unableToOpenPerspective(persp, e.getStatus()); }
3
Composite 1
                  
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
161
EmptyPropertyPage
1
                  
// in Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PropertyPageNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW); page = new EmptyPropertyPage(); }
1
ErrorPreferencePage
1
                  
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PreferenceNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW | StatusManager.LOG); page = new ErrorPreferencePage(); }
1
FillLayout 1
                  
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
15
Label 1
                  
// in Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java
catch (CoreException e1) { Label label = new Label(pageComposite, SWT.NONE); label.setText(e1.getMessage()); item.setData(null); }
136
Long 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } }
20
NullEditorInput 1
                  
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (PartInitException e1) { input = new NullEditorInput(this); }
4
Path 1
                  
// in Eclipse UI/org/eclipse/ui/internal/BrandingProperties.java
catch (MalformedURLException e) { if (definingBundle != null) { return Platform.find(definingBundle, new Path(value)); } }
16
StringBuffer 1
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
82
Text 1
                  
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
30
cancel 1
                  
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (CoreException e) { cancel(); return new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_jobError, e); }
31
cleanUp 1
                  
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
2
clear 1
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch(ParseException e) { bindings.clear(); addWarning( warningsToLog, "Cannot create modified sequence for key binding", //$NON-NLS-1$ sequenceModifier, parameterizedCommand.getId(), ATT_REPLACE, replaceSequence); }
180
createImage 1
                  
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
53
deletePerspective 1
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (IOException e) { perspRegistry.deletePerspective(realDesc); MessageDialog.openError((Shell) null, WorkbenchMessages.Perspective_problemSavingTitle, WorkbenchMessages.Perspective_problemSavingMessage); }
3
find 1
                  
// in Eclipse UI/org/eclipse/ui/internal/BrandingProperties.java
catch (MalformedURLException e) { if (definingBundle != null) { return Platform.find(definingBundle, new Path(value)); } }
76
fireWorkingSetChanged 1
                  
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
catch (IllegalStateException e) { // an invalid component; remove it IWorkingSet[] tmp = new IWorkingSet[components.length - 1]; if (i > 0) System.arraycopy(components, 0, tmp, 0, i); if (components.length - i - 1 > 0) System.arraycopy(components, i + 1, tmp, i, components.length - i - 1); components = tmp; workingSetMemento = null; // toss cached info fireWorkingSetChanged(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); continue; }
5
flush 1
                  
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
27
getActionBars 1
                  
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
37
getAdapter 1
                  
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardNode.java
catch (CoreException e) { IPluginContribution contribution = (IPluginContribution) Util.getAdapter(wizardElement, IPluginContribution.class); statuses[0] = new Status( IStatus.ERROR, contribution != null ? contribution.getPluginId() : WorkbenchPlugin.PI_WORKBENCH, IStatus.OK, WorkbenchMessages.WorkbenchWizard_errorMessage, e); }
99
getBundle 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
49
getCommand 1
                  
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
catch (IllegalArgumentException e) { addWarning(warningsToLog, "invalid keybinding: " + e.getMessage(), element, //$NON-NLS-1$ command.getCommand().getId()); }
118
getContributor 1
                  
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plugin \'" //$NON-NLS-1$ + menuElement.getContributor().getName() + "\' invalid Menu Extension (Group \'" //$NON-NLS-1$ + group + "\' is missing): " + id); //$NON-NLS-1$ }
19
getLabel 1
                  
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
catch (WorkbenchException e) { IStatus errorStatus = WorkbenchPlugin.newError(NLS.bind( WorkbenchMessages.Workbench_showPerspectiveError, descriptor.getLabel()), e); StatusManager.getManager().handle(errorStatus, StatusManager.SHOW); }
169
getLog 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
9
getMethod 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } }
16
getMethodToExecute 1
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
5
getMissingImageDescriptor 1
                  
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
6
getPluginID 1
                  
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
3
getProductName 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
6
getSymbolicName 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
14
getWorkbench 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
549
invoke 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } }
25
isDialogClosed 1
                  
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
2
isStarting 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
6
myApplyDialogFont 1
                  
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
9
newError 1
                  
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
catch (WorkbenchException e) { IStatus errorStatus = WorkbenchPlugin.newError(NLS.bind( WorkbenchMessages.Workbench_showPerspectiveError, descriptor.getLabel()), e); StatusManager.getManager().handle(errorStatus, StatusManager.SHOW); }
2
openWarning 1
                  
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
catch (PartInitException e2) { String title = WorkbenchMessages.OpenRecent_errorTitle; MessageDialog.openWarning(window.getShell(), title, e2 .getMessage()); history.remove(item); }
3
putString 1
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { childMem.putString(IWorkbenchConstants.TAG_REMOVED, "true"); //$NON-NLS-1$ result.add(StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e)); }
135
runWithoutExceptions 1
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final WorkbenchException e) { // Don't use the window's shell as the dialog parent, // as the window is not open yet (bug 76724). StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }}); }
72
schedule 1
                  
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
catch (InterruptedException e) { // Cancel and try again if there was an error schedule(); return Status.CANCEL_STATUS; }
53
setCanceled 1
                  
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (CoreException e) { StatusUtil.handleStatus(e.getStatus(), StatusManager.SHOW, shellProvider.getShell()); progressMonitor.setCanceled(true); }
10
setCategory 1
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setCategory(NewKeysPreferenceMessages.Unavailable_Category); }
3
setData 1
                  
// in Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java
catch (CoreException e1) { Label label = new Label(pageComposite, SWT.NONE); label.setText(e1.getMessage()); item.setData(null); }
95
setDescription 1
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setDescription(Util.ZERO_LENGTH_STRING); }
22
setImage 1
                  
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
89
setLayout 1
                  
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
183
setName 1
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setName(NewKeysPreferenceMessages.Undefined_Command); }
14
Method Nbr Nbr total
close 22
                  
// in Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
finally { try { if (is != null) { is.close(); } } catch (IOException e) { // do nothing if we fail to close } }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
finally { writer.close(); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleGroupData.java
finally { if (in != null) { try { in.close(); } catch (IOException e) { // do nothing } } }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
finally { try { if (in != null) { in.close(); } if (out != null) { out.close(); } } catch (IOException e) { return null; } }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
finally { try { if (reader != null) { reader.close(); } else if (stream != null) stream.close(); } catch (IOException ex) { WorkbenchPlugin.log("Error reading editors: Could not close steam", ex); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
finally { try { if (reader != null) { reader.close(); } else if (stream != null) { stream.close(); } } catch (IOException ex) { WorkbenchPlugin.log("Error reading resources: Could not close steam", ex); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { if (input != null) { try { input.close(); } catch (IOException e) { // he's done for } } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { if (!opened) { newWindow.close(); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { if (!restored) { // null the window in newWindowHolder so that it won't be // opened later on createdWindows[i] = null; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { newWindow[0].close(); }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { if (!opened) { myWindow.close(); } }
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { result = super.close(); // Clear the action sets, fix for bug 27416. getActionPresentation().clearActionSets(); try { // Bring down all of the services ... after the window goes away serviceLocator.dispose(); } catch (Exception ex) { WorkbenchPlugin.log(ex); } menuRestrictions.clear(); }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
finally { try { if (is != null) { is.close(); } } catch (IOException e) { // do nothing } }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
finally { out.close(); }
118
end 19
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { UIStats.end(UIStats.BRING_PART_TO_TOP, part, label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { UIStats.end(UIStats.SWITCH_PERSPECTIVE, desc.getId(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { UIStats.end(UIStats.CREATE_PERSPECTIVE, desc.getId(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { String blame = activeDescriptor == null ? pageName : activeDescriptor.getId(); UIStats.end(UIStats.RESTORE_WORKBENCH, blame, "WorkbenchPage" + label); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { partBeingActivated = null; Object blame = newPart == null ? (Object)this : newPart; UIStats.end(UIStats.ACTIVATE_PART, blame, label); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
finally { UIStats.end(UIStats.INIT_PART, part, label); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
finally { UIStats.end(UIStats.CREATE_PART_INPUT, input, label); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
finally { UIStats.end(UIStats.CREATE_PART, this, editorID); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
finally { UIStats.end(UIStats.CREATE_PART_CONTROL, part, editorID); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { UIStats.end(UIStats.RESTORE_WORKBENCH, this, "Workbench"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { UIStats.end(UIStats.RESTORE_WORKBENCH, this, "MRUList"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { UIStats.end(UIStats.RESTORE_WORKBENCH, factoryID, "WorkbenchPageFactory"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
finally { UIStats.end(UIStats.CREATE_PART, view, label); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
finally { UIStats.end(UIStats.INIT_PART, view, label); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
finally { UIStats.end(UIStats.CREATE_PART_CONTROL, view, label); }
// in Eclipse UI/org/eclipse/ui/progress/UIJob.java
finally { UIStats.end(UIStats.UI_JOB, UIJob.this, getName()); if (result == null) { result = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, ProgressMessages.InternalError, throwable); } done(result); }
24
setRedraw 14
                  
// in Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java
finally { if (!SwtUtil.isDisposed(this.parent)) { this.parent.setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java
finally { if (!SwtUtil.isDisposed(this.parent)) { this.parent.setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { // reset the handling of zoom events (possibly for the second time) in case there was // an exception thrown if (introViewAdapter != null) { introViewAdapter.setHandleZoomEvents(true); } if (introFullScreen) { window.getShell().setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { mgr.getControl2().setRedraw(true); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { getClientComposite().setRedraw(true); if (mgr != null) mgr.getControl2().setRedraw(true); IWorkbenchPart part = getActivePart(); if (part != null) { part.setFocus(); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
finally { viewer.getTree().setRedraw(true); }
// in Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
finally { fFilteredTree.setRedraw(true); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
finally { if (showAll) { filteredTree.getViewer().getControl().setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/presentations/BasicPartList.java
finally { if (usingMotif) { getTable().setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java
finally { parentWidget.setRedraw(true); }
// in Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
finally { control.setRedraw(true); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
finally { wbw.getPageComposite().setRedraw(true); // Force a redraw (fixes Mac refresh) wbw.getShell().redraw(); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
finally { // done updating the tree - set redraw back to true TreeItem[] items = getViewer().getTree().getItems(); if (items.length > 0 && getViewer().getTree().getSelectionCount() == 0) { treeViewer.getTree().setTopItem(items[0]); } redrawFalseControl.setRedraw(true); }
42
deferUpdates 10
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
finally { if (service!=null) { service.deferUpdates(false); } }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
finally { // restart context changes if (service != null) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { service.deferUpdates(false); } }); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
finally { service.deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
finally { service.deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { service.deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { deferUpdates(false); } }); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { service.deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java
finally { contextManager.deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { contextService.deferUpdates(false); }
36
dispose 8
                  
// in Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
finally { contentProvider.dispose(); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/StackTraceSupportArea.java
finally { if (clipboard != null) { clipboard.dispose(); } }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/DefaultDetailsArea.java
finally { if (clipboard != null) { clipboard.dispose(); } }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutSystemPage.java
finally { if (clipboard != null) { clipboard.dispose(); } }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutSystemPage.java
finally { if (clipboard != null) { clipboard.dispose(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { result = super.close(); // Clear the action sets, fix for bug 27416. getActionPresentation().clearActionSets(); try { // Bring down all of the services ... after the window goes away serviceLocator.dispose(); } catch (Exception ex) { WorkbenchPlugin.log(ex); } menuRestrictions.clear(); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
finally { if (testText != null) { testText.dispose(); } }
// in Eclipse UI/org/eclipse/ui/actions/QuickMenuCreator.java
finally { if (gc != null) { gc.dispose(); } }
573
isDisposed 6
                  
// in Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java
finally { if (!SwtUtil.isDisposed(this.parent)) { this.parent.setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java
finally { if (!SwtUtil.isDisposed(this.parent)) { this.parent.setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { // mandatory clean up // The runEventLoop flag may not have been cleared if an exception // occurred // Needs to be false to ensure PlatformUI.isWorkbenchRunning() // returns false. runEventLoop = false; if (!display.isDisposed()) { display.removeListener(SWT.Close, closeListener); } }
// in Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
finally { if (!dialog.isDisposed()) { cancel(dialog); } contextService.unregisterShell(dialog); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); }
261
log 6
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
finally { try { if (reader != null) { reader.close(); } else if (stream != null) stream.close(); } catch (IOException ex) { WorkbenchPlugin.log("Error reading editors: Could not close steam", ex); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
finally { try { if (reader != null) { reader.close(); } else if (stream != null) { stream.close(); } } catch (IOException ex) { WorkbenchPlugin.log("Error reading resources: Could not close steam", ex); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { result = super.close(); // Clear the action sets, fix for bug 27416. getActionPresentation().clearActionSets(); try { // Bring down all of the services ... after the window goes away serviceLocator.dispose(); } catch (Exception ex) { WorkbenchPlugin.log(ex); } menuRestrictions.clear(); }
261
getShell 5
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { // reset the handling of zoom events (possibly for the second time) in case there was // an exception thrown if (introViewAdapter != null) { introViewAdapter.setHandleZoomEvents(true); } if (introFullScreen) { window.getShell().setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
finally { wbw.getPageComposite().setRedraw(true); // Force a redraw (fixes Mac refresh) wbw.getShell().redraw(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { getShell().setLayoutDeferred(false); }
372
largeUpdateEnd 5
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { workbench.largeUpdateEnd(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { workbench.largeUpdateEnd(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { window.largeUpdateEnd(); if (newPersp == null) { return; } IPerspectiveDescriptor desc = newPersp.getDesc(); if (desc == null) { return; } if (dirtyPerspectives.remove(desc.getId())) { suggestReset(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { workbench.largeUpdateEnd(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { workbench.largeUpdateEnd(); }
6
done 4
                  
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
finally { monitorWrap.done(); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
finally { progressMonitor.done(); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
finally { monitor.done(); }
// in Eclipse UI/org/eclipse/ui/progress/UIJob.java
finally { UIStats.end(UIStats.UI_JOB, UIJob.this, getName()); if (result == null) { result = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, ProgressMessages.InternalError, throwable); } done(result); }
26
getId 4
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { UIStats.end(UIStats.SWITCH_PERSPECTIVE, desc.getId(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { UIStats.end(UIStats.CREATE_PERSPECTIVE, desc.getId(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { String blame = activeDescriptor == null ? pageName : activeDescriptor.getId(); UIStats.end(UIStats.RESTORE_WORKBENCH, blame, "WorkbenchPage" + label); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { window.largeUpdateEnd(); if (newPersp == null) { return; } IPerspectiveDescriptor desc = newPersp.getDesc(); if (desc == null) { return; } if (dirtyPerspectives.remove(desc.getId())) { suggestReset(); } }
831
getTree 4
                  
// in Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
finally { viewer.getTree().setRedraw(true); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
finally { // done updating the tree - set redraw back to true TreeItem[] items = getViewer().getTree().getItems(); if (items.length > 0 && getViewer().getTree().getSelectionCount() == 0) { treeViewer.getTree().setTopItem(items[0]); } redrawFalseControl.setRedraw(true); }
36
getControl 3
                  
// in Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
finally { if (showAll) { filteredTree.getViewer().getControl().setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
446
getLabel 3
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { UIStats.end(UIStats.NOTIFY_PAGE_LISTENERS, page.getLabel(), label); }
169
getMessage 3
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
110
getViewer 3
                  
// in Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
finally { if (showAll) { filteredTree.getViewer().getControl().setRedraw(true); } }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
finally { // done updating the tree - set redraw back to true TreeItem[] items = getViewer().getTree().getItems(); if (items.length > 0 && getViewer().getTree().getSelectionCount() == 0) { treeViewer.getTree().setTopItem(items[0]); } redrawFalseControl.setRedraw(true); }
104
runWithoutExceptions 3
                  
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
finally { // restart context changes if (service != null) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { service.deferUpdates(false); } }); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { deferUpdates(false); } }); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { if (!restored) { // null the window in newWindowHolder so that it won't be // opened later on createdWindows[i] = null; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { newWindow[0].close(); }}); }
72
setEnabled 3
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); }
313
String 2
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
31
clear 2
                  
// in Eclipse UI/org/eclipse/ui/internal/ExtensionEventHandler.java
finally { //ensure the list is cleared for the next pass through changeList.clear(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { result = super.close(); // Clear the action sets, fix for bug 27416. getActionPresentation().clearActionSets(); try { // Bring down all of the services ... after the window goes away serviceLocator.dispose(); } catch (Exception ex) { WorkbenchPlugin.log(ex); } menuRestrictions.clear(); }
180
getCommand 2
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
finally { getParameterizedCommand().getCommand().setHandler(oldHandler); }
118
getControl2 2
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { mgr.getControl2().setRedraw(true); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { getClientComposite().setRedraw(true); if (mgr != null) mgr.getControl2().setRedraw(true); IWorkbenchPart part = getActivePart(); if (part != null) { part.setFocus(); } }
8
getLocalizedMessage 2
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
13
open 2
                  
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
finally { if (fis != null) { try { fis.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); } } }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
finally { if (fos != null) { try { fos.close(); } catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; } } }
121
refresh 2
                  
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
finally { fileAssociationViewer.refresh(false); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
finally { fileAssociationViewer.refresh(false); }
73
setHandleZoomEvents 2
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { // we want the intro back to a normal state before we fire the event introViewAdapter.setHandleZoomEvents(true); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { // reset the handling of zoom events (possibly for the second time) in case there was // an exception thrown if (introViewAdapter != null) { introViewAdapter.setHandleZoomEvents(true); } if (introFullScreen) { window.getShell().setRedraw(true); } }
3
setHandler 2
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
finally { getParameterizedCommand().getCommand().setHandler(oldHandler); }
6
setLayoutDeferred 2
                  
// in Eclipse UI/org/eclipse/ui/internal/presentations/PaneFolder.java
finally { viewForm.setLayoutDeferred(false); inLayout = false; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { getShell().setLayoutDeferred(false); }
4
wake
2
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { initDone[0] = true; display.wake(); }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
finally { initDone[0] = true; display.wake(); }
2
Status 1
                  
// in Eclipse UI/org/eclipse/ui/progress/UIJob.java
finally { UIStats.end(UIStats.UI_JOB, UIJob.this, getName()); if (result == null) { result = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, ProgressMessages.InternalError, throwable); } done(result); }
146
cancel 1
                  
// in Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
finally { if (!dialog.isDisposed()) { cancel(dialog); } contextService.unregisterShell(dialog); }
31
clearActionSets 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { result = super.close(); // Clear the action sets, fix for bug 27416. getActionPresentation().clearActionSets(); try { // Bring down all of the services ... after the window goes away serviceLocator.dispose(); } catch (Exception ex) { WorkbenchPlugin.log(ex); } menuRestrictions.clear(); }
2
currentThread 1
                  
// in Eclipse UI/org/eclipse/ui/internal/UILockListener.java
finally { //UI field may be nulled if there is a nested wait during execution //of pending work, so make sure it is assigned before we start waiting ui = Thread.currentThread(); }
11
enableTrim
1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); }
1
endRule
1
                  
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
finally { manager.endRule(rule); }
1
endSourceChange
1
                  
// in Eclipse UI/org/eclipse/ui/internal/services/EvaluationAuthority.java
finally { endSourceChange(sourceNames); }
1
getActionPresentation 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { result = super.close(); // Clear the action sets, fix for bug 27416. getActionPresentation().clearActionSets(); try { // Bring down all of the services ... after the window goes away serviceLocator.dispose(); } catch (Exception ex) { WorkbenchPlugin.log(ex); } menuRestrictions.clear(); }
4
getActivePart 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { getClientComposite().setRedraw(true); if (mgr != null) mgr.getControl2().setRedraw(true); IWorkbenchPart part = getActivePart(); if (part != null) { part.setFocus(); } }
42
getClientComposite 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { getClientComposite().setRedraw(true); if (mgr != null) mgr.getControl2().setRedraw(true); IWorkbenchPart part = getActivePart(); if (part != null) { part.setFocus(); } }
20
getCurrentState 1
                  
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } }
27
getDefault 1
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { WorkbenchPlugin.getDefault().removeBundleListener( bundleListener); }
302
getDesc 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { window.largeUpdateEnd(); if (newPersp == null) { return; } IPerspectiveDescriptor desc = newPersp.getDesc(); if (desc == null) { return; } if (dirtyPerspectives.remove(desc.getId())) { suggestReset(); } }
43
getItems 1
                  
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
finally { // done updating the tree - set redraw back to true TreeItem[] items = getViewer().getTree().getItems(); if (items.length > 0 && getViewer().getTree().getSelectionCount() == 0) { treeViewer.getTree().setTopItem(items[0]); } redrawFalseControl.setRedraw(true); }
111
getName 1
                  
// in Eclipse UI/org/eclipse/ui/progress/UIJob.java
finally { UIStats.end(UIStats.UI_JOB, UIJob.this, getName()); if (result == null) { result = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, ProgressMessages.InternalError, throwable); } done(result); }
441
getPageComposite 1
                  
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
finally { wbw.getPageComposite().setRedraw(true); // Force a redraw (fixes Mac refresh) wbw.getShell().redraw(); }
7
getParameterizedCommand 1
                  
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
finally { getParameterizedCommand().getCommand().setHandler(oldHandler); }
52
getSelectionCount 1
                  
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
finally { // done updating the tree - set redraw back to true TreeItem[] items = getViewer().getTree().getItems(); if (items.length > 0 && getViewer().getTree().getSelectionCount() == 0) { treeViewer.getTree().setTopItem(items[0]); } redrawFalseControl.setRedraw(true); }
12
getTable 1
                  
// in Eclipse UI/org/eclipse/ui/internal/presentations/BasicPartList.java
finally { if (usingMotif) { getTable().setRedraw(true); } }
75
openWindowsAfterRestore
1
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { openWindowsAfterRestore(); }
1
printStackTrace 1
                  
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } }
17
redraw 1
                  
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
finally { wbw.getPageComposite().setRedraw(true); // Force a redraw (fixes Mac refresh) wbw.getShell().redraw(); }
14
release 1
                  
// in Eclipse UI/org/eclipse/ui/internal/UILockListener.java
finally { currentWork = oldWork; work.release(); }
3
remove 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { window.largeUpdateEnd(); if (newPersp == null) { return; } IPerspectiveDescriptor desc = newPersp.getDesc(); if (desc == null) { return; } if (dirtyPerspectives.remove(desc.getId())) { suggestReset(); } }
449
removeBundleListener 1
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { WorkbenchPlugin.getDefault().removeBundleListener( bundleListener); }
6
removeListener 1
                  
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
finally { // mandatory clean up // The runEventLoop flag may not have been cleared if an exception // occurred // Needs to be false to ensure PlatformUI.isWorkbenchRunning() // returns false. runEventLoop = false; if (!display.isDisposed()) { display.removeListener(SWT.Close, closeListener); } }
54
selectionChanged 1
                  
// in Eclipse UI/org/eclipse/ui/actions/BaseSelectionListenerAction.java
finally { running = false; IStructuredSelection s = deferredSelection; deferredSelection = null; if (s != null) { selectionChanged(s); } }
37
setFocus 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { getClientComposite().setRedraw(true); if (mgr != null) mgr.getControl2().setRedraw(true); IWorkbenchPart part = getActivePart(); if (part != null) { part.setFocus(); } }
83
setKeyFilterEnabled 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); }
9
setProxy 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
finally { wab.setProxy(null); }
2
setTopItem
1
                  
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java
finally { // done updating the tree - set redraw back to true TreeItem[] items = getViewer().getTree().getItems(); if (items.length > 0 && getViewer().getTree().getSelectionCount() == 0) { treeViewer.getTree().setTopItem(items[0]); } redrawFalseControl.setRedraw(true); }
1
setUserInterfaceActive 1
                  
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
finally { setUserInterfaceActive(true); }
3
stop 1
                  
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
finally { super.stop(context); }
2
suggestReset 1
                  
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
finally { window.largeUpdateEnd(); if (newPersp == null) { return; } IPerspectiveDescriptor desc = newPersp.getDesc(); if (desc == null) { return; } if (dirtyPerspectives.remove(desc.getId())) { suggestReset(); } }
3
ungetService 1
                  
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
finally { bundleContext.ungetService(factoryRef); }
3
unregisterShell 1
                  
// in Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
finally { if (!dialog.isDisposed()) { cancel(dialog); } contextService.unregisterShell(dialog); }
7

Reference Table

This table concatenates the results of the previous tables.

Checked/Runtime Type Exception Thrown Thrown from Catch Declared Caught directly Caught
with Thrown
Caught
with Thrown Runtime
unknown (Lib) BackingStoreException 0 0 8
            
// in Eclipse UI/org/eclipse/ui/preferences/WorkingCopyManager.java
public void applyChanges() throws BackingStoreException { Collection values = workingCopies.values(); WorkingCopyPreferences[] valuesArray = (WorkingCopyPreferences[]) values.toArray(new WorkingCopyPreferences[values.size()]); for (int i = 0; i < valuesArray.length; i++) { WorkingCopyPreferences prefs = valuesArray[i]; if (prefs.nodeExists(EMPTY_STRING)) prefs.flush(); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void removeNode() throws BackingStoreException { checkRemoved(); // clear all values (long way so people get notified) String[] keys = keys(); for (int i = 0; i < keys.length; i++) { remove(keys[i]); } // remove children String[] childNames = childrenNames(); for (int i = 0; i < childNames.length; i++) { node(childNames[i]).removeNode(); } // mark as removed removed = true; }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void accept(IPreferenceNodeVisitor visitor) throws BackingStoreException { checkRemoved(); if (!visitor.visit(this)) { return; } String[] childNames = childrenNames(); for (int i = 0; i < childNames.length; i++) { ((IEclipsePreferences) node(childNames[i])).accept(visitor); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public String[] keys() throws BackingStoreException { checkRemoved(); HashSet allKeys = new HashSet(Arrays.asList(getOriginal().keys())); allKeys.addAll(temporarySettings.keySet()); return (String[]) allKeys.toArray(new String[allKeys.size()]); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public String[] childrenNames() throws BackingStoreException { checkRemoved(); return getOriginal().childrenNames(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public boolean nodeExists(String pathName) throws BackingStoreException { // short circuit for this node if (pathName.length() == 0) { return removed ? false : getOriginal().nodeExists(pathName); } return getOriginal().nodeExists(pathName); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void flush() throws BackingStoreException { if (removed) { getOriginal().removeNode(); return; } checkRemoved(); // update underlying preferences for (Iterator i = temporarySettings.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); String value = (String) temporarySettings.get(key); if (value == null) { getOriginal().remove(key); } else { getOriginal().put(key, value); } } // clear our settings temporarySettings.clear(); // save the underlying preference store getOriginal().flush(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void sync() throws BackingStoreException { checkRemoved(); // forget our settings temporarySettings.clear(); // load the underlying preference store getOriginal().sync(); }
5
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { return;// No need to report here as the node won't have the // listener }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java
catch (BackingStoreException e) { String msg = e.getMessage(); if (msg == null) { msg = WorkbenchMessages.FilteredPreferenceDialog_PreferenceSaveFailed; } StatusUtil .handleStatus( WorkbenchMessages.PreferencesExportDialog_ErrorDialogTitle + ": " + msg, e, StatusManager.SHOW, //$NON-NLS-1$ getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/util/PrefUtil.java
catch (BackingStoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java
catch (BackingStoreException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin .getDefault().getBundle().getSymbolicName(), IStatus.ERROR, e.getLocalizedMessage(), e); WorkbenchPlugin.getDefault().getLog().log(status); }
1
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
0
unknown (Lib) BundleException 0 0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (BundleException e) { WorkbenchPlugin.log("Unable to load UI activator", e); //$NON-NLS-1$ }
0 0
unknown (Lib) ClassCastException 0 0 0 7
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final ClassCastException e) { final String message = "The proxied handler was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied delegate was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final ClassCastException e) { final String message = "The proxied widget was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final ClassCastException e) { final String message = "The proxied state was the wrong class"; //$NON-NLS-1$ final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
2
            
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ }
0
unknown (Lib) ClassNotFoundException 0 0 2
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected void swingInvokeLater(Runnable methodRunnable) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final Class swingUtilitiesClass = Class .forName("javax.swing.SwingUtilities"); //$NON-NLS-1$ final Method swingUtilitiesInvokeLaterMethod = swingUtilitiesClass .getMethod("invokeLater", //$NON-NLS-1$ new Class[] { Runnable.class }); swingUtilitiesInvokeLaterMethod.invoke(swingUtilitiesClass, new Object[] { methodRunnable }); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected Object getFocusComponent() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { /* * Before JRE 1.4, one has to use * javax.swing.FocusManager.getCurrentManager().getFocusOwner(). Since * JRE 1.4, one has to use * java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager * ().getFocusOwner(); the use of the older API would install a * LegacyGlueFocusTraversalPolicy which causes endless recursions in * some situations. */ Class keyboardFocusManagerClass = null; try { keyboardFocusManagerClass = Class .forName("java.awt.KeyboardFocusManager"); //$NON-NLS-1$ } catch (ClassNotFoundException e) { // switch to the old guy } if (keyboardFocusManagerClass != null) { // Use JRE 1.4 API final Method keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod = keyboardFocusManagerClass .getMethod("getCurrentKeyboardFocusManager", null); //$NON-NLS-1$ final Object keyboardFocusManager = keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod .invoke(keyboardFocusManagerClass, null); final Method keyboardFocusManagerGetFocusOwner = keyboardFocusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = keyboardFocusManagerGetFocusOwner .invoke(keyboardFocusManager, null); return focusComponent; } // Use JRE 1.3 API final Class focusManagerClass = Class .forName("javax.swing.FocusManager"); //$NON-NLS-1$ final Method focusManagerGetCurrentManagerMethod = focusManagerClass .getMethod("getCurrentManager", null); //$NON-NLS-1$ final Object focusManager = focusManagerGetCurrentManagerMethod .invoke(focusManagerClass, null); final Method focusManagerGetFocusOwner = focusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = focusManagerGetFocusOwner .invoke(focusManager, null); return focusComponent; }
10
            
// in Eclipse UI/org/eclipse/ui/BasicWorkingSetElementAdapter.java
catch (ClassNotFoundException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (ClassNotFoundException e) { // switch to the old guy }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (ClassNotFoundException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (ClassNotFoundException e) { // unable to load the class - sounds pretty serious // treat as if the plug-in were unavailable resourceAdapterPossible = false; return null; }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (ClassNotFoundException e) { // unable to load ITextSelection - sounds pretty serious // treat as if JFace text plug-in were unavailable textSelectionPossible = false; return null; }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (ClassNotFoundException exception) { return null; }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (ClassNotFoundException exception) { //Couldn't ask so return false return false; }
0 0
unknown (Lib) CloneNotSupportedException 0 0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/registry/FileEditorMapping.java
catch (CloneNotSupportedException e) { return null; }
0 0
checked (Domain) CommandException
public abstract class CommandException extends Exception {

	/**
	 * Generated serial version UID for this class.
	 * 
	 * @since 3.4
	 */
	private static final long serialVersionUID= 1776879459633730964L;
	
	
	private Throwable cause;

    /**
     * Creates a new instance of this class with the specified detail message.
     * 
     * @param message
     *            the detail message.
     */
    public CommandException(String message) {
        super(message);
    }

    /**
     * Creates a new instance of this class with the specified detail message
     * and cause.
     * 
     * @param message
     *            the detail message.
     * @param cause
     *            the cause.
     */
    public CommandException(String message, Throwable cause) {
        super(message);
        // don't pass the cause to super, to allow compilation against JCL Foundation
        this.cause = cause;
    }

    /**
     * Returns the cause of this throwable or <code>null</code> if the
     * cause is nonexistent or unknown. 
     *
     * @return the cause or <code>null</code>
     * @since 3.1
     */
    public Throwable getCause() {
        return cause;
    }
}
0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
final boolean executeCommand(final Binding binding, final Event trigger) throws CommandException { final ParameterizedCommand parameterizedCommand = binding .getParameterizedCommand(); if (DEBUG) { Tracing.printTrace("KEYS", //$NON-NLS-1$ "WorkbenchKeyboard.executeCommand(commandId = '" //$NON-NLS-1$ + parameterizedCommand.getId() + "', parameters = " //$NON-NLS-1$ + parameterizedCommand.getParameterMap() + ')'); } // Reset the key binding state (close window, clear status line, etc.) resetState(false); // Dispatch to the handler. final IHandlerService handlerService = (IHandlerService) workbench .getService(IHandlerService.class); final Command command = parameterizedCommand.getCommand(); final boolean commandDefined = command.isDefined(); final boolean commandHandled = command.isHandled(); command.setEnabled(handlerService.getCurrentState()); final boolean commandEnabled = command.isEnabled(); if (DEBUG && DEBUG_VERBOSE) { if (!commandDefined) { Tracing.printTrace("KEYS", " not defined"); //$NON-NLS-1$ //$NON-NLS-2$ } else if (!commandHandled) { Tracing.printTrace("KEYS", " not handled"); //$NON-NLS-1$ //$NON-NLS-2$ } else if (!commandEnabled) { Tracing.printTrace("KEYS", " not enabled"); //$NON-NLS-1$ //$NON-NLS-2$ } } try { handlerService.executeCommand(parameterizedCommand, trigger); } catch (final NotDefinedException e) { // The command is not defined. Forwarded to the IExecutionListener. } catch (final NotEnabledException e) { // The command is not enabled. Forwarded to the IExecutionListener. } catch (final NotHandledException e) { // There is no handler. Forwarded to the IExecutionListener. } /* * Now that the command has executed (and had the opportunity to use the * remembered state of the dialog), it is safe to delete that * information. */ if (keyAssistDialog != null) { keyAssistDialog.clearRememberedState(); } return (commandDefined && commandHandled); }
3
            
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final CommandException e) { logException(e, binding.getParameterizedCommand()); return true; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final CommandException e) { workbenchKeyboard.logException(e, binding .getParameterizedCommand()); }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final CommandException e) { /* * TODO There should be an API on IHandlerService that handles * the exceptions. */ }
0 0
checked (Domain) CommandNotMappedException
public class CommandNotMappedException extends CommandException {

	private static final long serialVersionUID = 1L;

	/**
	 * @param message
	 */
	public CommandNotMappedException(String message) {
		super(message);
	}

	/**
	 * @param message
	 * @param cause
	 */
	public CommandNotMappedException(String message, Throwable cause) {
		super(message, cause);
	}
}
3 0 1 0 0 0
checked (Domain) ContextException
public abstract class ContextException extends Exception {
	
	/**
	 * Generated serial version UID for this class.
	 * 
	 * @since 3.4
	 */
	private static final long serialVersionUID= -5143404124388080211L;
	
	
	private Throwable cause;

    /**
     * Creates a new instance of this class with the specified detail message.
     * 
     * @param message
     *            the detail message.
     */
    public ContextException(String message) {
        super(message);
    }

    /**
     * Creates a new instance of this class with the specified detail message
     * and cause.
     * 
     * @param message
     *            the detail message.
     * @param cause
     *            the cause.
     */
    public ContextException(String message, Throwable cause) {
        super(message);
        // don't pass the cause to super, to allow compilation against JCL Foundation
        this.cause = cause;
    }
    
    /**
     * Returns the cause of this throwable or <code>null</code> if the
     * cause is nonexistent or unknown. 
     *
     * @return the cause or <code>null</code>
     * @since 3.1
     */
    public Throwable getCause() {
        return cause;
    }

}
0 0 0 0 0 0
unknown (Lib) CoreException 14
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException { try { // If plugin has been loaded create extension. // Otherwise, show busy cursor then create extension. if (BundleUtility.isActivated(element.getDeclaringExtension() .getNamespace())) { return element.createExecutableExtension(classAttribute); } final Object[] ret = new Object[1]; final CoreException[] exc = new CoreException[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { ret[0] = element .createExecutableExtension(classAttribute); } catch (CoreException e) { exc[0] = e; } } }); if (exc[0] != null) { throw exc[0]; } return ret[0]; } catch (CoreException core) { throw core; } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); } }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
public IPreferencePage createPage(Object element) throws CoreException { IPreferencePage ppage = null; ppage = (IPreferencePage) WorkbenchPlugin.createExtension( pageElement, IWorkbenchRegistryConstants.ATT_CLASS); ppage.setTitle(getPageName()); Object[] elements = getObjects(element); IAdaptable[] adapt = new IAdaptable[elements.length]; for (int i = 0; i < elements.length; i++) { Object adapted = elements[i]; if (adaptable) { adapted = getAdaptedElement(adapted); if (adapted == null) { String message = "Error adapting selection to Property page " + pageId + " is being ignored"; //$NON-NLS-1$ //$NON-NLS-2$ throw new CoreException(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, message, null)); } } adapt[i] = (IAdaptable) ((adapted instanceof IAdaptable) ? adapted : new AdaptableForwarder(adapted)); } if (supportsMultiSelect) { if ((ppage instanceof IWorkbenchPropertyPageMulti)) ((IWorkbenchPropertyPageMulti) ppage).setElements(adapt); else throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Property page must implement IWorkbenchPropertyPageMulti: " + getPageName(), //$NON-NLS-1$ null)); } else ((IWorkbenchPropertyPage) ppage).setElement(adapt[0]); return ppage; }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void open() throws CoreException { Program program = this.descriptor.getProgram(); if (program == null) { openWithUserDefinedProgram(); } else { String path = ""; //$NON-NLS-1$ if (filePath != null) { path = filePath.toOSString(); if (program.execute(path)) { return; } } throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage, path), null)); } }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void openWithUserDefinedProgram() throws CoreException { // We need to determine if the command refers to a program in the plugin // install directory. Otherwise we assume the program is on the path. String programFileName = null; IConfigurationElement configurationElement = descriptor .getConfigurationElement(); // Check if we have a config element (if we don't it is an // external editor created on the resource associations page). if (configurationElement != null) { try { Bundle bundle = Platform.getBundle(configurationElement .getNamespace()); // See if the program file is in the plugin directory URL entry = bundle.getEntry(descriptor.getFileName()); if (entry != null) { // this will bring the file local if the plugin is on a server URL localName = Platform.asLocalURL(entry); File file = new File(localName.getFile()); //Check that it exists before we assert it is valid if (file.exists()) { programFileName = file.getAbsolutePath(); } } } catch (IOException e) { // Program file is not in the plugin directory } } if (programFileName == null) { // Program file is not in the plugin directory therefore // assume it is on the path programFileName = descriptor.getFileName(); } // Get the full path of the file to open if (filePath == null) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), null)); } String path = filePath.toOSString(); // Open the file // ShellCommand was removed in response to PR 23888. If an exception was // thrown, it was not caught in time, and no feedback was given to user try { if (Util.isMac()) { Runtime.getRuntime().exec( new String[] { "open", "-a", programFileName, path }); //$NON-NLS-1$ //$NON-NLS-2$ } else { Runtime.getRuntime().exec( new String[] { programFileName, path }); } } catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); } }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
private void loadFromExtension() throws CoreException { id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); String category = configElement.getAttribute(IWorkbenchRegistryConstants.TAG_CATEGORY); // Sanity check. if ((configElement.getAttribute(IWorkbenchRegistryConstants.ATT_NAME) == null) || (RegistryReader.getClassValue(configElement, IWorkbenchRegistryConstants.ATT_CLASS) == null)) { throw new CoreException(new Status(IStatus.ERROR, configElement .getNamespace(), 0, "Invalid extension (missing label or class name): " + id, //$NON-NLS-1$ null)); } if (category != null) { StringTokenizer stok = new StringTokenizer(category, "/"); //$NON-NLS-1$ categoryPath = new String[stok.countTokens()]; // Parse the path tokens and store them for (int i = 0; stok.hasMoreTokens(); i++) { categoryPath[i] = stok.nextToken(); } } String ratio = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_FAST_VIEW_WIDTH_RATIO); if (ratio != null) { try { fastViewWidthRatio = new Float(ratio).floatValue(); if (fastViewWidthRatio > IPageLayout.RATIO_MAX) { fastViewWidthRatio = IPageLayout.RATIO_MAX; } if (fastViewWidthRatio < IPageLayout.RATIO_MIN) { fastViewWidthRatio = IPageLayout.RATIO_MIN; } } catch (NumberFormatException e) { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } } else { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public Object create() throws CoreException { if (APPEARANCE_PREFERENCE_PAGE.equals(id)) { return configure(new ViewsPreferencePage()); } if (COLORS_AND_FONTS_PREFERENCE_PAGE.equals(id)) { return configure(new ColorsAndFontsPreferencePage()); } if (DECORATORS_PREFERENCE_PAGE.equals(id)) { return configure(new DecoratorsPreferencePage()); } if (EDITORS_PREFERENCE_PAGE.equals(id)) { return configure(new EditorsPreferencePage()); } if (FILE_ASSOCIATIONS_PREFERENCE_PAGE.equals(id)) { return configure(new FileEditorsPreferencePage()); } if (KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new KeysPreferencePage()); } if (NEW_KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new NewKeysPreferencePage()); } if (PERSPECTIVES_PREFERENCE_PAGE.equals(id)) { return configure(new PerspectivesPreferencePage()); } if (PREFERENCES_EXPORT_WIZARD.equals(id)) { return configure(new PreferencesExportWizard()); } if (PREFERENCES_IMPORT_WIZARD.equals(id)) { return configure(new PreferencesImportWizard()); } if (PROGRESS_VIEW.equals(id)) { return configure(new ProgressView()); } if (WORKBENCH_PREFERENCE_PAGE.equals(id)) { return configure(new WorkbenchPreferencePage()); } if (CONTENT_TYPES_PREFERENCE_PAGE.equals(id)) { return configure(new ContentTypesPreferencePage()); } if (SHOW_IN_CONTRIBUTION.equals(id)) { ShowInMenu showInMenu = new ShowInMenu(); return showInMenu; } throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Unknown id in data argument for " + getClass(), null)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof String) { id = (String) data; } else { throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Data argument must be a String for " + getClass(), null)); //$NON-NLS-1$ } this.config = config; this.propertyName = propertyName; }
2
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
66
            
// in Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceTransferElement.java
public IPreferenceFilter getFilter() throws CoreException { if (filter == null) { IConfigurationElement[] mappingConfigurations = PreferenceTransferRegistryReader .getMappings(configurationElement); int size = mappingConfigurations.length; Set scopes = new HashSet(size); Map mappingsMap = new HashMap(size); for (int i = 0; i < size; i++) { String scope = PreferenceTransferRegistryReader .getScope(mappingConfigurations[i]); scopes.add(scope); Map mappings; if (!mappingsMap.containsKey(scope)) { mappings = new HashMap(size); mappingsMap.put(scope, mappings); } else { mappings = (Map) mappingsMap.get(scope); if (mappings == null) { continue; } } Map entries = PreferenceTransferRegistryReader .getEntry(mappingConfigurations[i]); if (entries == null) { mappingsMap.put(scope, null); } else { mappings.putAll(entries); } } filter = new PreferenceFilter((String[]) scopes .toArray(new String[scopes.size()]), mappingsMap); } return filter; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException { try { // If plugin has been loaded create extension. // Otherwise, show busy cursor then create extension. if (BundleUtility.isActivated(element.getDeclaringExtension() .getNamespace())) { return element.createExecutableExtension(classAttribute); } final Object[] ret = new Object[1]; final CoreException[] exc = new CoreException[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { ret[0] = element .createExecutableExtension(classAttribute); } catch (CoreException e) { exc[0] = e; } } }); if (exc[0] != null) { throw exc[0]; } return ret[0]; } catch (CoreException core) { throw core; } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); } }
// in Eclipse UI/org/eclipse/ui/internal/ShowPartPaneMenuHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_PART_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/ShowPartPaneMenuHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/CloseAllHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_EDITOR_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/CloseAllHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/CloseOthersHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorReference[] refArray = page .getEditorReferences(); if (refArray != null && refArray.length > 1) { return EvaluationResult.TRUE; } } } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info .addVariableNameAccess(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/CloseOthersHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorReference[] refArray = page .getEditorReferences(); if (refArray != null && refArray.length > 1) { return EvaluationResult.TRUE; } } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ExecutableExtensionHandler.java
public void setInitializationData(final IConfigurationElement config, final String propertyName, final Object data) throws CoreException { // Do nothing, by default }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
private boolean eval(IEvaluationContext context, IHandlerActivation activation) throws CoreException { Expression expression = activation.getExpression(); if (expression == null) { return true; } return expression.evaluate(context) == EvaluationResult.TRUE; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
private void updateWizardSelection(IWizardDescriptor selectedObject) { selectedElement = selectedObject; WorkbenchWizardNode selectedNode; if (selectedWizards.containsKey(selectedObject)) { selectedNode = (WorkbenchWizardNode) selectedWizards .get(selectedObject); } else { selectedNode = new WorkbenchWizardNode(page, selectedObject) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; selectedWizards.put(selectedObject, selectedNode); } page.setCanFinishEarly(selectedObject.canFinishEarly()); page.setHasPages(selectedObject.hasPages()); page.selectWizardNode(selectedNode); updateDescription(selectedObject); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ExportWizard.java
protected IWizardNode createWizardNode(WorkbenchWizardElement element) { return new WorkbenchWizardNode(this, element) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ExportWizard.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportExportPage.java
private IWizardNode createWizardNode(IWizardDescriptor element) { return new WorkbenchWizardNode(this, element) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportExportPage.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportWizard.java
public IWizardNode createWizardNode(WorkbenchWizardElement element) { return new WorkbenchWizardNode(this, element) { public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ImportWizard.java
public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
public IPreferencePage createPage(Object element) throws CoreException { IPreferencePage ppage = null; ppage = (IPreferencePage) WorkbenchPlugin.createExtension( pageElement, IWorkbenchRegistryConstants.ATT_CLASS); ppage.setTitle(getPageName()); Object[] elements = getObjects(element); IAdaptable[] adapt = new IAdaptable[elements.length]; for (int i = 0; i < elements.length; i++) { Object adapted = elements[i]; if (adaptable) { adapted = getAdaptedElement(adapted); if (adapted == null) { String message = "Error adapting selection to Property page " + pageId + " is being ignored"; //$NON-NLS-1$ //$NON-NLS-2$ throw new CoreException(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, message, null)); } } adapt[i] = (IAdaptable) ((adapted instanceof IAdaptable) ? adapted : new AdaptableForwarder(adapted)); } if (supportsMultiSelect) { if ((ppage instanceof IWorkbenchPropertyPageMulti)) ((IWorkbenchPropertyPageMulti) ppage).setElements(adapt); else throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Property page must implement IWorkbenchPropertyPageMulti: " + getPageName(), //$NON-NLS-1$ null)); } else ((IWorkbenchPropertyPage) ppage).setElement(adapt[0]); return ppage; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardElement.java
public Object createExecutableExtension() throws CoreException { return WorkbenchPlugin.createExtension(configurationElement, IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardElement.java
public IWorkbenchWizard createWizard() throws CoreException { return (IWorkbenchWizard) createExecutableExtension(); }
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object s = context.getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (s == null || s == IEvaluationContext.UNDEFINED_VARIABLE) { return EvaluationResult.FALSE; } if (adapt) { int status = Platform.getAdapterManager().queryAdapter(s, objectClass); switch (status) { case IAdapterManager.LOADED: return EvaluationResult.TRUE; case IAdapterManager.NOT_LOADED: return EvaluationResult.NOT_LOADED; default: break; } } else { if (objectClass.equals(s.getClass().getName())) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
public IIntroPart createIntro() throws CoreException { return (IIntroPart) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
public IntroContentDetector getIntroContentDetector() throws CoreException { if (element.getAttribute(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR) == null) { return null; } return (IntroContentDetector) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/StatusHandlerDescriptor.java
public synchronized AbstractStatusHandler getStatusHandler() throws CoreException { if (cachedInstance == null) { AbstractStatusHandler statusHandler = (AbstractStatusHandler) configElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); statusHandler.setId(configElement .getAttribute(IWorkbenchRegistryConstants.ATT_ID)); IConfigurationElement parameters[] = configElement .getChildren(IWorkbenchRegistryConstants.TAG_PARAMETER); Map params = new HashMap(); for (int i = 0; i < parameters.length; i++) { params .put( parameters[i] .getAttribute(IWorkbenchRegistryConstants.ATT_NAME), parameters[i] .getAttribute(IWorkbenchRegistryConstants.ATT_VALUE)); } statusHandler.setParams(params); cachedInstance = statusHandler; } return cachedInstance; }
// in Eclipse UI/org/eclipse/ui/internal/CloseEditorHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_EDITOR_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/CloseEditorHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IEditorPart part = InternalHandlerUtil .getActiveEditor(context); if (part != null) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void open() throws CoreException { Program program = this.descriptor.getProgram(); if (program == null) { openWithUserDefinedProgram(); } else { String path = ""; //$NON-NLS-1$ if (filePath != null) { path = filePath.toOSString(); if (program.execute(path)) { return; } } throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage, path), null)); } }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
public void openWithUserDefinedProgram() throws CoreException { // We need to determine if the command refers to a program in the plugin // install directory. Otherwise we assume the program is on the path. String programFileName = null; IConfigurationElement configurationElement = descriptor .getConfigurationElement(); // Check if we have a config element (if we don't it is an // external editor created on the resource associations page). if (configurationElement != null) { try { Bundle bundle = Platform.getBundle(configurationElement .getNamespace()); // See if the program file is in the plugin directory URL entry = bundle.getEntry(descriptor.getFileName()); if (entry != null) { // this will bring the file local if the plugin is on a server URL localName = Platform.asLocalURL(entry); File file = new File(localName.getFile()); //Check that it exists before we assert it is valid if (file.exists()) { programFileName = file.getAbsolutePath(); } } } catch (IOException e) { // Program file is not in the plugin directory } } if (programFileName == null) { // Program file is not in the plugin directory therefore // assume it is on the path programFileName = descriptor.getFileName(); } // Get the full path of the file to open if (filePath == null) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), null)); } String path = filePath.toOSString(); // Open the file // ShellCommand was removed in response to PR 23888. If an exception was // thrown, it was not caught in time, and no feedback was given to user try { if (Util.isMac()) { Runtime.getRuntime().exec( new String[] { "open", "-a", programFileName, path }); //$NON-NLS-1$ //$NON-NLS-2$ } else { Runtime.getRuntime().exec( new String[] { programFileName, path }); } } catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorDescriptor.java
public ITriggerPointAdvisor createAdvisor() throws CoreException { return (ITriggerPointAdvisor) element .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
IIntroPart createNewIntroPart() throws CoreException { IntroDescriptor introDescriptor = workbench.getIntroDescriptor(); introPart = introDescriptor == null ? null : introDescriptor.createIntro(); if (introPart != null) { workbench.getExtensionTracker().registerObject( introDescriptor.getConfigurationElement() .getDeclaringExtension(), introPart, IExtensionTracker.REF_WEAK); } return introPart; }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
private Object getExecutableExtension(IConfigurationElement element) throws CoreException { String classname = element.getAttribute(IWorkbenchConstants.TAG_CLASS); // if class attribute is absent then try to use the compatibility // bundle to return the plugin object if (classname == null || classname.length() <= 0) { return getPluginForCompatibility(); } // otherwise the 3.0 runtime should be able to do it return WorkbenchPlugin.createExtension(element, IWorkbenchConstants.TAG_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveDescriptor.java
public IPerspectiveFactory createFactory() throws CoreException { // if there is an originalId, then use that descriptor instead if (originalId != null) { // Get the original descriptor to create the factory. If the // original is gone then nothing can be done. IPerspectiveDescriptor target = ((PerspectiveRegistry) WorkbenchPlugin .getDefault().getPerspectiveRegistry()) .findPerspectiveWithId(originalId); return target == null ? null : ((PerspectiveDescriptor) target) .createFactory(); } // otherwise try to create the executable extension if (configElement != null) { try { return (IPerspectiveFactory) configElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS); } catch (CoreException e) { // do nothing } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
public IViewPart createView() throws CoreException { Object extension = WorkbenchPlugin.createExtension( getConfigurationElement(), IWorkbenchRegistryConstants.ATT_CLASS); return ((InterceptContributions) Tweaklets .get(InterceptContributions.KEY)).tweakView(extension); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
private void loadFromExtension() throws CoreException { id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); String category = configElement.getAttribute(IWorkbenchRegistryConstants.TAG_CATEGORY); // Sanity check. if ((configElement.getAttribute(IWorkbenchRegistryConstants.ATT_NAME) == null) || (RegistryReader.getClassValue(configElement, IWorkbenchRegistryConstants.ATT_CLASS) == null)) { throw new CoreException(new Status(IStatus.ERROR, configElement .getNamespace(), 0, "Invalid extension (missing label or class name): " + id, //$NON-NLS-1$ null)); } if (category != null) { StringTokenizer stok = new StringTokenizer(category, "/"); //$NON-NLS-1$ categoryPath = new String[stok.countTokens()]; // Parse the path tokens and store them for (int i = 0; stok.hasMoreTokens(); i++) { categoryPath[i] = stok.nextToken(); } } String ratio = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_FAST_VIEW_WIDTH_RATIO); if (ratio != null) { try { fastViewWidthRatio = new Float(ratio).floatValue(); if (fastViewWidthRatio > IPageLayout.RATIO_MAX) { fastViewWidthRatio = IPageLayout.RATIO_MAX; } if (fastViewWidthRatio < IPageLayout.RATIO_MIN) { fastViewWidthRatio = IPageLayout.RATIO_MIN; } } catch (NumberFormatException e) { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } } else { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; } }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
public IEditorPart createEditor() throws CoreException { Object extension = WorkbenchPlugin.createExtension(getConfigurationElement(), IWorkbenchRegistryConstants.ATT_CLASS); return ((InterceptContributions)Tweaklets.get(InterceptContributions.KEY)).tweakEditor(extension); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ActionSetDescriptor.java
public IActionSet createActionSet() throws CoreException { return new PluginActionSet(this); }
// in Eclipse UI/org/eclipse/ui/internal/ActivateEditorHandler.java
protected Expression getEnabledWhenExpression() { if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { if (window.getActivePage() != null) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info .addVariableNameAccess(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/ActivateEditorHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchWindow window = InternalHandlerUtil .getActiveWorkbenchWindow(context); if (window != null) { if (window.getActivePage() != null) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/AndExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { return evaluateAnd(context); }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyActionSetExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } // Check the action sets. final Object variable = context .getVariable(ISources.ACTIVE_ACTION_SETS_NAME); if (variable instanceof IActionSetDescriptor[]) { final IActionSetDescriptor[] descriptors = (IActionSetDescriptor[]) variable; for (int i = 0; i < descriptors.length; i++) { final IActionSetDescriptor descriptor = descriptors[i]; final String currentId = descriptor.getId(); if (actionSetId.equals(currentId)) { return EvaluationResult.TRUE; } } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/WorkbenchWindowExpression.java
public EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { if (window != null) { Object value = context .getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); if (window.equals(value)) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacySelectionEnablerWrapper.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object defaultVariable = context .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); if (defaultVariable instanceof ISelection) { final ISelection selection = (ISelection) defaultVariable; if (enabler.isEnabledForSelection(selection)) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyActionExpressionWrapper.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object defaultVariable = context .getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); if (defaultVariable instanceof IStructuredSelection) { final IStructuredSelection selection = (IStructuredSelection) defaultVariable; if (expression.isEnabledFor(selection)) { return EvaluationResult.TRUE; } } else if (expression.isEnabledFor(defaultVariable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyViewContributionExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object variable = context .getVariable(ISources.ACTIVE_PART_ID_NAME); if (equals(activePartId, variable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyViewerContributionExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object value = context.getVariable(ISources.ACTIVE_MENU_NAME); if (value instanceof String) { final String menuId = (String) value; if (targetId.equals(menuId)) { if (expression == null) { return EvaluationResult.TRUE; } return expression.evaluate(context); } } else if (value instanceof Collection) { final Collection menuIds = (Collection) value; if (menuIds.contains(targetId)) { if (expression == null) { return EvaluationResult.TRUE; } return expression.evaluate(context); } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/CompositeExpression.java
protected EvaluationResult evaluateAnd(IEvaluationContext scope) throws CoreException { if (fExpressions == null) { return EvaluationResult.TRUE; } EvaluationResult result = EvaluationResult.TRUE; for (Iterator iter = fExpressions.iterator(); iter.hasNext();) { Expression expression = (Expression) iter.next(); result = result.and(expression.evaluate(scope)); // keep iterating even if we have a not loaded found. It can be // that we find a false which will result in a better result. if (result == EvaluationResult.FALSE) { return result; } } return result; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/CompositeExpression.java
protected EvaluationResult evaluateOr(IEvaluationContext scope) throws CoreException { if (fExpressions == null) { return EvaluationResult.TRUE; } EvaluationResult result = EvaluationResult.FALSE; for (Iterator iter = fExpressions.iterator(); iter.hasNext();) { Expression expression = (Expression) iter.next(); result = result.or(expression.evaluate(scope)); if (result == EvaluationResult.TRUE) { return result; } } return result; }
// in Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorContributionExpression.java
public final EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { final EvaluationResult result = super.evaluate(context); if (result == EvaluationResult.FALSE) { return result; } final Object variable = context .getVariable(ISources.ACTIVE_PART_ID_NAME); if (equals(activeEditorId, variable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { gotoDirection = "true".equals(data); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/themes/ThemeElementCategory.java
public IThemePreview createPreview() throws CoreException { String classString = element.getAttribute(IWorkbenchRegistryConstants.ATT_CLASS); if (classString == null || "".equals(classString)) { //$NON-NLS-1$ return null; } return (IThemePreview) WorkbenchPlugin.createExtension(element, IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
private IThemePreview getThemePreview(ThemeElementCategory category) throws CoreException { IThemePreview preview = category.createPreview(); if (preview != null) return preview; if (category.getParentId() != null) { int idx = Arrays.binarySearch(themeRegistry.getCategories(), category.getParentId(), IThemeRegistry.ID_COMPARATOR); if (idx >= 0) return getThemePreview(themeRegistry.getCategories()[idx]); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/themes/RGBContrastFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof Hashtable) { Hashtable table = (Hashtable) data; fg = (String) table.get("foreground"); //$NON-NLS-1$ bg1 = (String) table.get("background1"); //$NON-NLS-1$ bg2 = (String) table.get("background2"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
protected ILabelDecorator internalGetDecorator() throws CoreException { if (labelProviderCreationFailed) { return null; } final CoreException[] exceptions = new CoreException[1]; if (decorator == null) { Platform .run(new SafeRunnable( NLS.bind(WorkbenchMessages.DecoratorManager_ErrorActivatingDecorator, getName() )) { public void run() { try { decorator = (ILabelDecorator) WorkbenchPlugin .createExtension( definingElement, DecoratorDefinition.ATT_CLASS); decorator.addListener(WorkbenchPlugin .getDefault().getDecoratorManager()); } catch (CoreException exception) { exceptions[0] = exception; } } }); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
protected IBaseLabelProvider internalGetLabelProvider() throws CoreException { return internalGetDecorator(); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
protected ILightweightLabelDecorator internalGetDecorator() throws CoreException { if (labelProviderCreationFailed) { return null; } final CoreException[] exceptions = new CoreException[1]; if (decorator == null) { if (isDeclarative()) { decorator = new DeclarativeDecorator(definingElement, getIconLocation()); } else { Platform.run(new ISafeRunnable() { public void run() { try { decorator = (ILightweightLabelDecorator) WorkbenchPlugin .createExtension(definingElement, DecoratorDefinition.ATT_CLASS); decorator.addListener(WorkbenchPlugin.getDefault() .getDecoratorManager()); } catch (CoreException exception) { exceptions[0] = exception; } } /* * (non-Javadoc) Method declared on ISafeRunnable. */ public void handleException(Throwable e) { // Do nothing as Core will handle the logging } }); } }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
protected IBaseLabelProvider internalGetLabelProvider() throws CoreException { return internalGetDecorator(); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenuHandler.java
protected Expression getEnabledWhenExpression() { // TODO Auto-generated method stub if (enabledWhen == null) { enabledWhen = new Expression() { public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { PartPane pane = ((PartSite) part.getSite()).getPane(); if ((pane instanceof ViewPane) && ((ViewPane) pane).hasViewMenu()) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; } /* * (non-Javadoc) * * @see org.eclipse.core.expressions.Expression#collectExpressionInfo(org.eclipse.core.expressions.ExpressionInfo) */ public void collectExpressionInfo(ExpressionInfo info) { info.addVariableNameAccess(ISources.ACTIVE_PART_NAME); } }; } return enabledWhen; }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenuHandler.java
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { IWorkbenchPart part = InternalHandlerUtil .getActivePart(context); if (part != null) { PartPane pane = ((PartSite) part.getSite()).getPane(); if ((pane instanceof ViewPane) && ((ViewPane) pane).hasViewMenu()) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
private void internalRun(GranualProgressMonitor monitor) throws CoreException { try { if (monitor.isCanceled()) return; this.itemsFilter = filter; if (filter.getPattern().length() != 0) { filterContent(monitor); } if (monitor.isCanceled()) return; contentProvider.refresh(); } finally { monitor.done(); } }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
protected void filterContent(GranualProgressMonitor monitor) throws CoreException { if (lastCompletedFilter != null && lastCompletedFilter.isSubFilter(this.itemsFilter)) { int length = lastCompletedResult.size() / 500; monitor .beginTask( WorkbenchMessages.FilteredItemsSelectionDialog_cacheSearchJob_taskName, length); for (int pos = 0; pos < lastCompletedResult.size(); pos++) { Object item = lastCompletedResult.get(pos); if (monitor.isCanceled()) break; contentProvider.add(item, itemsFilter); if ((pos % 500) == 0) { monitor.worked(1); } } } else { lastCompletedFilter = null; lastCompletedResult = null; SubProgressMonitor subMonitor = null; if (monitor != null) { monitor .beginTask( WorkbenchMessages.FilteredItemsSelectionDialog_searchJob_taskName, 100); subMonitor = new SubProgressMonitor(monitor, 95); } fillContentProvider(contentProvider, itemsFilter, subMonitor); if (monitor != null && !monitor.isCanceled()) { monitor.worked(2); contentProvider.rememberResult(itemsFilter); monitor.worked(3); } } }
// in Eclipse UI/org/eclipse/ui/menus/ExtensionContributionFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { locationURI = config .getAttribute(IWorkbenchRegistryConstants.TAG_LOCATION_URI); namespace = config.getNamespaceIdentifier(); }
// in Eclipse UI/org/eclipse/ui/Saveable.java
public IJobRunnable doSave(IProgressMonitor monitor, IShellProvider shellProvider) throws CoreException { doSave(monitor); return null; }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public void startup() throws CoreException { // this method no longer does anything // the code that used to be here in 2.1 has moved to start(BundleContext) super.startup(); }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public void shutdown() throws CoreException { // this method no longer does anything interesting // the code that used to be here in 2.1 has moved to stop(BundleContext), // which is called regardless of whether the plug-in being instantiated // requires org.eclipse.core.runtime.compatibility super.shutdown(); }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
private Object configure(Object obj) throws CoreException { if (obj instanceof IExecutableExtension) { ((IExecutableExtension) obj).setInitializationData(config, propertyName, null); } return obj; }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public Object create() throws CoreException { if (APPEARANCE_PREFERENCE_PAGE.equals(id)) { return configure(new ViewsPreferencePage()); } if (COLORS_AND_FONTS_PREFERENCE_PAGE.equals(id)) { return configure(new ColorsAndFontsPreferencePage()); } if (DECORATORS_PREFERENCE_PAGE.equals(id)) { return configure(new DecoratorsPreferencePage()); } if (EDITORS_PREFERENCE_PAGE.equals(id)) { return configure(new EditorsPreferencePage()); } if (FILE_ASSOCIATIONS_PREFERENCE_PAGE.equals(id)) { return configure(new FileEditorsPreferencePage()); } if (KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new KeysPreferencePage()); } if (NEW_KEYS_PREFERENCE_PAGE.equals(id)) { return configure(new NewKeysPreferencePage()); } if (PERSPECTIVES_PREFERENCE_PAGE.equals(id)) { return configure(new PerspectivesPreferencePage()); } if (PREFERENCES_EXPORT_WIZARD.equals(id)) { return configure(new PreferencesExportWizard()); } if (PREFERENCES_IMPORT_WIZARD.equals(id)) { return configure(new PreferencesImportWizard()); } if (PROGRESS_VIEW.equals(id)) { return configure(new ProgressView()); } if (WORKBENCH_PREFERENCE_PAGE.equals(id)) { return configure(new WorkbenchPreferencePage()); } if (CONTENT_TYPES_PREFERENCE_PAGE.equals(id)) { return configure(new ContentTypesPreferencePage()); } if (SHOW_IN_CONTRIBUTION.equals(id)) { ShowInMenu showInMenu = new ShowInMenu(); return showInMenu; } throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Unknown id in data argument for " + getClass(), null)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/ExtensionFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof String) { id = (String) data; } else { throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Data argument must be a String for " + getClass(), null)); //$NON-NLS-1$ } this.config = config; this.propertyName = propertyName; }
// in Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java
protected static IDropActionDelegate getPluginAdapter( PluginTransferData data) throws CoreException { IExtensionRegistry registry = Platform.getExtensionRegistry(); String adapterName = data.getExtensionId(); IExtensionPoint xpt = registry.getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_DROP_ACTIONS); IExtension[] extensions = xpt.getExtensions(); for (int i = 0; i < extensions.length; i++) { IConfigurationElement[] configs = extensions[i].getConfigurationElements(); if (configs != null && configs.length > 0) { for (int j=0; j < configs.length; j++) { String id = configs[j].getAttribute("id");//$NON-NLS-1$ if (id != null && id.equals(adapterName)) { return (IDropActionDelegate) WorkbenchPlugin .createExtension(configs[j], ATT_CLASS); } } } } return null; }
// in Eclipse UI/org/eclipse/ui/themes/RGBBlendColorFactory.java
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { if (data instanceof Hashtable) { Hashtable table = (Hashtable) data; color1 = (String) table.get("color1"); //$NON-NLS-1$ color2 = (String) table.get("color2"); //$NON-NLS-1$ } }
85
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { exc[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException core) { throw core; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log( "Unable to create element factory.", e.getStatus()); //$NON-NLS-1$ factory = null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException e) { // log it since we cannot safely display a dialog. WorkbenchPlugin.log("Unable to create extension: " + targetID //$NON-NLS-1$ + " in extension point: " + extensionPointId //$NON-NLS-1$ + ", status: ", e.getStatus()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { // We will just fall through an let it return false. final StringBuffer message = new StringBuffer( "An exception occurred while evaluating the enabledWhen expression for "); //$NON-NLS-1$ if (delegate != null) { message.append(delegate); } else { message.append(element.getAttribute(delegateAttributeName)); } message.append("' could not be loaded"); //$NON-NLS-1$ final IStatus status = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, 0, e.getMessage(), e); WorkbenchPlugin.log(message.toString(), status); return; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" //$NON-NLS-1$ + element.getAttribute(delegateAttributeName) + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
catch (CoreException e) { // the evalution failed }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
catch (CoreException e) { // OK, this one is out of the running }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
catch (final CoreException e) { /* * TODO If it can't be instantiated, should future attempts to * instantiate be blocked? */ final String message = "The proxied handler for '" + configurationElement.getAttribute(HANDLER_ATTRIBUTE_NAME) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (CoreException e) { // TODO should we log this exception, or just treat it as // a failure }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
catch (final CoreException e) { final String message = "The proxied handler for '" + configurationElement.getAttribute(handlerAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); configurationElement = null; loadException = e; }
// in Eclipse UI/org/eclipse/ui/internal/ConfigurationInfo.java
catch (CoreException e) { WorkbenchPlugin.log( "could not create class attribute for extension", //$NON-NLS-1$ e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchWizardNode.java
catch (CoreException e) { IPluginContribution contribution = (IPluginContribution) Util.getAdapter(wizardElement, IPluginContribution.class); statuses[0] = new Status( IStatus.ERROR, contribution != null ? contribution.getPluginId() : WorkbenchPlugin.PI_WORKBENCH, IStatus.OK, WorkbenchMessages.WorkbenchWizard_errorMessage, e); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e1) { StatusUtil.handleStatus(e1.getStatus(), StatusManager.SHOW, parent.getShell()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException ex) { StatusUtil.handleStatus(ex.getStatus(), StatusManager.SHOW, shell); WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/ContentTypesPreferencePage.java
catch (CoreException e) { result.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/PropertyPageNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PropertyPageNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW); page = new EmptyPropertyPage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
catch (CoreException ex) { WorkbenchPlugin.log( "Unable to create action set " + actionSetDesc.getId(), ex); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceNode.java
catch (CoreException e) { // Just inform the user about the error. The details are // written to the log by now. IStatus errStatus = StatusUtil.newStatus(e.getStatus(), WorkbenchMessages.PreferenceNode_errorMessage); StatusManager.getManager().handle(errStatus, StatusManager.SHOW | StatusManager.LOG); page = new ErrorPreferencePage(); }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); return false; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/RegistryPageContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
catch (final CoreException e) { final String message = "The proxied delegate for '" + configurationElement.getAttribute(delegateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WidgetProxy.java
catch (final CoreException e) { final String message = "The proxied widget for '" + configurationElement.getAttribute(widgetAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (CoreException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to instantiate browser support" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesPage.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { //Do not log core exceptions, they indicate the chosen file is not valid //WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (CoreException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_descriptor, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandStateProxy.java
catch (final CoreException e) { final String message = "The proxied state for '" + configurationElement.getAttribute(stateAttributeName) //$NON-NLS-1$ + "' could not be loaded"; //$NON-NLS-1$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); return false; }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/services/WorkbenchServiceRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/services/RegistryPersistence.java
catch (final CoreException e) { // There when expression could not be created. addWarning( warningsToLog, "Problem creating when element", //$NON-NLS-1$ parentElement, id, "whenElementName", whenElementName); //$NON-NLS-1$ return ERROR_EXPRESSION; }
// in Eclipse UI/org/eclipse/ui/internal/services/EvaluationResultCache.java
catch (final CoreException e) { /* * Swallow the exception. It simply means the variable is not * valid it some (most frequently, that the value is null). This * kind of information is not really useful to us, so we can * just treat it as null. */ evaluationResult = EvaluationResult.FALSE; return false; }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
catch (CoreException e) { WorkbenchPlugin.log( "Unable to instantiate help UI" + e.getStatus(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (CoreException e) { WorkbenchPlugin.log("could not create trigger point advisor", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (CoreException e) { StatusManager.getManager().handle(e, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (CoreException e) { StatusUtil.handleStatus(e.getStatus(), StatusManager.SHOW, shellProvider.getShell()); progressMonitor.setCanceled(true); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { ex[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
// in Eclipse UI/org/eclipse/ui/internal/actions/NewWizardShortcutAction.java
catch (CoreException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.NewWizardShortcutAction_errorTitle, WorkbenchMessages.NewWizardShortcutAction_errorMessage, e.getStatus()); return; }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Tweaklets.java
catch (CoreException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Error with extension " + elements[i], e), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (CoreException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/InstallationDialog.java
catch (CoreException e1) { Label label = new Label(pageComposite, SWT.NONE); label.setText(e1.getMessage()); item.setData(null); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (CoreException ex) { WorkbenchPlugin.log(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IStatus.WARNING, "Could not load intro content detector", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (final CoreException e) { // TODO: give more info (eg plugin id).... // Gather formatting info final String classDef = element.getAttribute(attName); final String message = "Class load Failure: '" + classDef + "'"; //$NON-NLS-1$//$NON-NLS-2$ IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create layout descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ActionSetRegistry.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create action set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WizardsRegistryReader.java
catch (CoreException e) { WorkbenchPlugin.log("Cannot create category: ", e.getStatus());//$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to show a dialog here WorkbenchPlugin.log( "Unable to create view category.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create sticky view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "Unable to create view descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveDescriptor.java
catch (CoreException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetRegistryReader.java
catch (CoreException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin .log( "Unable to create working set descriptor.", e.getStatus());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set page: " + //$NON-NLS-1$ pageClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set element adapter: " + //$NON-NLS-1$ result, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/WorkingSetDescriptor.java
catch (CoreException exception) { WorkbenchPlugin.log("Unable to create working set updater: " + //$NON-NLS-1$ updaterClassName, exception.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Unable to create editor contributor: " + //$NON-NLS-1$ id, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
catch (CoreException e) { WorkbenchPlugin.log("Error creating editor management policy for editor id " + getId(), e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ActionPresentation.java
catch (CoreException e) { WorkbenchPlugin .log("Unable to create ActionSet: " + desc.getId(), e);//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
catch (CoreException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
catch (CoreException e) { enablement = null; WorkbenchPlugin.log(e); result = false; }
// in Eclipse UI/org/eclipse/ui/internal/part/StatusPart.java
catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (CoreException e) { previewControl = new Composite(previewComposite, SWT.NONE); previewControl.setLayout(new FillLayout()); myApplyDialogFont(previewControl); Text error = new Text(previewControl, SWT.WRAP | SWT.READ_ONLY); error.setText(RESOURCE_BUNDLE.getString("errorCreatingPreview")); //$NON-NLS-1$ WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorCreatePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); return false; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { exceptions[0] = exception; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecoratorManager.java
catch (CoreException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
catch (CoreException exception) { exceptions[0] = exception; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorDefinition.java
catch (CoreException exception) { handleCoreException(exception); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (CoreException e) { cancel(); return new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_jobError, e); }
// in Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
catch (CoreException ex) { logError("Errors during the default handler creating", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/part/PluginDropAdapter.java
catch (CoreException e) { WorkbenchPlugin.log("Drop Failed", e.getStatus());//$NON-NLS-1$ }
6
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (CoreException core) { throw core; }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
0
unknown (Lib) DataFormatException 0 0 1
            
// in Eclipse UI/org/eclipse/ui/themes/ColorUtil.java
public static RGB getColorValue(String rawValue) throws DataFormatException { if (rawValue == null) { return null; } rawValue = rawValue.trim(); if (!isDirectValue(rawValue)) { return process(rawValue); } return StringConverter.asRGB(rawValue); }
2
            
// in Eclipse UI/org/eclipse/ui/internal/themes/Theme.java
catch (DataFormatException e) { //no-op }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorDefinition.java
catch (DataFormatException e) { parsedValue = DEFAULT_COLOR_VALUE; IStatus status = StatusUtil.newStatus(IStatus.WARNING, "Could not parse value for theme color " + id, e); //$NON-NLS-1$ StatusManager.getManager().handle(status, StatusManager.LOG); }
0 0
unknown (Lib) DeviceResourceException 0 0 0 7
            
// in Eclipse UI/org/eclipse/ui/model/WorkbenchPartLabelProvider.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(getClass(), "getImage", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java
catch (final DeviceResourceException e) { final String message = "Problem retrieving image for a command '" //$NON-NLS-1$ + commandId + '\''; final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e); WorkbenchPlugin.log(message, status); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (DeviceResourceException e) { //ignore }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (DeviceResourceException e1) { WorkbenchPlugin.log(e1); return; }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (DeviceResourceException e) { icon = ImageDescriptor.getMissingImageDescriptor(); item.setImage(m.createImage(icon)); // as we replaced the failed icon, log the message once. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Failed to load image", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (DeviceResourceException e) { WorkbenchPlugin.log(e); }
0 0
runtime (Lib) Error 12
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else { methodToExecute.invoke(focusControl, null); } } catch (IllegalAccessException e) { // The method is protected, so do nothing. } catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected Method getMethodToExecute() { Display display = Display.getCurrent(); if (display == null) return null; final Control focusControl = display.getFocusControl(); Method method = null; if (focusControl != null) { final Class clazz = focusControl.getClass(); try { method = clazz.getMethod(methodName, NO_PARAMETERS); } catch (NoSuchMethodException e) { // Fall through... } } if ((method == null) && (focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * We couldn't find the appropriate method on the current focus * control. It is possible that the current focus control is an * embedded SWT composite, which could be containing some Swing * components. If this is the case, then we should try to pass * through to the underlying Swing component hierarchy. Insha'allah, * this will work. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { final Class clazz = focusComponent.getClass(); try { method = clazz.getMethod(methodName, NO_PARAMETERS); } catch (NoSuchMethodException e) { // Do nothing. } } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } return method; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); final int numParams = methodToExecute.getParameterTypes().length; if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { // we only support selectAll for swing components if (numParams != 0) { return null; } /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); // and back to the UI thread :-) focusControl.getDisplay().asyncExec( new Runnable() { public void run() { if (!focusControl .isDisposed()) { focusControl .notifyListeners( SWT.Selection, null); } } }); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else if (numParams == 0) { // This is a no-argument selectAll method. methodToExecute.invoke(focusControl, null); focusControl.notifyListeners(SWT.Selection, null); } else if (numParams == 1) { // This is a single-point selection method. final Method textLimitAccessor = focusControl.getClass() .getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$ final Integer textLimit = (Integer) textLimitAccessor .invoke(focusControl, null); final Object[] parameters = { new Point(0, textLimit .intValue()) }; methodToExecute.invoke(focusControl, parameters); if (!(focusControl instanceof Combo)) { focusControl.notifyListeners(SWT.Selection, null); } } else { /* * This means that getMethodToExecute() has been changed, * while this method hasn't. */ throw new ExecutionException( "Too many parameters on select all", new Exception()); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
public final void setVisible(final boolean visible) { if (visible == true) { Map contextsByName = new HashMap(); for (Iterator iterator = contextService.getDefinedContextIds() .iterator(); iterator.hasNext();) { Context context = contextService.getContext((String) iterator .next()); try { String name = context.getName(); Collection contexts = (Collection) contextsByName.get(name); if (contexts == null) { contexts = new HashSet(); contextsByName.put(name, contexts); } contexts.add(context); } catch (final NotDefinedException e) { // Do nothing. } } Map commandsByName = new HashMap(); for (Iterator iterator = commandService.getDefinedCommandIds() .iterator(); iterator.hasNext();) { Command command = commandService.getCommand((String) iterator .next()); if (!isActive(command)) { continue; } try { String name = command.getName(); Collection commands = (Collection) commandsByName.get(name); if (commands == null) { commands = new HashSet(); commandsByName.put(name, commands); } commands.add(command); } catch (NotDefinedException eNotDefined) { // Do nothing } } // moved here to allow us to remove any empty categories commandIdsByCategoryId = new HashMap(); for (Iterator iterator = commandService.getDefinedCommandIds() .iterator(); iterator.hasNext();) { final Command command = commandService .getCommand((String) iterator.next()); if (!isActive(command)) { continue; } try { String categoryId = command.getCategory().getId(); Collection commandIds = (Collection) commandIdsByCategoryId .get(categoryId); if (commandIds == null) { commandIds = new HashSet(); commandIdsByCategoryId.put(categoryId, commandIds); } commandIds.add(command.getId()); } catch (NotDefinedException eNotDefined) { // Do nothing } } Map categoriesByName = new HashMap(); for (Iterator iterator = commandService.getDefinedCategoryIds() .iterator(); iterator.hasNext();) { Category category = commandService .getCategory((String) iterator.next()); try { if (commandIdsByCategoryId.containsKey(category.getId())) { String name = category.getName(); Collection categories = (Collection) categoriesByName .get(name); if (categories == null) { categories = new HashSet(); categoriesByName.put(name, categories); } categories.add(category); } } catch (NotDefinedException eNotDefined) { // Do nothing } } Map schemesByName = new HashMap(); final Scheme[] definedSchemes = bindingService.getDefinedSchemes(); for (int i = 0; i < definedSchemes.length; i++) { final Scheme scheme = definedSchemes[i]; try { String name = scheme.getName(); Collection schemes = (Collection) schemesByName.get(name); if (schemes == null) { schemes = new HashSet(); schemesByName.put(name, schemes); } schemes.add(scheme); } catch (final NotDefinedException e) { // Do nothing. } } contextIdsByUniqueName = new HashMap(); contextUniqueNamesById = new HashMap(); for (Iterator iterator = contextsByName.entrySet().iterator(); iterator .hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); Set contexts = (Set) entry.getValue(); Iterator iterator2 = contexts.iterator(); if (contexts.size() == 1) { Context context = (Context) iterator2.next(); contextIdsByUniqueName.put(name, context.getId()); contextUniqueNamesById.put(context.getId(), name); } else { while (iterator2.hasNext()) { Context context = (Context) iterator2.next(); String uniqueName = MessageFormat.format( Util.translateString(RESOURCE_BUNDLE, "uniqueName"), new Object[] { name, //$NON-NLS-1$ context.getId() }); contextIdsByUniqueName.put(uniqueName, context.getId()); contextUniqueNamesById.put(context.getId(), uniqueName); } } } categoryIdsByUniqueName = new HashMap(); categoryUniqueNamesById = new HashMap(); for (Iterator iterator = categoriesByName.entrySet().iterator(); iterator .hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); Set categories = (Set) entry.getValue(); Iterator iterator2 = categories.iterator(); if (categories.size() == 1) { Category category = (Category) iterator2.next(); categoryIdsByUniqueName.put(name, category.getId()); categoryUniqueNamesById.put(category.getId(), name); } else { while (iterator2.hasNext()) { Category category = (Category) iterator2.next(); String uniqueName = MessageFormat.format( Util.translateString(RESOURCE_BUNDLE, "uniqueName"), new Object[] { name, //$NON-NLS-1$ category.getId() }); categoryIdsByUniqueName.put(uniqueName, category .getId()); categoryUniqueNamesById.put(category.getId(), uniqueName); } } } schemeIdsByUniqueName = new HashMap(); schemeUniqueNamesById = new HashMap(); for (Iterator iterator = schemesByName.entrySet().iterator(); iterator .hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); Set keyConfigurations = (Set) entry.getValue(); Iterator iterator2 = keyConfigurations.iterator(); if (keyConfigurations.size() == 1) { Scheme scheme = (Scheme) iterator2.next(); schemeIdsByUniqueName.put(name, scheme.getId()); schemeUniqueNamesById.put(scheme.getId(), name); } else { while (iterator2.hasNext()) { Scheme scheme = (Scheme) iterator2.next(); String uniqueName = MessageFormat.format( Util.translateString(RESOURCE_BUNDLE, "uniqueName"), new Object[] { name, //$NON-NLS-1$ scheme.getId() }); schemeIdsByUniqueName.put(uniqueName, scheme.getId()); schemeUniqueNamesById.put(scheme.getId(), uniqueName); } } } Scheme activeScheme = bindingService.getActiveScheme(); // Make an internal copy of the binding manager, for local changes. try { for (int i = 0; i < definedSchemes.length; i++) { final Scheme scheme = definedSchemes[i]; final Scheme copy = localChangeManager.getScheme(scheme .getId()); copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId()); } localChangeManager.setActiveScheme(bindingService .getActiveScheme()); } catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ } localChangeManager.setLocale(bindingService.getLocale()); localChangeManager.setPlatform(bindingService.getPlatform()); localChangeManager.setBindings(bindingService.getBindings()); // Populate the category combo box. List categoryNames = new ArrayList(categoryIdsByUniqueName.keySet()); Collections.sort(categoryNames, Collator.getInstance()); if (commandIdsByCategoryId.containsKey(null)) { categoryNames.add(0, Util.translateString(RESOURCE_BUNDLE, "other")); //$NON-NLS-1$ } comboCategory.setItems((String[]) categoryNames .toArray(new String[categoryNames.size()])); comboCategory.clearSelection(); comboCategory.deselectAll(); if (commandIdsByCategoryId.containsKey(null) || !categoryNames.isEmpty()) { comboCategory.select(0); } // Populate the scheme combo box. List schemeNames = new ArrayList(schemeIdsByUniqueName.keySet()); Collections.sort(schemeNames, Collator.getInstance()); comboScheme.setItems((String[]) schemeNames .toArray(new String[schemeNames.size()])); setScheme(activeScheme); // Update the entire page. update(true); } super.setVisible(visible); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
private final void updateComboCommand() { // Remember the current selection, so we can restore it later. final ParameterizedCommand command = getParameterizedCommand(); // Figure out where command identifiers apply to the selected category. final String categoryId = getCategoryId(); Set commandIds = (Set) commandIdsByCategoryId.get(categoryId); if (commandIds==null) { commandIds = Collections.EMPTY_SET; } /* * Generate an array of parameterized commands based on these * identifiers. The parameterized commands will be sorted based on their * names. */ List commands = new ArrayList(); final Iterator commandIdItr = commandIds.iterator(); while (commandIdItr.hasNext()) { final String currentCommandId = (String) commandIdItr.next(); final Command currentCommand = commandService .getCommand(currentCommandId); try { commands.addAll(ParameterizedCommand .generateCombinations(currentCommand)); } catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. } } // sort the commands with a collator, so they appear in the // combo correctly commands = sortParameterizedCommands(commands); final int commandCount = commands.size(); this.commands = (ParameterizedCommand[]) commands .toArray(new ParameterizedCommand[commandCount]); /* * Generate an array of command names based on this array of * parameterized commands. */ final String[] commandNames = new String[commandCount]; for (int i = 0; i < commandCount; i++) { try { commandNames[i] = this.commands[i].getName(); } catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ } } /* * Copy the command names into the combo box, but only if they've * changed. We do this to try to avoid unnecessary calls out to the * operating system, as well as to defend against bugs in SWT's event * mechanism. */ final String[] currentItems = comboCommand.getItems(); if (!Arrays.equals(currentItems, commandNames)) { comboCommand.setItems(commandNames); } // Try to restore the selection. setParameterizedCommand(command); /* * Just to be extra careful, make sure that we have a selection at this * point. This line could probably be removed, but it makes the code a * bit more robust. */ if ((comboCommand.getSelectionIndex() == -1) && (commandCount > 0)) { comboCommand.select(0); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
private final void updateTableBindingsForTriggerSequence( final TriggerSequence triggerSequence) { // Clear the table of its existing items. tableBindingsForTriggerSequence.removeAll(); // Get the collection of bindings for the current command. final Map activeBindings = localChangeManager .getActiveBindingsDisregardingContext(); final Collection bindings = (Collection) activeBindings .get(triggerSequence); if (bindings == null) { return; } // Add each of the bindings. final Iterator bindingItr = bindings.iterator(); while (bindingItr.hasNext()) { final Binding binding = (Binding) bindingItr.next(); final Context context = contextService.getContext(binding .getContextId()); final ParameterizedCommand parameterizedCommand = binding .getParameterizedCommand(); final Command command = parameterizedCommand.getCommand(); if ((!context.isDefined()) && (!command.isDefined())) { continue; } final TableItem tableItem = new TableItem( tableBindingsForTriggerSequence, SWT.NULL); tableItem.setData(ITEM_DATA_KEY, binding); /* * Set the associated image based on the type of binding. Either it * is a user binding or a system binding. * * TODO Identify more image types. */ if (binding.getType() == Binding.SYSTEM) { tableItem.setImage(0, IMAGE_BLANK); } else { tableItem.setImage(0, IMAGE_CHANGE); } try { tableItem.setText(1, context.getName()); tableItem.setText(2, parameterizedCommand.getName()); } catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
public final int compare(final Object object1, final Object object2) { final Binding binding1 = (Binding) object1; final Binding binding2 = (Binding) object2; /* * Get the category name, command name, formatted key sequence * and context name for the first binding. */ final Command command1 = binding1.getParameterizedCommand() .getCommand(); String categoryName1 = Util.ZERO_LENGTH_STRING; String commandName1 = Util.ZERO_LENGTH_STRING; try { commandName1 = command1.getName(); categoryName1 = command1.getCategory().getName(); } catch (final NotDefinedException e) { // Just use the zero-length string. } final String triggerSequence1 = binding1.getTriggerSequence() .format(); final String contextId1 = binding1.getContextId(); String contextName1 = Util.ZERO_LENGTH_STRING; if (contextId1 != null) { final Context context = contextService .getContext(contextId1); try { contextName1 = context.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. } } /* * Get the category name, command name, formatted key sequence * and context name for the first binding. */ final Command command2 = binding2.getParameterizedCommand() .getCommand(); String categoryName2 = Util.ZERO_LENGTH_STRING; String commandName2 = Util.ZERO_LENGTH_STRING; try { commandName2 = command2.getName(); categoryName2 = command2.getCategory().getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. } final String keySequence2 = binding2.getTriggerSequence() .format(); final String contextId2 = binding2.getContextId(); String contextName2 = Util.ZERO_LENGTH_STRING; if (contextId2 != null) { final Context context = contextService .getContext(contextId2); try { contextName2 = context.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. } } // Compare the items in the current sort order. int compare = 0; for (int i = 0; i < sortOrder.length; i++) { switch (sortOrder[i]) { case VIEW_CATEGORY_COLUMN_INDEX: compare = Util.compare(categoryName1, categoryName2); if (compare != 0) { return compare; } break; case VIEW_COMMAND_COLUMN_INDEX: compare = Util.compare(commandName1, commandName2); if (compare != 0) { return compare; } break; case VIEW_KEY_SEQUENCE_COLUMN_INDEX: compare = Util.compare(triggerSequence1, keySequence2); if (compare != 0) { return compare; } break; case VIEW_CONTEXT_COLUMN_INDEX: compare = Util.compare(contextName1, contextName2); if (compare != 0) { return compare; } break; default: throw new Error( "Programmer error: added another sort column without modifying the comparator."); //$NON-NLS-1$ } } return compare; }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
private static final void readActiveScheme( final IConfigurationElement[] configurationElements, final int configurationElementCount, final IMemento preferences, final BindingManager bindingManager) { // A non-default preference. final IPreferenceStore store = PlatformUI.getPreferenceStore(); final String defaultActiveSchemeId = store .getDefaultString(IWorkbenchPreferenceConstants.KEY_CONFIGURATION_ID); final String preferenceActiveSchemeId = store .getString(IWorkbenchPreferenceConstants.KEY_CONFIGURATION_ID); if ((preferenceActiveSchemeId != null) && (!preferenceActiveSchemeId.equals(defaultActiveSchemeId))) { try { bindingManager.setActiveScheme(bindingManager .getScheme(preferenceActiveSchemeId)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } // A legacy preference XML memento. if (preferences != null) { final IMemento[] preferenceMementos = preferences .getChildren(TAG_ACTIVE_KEY_CONFIGURATION); int preferenceMementoCount = preferenceMementos.length; for (int i = preferenceMementoCount - 1; i >= 0; i--) { final IMemento memento = preferenceMementos[i]; String id = memento.getString(ATT_KEY_CONFIGURATION_ID); if (id != null) { try { bindingManager.setActiveScheme(bindingManager .getScheme(id)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } } } // A default preference value that is different than the default. if ((defaultActiveSchemeId != null && defaultActiveSchemeId.length() > 0) && (!defaultActiveSchemeId .equals(IBindingService.DEFAULT_DEFAULT_ACTIVE_SCHEME_ID))) { try { bindingManager.setActiveScheme(bindingManager .getScheme(defaultActiveSchemeId)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } // The registry. for (int i = configurationElementCount - 1; i >= 0; i--) { final IConfigurationElement configurationElement = configurationElements[i]; String id = configurationElement .getAttribute(ATT_KEY_CONFIGURATION_ID); if (id != null) { try { bindingManager .setActiveScheme(bindingManager.getScheme(id)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } id = configurationElement.getAttribute(ATT_VALUE); if (id != null) { try { bindingManager .setActiveScheme(bindingManager.getScheme(id)); return; } catch (final NotDefinedException e) { // Let's keep looking.... } } } // The default default active scheme id. try { bindingManager .setActiveScheme(bindingManager .getScheme(IBindingService.DEFAULT_DEFAULT_ACTIVE_SCHEME_ID)); } catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createWriteRoot(String type) throws DOMException { Document document; try { document = DocumentBuilderFactory.newInstance() .newDocumentBuilder().newDocument(); Element element = document.createElement(type); document.appendChild(element); return new XMLMemento(document, element); } catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); } }
10
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }
0 0 0 0
checked (Lib) Exception 0 0 41
            
// in Eclipse UI/org/eclipse/ui/internal/splash/SplashHandlerFactory.java
private static AbstractSplashHandler create( final IConfigurationElement splashElement) { final AbstractSplashHandler[] handler = new AbstractSplashHandler[1]; SafeRunner.run(new SafeRunnable() { /* * (non-Javadoc) * * @see org.eclipse.core.runtime.ISafeRunnable#run() */ public void run() throws Exception { handler[0] = (AbstractSplashHandler) WorkbenchPlugin .createExtension(splashElement, IWorkbenchRegistryConstants.ATT_CLASS); } /* * (non-Javadoc) * * @see org.eclipse.jface.util.SafeRunnable#handleException(java.lang.Throwable) */ public void handleException(Throwable e) { WorkbenchPlugin .log("Problem creating splash implementation", e); //$NON-NLS-1$ } }); return handler[0]; }
// in Eclipse UI/org/eclipse/ui/internal/splash/SplashHandlerFactory.java
public void run() throws Exception { handler[0] = (AbstractSplashHandler) WorkbenchPlugin .createExtension(splashElement, IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public void start(BundleContext context) throws Exception { context.addBundleListener(getBundleListener()); super.start(context); bundleContext = context; JFaceUtil.initializeJFace(); Window.setDefaultOrientation(getDefaultOrientation()); // The UI plugin needs to be initialized so that it can install the callback in PrefUtil, // which needs to be done as early as possible, before the workbench // accesses any API preferences. Bundle uiBundle = Platform.getBundle(PlatformUI.PLUGIN_ID); try { // Attempt to load the activator of the ui bundle. This will force lazy start // of the ui bundle. Using the bundle activator class here because it is a // class that needs to be loaded anyway so it should not cause extra classes // to be loaded.s if(uiBundle != null) uiBundle.start(Bundle.START_TRANSIENT); } catch (BundleException e) { WorkbenchPlugin.log("Unable to load UI activator", e); //$NON-NLS-1$ } /* * DO NOT RUN ANY OTHER CODE AFTER THIS LINE. If you do, then you are * likely to cause a deadlock in class loader code. Please see Bug 86450 * for more information. */ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public void stop(BundleContext context) throws Exception { if (bundleListener!=null) { context.removeBundleListener(bundleListener); bundleListener = null; } // TODO normally super.stop(*) would be the last statement in this // method super.stop(context); }
// in Eclipse UI/org/eclipse/ui/internal/menus/PulldownDelegateWidgetProxy.java
public void run() throws Exception { if (parent == null) { menu = delegate.getMenu(control); } else { menu = ((IWorkbenchWindowPulldownDelegate2) delegate) .getMenu(parent); } }
// in Eclipse UI/org/eclipse/ui/internal/menus/ProxyMenuAdditionCacheEntry.java
private AbstractContributionFactory createFactory() { final AbstractContributionFactory[] factory = new AbstractContributionFactory[1]; SafeRunner.run(new SafeRunnable() { public void run() throws Exception { factory[0] = (AbstractContributionFactory) WorkbenchPlugin .createExtension(getConfigElement(), IWorkbenchRegistryConstants.ATT_CLASS); } }); createFactory = false; return factory[0]; }
// in Eclipse UI/org/eclipse/ui/internal/menus/ProxyMenuAdditionCacheEntry.java
public void run() throws Exception { factory[0] = (AbstractContributionFactory) WorkbenchPlugin .createExtension(getConfigElement(), IWorkbenchRegistryConstants.ATT_CLASS); }
// in Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
private boolean processAdditions(final IServiceLocator serviceLocatorToUse, Set restriction, final ContributionManager mgr, final AbstractContributionFactory cache, final Set itemsAdded) { if (!processFactory(mgr, cache)) return true; final int idx = getInsertionIndex(mgr, cache.getLocation()); if (idx == -1) return false; // can't process (yet) // Get the additions final ContributionRoot ciList = new ContributionRoot(this, restriction, mgr, cache); ISafeRunnable run = new ISafeRunnable() { public void handleException(Throwable exception) { // TODO Auto-generated method stub } public void run() throws Exception { int insertionIndex = idx; cache.createContributionItems(serviceLocatorToUse, ciList); // If we have any then add them at the correct location if (ciList.getItems().size() > 0) { // Cache the items for future cleanup ManagerPopulationRecord mpr = (ManagerPopulationRecord) populatedManagers.get(mgr); ContributionRoot contributions = mpr.getContributions(cache); if (contributions != null) { // Existing contributions in the mgr will be released. // Adjust the insertionIndex for (Iterator i = contributions.getItems().iterator(); i.hasNext();) { IContributionItem item = (IContributionItem) i.next(); if (item.equals(mgr.find(item.getId()))) insertionIndex--; } } mpr.addFactoryContribution(cache, ciList); for (Iterator ciIter = ciList.getItems().iterator(); ciIter .hasNext();) { IContributionItem ici = (IContributionItem) ciIter .next(); if ((ici instanceof ContributionManager || ici instanceof IToolBarContributionItem || ici instanceof AbstractGroupMarker) && ici.getId() != null && !"".equals(ici.getId())) { //$NON-NLS-1$ IContributionItem foundIci = mgr.find(ici.getId()); // really, this is a very specific scenario that // allows merging // but, if it is a contribution manager that also // contains // items, then we would be throwing stuff away. if (foundIci instanceof ContributionManager) { if (((ContributionManager) ici).getSize() > 0) { IStatus status = new Status( IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Menu contribution id collision: " //$NON-NLS-1$ + ici.getId()); StatusManager.getManager().handle(status); } continue; } else if (foundIci instanceof IToolBarContributionItem) { IToolBarManager toolBarManager = ((IToolBarContributionItem) ici) .getToolBarManager(); if (toolBarManager instanceof ContributionManager && ((ContributionManager) toolBarManager) .getSize() > 0) { IStatus status = new Status( IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Toolbar contribution id collision: " //$NON-NLS-1$ + ici.getId()); StatusManager.getManager().handle(status); } continue; } else if (foundIci instanceof AbstractGroupMarker) { continue; } } final int oldSize = mgr.getSize(); mgr.insert(insertionIndex, ici); if (ici.getId() != null) { itemsAdded.add(ici.getId()); } if (mgr.getSize() > oldSize) insertionIndex++; } } } }; SafeRunner.run(run); return true; }
// in Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
public void run() throws Exception { int insertionIndex = idx; cache.createContributionItems(serviceLocatorToUse, ciList); // If we have any then add them at the correct location if (ciList.getItems().size() > 0) { // Cache the items for future cleanup ManagerPopulationRecord mpr = (ManagerPopulationRecord) populatedManagers.get(mgr); ContributionRoot contributions = mpr.getContributions(cache); if (contributions != null) { // Existing contributions in the mgr will be released. // Adjust the insertionIndex for (Iterator i = contributions.getItems().iterator(); i.hasNext();) { IContributionItem item = (IContributionItem) i.next(); if (item.equals(mgr.find(item.getId()))) insertionIndex--; } } mpr.addFactoryContribution(cache, ciList); for (Iterator ciIter = ciList.getItems().iterator(); ciIter .hasNext();) { IContributionItem ici = (IContributionItem) ciIter .next(); if ((ici instanceof ContributionManager || ici instanceof IToolBarContributionItem || ici instanceof AbstractGroupMarker) && ici.getId() != null && !"".equals(ici.getId())) { //$NON-NLS-1$ IContributionItem foundIci = mgr.find(ici.getId()); // really, this is a very specific scenario that // allows merging // but, if it is a contribution manager that also // contains // items, then we would be throwing stuff away. if (foundIci instanceof ContributionManager) { if (((ContributionManager) ici).getSize() > 0) { IStatus status = new Status( IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Menu contribution id collision: " //$NON-NLS-1$ + ici.getId()); StatusManager.getManager().handle(status); } continue; } else if (foundIci instanceof IToolBarContributionItem) { IToolBarManager toolBarManager = ((IToolBarContributionItem) ici) .getToolBarManager(); if (toolBarManager instanceof ContributionManager && ((ContributionManager) toolBarManager) .getSize() > 0) { IStatus status = new Status( IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Toolbar contribution id collision: " //$NON-NLS-1$ + ici.getId()); StatusManager.getManager().handle(status); } continue; } else if (foundIci instanceof AbstractGroupMarker) { continue; } } final int oldSize = mgr.getSize(); mgr.insert(insertionIndex, ici); if (ici.getId() != null) { itemsAdded.add(ici.getId()); } if (mgr.getSize() > oldSize) insertionIndex++; } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
void restoreWorkingSet() { IMemento[] itemMementos = workingSetMemento .getChildren(IWorkbenchConstants.TAG_ITEM); final Set items = new HashSet(); for (int i = 0; i < itemMementos.length; i++) { final IMemento itemMemento = itemMementos[i]; final String factoryID = itemMemento .getString(IWorkbenchConstants.TAG_FACTORY_ID); if (factoryID == null) { WorkbenchPlugin .log("Unable to restore working set item - no factory ID."); //$NON-NLS-1$ continue; } final IElementFactory factory = PlatformUI.getWorkbench() .getElementFactory(factoryID); if (factory == null) { WorkbenchPlugin .log("Unable to restore working set item - cannot instantiate factory: " + factoryID); //$NON-NLS-1$ continue; } SafeRunner .run(new SafeRunnable( "Unable to restore working set item - exception while invoking factory: " + factoryID) { //$NON-NLS-1$ public void run() throws Exception { IAdaptable item = factory .createElement(itemMemento); if (item == null) { if (Policy.DEBUG_WORKING_SETS) WorkbenchPlugin .log("Unable to restore working set item - cannot instantiate item: " + factoryID); //$NON-NLS-1$ } else items.add(item); } }); } internalSetElements((IAdaptable[]) items.toArray(new IAdaptable[items .size()])); }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
public void run() throws Exception { IAdaptable item = factory .createElement(itemMemento); if (item == null) { if (Policy.DEBUG_WORKING_SETS) WorkbenchPlugin .log("Unable to restore working set item - cannot instantiate item: " + factoryID); //$NON-NLS-1$ } else items.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
public void saveState(IMemento memento) { if (workingSetMemento != null) { // just re-save the previous memento if the working set has // not been restored memento.putMemento(workingSetMemento); } else { memento.putString(IWorkbenchConstants.TAG_NAME, getName()); memento.putString(IWorkbenchConstants.TAG_LABEL, getLabel()); memento.putString(IWorkbenchConstants.TAG_ID, getUniqueId()); memento.putString(IWorkbenchConstants.TAG_EDIT_PAGE_ID, editPageId); Iterator iterator = elements.iterator(); while (iterator.hasNext()) { IAdaptable adaptable = (IAdaptable) iterator.next(); final IPersistableElement persistable = (IPersistableElement) Util .getAdapter(adaptable, IPersistableElement.class); if (persistable != null) { final IMemento itemMemento = memento .createChild(IWorkbenchConstants.TAG_ITEM); itemMemento.putString(IWorkbenchConstants.TAG_FACTORY_ID, persistable.getFactoryId()); SafeRunner .run(new SafeRunnable( "Problems occurred while saving persistable item state") { //$NON-NLS-1$ public void run() throws Exception { persistable.saveState(itemMemento); } }); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSet.java
public void run() throws Exception { persistable.saveState(itemMemento); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectPluginAction.java
protected void initDelegate() { super.initDelegate(); final IActionDelegate actionDelegate = getDelegate(); if (actionDelegate instanceof IObjectActionDelegate && activePart != null) { final IObjectActionDelegate objectActionDelegate = (IObjectActionDelegate) actionDelegate; final ISafeRunnable runnable = new ISafeRunnable() { public void run() throws Exception { objectActionDelegate.setActivePart(ObjectPluginAction.this, activePart); } public void handleException(Throwable exception) { // Do nothing. } }; Platform.run(runnable); } }
// in Eclipse UI/org/eclipse/ui/internal/ObjectPluginAction.java
public void run() throws Exception { objectActionDelegate.setActivePart(ObjectPluginAction.this, activePart); }
// in Eclipse UI/org/eclipse/ui/internal/ObjectPluginAction.java
public void setActivePart(IWorkbenchPart targetPart) { if (activePart != targetPart) { if (activePart != null) { activePart.getSite().getPage().removePartListener(this); } if (targetPart != null) { targetPart.getSite().getPage().addPartListener(this); } } activePart = targetPart; IActionDelegate delegate = getDelegate(); if (delegate instanceof IObjectActionDelegate && activePart != null) { final IObjectActionDelegate objectActionDelegate = (IObjectActionDelegate) delegate; final ISafeRunnable runnable = new ISafeRunnable() { public void run() throws Exception { objectActionDelegate.setActivePart(ObjectPluginAction.this, activePart); } public void handleException(Throwable exception) { // Do nothing. } }; Platform.run(runnable); } }
// in Eclipse UI/org/eclipse/ui/internal/ObjectPluginAction.java
public void run() throws Exception { objectActionDelegate.setActivePart(ObjectPluginAction.this, activePart); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final void refreshElements(String commandId, Map filter) { Command cmd = getCommand(commandId); if (!cmd.isDefined() || !(cmd.getHandler() instanceof IElementUpdater)) { return; } final IElementUpdater updater = (IElementUpdater) cmd.getHandler(); if (commandCallbacks == null) { return; } List callbackRefs = (List) commandCallbacks.get(commandId); if (callbackRefs == null) { return; } for (Iterator i = callbackRefs.iterator(); i.hasNext();) { final IElementReference callbackRef = (IElementReference) i.next(); final Map parms = Collections.unmodifiableMap(callbackRef .getParameters()); ISafeRunnable run = new ISafeRunnable() { public void handleException(Throwable exception) { WorkbenchPlugin.log("Failed to update callback: " //$NON-NLS-1$ + callbackRef.getCommandId(), exception); } public void run() throws Exception { updater.updateElement(callbackRef.getElement(), parms); } }; if (filter == null) { SafeRunner.run(run); } else { boolean match = true; for (Iterator j = filter.entrySet().iterator(); j.hasNext() && match;) { Map.Entry parmEntry = (Map.Entry) j.next(); Object value = parms.get(parmEntry.getKey()); if (!parmEntry.getValue().equals(value)) { match = false; } } if (match) { SafeRunner.run(run); } } } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public void run() throws Exception { updater.updateElement(callbackRef.getElement(), parms); }
// in Eclipse UI/org/eclipse/ui/internal/services/EvaluationAuthority.java
private void fireServiceChange(final String property, final Object oldValue, final Object newValue) { Object[] listeners = serviceListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i]; SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable exception) { WorkbenchPlugin.log(exception); } public void run() throws Exception { listener.propertyChange(new PropertyChangeEvent( EvaluationAuthority.this, property, oldValue, newValue)); } }); } }
// in Eclipse UI/org/eclipse/ui/internal/services/EvaluationAuthority.java
public void run() throws Exception { listener.propertyChange(new PropertyChangeEvent( EvaluationAuthority.this, property, oldValue, newValue)); }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
public void run() throws Exception { IConfigurationElement[] configElements = extension .getConfigurationElements(); // look for the startup tag in each element and run the extension boolean foundAtLeastOne = false; for (int i = 0; i < configElements.length; ++i) { IConfigurationElement element = configElements[i]; if (element != null && element.getName() .equals(IWorkbenchConstants.TAG_STARTUP)) { runEarlyStartup(getExecutableExtension(element)); foundAtLeastOne = true; } } // if no startup tags were found, then try the plugin object if (!foundAtLeastOne) { runEarlyStartup(getPluginForCompatibility()); } }
// in Eclipse UI/org/eclipse/ui/internal/PartTester.java
public static void testEditor(IEditorPart part) throws Exception { testWorkbenchPart(part); Assert.isTrue(part.getEditorSite() == part.getSite(), "The part's editor site must be the same as the part's site"); //$NON-NLS-1$ IEditorInput input = part.getEditorInput(); Assert.isNotNull(input, "The editor input must be non-null"); //$NON-NLS-1$ testEditorInput(input); part.isDirty(); part.isSaveAsAllowed(); part.isSaveOnCloseNeeded(); }
// in Eclipse UI/org/eclipse/ui/internal/PartTester.java
public static void testEditorInput(IEditorInput input) throws Exception { input.getAdapter(Object.class); // Don't test input.getImageDescriptor() -- the workbench never uses that // method and most editor inputs would fail the test. It should really be // deprecated. Assert.isNotNull(input.getName(), "The editor input must have a non-null name"); //$NON-NLS-1$ Assert.isNotNull(input.getToolTipText(), "The editor input must have a non-null tool tip"); //$NON-NLS-1$ // Persistable element may be null IPersistableElement persistableElement = input.getPersistable(); if (persistableElement != null) { Assert .isNotNull(persistableElement.getFactoryId(), "The persistable element for the editor input must have a non-null factory id"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/PartTester.java
private static void testWorkbenchPart(IWorkbenchPart part) throws Exception { IPropertyListener testListener = new IPropertyListener() { public void propertyChanged(Object source, int propId) { } }; // Test addPropertyListener part.addPropertyListener(testListener); // Test removePropertyListener part.removePropertyListener(testListener); // Test equals Assert.isTrue(part.equals(part), "A part must be equal to itself"); //$NON-NLS-1$ Assert.isTrue(!part.equals(new Integer(32)), "A part must have a meaningful equals method"); //$NON-NLS-1$ // Test getAdapter Object partAdapter = part.getAdapter(part.getClass()); Assert.isTrue(partAdapter == null || partAdapter == part, "A part must adapter to itself or return null"); //$NON-NLS-1$ // Test getTitle Assert.isNotNull(part.getTitle(), "A part's title must be non-null"); //$NON-NLS-1$ // Test getTitleImage Assert.isNotNull(part.getTitleImage(), "A part's title image must be non-null"); //$NON-NLS-1$ // Test getTitleToolTip Assert.isNotNull(part.getTitleToolTip(), "A part's title tool tip must be non-null"); //$NON-NLS-1$ // Test toString Assert.isNotNull(part.toString(), "A part's toString method must return a non-null value"); //$NON-NLS-1$ // Compute hashCode part.hashCode(); if (part instanceof IWorkbenchPart2) { testWorkbenchPart2((IWorkbenchPart2)part); } }
// in Eclipse UI/org/eclipse/ui/internal/PartTester.java
private static void testWorkbenchPart2(IWorkbenchPart2 part) throws Exception { Assert.isNotNull(part.getContentDescription(), "A part must return a non-null content description"); //$NON-NLS-1$ Assert.isNotNull(part.getPartName(), "A part must return a non-null part name"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PartTester.java
public static void testView(IViewPart part) throws Exception { Assert.isTrue(part.getSite() == part.getViewSite(), "A part's site must be the same as a part's view site"); //$NON-NLS-1$ testWorkbenchPart(part); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void dispose() { bundleContext.removeBundleListener(this); for (final Iterator iter= updaters.values().iterator(); iter.hasNext();) { SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { ((IWorkingSetUpdater) iter.next()).dispose(); } }); } for (final Iterator iter= elementAdapters.values().iterator(); iter.hasNext();) { SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { ((IWorkingSetElementAdapter)iter.next()).dispose(); } }); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { ((IWorkingSetUpdater) iter.next()).dispose(); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { ((IWorkingSetElementAdapter)iter.next()).dispose(); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
protected void firePropertyChange(String changeId, Object oldValue, Object newValue) { final Object[] listeners = getListeners(); if (listeners.length == 0) { return; } final PropertyChangeEvent event = new PropertyChangeEvent(this, changeId, oldValue, newValue); Runnable notifier = new Runnable() { public void run() { for (int i = 0; i < listeners.length; i++) { final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i]; ISafeRunnable safetyWrapper = new ISafeRunnable() { public void run() throws Exception { listener.propertyChange(event); } public void handleException(Throwable exception) { // logged by the runner } }; SafeRunner.run(safetyWrapper); } } }; // Notifications are sent on the UI thread. if (Display.getCurrent() != null) { notifier.run(); } else { // Use an asyncExec to avoid deadlocks. Display.getDefault().asyncExec(notifier); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() { for (int i = 0; i < listeners.length; i++) { final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i]; ISafeRunnable safetyWrapper = new ISafeRunnable() { public void run() throws Exception { listener.propertyChange(event); } public void handleException(Throwable exception) { // logged by the runner } }; SafeRunner.run(safetyWrapper); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { listener.propertyChange(event); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
private void saveWorkingSetState(final IMemento memento, List list) { for (Iterator i = list.iterator(); i.hasNext();) { final IPersistableElement persistable = (IWorkingSet) i.next(); SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { // create a dummy node to write too - the write could fail so we // shouldn't soil the final memento until we're sure it succeeds. XMLMemento dummy = XMLMemento.createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET); dummy.putString(IWorkbenchConstants.TAG_FACTORY_ID, persistable.getFactoryId()); persistable.saveState(dummy); // if the dummy was created successfully copy it to the real output IMemento workingSetMemento = memento .createChild(IWorkbenchConstants.TAG_WORKING_SET); workingSetMemento.putMemento(dummy); } }); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { // create a dummy node to write too - the write could fail so we // shouldn't soil the final memento until we're sure it succeeds. XMLMemento dummy = XMLMemento.createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET); dummy.putString(IWorkbenchConstants.TAG_FACTORY_ID, persistable.getFactoryId()); persistable.saveState(dummy); // if the dummy was created successfully copy it to the real output IMemento workingSetMemento = memento .createChild(IWorkbenchConstants.TAG_WORKING_SET); workingSetMemento.putMemento(dummy); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
protected IWorkingSet restoreWorkingSet(final IMemento memento) { String factoryID = memento .getString(IWorkbenchConstants.TAG_FACTORY_ID); if (factoryID == null) { // if the factory id was not set in the memento // then assume that the memento was created using // IMemento.saveState, and should be restored using WorkingSetFactory factoryID = AbstractWorkingSet.FACTORY_ID; } final IElementFactory factory = PlatformUI.getWorkbench().getElementFactory( factoryID); if (factory == null) { WorkbenchPlugin .log("Unable to restore working set - cannot instantiate factory: " + factoryID); //$NON-NLS-1$ return null; } final IAdaptable[] adaptable = new IAdaptable[1]; SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { adaptable[0] = factory.createElement(memento); } }); if (adaptable[0] == null) { WorkbenchPlugin .log("Unable to restore working set - cannot instantiate working set: " + factoryID); //$NON-NLS-1$ return null; } if ((adaptable[0] instanceof IWorkingSet) == false) { WorkbenchPlugin .log("Unable to restore working set - element is not an IWorkingSet: " + factoryID); //$NON-NLS-1$ return null; } return (IWorkingSet) adaptable[0]; }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { adaptable[0] = factory.createElement(memento); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void bundleChanged(BundleEvent event) { String symbolicName = event.getBundle().getSymbolicName(); if (symbolicName == null) return; // If the workbench isn't running anymore simply return. if (!PlatformUI.isWorkbenchRunning()) { return; } if (event.getBundle().getState() == Bundle.ACTIVE) { final WorkingSetDescriptor[] descriptors = WorkbenchPlugin.getDefault() .getWorkingSetRegistry().getUpdaterDescriptorsForNamespace( symbolicName); Job job = new WorkbenchJob( NLS .bind( WorkbenchMessages.AbstractWorkingSetManager_updatersActivating, symbolicName)) { public IStatus runInUIThread(IProgressMonitor monitor) { synchronized (updaters) { for (int i = 0; i < descriptors.length; i++) { WorkingSetDescriptor descriptor = descriptors[i]; List workingSets = getWorkingSetsForId(descriptor .getId()); if (workingSets.size() == 0) { continue; } final IWorkingSetUpdater updater = getUpdater(descriptor); for (Iterator iter = workingSets.iterator(); iter .hasNext();) { final IWorkingSet workingSet = (IWorkingSet) iter .next(); SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { if (!updater.contains(workingSet)) { updater.add(workingSet); } } }); } } } return Status.OK_STATUS; } }; job.setSystem(true); job.schedule(); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public IStatus runInUIThread(IProgressMonitor monitor) { synchronized (updaters) { for (int i = 0; i < descriptors.length; i++) { WorkingSetDescriptor descriptor = descriptors[i]; List workingSets = getWorkingSetsForId(descriptor .getId()); if (workingSets.size() == 0) { continue; } final IWorkingSetUpdater updater = getUpdater(descriptor); for (Iterator iter = workingSets.iterator(); iter .hasNext();) { final IWorkingSet workingSet = (IWorkingSet) iter .next(); SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { if (!updater.contains(workingSet)) { updater.add(workingSet); } } }); } } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { if (!updater.contains(workingSet)) { updater.add(workingSet); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
private void addToUpdater(final IWorkingSet workingSet) { WorkingSetDescriptor descriptor= WorkbenchPlugin.getDefault() .getWorkingSetRegistry().getWorkingSetDescriptor(workingSet.getId()); if (descriptor == null || !descriptor.isUpdaterClassLoaded()) { return; } synchronized(updaters) { final IWorkingSetUpdater updater= getUpdater(descriptor); SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { if (!updater.contains(workingSet)) { updater.add(workingSet); } }}); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { if (!updater.contains(workingSet)) { updater.add(workingSet); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
private void removeFromUpdater(final IWorkingSet workingSet) { synchronized (updaters) { final IWorkingSetUpdater updater = (IWorkingSetUpdater) updaters .get(workingSet.getId()); if (updater != null) { SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { updater.remove(workingSet); }}); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { updater.remove(workingSet); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
private void removeElementAdapter( final IWorkingSetElementAdapter elementAdapter) { SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { elementAdapter.dispose(); } }); synchronized (elementAdapters) { elementAdapters.values().remove(elementAdapter); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { elementAdapter.dispose(); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
private void removeUpdater(final IWorkingSetUpdater updater) { SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { updater.dispose(); } }); synchronized (updaters) { updaters.values().remove(updater); } firePropertyChange(IWorkingSetManager.CHANGE_WORKING_SET_UPDATER_UNINSTALLED, updater, null); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { updater.dispose(); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void addToWorkingSets(final IAdaptable element, IWorkingSet[] workingSets) { // ideally this method would be in a static util class of some kind but // we dont have any such beast for working sets and making one for one // method is overkill. for (int i = 0; i < workingSets.length; i++) { final IWorkingSet workingSet = workingSets[i]; SafeRunner.run(new WorkingSetRunnable() { public void run() throws Exception { IAdaptable[] adaptedNewElements = workingSet .adaptElements(new IAdaptable[] { element }); if (adaptedNewElements.length == 1) { IAdaptable[] elements = workingSet.getElements(); IAdaptable[] newElements = new IAdaptable[elements.length + 1]; System.arraycopy(elements, 0, newElements, 0, elements.length); newElements[newElements.length - 1] = adaptedNewElements[0]; workingSet.setElements(newElements); } }}); } }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void run() throws Exception { IAdaptable[] adaptedNewElements = workingSet .adaptElements(new IAdaptable[] { element }); if (adaptedNewElements.length == 1) { IAdaptable[] elements = workingSet.getElements(); IAdaptable[] newElements = new IAdaptable[elements.length + 1]; System.arraycopy(elements, 0, newElements, 0, elements.length); newElements[newElements.length - 1] = adaptedNewElements[0]; workingSet.setElements(newElements); } }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
public boolean contributeObjectActions(final IWorkbenchPart part, IMenuManager menu, ISelectionProvider selProv, List actionIdOverrides) { if (!configRead) { readConfigElement(); } // Easy case out if no actions if (currentContribution.actions == null) { return false; } // Get a structured selection. ISelection sel = selProv.getSelection(); if ((sel == null) || !(sel instanceof IStructuredSelection)) { return false; } IStructuredSelection ssel = (IStructuredSelection) sel; if(canAdapt()) { IStructuredSelection newSelection = LegacyResourceSupport.adaptSelection(ssel, getObjectClass()); if(newSelection.size() != ssel.size()) { if (Policy.DEBUG_CONTRIBUTIONS) { WorkbenchPlugin.log("Error adapting selection to " + getObjectClass() + //$NON-NLS-1$ ". Contribution " + getID(config) + " is being ignored"); //$NON-NLS-1$ //$NON-NLS-2$ } return false; } ssel = newSelection; } final IStructuredSelection selection = ssel; // Generate menu. for (int i = 0; i < currentContribution.actions.size(); i++) { ActionDescriptor ad = (ActionDescriptor) currentContribution.actions .get(i); if (!actionIdOverrides.contains(ad.getId())) { currentContribution.contributeMenuAction(ad, menu, true); // Update action for the current selection and part. if (ad.getAction() instanceof ObjectPluginAction) { final ObjectPluginAction action = (ObjectPluginAction) ad .getAction(); ISafeRunnable runnable = new ISafeRunnable() { public void handleException(Throwable exception) { WorkbenchPlugin.log("Failed to update action " //$NON-NLS-1$ + action.getId(), exception); } public void run() throws Exception { action.setActivePart(part); action.selectionChanged(selection); } }; SafeRunner.run(runnable); } } } return true; }
// in Eclipse UI/org/eclipse/ui/internal/ObjectActionContributor.java
public void run() throws Exception { action.setActivePart(part); action.selectionChanged(selection); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private void createSplashWrapper() { final Display display = getDisplay(); String splashLoc = System.getProperty("org.eclipse.equinox.launcher.splash.location"); //$NON-NLS-1$ final Image background = loadImage(splashLoc); SafeRunnable run = new SafeRunnable() { public void run() throws Exception { if (! WorkbenchPlugin.isSplashHandleSpecified()) { createSplash = false; return; } // create the splash getSplash(); if (splash == null) { createSplash = false; return; } Shell splashShell = splash.getSplash(); if (splashShell == null) { splashShell = WorkbenchPlugin.getSplashShell(display); if (splashShell == null) return; if (background != null) splashShell.setBackgroundImage(background); } Dictionary properties = new Hashtable(); properties.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); BundleContext context = WorkbenchPlugin.getDefault().getBundleContext(); final ServiceRegistration registration[] = new ServiceRegistration[1]; StartupMonitor startupMonitor = new StartupMonitor() { public void applicationRunning() { splash.dispose(); if (background != null) background.dispose(); registration[0].unregister(); // unregister ourself WorkbenchPlugin.unsetSplashShell(display); } public void update() { // do nothing - we come into the picture far too late // for this to be relevant } }; registration[0] = context.registerService(StartupMonitor.class .getName(), startupMonitor, properties); splash.init(splashShell); } /* (non-Javadoc) * @see org.eclipse.jface.util.SafeRunnable#handleException(java.lang.Throwable) */ public void handleException(Throwable e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, "Could not instantiate splash", e)); //$NON-NLS-1$ createSplash = false; splash = null; if (background != null) background.dispose(); } }; SafeRunner.run(run); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void run() throws Exception { if (! WorkbenchPlugin.isSplashHandleSpecified()) { createSplash = false; return; } // create the splash getSplash(); if (splash == null) { createSplash = false; return; } Shell splashShell = splash.getSplash(); if (splashShell == null) { splashShell = WorkbenchPlugin.getSplashShell(display); if (splashShell == null) return; if (background != null) splashShell.setBackgroundImage(background); } Dictionary properties = new Hashtable(); properties.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); BundleContext context = WorkbenchPlugin.getDefault().getBundleContext(); final ServiceRegistration registration[] = new ServiceRegistration[1]; StartupMonitor startupMonitor = new StartupMonitor() { public void applicationRunning() { splash.dispose(); if (background != null) background.dispose(); registration[0].unregister(); // unregister ourself WorkbenchPlugin.unsetSplashShell(display); } public void update() { // do nothing - we come into the picture far too late // for this to be relevant } }; registration[0] = context.registerService(StartupMonitor.class .getName(), startupMonitor, properties); splash.init(splashShell); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
IStatus restoreState() { if (!getWorkbenchConfigurer().getSaveAndRestore()) { String msg = WorkbenchMessages.Workbench_restoreDisabled; return new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } // Read the workbench state file. final File stateFile = getWorkbenchStateFile(); // If there is no state file cause one to open. if (stateFile == null || !stateFile.exists()) { String msg = WorkbenchMessages.Workbench_noStateToRestore; return new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } final IStatus result[] = { Status.OK_STATUS }; SafeRunner.run(new SafeRunnable(WorkbenchMessages.ErrorReadingState) { public void run() throws Exception { FileInputStream input = new FileInputStream(stateFile); BufferedReader reader = new BufferedReader( new InputStreamReader(input, "utf-8")); //$NON-NLS-1$ IMemento memento = XMLMemento.createReadRoot(reader); // Validate known version format String version = memento .getString(IWorkbenchConstants.TAG_VERSION); boolean valid = false; for (int i = 0; i < VERSION_STRING.length; i++) { if (VERSION_STRING[i].equals(version)) { valid = true; break; } } if (!valid) { reader.close(); String msg = WorkbenchMessages.Invalid_workbench_state_ve; MessageDialog.openError((Shell) null, WorkbenchMessages.Restoring_Problems, msg); stateFile.delete(); result[0] = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); return; } // Validate compatible version format // We no longer support the release 1.0 format if (VERSION_STRING[0].equals(version)) { reader.close(); String msg = WorkbenchMessages.Workbench_incompatibleSavedStateVersion; boolean ignoreSavedState = new MessageDialog(null, WorkbenchMessages.Workbench_incompatibleUIState, null, msg, MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0).open() == 0; // OK is the default if (ignoreSavedState) { stateFile.delete(); result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } else { result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_EXIT, msg, null); } return; } // Restore the saved state final IStatus restoreResult = restoreState(memento); reader.close(); if (restoreResult.getSeverity() == IStatus.ERROR) { StartupThreading .runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { StatusManager.getManager().handle(restoreResult, StatusManager.LOG); } }); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void run() throws Exception { FileInputStream input = new FileInputStream(stateFile); BufferedReader reader = new BufferedReader( new InputStreamReader(input, "utf-8")); //$NON-NLS-1$ IMemento memento = XMLMemento.createReadRoot(reader); // Validate known version format String version = memento .getString(IWorkbenchConstants.TAG_VERSION); boolean valid = false; for (int i = 0; i < VERSION_STRING.length; i++) { if (VERSION_STRING[i].equals(version)) { valid = true; break; } } if (!valid) { reader.close(); String msg = WorkbenchMessages.Invalid_workbench_state_ve; MessageDialog.openError((Shell) null, WorkbenchMessages.Restoring_Problems, msg); stateFile.delete(); result[0] = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); return; } // Validate compatible version format // We no longer support the release 1.0 format if (VERSION_STRING[0].equals(version)) { reader.close(); String msg = WorkbenchMessages.Workbench_incompatibleSavedStateVersion; boolean ignoreSavedState = new MessageDialog(null, WorkbenchMessages.Workbench_incompatibleUIState, null, msg, MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0).open() == 0; // OK is the default if (ignoreSavedState) { stateFile.delete(); result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } else { result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_EXIT, msg, null); } return; } // Restore the saved state final IStatus restoreResult = restoreState(memento); reader.close(); if (restoreResult.getSeverity() == IStatus.ERROR) { StartupThreading .runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { StatusManager.getManager().handle(restoreResult, StatusManager.LOG); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private void startSourceProviders() { /* * Phase 3 of the initialization of commands. The source providers that * the workbench provides are creating and registered with the above * services. These source providers notify the services when particular * pieces of workbench state change. */ final IEvaluationService evaluationService = (IEvaluationService) serviceLocator .getService(IEvaluationService.class); final IContextService contextService = (IContextService) serviceLocator .getService(IContextService.class); final SourceProviderService sourceProviderService = new SourceProviderService( serviceLocator); serviceLocator.registerService(ISourceProviderService.class, sourceProviderService); SafeRunner.run(new ISafeRunnable() { public void run() throws Exception { // this currently instantiates all players ... sigh sourceProviderService.readRegistry(); ISourceProvider[] sp = sourceProviderService.getSourceProviders(); for (int i = 0; i < sp.length; i++) { evaluationService.addSourceProvider(sp[i]); if (!(sp[i] instanceof ActiveContextSourceProvider)) { contextService.addSourceProvider(sp[i]); } } } public void handleException(Throwable exception) { WorkbenchPlugin.log("Failed to initialize a source provider", exception); //$NON-NLS-1$ } }); SafeRunner.run(new ISafeRunnable() { public void run() throws Exception { // these guys are need to provide the variables they say // they source actionSetSourceProvider = (ActionSetSourceProvider) sourceProviderService .getSourceProvider(ISources.ACTIVE_ACTION_SETS_NAME); FocusControlSourceProvider focusControl = (FocusControlSourceProvider) sourceProviderService .getSourceProvider(ISources.ACTIVE_FOCUS_CONTROL_ID_NAME); serviceLocator.registerService(IFocusService.class, focusControl); menuSourceProvider = (MenuSourceProvider) sourceProviderService .getSourceProvider(ISources.ACTIVE_MENU_NAME); } public void handleException(Throwable exception) { WorkbenchPlugin.log("Failed to initialize a source provider", exception); //$NON-NLS-1$ } }); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void run() throws Exception { // this currently instantiates all players ... sigh sourceProviderService.readRegistry(); ISourceProvider[] sp = sourceProviderService.getSourceProviders(); for (int i = 0; i < sp.length; i++) { evaluationService.addSourceProvider(sp[i]); if (!(sp[i] instanceof ActiveContextSourceProvider)) { contextService.addSourceProvider(sp[i]); } } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void run() throws Exception { // these guys are need to provide the variables they say // they source actionSetSourceProvider = (ActionSetSourceProvider) sourceProviderService .getSourceProvider(ISources.ACTIVE_ACTION_SETS_NAME); FocusControlSourceProvider focusControl = (FocusControlSourceProvider) sourceProviderService .getSourceProvider(ISources.ACTIVE_FOCUS_CONTROL_ID_NAME); serviceLocator.registerService(IFocusService.class, focusControl); menuSourceProvider = (MenuSourceProvider) sourceProviderService .getSourceProvider(ISources.ACTIVE_MENU_NAME); }
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
public void fill(final Menu menu, int index) { if (window.getActivePage() == null || window.getActivePage().getPerspective() == null) { return; } if (getParent() instanceof MenuManager) { ((MenuManager) getParent()).addMenuListener(menuListener); } int itemsToShow = WorkbenchPlugin.getDefault().getPreferenceStore() .getInt(IPreferenceConstants.RECENT_FILES); if (itemsToShow == 0 || history == null) { return; } // Get items. EditorHistoryItem[] historyItems = history.getItems(); int n = Math.min(itemsToShow, historyItems.length); if (n <= 0) { return; } if (showSeparator) { new MenuItem(menu, SWT.SEPARATOR, index); ++index; } final int menuIndex[] = new int[] { index }; for (int i = 0; i < n; i++) { final EditorHistoryItem item = historyItems[i]; final int historyIndex = i; SafeRunner.run(new SafeRunnable() { public void run() throws Exception { String text = calcText(historyIndex, item); MenuItem mi = new MenuItem(menu, SWT.PUSH, menuIndex[0]); ++menuIndex[0]; mi.setText(text); mi.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { open(item); } }); } public void handleException(Throwable e) { // just skip the item if there's an error, // e.g. in the calculation of the shortened name WorkbenchPlugin.log(getClass(), "fill", e); //$NON-NLS-1$ } }); } dirty = false; }
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
public void run() throws Exception { String text = calcText(historyIndex, item); MenuItem mi = new MenuItem(menu, SWT.PUSH, menuIndex[0]); ++menuIndex[0]; mi.setText(text); mi.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { open(item); } }); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullImageDecoratorRunnable.java
public void run() throws Exception { result = decorator.decorateImage(start, element); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/LightweightDecoratorManager.java
public void run() throws Exception { decorator.decorate(element, decoration); clearReferences(); }
// in Eclipse UI/org/eclipse/ui/internal/decorators/FullTextDecoratorRunnable.java
public void run() throws Exception { result = decorator.decorateText(start, element); }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginPulldown.java
public void run() throws Exception { if (parent == null) { menu = delegate.getMenu(control); } else { menu = ((IWorkbenchWindowPulldownDelegate2) delegate) .getMenu(parent); } }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public void start(BundleContext context) throws Exception { super.start(context); final BundleContext fc = context; // Should only attempt refreshPluginActions() once the bundle // has been fully started. Otherwise, action delegates // can be created while in the process of creating // a triggering action delegate (if UI events are processed during startup). // Also, if the start throws an exception, the bundle will be shut down. // We don't want to have created any delegates if this happens. // See bug 63324 for more details. bundleListener = new SynchronousBundleListener() { public void bundleChanged(BundleEvent event) { if (event.getBundle() == getBundle()) { if (event.getType() == BundleEvent.STARTED) { // We're getting notified that the bundle has been started. // Make sure it's still active. It may have been shut down between // the time this event was queued and now. if (getBundle().getState() == Bundle.ACTIVE) { refreshPluginActions(); } fc.removeBundleListener(this); } } } }; context.addBundleListener(bundleListener); // bundleListener is removed in stop(BundleContext) }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public void stop(BundleContext context) throws Exception { try { if (bundleListener != null) { context.removeBundleListener(bundleListener); } saveDialogSettings(); savePreferenceStore(); preferenceStore = null; if (imageRegistry != null) imageRegistry.dispose(); imageRegistry = null; } finally { super.stop(context); } }
30
            
// in Eclipse UI/org/eclipse/ui/internal/splash/EclipseSplashHandler.java
catch (Exception ex) { foregroundColorInteger = 0xD2D7FF; // off white }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/HeapStatus.java
catch (Exception e) { // ignore if method missing or if there are other failures trying to determine the max }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (Exception e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (Exception ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (Exception ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/WorkbenchStatusDialogManagerImpl.java
catch (Exception e) { // if dialog is open, dispose it (and all child controls) if (!isDialogClosed()) { dialog.getShell().dispose(); } // reset the state cleanUp(); // log original problem // TODO: check if is it possible to discover duplicates WorkbenchPlugin.log(statusAdapter.getStatus()); // log the problem with status handling WorkbenchPlugin.log(e); e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityPropertyTester.java
catch (Exception e) { // workbench not yet activated; nothing enabled yet }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityPropertyTester.java
catch (Exception e) { // workbench not yet activated; nothing enabled yet }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
catch (Exception e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { // ignore exceptions return false; }
// in Eclipse UI/org/eclipse/ui/internal/actions/CommandAction.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractSelectionService.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractSelectionService.java
catch (Exception e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
catch (Exception ex) { // protecting against assertion failures WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doRemove", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/UIExtensionTracker.java
catch (Exception e) { WorkbenchPlugin.log(getClass(), "doAdd", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { content.dispose(); StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); return null; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING, "Could not start styling support.", //$NON-NLS-1$ ex)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final Exception e) { if (!display.isDisposed()) { handler.handleException(e); } else { String msg = "Exception in Workbench.runUI after display was disposed"; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Exception ex) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, "Exceptions during shutdown", ex)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistryReader.java
catch (Exception e) { WorkbenchPlugin.log(RESOURCE_BUNDLE .getString("Colors.badFactory"), //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (Exception ex) { WorkbenchPlugin.log(ex); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Exception e) { content.dispose(); StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); return null; }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (Exception e) { // ignore }
6
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.WorkbenchPlugin_extension,e)); }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, NLS.bind(WorkbenchMessages.ExternalEditor_errorMessage,programFileName), e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ }
0
checked (Domain) ExecutionException
public final class ExecutionException extends CommandException {

    /**
     * Generated serial version UID for this class.
     * 
     * @since 3.1
     */
    private static final long serialVersionUID = 3258130262767448120L;

    /**
     * Creates a new instance of this class with the specified detail message
     * and cause.
     * 
     * @param message
     *            the detail message.
     * @param cause
     *            the cause.
     */
    public ExecutionException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Constructs a new instance of <code>ExecutionException</code> using an
     * instance of the new <code>ExecutionException</code>.
     * 
     * @param e
     *            The exception from which this exception should be created;
     *            must not be <code>null</code>.
     * @since 3.1
     */
    public ExecutionException(final org.eclipse.core.commands.ExecutionException e) {
        super(e.getMessage(), e);
    }
}
24
            
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void noVariableFound(ExecutionEvent event, String name) throws ExecutionException { throw new ExecutionException("No " + name //$NON-NLS-1$ + " found while executing " + event.getCommand().getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void incorrectTypeFound(ExecutionEvent event, String name, Class expectedType, Class wrongType) throws ExecutionException { throw new ExecutionException("Incorrect type for " //$NON-NLS-1$ + name + " found while executing " //$NON-NLS-1$ + event.getCommand().getId() + ", expected " + expectedType.getName() //$NON-NLS-1$ + " found " + wrongType.getName()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean toggleCommandState(Command command) throws ExecutionException { State state = command.getState(RegistryToggleState.STATE_ID); if(state == null) throw new ExecutionException("The command does not have a toggle state"); //$NON-NLS-1$ if(!(state.getValue() instanceof Boolean)) throw new ExecutionException("The command's toggle state doesn't contain a boolean value"); //$NON-NLS-1$ boolean oldValue = ((Boolean) state.getValue()).booleanValue(); state.setValue(new Boolean(!oldValue)); return oldValue; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean matchesRadioState(ExecutionEvent event) throws ExecutionException { String parameter = event.getParameter(RadioState.PARAMETER_ID); if (parameter == null) throw new ExecutionException( "The event does not have the radio state parameter"); //$NON-NLS-1$ Command command = event.getCommand(); State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ if (!(state.getValue() instanceof String)) throw new ExecutionException( "The command's radio state doesn't contain a String value"); //$NON-NLS-1$ return parameter.equals(state.getValue()); }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static void updateRadioState(Command command, String newState) throws ExecutionException { State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ state.setValue(newState); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private final void openPerspective(final String perspectiveId, final IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final IWorkbench workbench = PlatformUI.getWorkbench(); final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); IPerspectiveDescriptor desc = activeWorkbenchWindow.getWorkbench() .getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); if (desc == null) { throw new ExecutionException("Perspective " + perspectiveId //$NON-NLS-1$ + " cannot be found."); //$NON-NLS-1$ } try { if (activePage != null) { activePage.setPerspective(desc); } else { IAdaptable input = ((Workbench) workbench) .getDefaultPageInput(); activeWorkbenchWindow.openPage(perspectiveId, input); } } catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); // Get the view identifier, if any. final Map parameters = event.getParameters(); final Object viewId = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_ID); final Object secondary = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_SECONDARY_ID); makeFast = "true".equals(parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_FASTVIEW)); //$NON-NLS-1$ if (viewId == null) { openOther(window); } else { try { openView((String) viewId, (String) secondary, window); } catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else { methodToExecute.invoke(focusControl, null); } } catch (IllegalAccessException e) { // The method is protected, so do nothing. } catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); final int numParams = methodToExecute.getParameterTypes().length; if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { // we only support selectAll for swing components if (numParams != 0) { return null; } /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); // and back to the UI thread :-) focusControl.getDisplay().asyncExec( new Runnable() { public void run() { if (!focusControl .isDisposed()) { focusControl .notifyListeners( SWT.Selection, null); } } }); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else if (numParams == 0) { // This is a no-argument selectAll method. methodToExecute.invoke(focusControl, null); focusControl.notifyListeners(SWT.Selection, null); } else if (numParams == 1) { // This is a single-point selection method. final Method textLimitAccessor = focusControl.getClass() .getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$ final Integer textLimit = (Integer) textLimitAccessor .invoke(focusControl, null); final Object[] parameters = { new Point(0, textLimit .intValue()) }; methodToExecute.invoke(focusControl, parameters); if (!(focusControl instanceof Combo)) { focusControl.notifyListeners(SWT.Selection, null); } } else { /* * This means that getMethodToExecute() has been changed, * while this method hasn't. */ throw new ExecutionException( "Too many parameters on select all", new Exception()); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { // Debugging output if (DEBUG_HANDLERS) { final StringBuffer buffer = new StringBuffer("Executing LegacyHandlerWrapper for "); //$NON-NLS-1$ if (handler == null) { buffer.append("no handler"); //$NON-NLS-1$ } else { buffer.append('\''); buffer.append(handler.getClass().getName()); buffer.append('\''); } Tracing.printTrace("HANDLERS", buffer.toString()); //$NON-NLS-1$ } try { return handler.execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String wizardId = event.getParameter(getWizardIdParameterId()); IWorkbenchWindow activeWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); if (wizardId == null) { executeHandler(event); } else { IWizardRegistry wizardRegistry = getWizardRegistry(); IWizardDescriptor wizardDescriptor = wizardRegistry .findWizard(wizardId); if (wizardDescriptor == null) { throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$ } try { IWorkbenchWizard wizard = wizardDescriptor.createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelectionToUse(event)); if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) { wizard.performFinish(); return null; } Shell parent = activeWindow.getShell(); WizardDialog dialog = new WizardDialog(parent, wizard); dialog.create(); dialog.open(); } catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/QuickMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { locationURI = event.getParameter("org.eclipse.ui.window.quickMenu.uri"); //$NON-NLS-1$ if (locationURI == null) { throw new ExecutionException("locatorURI must not be null"); //$NON-NLS-1$ } creator.createMenu(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { if (loadHandler()) { if (!isEnabled()) { MessageDialog.openInformation(Util.getShellToParentOn(), WorkbenchMessages.Information, WorkbenchMessages.PluginAction_disabledMessage); return null; } return handler.execute(event); } if(loadException !=null) throw new ExecutionException("Exception occured when loading the handler", loadException); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String targetId = event .getParameter(IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_PARM_TARGET); if (targetId == null) { throw new ExecutionException("No targetId specified"); //$NON-NLS-1$ } final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindowChecked(event); ISourceProviderService sps = (ISourceProviderService)activeWorkbenchWindow.getService(ISourceProviderService.class); if (sps != null) { ISourceProvider sp = sps.getSourceProvider(ISources.SHOW_IN_SELECTION); if (sp instanceof WorkbenchSourceProvider) { ((WorkbenchSourceProvider)sp).checkActivePart(true); } } ShowInContext context = getContext(HandlerUtil .getShowInSelection(event), HandlerUtil.getShowInInput(event)); if (context == null) { return null; } IWorkbenchPage page= activeWorkbenchWindow.getActivePage(); try { IViewPart view = page.showView(targetId); IShowInTarget target = getShowInTarget(view); if (!(target != null && target.show(context))) { page.getWorkbenchWindow().getShell().getDisplay().beep(); } ((WorkbenchPage) page).performedShowIn(targetId); // TODO: move // back up } catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ } return null; }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { try { return execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
public Object execute(Map parameterValuesByName) throws ExecutionException { if ((action.getStyle() == IAction.AS_CHECK_BOX) || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { action.setChecked(!action.isChecked()); } try { action.runWithEvent(new Event()); } catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ } return null; }
10
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ }
72
            
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void noVariableFound(ExecutionEvent event, String name) throws ExecutionException { throw new ExecutionException("No " + name //$NON-NLS-1$ + " found while executing " + event.getCommand().getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
private static void incorrectTypeFound(ExecutionEvent event, String name, Class expectedType, Class wrongType) throws ExecutionException { throw new ExecutionException("Incorrect type for " //$NON-NLS-1$ + name + " found while executing " //$NON-NLS-1$ + event.getCommand().getId() + ", expected " + expectedType.getName() //$NON-NLS-1$ + " found " + wrongType.getName()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Object getVariableChecked(ExecutionEvent event, String name) throws ExecutionException { Object o = getVariable(event, name); if (o == null) { noVariableFound(event, name); } return o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Collection getActiveContextsChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_CONTEXT_NAME); if (!(o instanceof Collection)) { incorrectTypeFound(event, ISources.ACTIVE_CONTEXT_NAME, Collection.class, o.getClass()); } return (Collection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Shell getActiveShellChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_SHELL_NAME); if (!(o instanceof Shell)) { incorrectTypeFound(event, ISources.ACTIVE_SHELL_NAME, Shell.class, o.getClass()); } return (Shell) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IWorkbenchWindow getActiveWorkbenchWindowChecked( ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_WORKBENCH_WINDOW_NAME); if (!(o instanceof IWorkbenchWindow)) { incorrectTypeFound(event, ISources.ACTIVE_WORKBENCH_WINDOW_NAME, IWorkbenchWindow.class, o.getClass()); } return (IWorkbenchWindow) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IEditorPart getActiveEditorChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_EDITOR_NAME); if (!(o instanceof IEditorPart)) { incorrectTypeFound(event, ISources.ACTIVE_EDITOR_NAME, IEditorPart.class, o.getClass()); } return (IEditorPart) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static String getActiveEditorIdChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_EDITOR_ID_NAME); if (!(o instanceof String)) { incorrectTypeFound(event, ISources.ACTIVE_EDITOR_ID_NAME, String.class, o.getClass()); } return (String) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IEditorInput getActiveEditorInputChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_EDITOR_INPUT_NAME); if (!(o instanceof IEditorInput)) { incorrectTypeFound(event, ISources.ACTIVE_EDITOR_INPUT_NAME, IEditorInput.class, o.getClass()); } return (IEditorInput) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IWorkbenchPart getActivePartChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_PART_NAME); if (!(o instanceof IWorkbenchPart)) { incorrectTypeFound(event, ISources.ACTIVE_PART_NAME, IWorkbenchPart.class, o.getClass()); } return (IWorkbenchPart) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static String getActivePartIdChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_PART_ID_NAME); if (!(o instanceof String)) { incorrectTypeFound(event, ISources.ACTIVE_PART_ID_NAME, String.class, o.getClass()); } return (String) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static IWorkbenchSite getActiveSiteChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_SITE_NAME); if (!(o instanceof IWorkbenchSite)) { incorrectTypeFound(event, ISources.ACTIVE_SITE_NAME, IWorkbenchSite.class, o.getClass()); } return (IWorkbenchSite) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getCurrentSelectionChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_CURRENT_SELECTION_NAME); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.ACTIVE_CURRENT_SELECTION_NAME, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Collection getActiveMenusChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_MENU_NAME); if (!(o instanceof Collection)) { incorrectTypeFound(event, ISources.ACTIVE_MENU_NAME, Collection.class, o.getClass()); } return (Collection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getActiveMenuSelectionChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_MENU_SELECTION_NAME); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.ACTIVE_MENU_SELECTION_NAME, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getActiveMenuEditorInputChecked( ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.ACTIVE_MENU_EDITOR_INPUT_NAME); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.ACTIVE_MENU_EDITOR_INPUT_NAME, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static ISelection getShowInSelectionChecked(ExecutionEvent event) throws ExecutionException { Object o = getVariableChecked(event, ISources.SHOW_IN_SELECTION); if (!(o instanceof ISelection)) { incorrectTypeFound(event, ISources.SHOW_IN_SELECTION, ISelection.class, o.getClass()); } return (ISelection) o; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static Object getShowInInputChecked(ExecutionEvent event) throws ExecutionException { Object var = getVariableChecked(event, ISources.SHOW_IN_INPUT); return var; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean toggleCommandState(Command command) throws ExecutionException { State state = command.getState(RegistryToggleState.STATE_ID); if(state == null) throw new ExecutionException("The command does not have a toggle state"); //$NON-NLS-1$ if(!(state.getValue() instanceof Boolean)) throw new ExecutionException("The command's toggle state doesn't contain a boolean value"); //$NON-NLS-1$ boolean oldValue = ((Boolean) state.getValue()).booleanValue(); state.setValue(new Boolean(!oldValue)); return oldValue; }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static boolean matchesRadioState(ExecutionEvent event) throws ExecutionException { String parameter = event.getParameter(RadioState.PARAMETER_ID); if (parameter == null) throw new ExecutionException( "The event does not have the radio state parameter"); //$NON-NLS-1$ Command command = event.getCommand(); State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ if (!(state.getValue() instanceof String)) throw new ExecutionException( "The command's radio state doesn't contain a String value"); //$NON-NLS-1$ return parameter.equals(state.getValue()); }
// in Eclipse UI/org/eclipse/ui/handlers/HandlerUtil.java
public static void updateRadioState(Command command, String newState) throws ExecutionException { State state = command.getState(RadioState.STATE_ID); if (state == null) throw new ExecutionException( "The command does not have a radio state"); //$NON-NLS-1$ state.setValue(newState); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); // Get the view identifier, if any. final Map parameters = event.getParameters(); final Object value = parameters .get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_ID); final String newWindow = (String) parameters .get(IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE_PARM_NEWWINDOW); if (value == null) { openOther(window); } else { if (newWindow == null || newWindow.equalsIgnoreCase("false")) { //$NON-NLS-1$ openPerspective((String) value, window); } else { openNewWindowPerspective((String) value, window); } } return null; }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private void openNewWindowPerspective(String perspectiveId, IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final IWorkbench workbench = PlatformUI.getWorkbench(); try { IAdaptable input = ((Workbench) workbench).getDefaultPageInput(); workbench.openWorkbenchWindow(perspectiveId, input); } catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private final void openOther(final IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final SelectPerspectiveDialog dialog = new SelectPerspectiveDialog( activeWorkbenchWindow.getShell(), WorkbenchPlugin.getDefault() .getPerspectiveRegistry()); dialog.open(); if (dialog.getReturnCode() == Window.CANCEL) { return; } final IPerspectiveDescriptor descriptor = dialog.getSelection(); if (descriptor != null) { int openPerspMode = WorkbenchPlugin.getDefault().getPreferenceStore() .getInt(IPreferenceConstants.OPEN_PERSP_MODE); IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); IPerspectiveDescriptor persp = page == null ? null : page.getPerspective(); String perspectiveId = descriptor.getId(); // only open it in a new window if the preference is set and the // current workbench page doesn't have an active perspective if (IPreferenceConstants.OPM_NEW_WINDOW == openPerspMode && persp != null) { openNewWindowPerspective(perspectiveId, activeWorkbenchWindow); } else { openPerspective(perspectiveId, activeWorkbenchWindow); } } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
private final void openPerspective(final String perspectiveId, final IWorkbenchWindow activeWorkbenchWindow) throws ExecutionException { final IWorkbench workbench = PlatformUI.getWorkbench(); final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); IPerspectiveDescriptor desc = activeWorkbenchWindow.getWorkbench() .getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); if (desc == null) { throw new ExecutionException("Perspective " + perspectiveId //$NON-NLS-1$ + " cannot be found."); //$NON-NLS-1$ } try { if (activePage != null) { activePage.setPerspective(desc); } else { IAdaptable input = ((Workbench) workbench) .getDefaultPageInput(); activeWorkbenchWindow.openPage(perspectiveId, input); } } catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); // Get the view identifier, if any. final Map parameters = event.getParameters(); final Object viewId = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_ID); final Object secondary = parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_SECONDARY_ID); makeFast = "true".equals(parameters.get(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_FASTVIEW)); //$NON-NLS-1$ if (viewId == null) { openOther(window); } else { try { openView((String) viewId, (String) secondary, window); } catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/ShowPartPaneMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePart(event); if (part != null) { IWorkbenchPartSite site = part.getSite(); if (site instanceof PartSite) { PartPane pane = ((PartSite) site).getPane(); pane.showSystemMenu(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/CloseAllHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { page.closeAllEditors(true); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/CloseOthersHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorReference[] refArray = page.getEditorReferences(); if (refArray != null && refArray.length > 1) { IEditorReference[] otherEditors = new IEditorReference[refArray.length - 1]; IEditorReference activeEditor = (IEditorReference) page .getReference(page.getActiveEditor()); for (int i = 0; i < refArray.length; i++) { if (refArray[i] != activeEditor) continue; System.arraycopy(refArray, 0, otherEditors, 0, i); System.arraycopy(refArray, i + 1, otherEditors, i, refArray.length - 1 - i); break; } page.closeEditors(otherEditors, true); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LockToolBarHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { WorkbenchWindow workbenchWindow = (WorkbenchWindow) HandlerUtil .getActiveWorkbenchWindow(event); if (workbenchWindow != null) { ICoolBarManager coolBarManager = workbenchWindow.getCoolBarManager2(); if (coolBarManager != null) { boolean oldValue = HandlerUtil.toggleCommandState(event.getCommand()); coolBarManager.setLockLayout(!oldValue); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/EditActionSetsHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { WorkbenchPage page = (WorkbenchPage) activeWorkbenchWindow .getActivePage(); if (page != null) { page.editActionSets(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ToggleCoolbarHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); if (activeWorkbenchWindow instanceof WorkbenchWindow) { WorkbenchWindow window = (WorkbenchWindow) activeWorkbenchWindow; window.toggleToolbarVisibility(); ICommandService commandService = (ICommandService) activeWorkbenchWindow .getService(ICommandService.class); Map filter = new HashMap(); filter.put(IServiceScopes.WINDOW_SCOPE, window); commandService.refreshElements(event.getCommand().getId(), filter); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/MaximizePartHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); if (page != null) { IWorkbenchPartReference partRef = page.getActivePartReference(); if (partRef != null) { page.toggleZoom(partRef); } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/QuitHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow == null) { // action has been disposed return null; } activeWorkbenchWindow.getWorkbench().close(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CloseAllPerspectivesHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { page.closeAllPerspectives(true, true); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/PropertyDialogHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { PreferenceDialog dialog; Object element = null; ISelection currentSelection = HandlerUtil.getCurrentSelection(event); IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event); Shell shell; if (currentSelection instanceof IStructuredSelection) { element = ((IStructuredSelection) currentSelection) .getFirstElement(); } else { return null; } if (activeWorkbenchWindow != null){ shell = activeWorkbenchWindow.getShell(); dialog = PropertyDialog.createDialogOn(shell, initialPageId, element); if (dialog != null) { dialog.open(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SaveAllHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { ((WorkbenchPage) page).saveAllEditors(false, true); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ClosePerspectiveHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { WorkbenchPage page = (WorkbenchPage) activeWorkbenchWindow .getActivePage(); if (page != null) { Map parameters = event.getParameters(); String value = (String) parameters .get(IWorkbenchCommandConstants.WINDOW_CLOSE_PERSPECTIVE_PARM_ID); if (value == null) { page.closePerspective(page.getPerspective(), true, true); } else { IPerspectiveDescriptor perspective = activeWorkbenchWindow .getWorkbench().getPerspectiveRegistry() .findPerspectiveWithId(value); if (perspective != null) { page.closePerspective(perspective, true, true); } } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); if (page == null) { return null; } IEditorPart editor = page.getActiveEditor(); if (editor == null) { return null; } String editorId = editor.getSite().getId(); if (editorId == null) { return null; } try { if (editor instanceof IPersistableEditor) { XMLMemento editorState = XMLMemento .createWriteRoot(IWorkbenchConstants.TAG_EDITOR_STATE); ((IPersistableEditor) editor).saveState(editorState); ((WorkbenchPage) page).openEditor(editor.getEditorInput(), editorId, true, IWorkbenchPage.MATCH_NONE, editorState); } else { page.openEditor(editor.getEditorInput(), editorId, true, IWorkbenchPage.MATCH_NONE); } } catch (PartInitException e) { DialogUtil.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.Error, e.getMessage(), e); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/OpenInNewWindowHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow == null) { return null; } try { String perspId = null; IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); IAdaptable pageInput = ((Workbench) activeWorkbenchWindow .getWorkbench()).getDefaultPageInput(); if (page != null && page.getPerspective() != null) { perspId = page.getPerspective().getId(); pageInput = page.getInput(); } else { perspId = activeWorkbenchWindow.getWorkbench() .getPerspectiveRegistry().getDefaultPerspective(); } activeWorkbenchWindow.getWorkbench().openWorkbenchWindow(perspId, pageInput); } catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ClosePartHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePartChecked(event); IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); if (part instanceof IEditorPart) { window.getActivePage().closeEditor((IEditorPart) part, true); } else if (part instanceof IViewPart) { window.getActivePage().hideView((IViewPart) part); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerProxy.java
public Object execute(Map parameters) throws ExecutionException { if (loadHandler()) { return handler.execute(parameters); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else { methodToExecute.invoke(focusControl, null); } } catch (IllegalAccessException e) { // The method is protected, so do nothing. } catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final Method methodToExecute = getMethodToExecute(); if (methodToExecute != null) { try { final Control focusControl = Display.getCurrent() .getFocusControl(); final int numParams = methodToExecute.getParameterTypes().length; if ((focusControl instanceof Composite) && ((((Composite) focusControl).getStyle() & SWT.EMBEDDED) != 0)) { // we only support selectAll for swing components if (numParams != 0) { return null; } /* * Okay. Have a seat. Relax a while. This is going to be a * bumpy ride. If it is an embedded widget, then it *might* * be a Swing widget. At the point where this handler is * executing, the key event is already bound to be * swallowed. If I don't do something, then the key will be * gone for good. So, I will try to forward the event to the * Swing widget. Unfortunately, we can't even count on the * Swing libraries existing, so I need to use reflection * everywhere. And, to top it off, I need to dispatch the * event on the Swing event queue, which means that it will * be carried out asynchronously to the SWT event queue. */ try { final Object focusComponent = getFocusComponent(); if (focusComponent != null) { Runnable methodRunnable = new Runnable() { public void run() { try { methodToExecute.invoke(focusComponent, null); // and back to the UI thread :-) focusControl.getDisplay().asyncExec( new Runnable() { public void run() { if (!focusControl .isDisposed()) { focusControl .notifyListeners( SWT.Selection, null); } } }); } catch (final IllegalAccessException e) { // The method is protected, so do // nothing. } catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } }); } } }; swingInvokeLater(methodRunnable); } } catch (final ClassNotFoundException e) { // There is no Swing support, so do nothing. } catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ } } else if (numParams == 0) { // This is a no-argument selectAll method. methodToExecute.invoke(focusControl, null); focusControl.notifyListeners(SWT.Selection, null); } else if (numParams == 1) { // This is a single-point selection method. final Method textLimitAccessor = focusControl.getClass() .getMethod("getTextLimit", NO_PARAMETERS); //$NON-NLS-1$ final Integer textLimit = (Integer) textLimitAccessor .invoke(focusControl, null); final Object[] parameters = { new Point(0, textLimit .intValue()) }; methodToExecute.invoke(focusControl, parameters); if (!(focusControl instanceof Combo)) { focusControl.notifyListeners(SWT.Selection, null); } } else { /* * This means that getMethodToExecute() has been changed, * while this method hasn't. */ throw new ExecutionException( "Too many parameters on select all", new Exception()); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { // Debugging output if (DEBUG_HANDLERS) { final StringBuffer buffer = new StringBuffer("Executing LegacyHandlerWrapper for "); //$NON-NLS-1$ if (handler == null) { buffer.append("no handler"); //$NON-NLS-1$ } else { buffer.append('\''); buffer.append(handler.getClass().getName()); buffer.append('\''); } Tracing.printTrace("HANDLERS", buffer.toString()); //$NON-NLS-1$ } try { return handler.execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String wizardId = event.getParameter(getWizardIdParameterId()); IWorkbenchWindow activeWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); if (wizardId == null) { executeHandler(event); } else { IWizardRegistry wizardRegistry = getWizardRegistry(); IWizardDescriptor wizardDescriptor = wizardRegistry .findWizard(wizardId); if (wizardDescriptor == null) { throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$ } try { IWorkbenchWizard wizard = wizardDescriptor.createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelectionToUse(event)); if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) { wizard.performFinish(); return null; } Shell parent = activeWindow.getShell(); WizardDialog dialog = new WizardDialog(parent, wizard); dialog.create(); dialog.open(); } catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(command, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final String commandId, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(commandId, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public Object executeCommandInContext(ParameterizedCommand command, Event event, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommandInContext(command, event, context); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/QuickMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { locationURI = event.getParameter("org.eclipse.ui.window.quickMenu.uri"); //$NON-NLS-1$ if (locationURI == null) { throw new ExecutionException("locatorURI must not be null"); //$NON-NLS-1$ } creator.createMenu(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerProxy.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { if (loadHandler()) { if (!isEnabled()) { MessageDialog.openInformation(Util.getShellToParentOn(), WorkbenchMessages.Information, WorkbenchMessages.PluginAction_disabledMessage); return null; } return handler.execute(event); } if(loadException !=null) throw new ExecutionException("Exception occured when loading the handler", loadException); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return command.executeWithChecks(trigger, getCurrentState()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final String commandId, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { final Command command = commandService.getCommand(commandId); final ExecutionEvent event = new ExecutionEvent(command, Collections.EMPTY_MAP, trigger, getCurrentState()); return command.executeWithChecks(event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommandInContext( final ParameterizedCommand command, final Event trigger, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { IHandler oldHandler = command.getCommand().getHandler(); IHandler handler = findHandler(command.getId(), context); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(context); } try { command.getCommand().setHandler(handler); return command.executeWithChecks(trigger, context); } finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/MinimizePartHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (activeWorkbenchWindow != null) { IWorkbenchPage page = activeWorkbenchWindow.getActivePage(); if (page != null) { IWorkbenchPartReference partRef = page.getActivePartReference(); if (partRef != null) { page.setPartState(partRef, IStackPresentationSite.STATE_MINIMIZED); } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CyclePageHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { if (event.getCommand().getId().equals(IWorkbenchCommandConstants.NAVIGATE_NEXT_PAGE)) { gotoDirection = true; } else { gotoDirection = false; } super.execute(event); if (lrm != null) { lrm.dispose(); lrm = null; } return null; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/CloseEditorHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IEditorPart part = HandlerUtil.getActiveEditorChecked(event); window.getActivePage().closeEditor(part, true); return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbookEditorsHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow workbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (workbenchWindow == null) { // action has been disposed return null; } IWorkbenchPage page = workbenchWindow.getActivePage(); if (page != null) { WorkbenchPage wbp = (WorkbenchPage) page; EditorAreaHelper eah = wbp.getEditorPresentation(); if (eah != null) { eah.displayEditorList(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { new AboutDialog(HandlerUtil.getActiveShellChecked(event)).open(); return null; }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
public final Object execute(final ExecutionEvent event) throws ExecutionException { final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil .getActiveWorkbenchWindowChecked(event); final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage == null) { return null; } try { activePage.showView(viewId); } catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/ActivateEditorHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil .getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); if (page != null) { IEditorPart part = HandlerUtil.getActiveEditor(event); if (part != null) { page.activate(part); } else { IWorkbenchPartReference ref = page.getActivePartReference(); if (ref instanceof IViewReference) { if (((WorkbenchPage) page).isFastView((IViewReference) ref)) { ((WorkbenchPage) page) .toggleFastView((IViewReference) ref); } } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchEditorsHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow workbenchWindow = HandlerUtil .getActiveWorkbenchWindow(event); if (workbenchWindow == null) { // action has been disposed return null; } IWorkbenchPage page = workbenchWindow.getActivePage(); if (page != null) { new WorkbenchEditorsDialog(workbenchWindow).open(); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/CycleBaseHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { window = HandlerUtil.getActiveWorkbenchWindowChecked(event); IWorkbenchPage page = window.getActivePage(); IWorkbenchPart activePart= page.getActivePart(); getTriggers(); openDialog((WorkbenchPage) page, activePart); clearTriggers(); activate(page, selection); return null; }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenuHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePart(event); if (part != null) { IWorkbenchPartSite site = part.getSite(); if (site instanceof PartSite) { PartPane pane = ((PartSite) site).getPane(); pane.showPaneMenu(); } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
public Object execute(ExecutionEvent event) throws ExecutionException { String targetId = event .getParameter(IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_PARM_TARGET); if (targetId == null) { throw new ExecutionException("No targetId specified"); //$NON-NLS-1$ } final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindowChecked(event); ISourceProviderService sps = (ISourceProviderService)activeWorkbenchWindow.getService(ISourceProviderService.class); if (sps != null) { ISourceProvider sp = sps.getSourceProvider(ISources.SHOW_IN_SELECTION); if (sp instanceof WorkbenchSourceProvider) { ((WorkbenchSourceProvider)sp).checkActivePart(true); } } ShowInContext context = getContext(HandlerUtil .getShowInSelection(event), HandlerUtil.getShowInInput(event)); if (context == null) { return null; } IWorkbenchPage page= activeWorkbenchWindow.getActivePage(); try { IViewPart view = page.showView(targetId); IShowInTarget target = getShowInTarget(view); if (!(target != null && target.show(context))) { page.getWorkbenchWindow().getShell().getDisplay().beep(); } ((WorkbenchPage) page).performedShowIn(targetId); // TODO: move // back up } catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ } return null; }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public Object execute(final ExecutionEvent event) throws ExecutionException { try { return execute(event.getParameters()); } catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); } }
// in Eclipse UI/org/eclipse/ui/commands/ActionHandler.java
public Object execute(Map parameterValuesByName) throws ExecutionException { if ((action.getStyle() == IAction.AS_CHECK_BOX) || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { action.setChecked(!action.isChecked()); } try { action.runWithEvent(new Event()); } catch (Exception e) { throw new ExecutionException( "While executing the action, an exception occurred", e); //$NON-NLS-1$ } return null; }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
private void initializeSubTabSwitching() { IHandlerService service = (IHandlerService) getSite().getService(IHandlerService.class); service.activateHandler(COMMAND_NEXT_SUB_TAB, new AbstractHandler() { /** * {@inheritDoc} * @throws ExecutionException * if an exception occurred during execution */ public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() + 1; if (i >= n) i= 0; setActivePage(i); return null; } }); service.activateHandler(COMMAND_PREVIOUS_SUB_TAB, new AbstractHandler() { /** * {@inheritDoc} * @throws ExecutionException * if an exception occurred during execution */ public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() - 1; if (i < 0) i= n - 1; setActivePage(i); return null; } }); }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() + 1; if (i >= n) i= 0; setActivePage(i); return null; }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public Object execute(ExecutionEvent event) throws ExecutionException { int n= getPageCount(); if (n == 0) return null; int i= getActivePage() - 1; if (i < 0) i= n - 1; setActivePage(i); return null; }
// in Eclipse UI/org/eclipse/ui/operations/RedoActionHandler.java
IStatus runCommand(IProgressMonitor pm) throws ExecutionException { return getHistory().redo(getUndoContext(), pm, this); }
// in Eclipse UI/org/eclipse/ui/operations/UndoActionHandler.java
IStatus runCommand(IProgressMonitor pm) throws ExecutionException { return getHistory().undo(getUndoContext(), pm, this); }
21
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final ExecutionException e) { firePropertyChange(IAction.RESULT, null, Boolean.FALSE); // TODO Should this be logged? }
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WorkbenchWindowHandlerDelegate.java
catch (final ExecutionException e) { // TODO Do something meaningful and poignant. }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (ExecutionException ex) { StatusUtil.handleStatus(ex, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (ExecutionException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (ExecutionException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (final ExecutionException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (ExecutionException e) { reportException(e, uiInfo); status = IOperationHistory.OPERATION_INVALID_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (ExecutionException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (ExecutionException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (ExecutionException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
// in Eclipse UI/org/eclipse/ui/operations/LinearUndoViolationUserApprover.java
catch (ExecutionException e) { // flush the redo history here because it failed. history.dispose(context, false, true, false); return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/LinearUndoViolationUserApprover.java
catch (ExecutionException e) { // flush the undo history here because something went wrong. history.dispose(context, true, false, false); return Status.CANCEL_STATUS; }
4
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerWrapper.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
catch (final org.eclipse.ui.commands.ExecutionException e) { throw new ExecutionException(e.getMessage(), e.getCause()); }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
0
unknown (Lib) FileNotFoundException 0 0 0 5
            
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); return new PreferenceTransferElement[0]; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (FileNotFoundException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (FileNotFoundException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (FileNotFoundException exception) { ProgressManagerUtil.logException(exception); return null; }
0 0
unknown (Lib) GeneralSecurityException 0 0 0 2
            
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
catch (GeneralSecurityException e){ isSigned = false; }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (GeneralSecurityException e) { // default "unsigned info is ok, but log the problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
0 0
checked (Lib) IOException 1
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
public void save() throws IOException { try { getStorePreferences().flush(); dirty = false; } catch (BackingStoreException e) { throw new IOException(e.getMessage()); } }
1
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (BackingStoreException e) { throw new IOException(e.getMessage()); }
13
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
public void save() throws IOException { try { getStorePreferences().flush(); dirty = false; } catch (BackingStoreException e) { throw new IOException(e.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
public void exportCSV(Shell shell) { final FileDialog fileDialog = new FileDialog(shell, SWT.SAVE | SWT.SHEET); fileDialog.setFilterExtensions(new String[] { "*.csv" }); //$NON-NLS-1$ fileDialog.setFilterNames(new String[] { Util.translateString( RESOURCE_BUNDLE, "csvFilterName") }); //$NON-NLS-1$ fileDialog.setOverwrite(true); final String filePath = fileDialog.open(); if (filePath == null) { return; } final SafeRunnable runnable = new SafeRunnable() { public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(filePath), "UTF-8")); //$NON-NLS-1$ final Object[] bindingElements = bindingModel.getBindings() .toArray(); for (int i = 0; i < bindingElements.length; i++) { final BindingElement be = (BindingElement) bindingElements[i]; if (be.getTrigger() == null || be.getTrigger().isEmpty() || be.getContext() == null || be.getContext().getName() == null) { continue; } StringBuffer buffer = new StringBuffer(); buffer.append(ESCAPED_QUOTE + Util.replaceAll(be.getCategory(), ESCAPED_QUOTE, REPLACEMENT) + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getName() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getTrigger().format() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getContext().getName() + ESCAPED_QUOTE); buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$ fileWriter.write(buffer.toString()); } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } } }; SafeRunner.run(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(filePath), "UTF-8")); //$NON-NLS-1$ final Object[] bindingElements = bindingModel.getBindings() .toArray(); for (int i = 0; i < bindingElements.length; i++) { final BindingElement be = (BindingElement) bindingElements[i]; if (be.getTrigger() == null || be.getTrigger().isEmpty() || be.getContext() == null || be.getContext().getName() == null) { continue; } StringBuffer buffer = new StringBuffer(); buffer.append(ESCAPED_QUOTE + Util.replaceAll(be.getCategory(), ESCAPED_QUOTE, REPLACEMENT) + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getName() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getTrigger().format() + ESCAPED_QUOTE + DELIMITER); buffer.append(ESCAPED_QUOTE + be.getContext().getName() + ESCAPED_QUOTE); buffer.append(System.getProperty("line.separator")); //$NON-NLS-1$ fileWriter.write(buffer.toString()); } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
private final void selectedButtonExport() { final FileDialog fileDialog = new FileDialog(getShell(), SWT.SAVE | SWT.SHEET); fileDialog.setFilterExtensions(new String[] { "*.csv" }); //$NON-NLS-1$ fileDialog.setFilterNames(new String[] { Util.translateString( RESOURCE_BUNDLE, "csvFilterName") }); //$NON-NLS-1$ final String filePath = fileDialog.open(); if (filePath == null) { return; } final SafeRunnable runnable = new SafeRunnable() { public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new FileWriter(filePath)); final TableItem[] items = tableBindings.getItems(); final int numColumns = tableBindings.getColumnCount(); for (int i = 0; i < items.length; i++) { final TableItem item = items[i]; for (int j = 0; j < numColumns; j++) { String buf = Util.replaceAll(item.getText(j), "\"", //$NON-NLS-1$ "\"\""); //$NON-NLS-1$ fileWriter.write("\"" + buf + "\""); //$NON-NLS-1$//$NON-NLS-2$ if (j < numColumns - 1) { fileWriter.write(','); } } fileWriter.write(System.getProperty("line.separator")); //$NON-NLS-1$ } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } } }; SafeRunner.run(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
public final void run() throws IOException { Writer fileWriter = null; try { fileWriter = new BufferedWriter(new FileWriter(filePath)); final TableItem[] items = tableBindings.getItems(); final int numColumns = tableBindings.getColumnCount(); for (int i = 0; i < items.length; i++) { final TableItem item = items[i]; for (int j = 0; j < numColumns; j++) { String buf = Util.replaceAll(item.getText(j), "\"", //$NON-NLS-1$ "\"\""); //$NON-NLS-1$ fileWriter.write("\"" + buf + "\""); //$NON-NLS-1$//$NON-NLS-2$ if (j < numColumns - 1) { fileWriter.write(','); } } fileWriter.write(System.getProperty("line.separator")); //$NON-NLS-1$ } } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (final IOException e) { // At least I tried. } } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
static final void write(final Scheme activeScheme, final Binding[] bindings) throws IOException { // Print out debugging information, if requested. if (DEBUG) { Tracing.printTrace("BINDINGS", "Persisting active scheme '" //$NON-NLS-1$ //$NON-NLS-2$ + activeScheme.getId() + '\''); Tracing.printTrace("BINDINGS", "Persisting bindings"); //$NON-NLS-1$ //$NON-NLS-2$ } // Write the simple preference key to the UI preference store. writeActiveScheme(activeScheme); // Build the XML block for writing the bindings and active scheme. final XMLMemento xmlMemento = XMLMemento .createWriteRoot(EXTENSION_COMMANDS); if (activeScheme != null) { writeActiveSchemeToPreferences(xmlMemento, activeScheme); } if (bindings != null) { final int bindingsLength = bindings.length; for (int i = 0; i < bindingsLength; i++) { final Binding binding = bindings[i]; if (binding.getType() == Binding.USER) { writeBindingToPreferences(xmlMemento, binding); } } } // Write the XML block to the workbench preference store. final IPreferenceStore preferenceStore = WorkbenchPlugin.getDefault() .getPreferenceStore(); final Writer writer = new StringWriter(); try { xmlMemento.save(writer); preferenceStore.setValue(EXTENSION_COMMANDS, writer.toString()); } finally { writer.close(); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
public final void savePreferences(final Scheme activeScheme, final Binding[] bindings) throws IOException { BindingPersistence.write(activeScheme, bindings); try { bindingManager.setActiveScheme(activeScheme); } catch (final NotDefinedException e) { WorkbenchPlugin.log("The active scheme is not currently defined.", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); } bindingManager.setBindings(bindings); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
private Process openWebBrowser(String href) throws IOException { Process p = null; if (webBrowser == null) { try { webBrowser = "firefox"; //$NON-NLS-1$ p = Runtime.getRuntime().exec(webBrowser + " " + href); //$NON-NLS-1$; } catch (IOException e) { p = null; webBrowser = "mozilla"; //$NON-NLS-1$ } } if (p == null) { try { p = Runtime.getRuntime().exec(webBrowser + " " + href); //$NON-NLS-1$; } catch (IOException e) { p = null; webBrowser = "netscape"; //$NON-NLS-1$ } } if (p == null) { try { p = Runtime.getRuntime().exec(webBrowser + " " + href); //$NON-NLS-1$; } catch (IOException e) { p = null; throw e; } } return p; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
private void load() throws IOException { if (activityRequirementBindingDefinitions == null) { activityRequirementBindingDefinitions = new ArrayList(); } else { activityRequirementBindingDefinitions.clear(); } if (activityDefinitions == null) { activityDefinitions = new ArrayList(); } else { activityDefinitions.clear(); } if (activityPatternBindingDefinitions == null) { activityPatternBindingDefinitions = new ArrayList(); } else { activityPatternBindingDefinitions.clear(); } if (categoryActivityBindingDefinitions == null) { categoryActivityBindingDefinitions = new ArrayList(); } else { categoryActivityBindingDefinitions.clear(); } if (categoryDefinitions == null) { categoryDefinitions = new ArrayList(); } else { categoryDefinitions.clear(); } if (defaultEnabledActivities == null) { defaultEnabledActivities = new ArrayList(); } else { defaultEnabledActivities.clear(); } IConfigurationElement[] configurationElements = extensionRegistry .getConfigurationElementsFor(Persistence.PACKAGE_FULL); for (int i = 0; i < configurationElements.length; i++) { IConfigurationElement configurationElement = configurationElements[i]; String name = configurationElement.getName(); if (Persistence.TAG_ACTIVITY_REQUIREMENT_BINDING.equals(name)) { readActivityRequirementBindingDefinition(configurationElement); } else if (Persistence.TAG_ACTIVITY.equals(name)) { readActivityDefinition(configurationElement); } else if (Persistence.TAG_ACTIVITY_PATTERN_BINDING.equals(name)) { readActivityPatternBindingDefinition(configurationElement); } else if (Persistence.TAG_CATEGORY_ACTIVITY_BINDING.equals(name)) { readCategoryActivityBindingDefinition(configurationElement); } else if (Persistence.TAG_CATEGORY.equals(name)) { readCategoryDefinition(configurationElement); } else if (Persistence.TAG_DEFAULT_ENABLEMENT.equals(name)) { readDefaultEnablement(configurationElement); } } // merge enablement overrides from plugin_customization.ini IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); for (Iterator i = activityDefinitions.iterator(); i.hasNext();) { ActivityDefinition activityDef = (ActivityDefinition) i.next(); String id = activityDef.getId(); String preferenceKey = createPreferenceKey(id); if ("".equals(store.getDefaultString(preferenceKey))) //$NON-NLS-1$ continue; if (store.getDefaultBoolean(preferenceKey)) { if (!defaultEnabledActivities.contains(id) && activityDef.getEnabledWhen() == null) defaultEnabledActivities.add(id); } else { defaultEnabledActivities.remove(id); } } // Removal of all defaultEnabledActivites which target to expression // controlled activities. for (int i = 0; i < defaultEnabledActivities.size();) { String id = (String) defaultEnabledActivities.get(i); ActivityDefinition activityDef = getActivityDefinitionById(id); if (activityDef != null && activityDef.getEnabledWhen() != null) { defaultEnabledActivities.remove(i); StatusManager .getManager() .handle( new Status( IStatus.WARNING, PlatformUI.PLUGIN_ID, "Default enabled activity declarations will be ignored (id: " + id + ")")); //$NON-NLS-1$ //$NON-NLS-2$ } else { i++; } } // remove all requirement bindings that reference expression-bound activities for (Iterator i = activityRequirementBindingDefinitions.iterator(); i .hasNext();) { ActivityRequirementBindingDefinition bindingDef = (ActivityRequirementBindingDefinition) i .next(); ActivityDefinition activityDef = getActivityDefinitionById(bindingDef .getRequiredActivityId()); if (activityDef != null && activityDef.getEnabledWhen() != null) { i.remove(); StatusManager .getManager() .handle( new Status( IStatus.WARNING, PlatformUI.PLUGIN_ID, "Expression activity cannot have requirements (id: " + activityDef.getId() + ")")); //$NON-NLS-1$ //$NON-NLS-2$ continue; } activityDef = getActivityDefinitionById(bindingDef.getActivityId()); if (activityDef != null && activityDef.getEnabledWhen() != null) { i.remove(); StatusManager .getManager() .handle( new Status( IStatus.WARNING, PlatformUI.PLUGIN_ID, "Expression activity cannot be required (id: " + activityDef.getId() + ")")); //$NON-NLS-1$ //$NON-NLS-2$ } } boolean activityRegistryChanged = false; if (!activityRequirementBindingDefinitions .equals(super.activityRequirementBindingDefinitions)) { super.activityRequirementBindingDefinitions = Collections .unmodifiableList(new ArrayList(activityRequirementBindingDefinitions)); activityRegistryChanged = true; } if (!activityDefinitions.equals(super.activityDefinitions)) { super.activityDefinitions = Collections .unmodifiableList(new ArrayList(activityDefinitions)); activityRegistryChanged = true; } if (!activityPatternBindingDefinitions .equals(super.activityPatternBindingDefinitions)) { super.activityPatternBindingDefinitions = Collections .unmodifiableList(new ArrayList(activityPatternBindingDefinitions)); activityRegistryChanged = true; } if (!categoryActivityBindingDefinitions .equals(super.categoryActivityBindingDefinitions)) { super.categoryActivityBindingDefinitions = Collections .unmodifiableList(new ArrayList(categoryActivityBindingDefinitions)); activityRegistryChanged = true; } if (!categoryDefinitions.equals(super.categoryDefinitions)) { super.categoryDefinitions = Collections .unmodifiableList(new ArrayList(categoryDefinitions)); activityRegistryChanged = true; } if (!defaultEnabledActivities.equals(super.defaultEnabledActivities)) { super.defaultEnabledActivities = Collections .unmodifiableList(new ArrayList(defaultEnabledActivities)); activityRegistryChanged = true; } if (activityRegistryChanged) { fireActivityRegistryChanged(); } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public void saveCustomPersp(PerspectiveDescriptor desc, XMLMemento memento) throws IOException { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); // Save it to the preference store. Writer writer = new StringWriter(); memento.save(writer); writer.close(); store.setValue(desc.getId() + PERSP, writer.toString()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IMemento getCustomPersp(String id) throws WorkbenchException, IOException { Reader reader = null; IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); String xmlString = store.getString(id + PERSP); if (xmlString != null && xmlString.length() != 0) { // defined in store reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, id))); } XMLMemento memento = XMLMemento.createReadRoot(reader); reader.close(); return memento; }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void saveState(File stateFile) throws IOException { XMLMemento memento = XMLMemento .createWriteRoot(IWorkbenchConstants.TAG_WORKING_SET_MANAGER); saveWorkingSetState(memento); saveMruList(memento); FileOutputStream stream = new FileOutputStream(stateFile); OutputStreamWriter writer = new OutputStreamWriter(stream, "utf-8"); //$NON-NLS-1$ memento.save(writer); writer.close(); }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
private EditorInputData readEditorInput(DataInputStream dataIn) throws IOException, WorkbenchException { String editorId = dataIn.readUTF(); String factoryId = dataIn.readUTF(); String xmlString = dataIn.readUTF(); if (xmlString == null || xmlString.length() == 0) { return null; } StringReader reader = new StringReader(xmlString); // Restore the editor input XMLMemento memento = XMLMemento.createReadRoot(reader); IElementFactory factory = PlatformUI.getWorkbench().getElementFactory( factoryId); if (factory != null) { IAdaptable adaptable = factory.createElement(memento); if (adaptable != null && (adaptable instanceof IEditorInput)) { return new EditorInputData(editorId, (IEditorInput) adaptable); } } return null; }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
private void writeEditorInput(DataOutputStream dataOut, EditorInputData editorInputData) throws IOException { //write the id of the editor dataOut.writeUTF(editorInputData.editorId); //write the information needed to recreate the editor input if (editorInputData.input != null) { // Capture the editor information XMLMemento memento = XMLMemento.createWriteRoot("IEditorInput");//$NON-NLS-1$ IPersistableElement element = editorInputData.input .getPersistable(); if (element != null) { //get the IEditorInput to save its state element.saveState(memento); //convert memento to String StringWriter writer = new StringWriter(); memento.save(writer); writer.close(); //write the factor ID and state information dataOut.writeUTF(element.getFactoryId()); dataOut.writeUTF(writer.toString()); } } }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public void save(Writer writer) throws IOException { DOMWriter out = new DOMWriter(writer); try { out.print(element); } finally { out.close(); } }
62
            
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingSetSettingsTransfer.java
catch (IOException e) { new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, WorkbenchMessages.ProblemSavingWorkingSetState_message, e); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (IOException e) { unableToOpenPerspective(persp, null); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (IOException e) { perspRegistry.deletePerspective(realDesc); MessageDialog.openError((Shell) null, WorkbenchMessages.Perspective_problemSavingTitle, WorkbenchMessages.Perspective_problemSavingMessage); }
// in Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
catch (IOException e) { bundle = null; }
// in Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
catch (IOException e) { // do nothing if we fail to close }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerActivation.java
catch (IOException e) { // we're a string buffer, there should be no IO exception }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java
catch (IOException e) { // should never get this. }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final IOException e) { // At least I tried. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { logPreferenceStoreException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final IOException e) { // At least I tried. }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { openWebBrowserError(d); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; webBrowser = "mozilla"; //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; webBrowser = "netscape"; //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; throw e; }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesImportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); }
// in Eclipse UI/org/eclipse/ui/internal/wizards/preferences/WizardPreferencesExportPage1.java
catch (IOException e) { WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, getControl() .getShell(), new String(), e.getLocalizedMessage(), SWT.SHEET); return false; }
// in Eclipse UI/org/eclipse/ui/internal/misc/ExternalEditor.java
catch (IOException e) { // Program file is not in the plugin directory }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (IOException eIO) { }
// in Eclipse UI/org/eclipse/ui/internal/activities/ExtensionActivityRegistry.java
catch (IOException eIO) { }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleGroupData.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleGroupData.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
catch (IOException e) { isSigned = false; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (IOException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (IOException e) { // default "unsigned info" is ok for the user, but log the // problem. StatusManager.getManager().handle( new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, e.getMessage(), e), StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/about/ConfigurationLogDefaultSection.java
catch (IOException e) { writer.println("Error reading preferences " + e.toString());//$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutPluginsPage.java
catch (IOException e) { // skip the about dir if its not found or there are other // problems. }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutPluginsPage.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutData.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (IOException exception) { ProgressManagerUtil.logException(exception); return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (IOException e) { handleInternalError( e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (IOException e) { stateFile.delete(); handleInternalError(e, WorkbenchMessages.ProblemSavingWorkingSetState_title, WorkbenchMessages.ProblemSavingWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (IOException e) { unableToLoadPerspective(null); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (IOException e) { unableToLoadPerspective(null); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { //Ignore this as the workbench may not yet have saved any state return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { WorkbenchPlugin.log("Error reading editors: Could not close steam", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { MessageDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { WorkbenchPlugin.log("Error reading resources: Could not close steam", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Saving Problems", //$NON-NLS-1$ "Unable to save resource associations."); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { ex.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException e) { try { if (writer != null) { writer.close(); } } catch (IOException ex) { ex.printStackTrace(); } MessageDialog.openError((Shell) null, "Error", "Unable to save resource associations."); //$NON-NLS-1$ //$NON-NLS-2$ return; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (IOException ex) { ex.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchLayoutSettingsTransfer.java
catch (IOException e) { return new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, WorkbenchMessages.Workbench_problemsSavingMsg, e); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { // he's done for }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (IOException e) { stateFile.delete(); MessageDialog.openError((Shell) null, WorkbenchMessages.SavingProblem, WorkbenchMessages.ProblemSavingState); return false; }
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (IOException e) { // Simply don't store the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_storeError, e)); }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // load failed so ensure we have an empty settings dialogSettings = new DialogSettings("Workbench"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // load failed so ensure we have an empty settings dialogSettings = new DialogSettings("Workbench"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IOException e) { // spec'ed to ignore problems }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
catch (IOException e) { }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
catch (IOException e) { return null; }
// in Eclipse UI/org/eclipse/ui/part/PluginTransfer.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/part/PluginTransfer.java
catch (IOException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (IOException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_ioError; }
2
            
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { p = null; throw e; }
0
unknown (Lib) IllegalAccessException 0 0 3
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Shell getSplashShell(Display display) throws NumberFormatException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { Shell splashShell = (Shell) display.getData(DATA_SPLASH_SHELL); if (splashShell != null) return splashShell; String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); if (splashHandle == null) { return null; } // look for the 32 bit internal_new shell method try { Method method = Shell.class.getMethod( "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ // we're on a 32 bit platform so invoke it with splash // handle as an int splashShell = (Shell) method.invoke(null, new Object[] { display, new Integer(splashHandle) }); } catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } } display.setData(DATA_SPLASH_SHELL, splashShell); return splashShell; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected void swingInvokeLater(Runnable methodRunnable) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final Class swingUtilitiesClass = Class .forName("javax.swing.SwingUtilities"); //$NON-NLS-1$ final Method swingUtilitiesInvokeLaterMethod = swingUtilitiesClass .getMethod("invokeLater", //$NON-NLS-1$ new Class[] { Runnable.class }); swingUtilitiesInvokeLaterMethod.invoke(swingUtilitiesClass, new Object[] { methodRunnable }); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected Object getFocusComponent() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { /* * Before JRE 1.4, one has to use * javax.swing.FocusManager.getCurrentManager().getFocusOwner(). Since * JRE 1.4, one has to use * java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager * ().getFocusOwner(); the use of the older API would install a * LegacyGlueFocusTraversalPolicy which causes endless recursions in * some situations. */ Class keyboardFocusManagerClass = null; try { keyboardFocusManagerClass = Class .forName("java.awt.KeyboardFocusManager"); //$NON-NLS-1$ } catch (ClassNotFoundException e) { // switch to the old guy } if (keyboardFocusManagerClass != null) { // Use JRE 1.4 API final Method keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod = keyboardFocusManagerClass .getMethod("getCurrentKeyboardFocusManager", null); //$NON-NLS-1$ final Object keyboardFocusManager = keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod .invoke(keyboardFocusManagerClass, null); final Method keyboardFocusManagerGetFocusOwner = keyboardFocusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = keyboardFocusManagerGetFocusOwner .invoke(keyboardFocusManager, null); return focusComponent; } // Use JRE 1.3 API final Class focusManagerClass = Class .forName("javax.swing.FocusManager"); //$NON-NLS-1$ final Method focusManagerGetCurrentManagerMethod = focusManagerClass .getMethod("getCurrentManager", null); //$NON-NLS-1$ final Object focusManager = focusManagerGetCurrentManagerMethod .invoke(focusManagerClass, null); final Method focusManagerGetFocusOwner = focusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = focusManagerGetFocusOwner .invoke(focusManager, null); return focusComponent; }
16
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final IllegalAccessException e) { // The method is protected, so do // nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The method is protected, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final IllegalAccessException e) { // The method is protected, so do // nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (IllegalAccessException e) { // The method is protected, so do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (IllegalAccessException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (IllegalAccessException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalAccessException e) { WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalAccessException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalAccessException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalAccessException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (IllegalAccessException e) { // should not happen - fall through if it does }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (IllegalAccessException e) { // fall through }
// in Eclipse UI/org/eclipse/ui/themes/ColorUtil.java
catch (IllegalAccessException e) { // no op - shouldnt happen. We check for public before calling // getInt(null) }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (IllegalAccessException exception) { return null; }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (IllegalAccessException exception) { return false; }
1
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (IllegalAccessException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
1
runtime (Lib) IllegalArgumentException 150
            
// in Eclipse UI/org/eclipse/ui/preferences/WorkingCopyManager.java
public IEclipsePreferences getWorkingCopy(IEclipsePreferences original) { if (original instanceof WorkingCopyPreferences) { throw new IllegalArgumentException("Trying to get a working copy of a working copy"); //$NON-NLS-1$ } String absolutePath = original.absolutePath(); IEclipsePreferences preferences = (IEclipsePreferences) workingCopies.get(absolutePath); if (preferences == null) { preferences = new WorkingCopyPreferences(original, this); workingCopies.put(absolutePath, preferences); } return preferences; }
// in Eclipse UI/org/eclipse/ui/internal/preferences/Base64.java
static int decodeDigit(byte data) { char charData = (char) data; if (charData <= 'Z' && charData >= 'A') { return charData - 'A'; } if (charData <= 'z' && charData >= 'a') { return charData - 'a' + 26; } if (charData <= '9' && charData >= '0') { return charData - '0' + 52; } switch (charData) { case '+' : return 62; case '/' : return 63; default : throw new IllegalArgumentException("Invalid char to decode: " + data); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(final IEditorInput input, final String editorID, final boolean activate, final int matchFlags, final IMemento editorState) throws PartInitException { if (input == null || editorID == null) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditor(input, editorID, activate, matchFlags, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditorFromDescriptor(final IEditorInput input, final IEditorDescriptor editorDescriptor, final boolean activate, final IMemento editorState) throws PartInitException { if (input == null || !(editorDescriptor instanceof EditorDescriptor)) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditorFromDescriptor(input, (EditorDescriptor)editorDescriptor, activate, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(final String viewID, final String secondaryID, final int mode) throws PartInitException { if (secondaryID != null) { if (secondaryID.length() == 0 || secondaryID.indexOf(ViewFactory.ID_SEP) != -1) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalSecondaryId); } } if (!certifyMode(mode)) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalViewMode); } // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyShowView(viewID, secondaryID, mode); } catch (PartInitException e) { result[0] = e; } } }); if (result[0] instanceof IViewPart) { return (IViewPart) result[0]; } else if (result[0] instanceof PartInitException) { throw (PartInitException) result[0]; } else { throw new PartInitException(WorkbenchMessages.WorkbenchPage_AbnormalWorkbenchCondition); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void setWorkingSets(IWorkingSet[] newWorkingSets) { if (newWorkingSets != null) { WorkbenchPlugin .getDefault() .getWorkingSetManager() .addPropertyChangeListener(workingSetPropertyChangeListener); } else { WorkbenchPlugin.getDefault().getWorkingSetManager() .removePropertyChangeListener( workingSetPropertyChangeListener); } if (newWorkingSets == null) { newWorkingSets = new IWorkingSet[0]; } IWorkingSet[] oldWorkingSets = workingSets; // filter out any duplicates if necessary if (newWorkingSets.length > 1) { Set setOfSets = new HashSet(); for (int i = 0; i < newWorkingSets.length; i++) { if (newWorkingSets[i] == null) { throw new IllegalArgumentException(); } setOfSets.add(newWorkingSets[i]); } newWorkingSets = (IWorkingSet[]) setOfSets .toArray(new IWorkingSet[setOfSets.size()]); } workingSets = newWorkingSets; if (!Arrays.equals(oldWorkingSets, newWorkingSets)) { firePropertyChange(CHANGE_WORKING_SETS_REPLACE, oldWorkingSets, newWorkingSets); if (aggregateWorkingSet != null) { aggregateWorkingSet.setComponents(workingSets); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorReference[] openEditors(final IEditorInput[] inputs, final String[] editorIDs, final int matchFlags) throws MultiPartInitException { if (inputs == null) throw new IllegalArgumentException(); if (editorIDs == null) throw new IllegalArgumentException(); if (inputs.length != editorIDs.length) throw new IllegalArgumentException(); final IEditorReference[] results = new IEditorReference[inputs.length]; final PartInitException[] exceptions = new PartInitException[inputs.length]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } } }); boolean hasException = false; for(int i = 0 ; i < results.length; i++) { if (exceptions[i] != null) { hasException = true; } if (results[i] == null) { continue; } window.firePerspectiveChanged(this, getPerspective(), results[i], CHANGE_EDITOR_OPEN); } window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); if (hasException) { throw new MultiPartInitException(results, exceptions); } return results; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } }
// in Eclipse UI/org/eclipse/ui/internal/menus/ContributionRoot.java
public void addContributionItem(IContributionItem item, Expression visibleWhen) { if (item == null) throw new IllegalArgumentException(); topLevelItems.add(item); if (visibleWhen == null) visibleWhen = AlwaysEnabledExpression.INSTANCE; menuService.registerVisibleWhen(item, visibleWhen, restriction, createIdentifierId(item)); itemsToExpressions.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/menus/ContributionRoot.java
public void registerVisibilityForChild(IContributionItem item, Expression visibleWhen) { if (item == null) throw new IllegalArgumentException(); if (visibleWhen == null) visibleWhen = AlwaysEnabledExpression.INSTANCE; menuService.registerVisibleWhen(item, visibleWhen, restriction, createIdentifierId(item)); itemsToExpressions.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
public void registerVisibleWhen(final IContributionItem item, final Expression visibleWhen, final Set restriction, String identifierID) { if (item == null) { throw new IllegalArgumentException("item cannot be null"); //$NON-NLS-1$ } if (visibleWhen == null) { throw new IllegalArgumentException( "visibleWhen expression cannot be null"); //$NON-NLS-1$ } if (evaluationsByItem.get(item) != null) { final String id = item.getId(); WorkbenchPlugin.log("item is already registered: " //$NON-NLS-1$ + (id == null ? "no id" : id)); //$NON-NLS-1$ return; } IIdentifier identifier = null; if (identifierID != null) { identifier = PlatformUI.getWorkbench().getActivitySupport() .getActivityManager().getIdentifier(identifierID); } ContributionItemUpdater listener = new ContributionItemUpdater(item, identifier); if (visibleWhen != AlwaysEnabledExpression.INSTANCE) { IEvaluationReference ref = evaluationService.addEvaluationListener( visibleWhen, listener, PROP_VISIBLE); if (restriction != null) { restriction.add(ref); } evaluationsByItem.put(item, ref); } activityListenersByItem.put(item, listener); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
public final void bind(final String commandId, final int type, final String style, final ImageDescriptor descriptor) { Object[] images = (Object[]) imagesById.get(commandId); if (images == null) { images = new Object[3]; imagesById.put(commandId, images); } if ((type < 0) || (type >= images.length)) { throw new IllegalArgumentException( "The type must be one of TYPE_DEFAULT, TYPE_DISABLED and TYPE_HOVER."); //$NON-NLS-1$ } final Object typedImage = images[type]; if (style == null) { if ((typedImage == null) || (typedImage instanceof ImageDescriptor)) { images[type] = descriptor; } else if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; styleMap.put(style, descriptor); } } else { if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; styleMap.put(style, descriptor); } else if (typedImage instanceof ImageDescriptor || typedImage == null) { final Map styleMap = new HashMap(); styleMap.put(null, typedImage); styleMap.put(style, descriptor); images[type] = styleMap; } } fireManagerChanged(new CommandImageManagerEvent(this, new String[] { commandId }, type, style)); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
public final ImageDescriptor getImageDescriptor(final String commandId, final int type, final String style) { if (commandId == null) { throw new NullPointerException(); } final Object[] images = (Object[]) imagesById.get(commandId); if (images == null) { return null; } if ((type < 0) || (type >= images.length)) { throw new IllegalArgumentException( "The type must be one of TYPE_DEFAULT, TYPE_DISABLED and TYPE_HOVER."); //$NON-NLS-1$ } Object typedImage = images[type]; if (typedImage == null) { return null; } if (typedImage instanceof ImageDescriptor) { return (ImageDescriptor) typedImage; } if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; Object styledImage = styleMap.get(style); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } if (style != null) { styledImage = styleMap.get(null); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java
public final boolean registerShell(final Shell shell, final int type) { // We do not allow null shell registration. It is reserved. if (shell == null) { throw new NullPointerException("The shell was null"); //$NON-NLS-1$ } // Debugging output if (DEBUG) { final StringBuffer buffer = new StringBuffer("register shell '"); //$NON-NLS-1$ buffer.append(shell); buffer.append("' as "); //$NON-NLS-1$ switch (type) { case IContextService.TYPE_DIALOG: buffer.append("dialog"); //$NON-NLS-1$ break; case IContextService.TYPE_WINDOW: buffer.append("window"); //$NON-NLS-1$ break; case IContextService.TYPE_NONE: buffer.append("none"); //$NON-NLS-1$ break; default: buffer.append("unknown"); //$NON-NLS-1$ break; } Tracing.printTrace(TRACING_COMPONENT, buffer.toString()); } // Build the list of submissions. final List activations = new ArrayList(); Expression expression; IContextActivation dialogWindowActivation; switch (type) { case IContextService.TYPE_DIALOG: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation dialogActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG, expression, contextService); activateContext(dialogActivation); activations.add(dialogActivation); break; case IContextService.TYPE_NONE: break; case IContextService.TYPE_WINDOW: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation windowActivation = new ContextActivation( IContextService.CONTEXT_ID_WINDOW, expression, contextService); activateContext(windowActivation); activations.add(windowActivation); break; default: throw new IllegalArgumentException("The type is not recognized: " //$NON-NLS-1$ + type); } // Check to see if the activations are already present. boolean returnValue = false; final Collection previousActivations = (Collection) registeredWindows .get(shell); if (previousActivations != null) { returnValue = true; final Iterator previousActivationItr = previousActivations .iterator(); while (previousActivationItr.hasNext()) { final IContextActivation activation = (IContextActivation) previousActivationItr .next(); deactivateContext(activation); } } // Add the new submissions, and force some reprocessing to occur. registeredWindows.put(shell, activations); /* * Remember the dispose listener so that we can remove it later if we * unregister the shell. */ final DisposeListener shellDisposeListener = new DisposeListener() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) */ public void widgetDisposed(DisposeEvent e) { registeredWindows.remove(shell); if (!shell.isDisposed()) { shell.removeDisposeListener(this); } /* * In the case where a dispose has happened, we are expecting an * activation event to arrive at some point in the future. If we * process the submissions now, then we will update the * activeShell before checkWindowType is called. This means that * dialogs won't be recognized as dialogs. */ final Iterator activationItr = activations.iterator(); while (activationItr.hasNext()) { deactivateContext((IContextActivation) activationItr.next()); } } }; // Make sure the submissions will be removed in event of disposal. shell.addDisposeListener(shellDisposeListener); shell.setData(DISPOSE_LISTENER, shellDisposeListener); return returnValue; }
// in Eclipse UI/org/eclipse/ui/internal/services/ServiceLocator.java
public final void registerService(final Class api, final Object service) { if (api == null) { throw new NullPointerException("The service key cannot be null"); //$NON-NLS-1$ } if (!api.isInstance(service)) { throw new IllegalArgumentException( "The service does not implement the given interface"); //$NON-NLS-1$ } if (services == null) { services = new HashMap(); } if (services.containsKey(api)) { final Object currentService = services.remove(api); if (currentService instanceof IDisposable) { final IDisposable disposable = (IDisposable) currentService; disposable.dispose(); } } if (service == null) { if (services.isEmpty()) { services = null; } } else { services.put(api, service); if (service instanceof INestable && activated) { ((INestable)service).activate(); } } }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
public void displayContext(IContext context, int x, int y) { if (context == null) { throw new IllegalArgumentException(); } AbstractHelpUI helpUI = getHelpUI(); if (helpUI != null) { helpUI.displayContext(context, x, y); } }
// in Eclipse UI/org/eclipse/ui/internal/help/WorkbenchHelpSystem.java
public void displayHelpResource(String href) { if (href == null) { throw new IllegalArgumentException(); } AbstractHelpUI helpUI = getHelpUI(); if (helpUI != null) { helpUI.displayHelpResource(href); } }
// in Eclipse UI/org/eclipse/ui/internal/misc/StringMatcher.java
public StringMatcher.Position find(String text, int start, int end) { if (text == null) { throw new IllegalArgumentException(); } int tlen = text.length(); if (start < 0) { start = 0; } if (end > tlen) { end = tlen; } if (end < 0 || start >= end) { return null; } if (fLength == 0) { return new Position(start, start); } if (fIgnoreWildCards) { int x = posIn(text, start, end); if (x < 0) { return null; } return new Position(x, x + fLength); } int segCount = fSegments.length; if (segCount == 0) { return new Position(start, end); } int curPos = start; int matchStart = -1; int i; for (i = 0; i < segCount && curPos < end; ++i) { String current = fSegments[i]; int nextMatch = regExpPosIn(text, curPos, end, current); if (nextMatch < 0) { return null; } if (i == 0) { matchStart = nextMatch; } curPos = nextMatch + current.length(); } if (i < segCount) { return null; } return new Position(matchStart, curPos); }
// in Eclipse UI/org/eclipse/ui/internal/misc/StringMatcher.java
public boolean match(String text, int start, int end) { if (null == text) { throw new IllegalArgumentException(); } if (start > end) { return false; } if (fIgnoreWildCards) { return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength); } int segCount = fSegments.length; if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) { return true; } if (start == end) { return fLength == 0; } if (fLength == 0) { return start == end; } int tlen = text.length(); if (start < 0) { start = 0; } if (end > tlen) { end = tlen; } int tCurPos = start; int bound = end - fBound; if (bound < 0) { return false; } int i = 0; String current = fSegments[i]; int segLength = current.length(); /* process first segment */ if (!fHasLeadingStar) { if (!regExpRegionMatches(text, start, current, 0, segLength)) { return false; } else { ++i; tCurPos = tCurPos + segLength; } } if ((fSegments.length == 1) && (!fHasLeadingStar) && (!fHasTrailingStar)) { // only one segment to match, no wildcards specified return tCurPos == end; } /* process middle segments */ while (i < segCount) { current = fSegments[i]; int currentMatch; int k = current.indexOf(fSingleWildCard); if (k < 0) { currentMatch = textPosIn(text, tCurPos, end, current); if (currentMatch < 0) { return false; } } else { currentMatch = regExpPosIn(text, tCurPos, end, current); if (currentMatch < 0) { return false; } } tCurPos = currentMatch + current.length(); i++; } /* process final segment */ if (!fHasTrailingStar && tCurPos != end) { int clen = current.length(); return regExpRegionMatches(text, end - clen, current, 0, clen); } return i == segCount; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityLabelProvider.java
public String getText(Object element) { if (element instanceof String) { return getActivityText(activityManager .getActivity((String) element)); } else if (element instanceof IActivity) { return getActivityText((IActivity) element); } else { throw new IllegalArgumentException(); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditor(String editorId, IEditorInput input, boolean setVisible, IMemento editorState) throws PartInitException { if (editorId == null || input == null) { throw new IllegalArgumentException(); } IEditorDescriptor desc = getEditorRegistry().findEditor(editorId); if (desc != null && !desc.isOpenExternal() && isLargeDocument(input)) { desc = getAlternateEditor(); if (desc == null) { // the user pressed cancel in the editor selection dialog return null; } } if (desc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorId)); } IEditorReference result = openEditorFromDescriptor((EditorDescriptor) desc, input, editorState); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openSystemExternalEditor(final IPath location) throws PartInitException { if (location == null) { throw new IllegalArgumentException(); } final boolean result[] = { false }; BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { if (location != null) { result[0] = Program.launch(location.toOSString()); } } }); if (!result[0]) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unableToOpenExternalEditor, location)); } // We do not have an editor part for external editors return null; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public void declareImage(String symbolicName, ImageDescriptor descriptor, boolean shared) { if (symbolicName == null || descriptor == null) { throw new IllegalArgumentException(); } WorkbenchImages.declareImage(symbolicName, descriptor, shared); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public IWorkbenchWindowConfigurer getWindowConfigurer( IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return ((WorkbenchWindow) window).getWindowConfigurer(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public Object getData(String key) { if (key == null) { throw new IllegalArgumentException(); } return extraData.get(key); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public void setData(String key, Object data) { if (key == null) { throw new IllegalArgumentException(); } if (data != null) { extraData.put(key, data); } else { extraData.remove(key); } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void assertInstance(Object object, Class c, boolean allowNull) { if (object == null && allowNull) { return; } if (object == null || c == null) { throw new NullPointerException(); } else if (!c.isInstance(object)) { throw new IllegalArgumentException(); } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void arrayCopyWithRemoval(Object [] src, Object [] dst, int idxToRemove) { if (src == null || dst == null || src.length - 1 != dst.length || idxToRemove < 0 || idxToRemove >= src.length) { throw new IllegalArgumentException(); } if (idxToRemove == 0) { System.arraycopy(src, 1, dst, 0, src.length - 1); } else if (idxToRemove == src.length - 1) { System.arraycopy(src, 0, dst, 0, src.length - 1); } else { System.arraycopy(src, 0, dst, 0, idxToRemove); System.arraycopy(src, idxToRemove + 1, dst, idxToRemove, src.length - idxToRemove - 1); } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IPerspectiveDescriptor clonePerspective(String id, String label, IPerspectiveDescriptor originalDescriptor) { // Check for invalid labels if (label == null || !(label.trim().length() > 0)) { throw new IllegalArgumentException(); } // Check for duplicates IPerspectiveDescriptor desc = findPerspectiveWithId(id); if (desc != null) { throw new IllegalArgumentException(); } // Create descriptor. desc = new PerspectiveDescriptor(id, label, (PerspectiveDescriptor) originalDescriptor); add((PerspectiveDescriptor) desc); return desc; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorDescriptor.java
public static EditorDescriptor createForProgram(String filename) { if (filename == null) { throw new IllegalArgumentException(); } EditorDescriptor editor = new EditorDescriptor(); editor.setFileName(filename); editor.setID(filename); editor.setOpenMode(OPEN_EXTERNAL); //Isolate the program name (no directory or extension) int start = filename.lastIndexOf(File.separator); String name; if (start != -1) { name = filename.substring(start + 1); } else { name = filename; } int end = name.lastIndexOf('.'); if (end != -1) { name = name.substring(0, end); } editor.setName(name); // get the program icon without storing it in the registry ImageDescriptor imageDescriptor = new ProgramImageDescriptor(filename, 0); editor.setImageDescriptor(imageDescriptor); return editor; }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void set(Object value) { if (value != Boolean.TRUE && value != Boolean.FALSE) throw new IllegalArgumentException(); super.set(value); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void set(Object value) { if (value != Boolean.TRUE && value != Boolean.FALSE) throw new IllegalArgumentException(); if (value == Boolean.TRUE && ((Boolean)startupThread.get()).booleanValue()) { throw new IllegalStateException(); } super.set(value); }
// in Eclipse UI/org/eclipse/ui/internal/AbstractWorkingSetManager.java
public void setRecentWorkingSetsLength(int length) { if (length < 1 || length > 99) throw new IllegalArgumentException("Invalid recent working sets length: " + length); //$NON-NLS-1$ IPreferenceStore store = PrefUtil.getAPIPreferenceStore(); store.setValue(IWorkbenchPreferenceConstants.RECENTLY_USED_WORKINGSETS_SIZE, length); // adjust length sizeRecentWorkingSets(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public void setTitle(String title) { if (title == null) { throw new IllegalArgumentException(); } windowTitle = title; Shell shell = window.getShell(); if (shell != null && !shell.isDisposed()) { shell.setText(TextProcessor.process(title, WorkbenchWindow.TEXT_DELIMITERS)); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public Object getData(String key) { if (key == null) { throw new IllegalArgumentException(); } return extraData.get(key); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public void setData(String key, Object data) { if (key == null) { throw new IllegalArgumentException(); } if (data != null) { extraData.put(key, data); } else { extraData.remove(key); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public void setPresentationFactory(AbstractPresentationFactory factory) { if (factory == null) { throw new IllegalArgumentException(); } presentationFactory = factory; }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
public static ImageDescriptor imageDescriptorFromPlugin(String pluginId, String imageFilePath) { if (pluginId == null || imageFilePath == null) { throw new IllegalArgumentException(); } IWorkbench workbench = PlatformUI.isWorkbenchRunning() ? PlatformUI.getWorkbench() : null; ImageDescriptor imageDescriptor = workbench == null ? null : workbench .getSharedImages().getImageDescriptor(imageFilePath); if (imageDescriptor != null) return imageDescriptor; // found in the shared images // if the bundle is not ready then there is no image Bundle bundle = Platform.getBundle(pluginId); if (!BundleUtility.isReady(bundle)) { return null; } // look for the image (this will check both the plugin and fragment folders URL fullPathString = BundleUtility.find(bundle, imageFilePath); if (fullPathString == null) { try { fullPathString = new URL(imageFilePath); } catch (MalformedURLException e) { return null; } } return ImageDescriptor.createFromURL(fullPathString); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(final IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } CommandContributionItemParameter parameter = new CommandContributionItemParameter( window, COMMAND_ID, COMMAND_ID, null, WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR), WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR_DISABLED), null, null, null, null, CommandContributionItem.STYLE_CHECK, null, false); final IPropertyChangeListener[] perfs = new IPropertyChangeListener[1]; final IPartListener partListener = new IPartListener() { public void partOpened(IWorkbenchPart part) { } public void partDeactivated(IWorkbenchPart part) { } public void partClosed(IWorkbenchPart part) { } public void partBroughtToTop(IWorkbenchPart part) { if (!(part instanceof IEditorPart)) { return; } ICommandService commandService = (ICommandService) window .getService(ICommandService.class); commandService.refreshElements(COMMAND_ID, null); } public void partActivated(IWorkbenchPart part) { } }; window.getPartService().addPartListener(partListener); final CommandContributionItem action = new CommandContributionItem( parameter) { public void dispose() { WorkbenchPlugin.getDefault().getPreferenceStore() .removePropertyChangeListener(perfs[0]); window.getPartService().removePartListener(partListener); super.dispose(); } }; perfs[0] = new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals( IPreferenceConstants.REUSE_EDITORS_BOOLEAN)) { if (action.getParent() != null) { IPreferenceStore store = WorkbenchPlugin .getDefault().getPreferenceStore(); boolean reuseEditors = store .getBoolean(IPreferenceConstants.REUSE_EDITORS_BOOLEAN) || ((TabBehaviour) Tweaklets .get(TabBehaviour.KEY)) .alwaysShowPinAction(); action.setVisible(reuseEditors); action.getParent().markDirty(); if (window.getShell() != null && !window.getShell().isDisposed()) { // this property change notification could be // from a non-ui thread window.getShell().getDisplay().syncExec( new Runnable() { public void run() { action.getParent() .update(false); } }); } } } } }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new SwitchToWindowMenu(window, getId(), true); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new ShowViewMenu(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } ShowInMenu showInMenu = new ShowInMenu(); showInMenu.setId(getId()); showInMenu.initialize(window); return showInMenu; }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new ReopenEditorMenu(window, getId(), true); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new ChangeToPerspectiveMenu(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new BaseNewWizardMenu(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ContributionItemFactory.java
public IContributionItem create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } return new HelpSearchContributionItem(window, getId()); }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); IProduct product = Platform.getProduct(); String productName = null; if (product != null) { productName = product.getName(); } if (productName == null) { productName = ""; //$NON-NLS-1$ } action.setText(NLS.bind(WorkbenchMessages.AboutAction_text, productName)); action.setToolTipText(NLS.bind( WorkbenchMessages.AboutAction_toolTip, productName)); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.ABOUT_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ActivateEditorAction_text); action .setToolTipText(WorkbenchMessages.ActivateEditorAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(), WorkbenchMessages.Workbench_back); action.setToolTipText(WorkbenchMessages.Workbench_backToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new NavigationHistoryAction(window, false); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseEditorAction_text); action.setToolTipText(WorkbenchMessages.CloseEditorAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseAllAction_text); action.setToolTipText(WorkbenchMessages.CloseAllAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseOthersAction_text); action.setToolTipText(WorkbenchMessages.CloseOthersAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CloseAllPerspectivesAction_text); action.setToolTipText(WorkbenchMessages.CloseAllPerspectivesAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CLOSE_ALL_PAGES_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new CloseAllSavedAction(window); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages. ClosePerspectiveAction_text); action.setToolTipText(WorkbenchMessages. ClosePerspectiveAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CLOSE_PAGE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(IntroMessages.Intro_action_text); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.INTRO_ACTION); IntroDescriptor introDescriptor = ((Workbench) window.getWorkbench()) .getIntroDescriptor(); if (introDescriptor != null) action.setImageDescriptor(introDescriptor.getImageDescriptor()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_copy); action.setToolTipText(WorkbenchMessages.Workbench_copyToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_cut); action.setToolTipText(WorkbenchMessages.Workbench_cutToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_CUT)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_delete); action.setToolTipText(WorkbenchMessages.Workbench_deleteToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); action.enableAccelerator(false); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.DELETE_RETARGET_ACTION); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); action .setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.EditActionSetsAction_text); action.setToolTipText(WorkbenchMessages.EditActionSetsAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.EDIT_ACTION_SETS_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ExportResourcesAction_fileMenuText); action.setToolTipText(WorkbenchMessages.ExportResourcesAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.EXPORT_ACTION); action.setImageDescriptor(WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_EXPORT_WIZ)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_findReplace); action.setToolTipText(WorkbenchMessages.Workbench_findReplaceToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); // Find's images are commented out due to a conflict with Search. // See bug 16412. // action.setImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC)); // action.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_SEARCH_SRC_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_forward); action.setToolTipText(WorkbenchMessages.Workbench_forwardToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new NavigationHistoryAction(window, true); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_goInto); action.setToolTipText(WorkbenchMessages.Workbench_goIntoToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ImportResourcesAction_text); action.setToolTipText(WorkbenchMessages.ImportResourcesAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.IMPORT_ACTION); action.setImageDescriptor(WorkbenchImages .getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_IMPORT_WIZ)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.LockToolBarAction_text); action.setToolTipText(WorkbenchMessages.LockToolBarAction_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.LOCK_TOOLBAR_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setToolTipText(WorkbenchMessages.MaximizePartAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.MAXIMIZE_PART_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setToolTipText(WorkbenchMessages.MinimizePartAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.MINIMIZE_PART_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_move); action.setToolTipText(WorkbenchMessages.Workbench_moveToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); ISharedImages images = window.getWorkbench().getSharedImages(); action.setImageDescriptor(images .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); action.setDisabledImageDescriptor(images .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED)); action.setText(WorkbenchMessages.NewWizardAction_text); action.setToolTipText(WorkbenchMessages.NewWizardAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.NEW_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new NewWizardDropDownAction(window); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_next); action.setToolTipText(WorkbenchMessages.Workbench_nextToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CycleEditorAction_next_text); action.setToolTipText(WorkbenchMessages.CycleEditorAction_next_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_EDITOR_FORWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePartAction_next_text); action.setToolTipText(WorkbenchMessages.CyclePartAction_next_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PART_FORWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePerspectiveAction_next_text); action.setToolTipText(WorkbenchMessages.CyclePerspectiveAction_next_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PERSPECTIVE_FORWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.OpenInNewWindowAction_text); action.setToolTipText(WorkbenchMessages.OpenInNewWindowAction_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.OPEN_NEW_WINDOW_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_paste); action.setToolTipText(WorkbenchMessages.Workbench_pasteToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.OpenPreferences_text); action.setToolTipText(WorkbenchMessages.OpenPreferences_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.OPEN_PREFERENCES_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_previous); action.setToolTipText(WorkbenchMessages.Workbench_previousToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CycleEditorAction_prev_text); action.setToolTipText(WorkbenchMessages.CycleEditorAction_prev_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_EDITOR_BACKWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePartAction_prev_text); action.setToolTipText(WorkbenchMessages.CyclePartAction_prev_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PART_BACKWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.CyclePerspectiveAction_prev_text); action.setToolTipText(WorkbenchMessages.CyclePerspectiveAction_prev_toolTip); // @issue missing action ids window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.CYCLE_PERSPECTIVE_BACKWARD_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_print); action.setToolTipText(WorkbenchMessages.Workbench_printToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); action .setImageDescriptor(WorkbenchImages .getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT)); action .setDisabledImageDescriptor(WorkbenchImages .getImageDescriptor(ISharedImages.IMG_ETOOL_PRINT_EDIT_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_properties); action.setToolTipText(WorkbenchMessages.Workbench_propertiesToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.Exit_text); action.setToolTipText(WorkbenchMessages.Exit_toolTip); window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.QUIT_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } LabelRetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_redo); action.setToolTipText(WorkbenchMessages.Workbench_redoToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_REDO)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_refresh); action.setToolTipText(WorkbenchMessages.Workbench_refreshToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_rename); action.setToolTipText(WorkbenchMessages.Workbench_renameToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ResetPerspective_text); action.setToolTipText(WorkbenchMessages.ResetPerspective_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.RESET_PERSPECTIVE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_revert); action.setToolTipText(WorkbenchMessages.Workbench_revertToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setText(WorkbenchMessages.SaveAction_text); action.setToolTipText(WorkbenchMessages.SaveAction_toolTip); action.setId(getId()); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction(getCommandId(), window); action.setText(WorkbenchMessages.SaveAll_text); action.setToolTipText(WorkbenchMessages.SaveAll_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_ALL_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new WorkbenchCommandAction(getCommandId(), window); action.setText(WorkbenchMessages.SaveAs_text); action.setToolTipText(WorkbenchMessages.SaveAs_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_AS_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.SavePerspective_text); action.setToolTipText(WorkbenchMessages.SavePerspective_toolTip); window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.SAVE_PERSPECTIVE_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new RetargetAction(getId(),WorkbenchMessages.Workbench_selectAll); action.setToolTipText(WorkbenchMessages.Workbench_selectAllToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } IWorkbenchAction action = new ToggleEditorsVisibilityAction(window); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.switchToEditor", window); //$NON-NLS-1$ action.setId(getId()); action.setText(WorkbenchMessages.WorkbenchEditorsAction_label); // @issue missing action id window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.WORKBENCH_EDITORS_ACTION); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction("org.eclipse.ui.window.openEditorDropDown", window); //$NON-NLS-1$ action.setId(getId()); action.setText(WorkbenchMessages.WorkbookEditorsAction_label); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action=new WorkbenchCommandAction("org.eclipse.ui.window.showSystemMenu",window); //$NON-NLS-1$ action.setId(getId()); action.setText(WorkbenchMessages.ShowPartPaneMenuAction_text); action.setToolTipText(WorkbenchMessages.ShowPartPaneMenuAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.ShowViewMenuAction_text); action.setToolTipText(WorkbenchMessages.ShowViewMenuAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } LabelRetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_undo); action.setToolTipText(WorkbenchMessages.Workbench_undoToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); ISharedImages sharedImages = window.getWorkbench() .getSharedImages(); action.setImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO)); action.setDisabledImageDescriptor(sharedImages .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } RetargetAction action = new LabelRetargetAction(getId(),WorkbenchMessages.Workbench_up); action.setToolTipText(WorkbenchMessages.Workbench_upToolTip); window.getPartService().addPartListener(action); action.setActionDefinitionId(getCommandId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); // support for allowing a product to override the text for the // action String overrideText = PrefUtil.getAPIPreferenceStore().getString( IWorkbenchPreferenceConstants.HELP_CONTENTS_ACTION_TEXT); if ("".equals(overrideText)) { //$NON-NLS-1$ action.setText(WorkbenchMessages.HelpContentsAction_text); action.setToolTipText(WorkbenchMessages.HelpContentsAction_toolTip); } else { action.setText(overrideText); action.setToolTipText(Action.removeMnemonics(overrideText)); } window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.HELP_CONTENTS_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); // support for allowing a product to override the text for the // action String overrideText = PrefUtil.getAPIPreferenceStore().getString( IWorkbenchPreferenceConstants.HELP_SEARCH_ACTION_TEXT); if ("".equals(overrideText)) { //$NON-NLS-1$ action.setText(WorkbenchMessages.HelpSearchAction_text); action.setToolTipText(WorkbenchMessages.HelpSearchAction_toolTip); } else { action.setText(overrideText); action.setToolTipText(Action.removeMnemonics(overrideText)); } window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.HELP_SEARCH_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window); // support for allowing a product to override the text for the // action String overrideText = PrefUtil.getAPIPreferenceStore().getString( IWorkbenchPreferenceConstants.DYNAMIC_HELP_ACTION_TEXT); if ("".equals(overrideText)) { //$NON-NLS-1$ action.setText(WorkbenchMessages.DynamicHelpAction_text); action.setToolTipText(WorkbenchMessages.DynamicHelpAction_toolTip); } else { action.setText(overrideText); action.setToolTipText(Action.removeMnemonics(overrideText)); } window.getWorkbench().getHelpSystem() .setHelp(action, IWorkbenchHelpContextIds.DYNAMIC_HELP_ACTION); action.setId(getId()); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.OpenPerspectiveDialogAction_text); action.setToolTipText(WorkbenchMessages.OpenPerspectiveDialogAction_tooltip); action.setImageDescriptor(WorkbenchImages.getImageDescriptor( IWorkbenchGraphicConstants.IMG_ETOOL_NEW_PAGE)); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( getCommandId(), window); action.setId(getId()); action.setText(WorkbenchMessages.NewEditorAction_text); action.setToolTipText(WorkbenchMessages.NewEditorAction_tooltip); return action; }
// in Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
public IWorkbenchAction create(IWorkbenchWindow window) { if (window == null) { throw new IllegalArgumentException(); } WorkbenchCommandAction action = new WorkbenchCommandAction( "org.eclipse.ui.ToggleCoolbarAction", window); //$NON-NLS-1$ action.setId(getId()); // set the default text - this will be updated by the handler action.setText(WorkbenchMessages.ToggleCoolbarVisibilityAction_hide_text); action.setToolTipText(WorkbenchMessages.ToggleCoolbarVisibilityAction_toolTip); return action; }
// in Eclipse UI/org/eclipse/ui/MultiPartInitException.java
private static int findSingleException(PartInitException[] exceptions) { int index = -1; for (int i = 0; i < exceptions.length; i++) { if (exceptions[i] != null) { if (index == -1) { index = i; } else throw new IllegalArgumentException(); } } if (index == -1) { throw new IllegalArgumentException(); } return index; }
0 3
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Shell getSplashShell(Display display) throws NumberFormatException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { Shell splashShell = (Shell) display.getData(DATA_SPLASH_SHELL); if (splashShell != null) return splashShell; String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); if (splashHandle == null) { return null; } // look for the 32 bit internal_new shell method try { Method method = Shell.class.getMethod( "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ // we're on a 32 bit platform so invoke it with splash // handle as an int splashShell = (Shell) method.invoke(null, new Object[] { display, new Integer(splashHandle) }); } catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } } display.setData(DATA_SPLASH_SHELL, splashShell); return splashShell; }
16
            
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plugin \'" //$NON-NLS-1$ + menuElement.getContributor().getName() + "\' invalid Menu Extension (Group \'" //$NON-NLS-1$ + group + "\' is missing): " + id); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() + "' contributed an invalid Menu Extension (Group: '" + mgroup + "' is missing): " + ad.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
// in Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java
catch (IllegalArgumentException e) { WorkbenchPlugin .log("Plug-in '" + ad.getPluginId() //$NON-NLS-1$ + "' invalid Toolbar Extension (Group \'" //$NON-NLS-1$ + tgroup + "\' is missing): " + ad.getId()); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final IllegalArgumentException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement, commandId, "keySequence", //$NON-NLS-1$ keySequenceText); return null; }
// in Eclipse UI/org/eclipse/ui/internal/menus/LegacyActionPersistence.java
catch (IllegalArgumentException e) { addWarning(warningsToLog, "invalid keybinding: " + e.getMessage(), element, //$NON-NLS-1$ command.getCommand().getId()); }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (IllegalArgumentException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/TriggerPointAdvisorRegistry.java
catch (IllegalArgumentException e) { // log an error since its not safe to open a dialog here WorkbenchPlugin.log( "invalid trigger point advisor extension", //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e .getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutTextManager.java
catch (IllegalArgumentException ex) { // leave value as -1 }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalArgumentException e) { throw e; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalArgumentException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalArgumentException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (IllegalArgumentException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
catch (IllegalArgumentException e) { m.add(item); }
// in Eclipse UI/org/eclipse/ui/internal/FastViewPane.java
catch (IllegalArgumentException e) { m.add(item); }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (IllegalArgumentException e) { //fall through }
// in Eclipse UI/org/eclipse/ui/themes/ColorUtil.java
catch (IllegalArgumentException e) { // no op - shouldnt happen. We check for static before calling // getInt(null) }
1
            
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (IllegalArgumentException e) { throw e; }
0
runtime (Lib) IllegalStateException 18
            
// in Eclipse UI/org/eclipse/ui/PlatformUI.java
public static IWorkbench getWorkbench() { if (Workbench.getInstance() == null) { // app forgot to call createAndRunWorkbench beforehand throw new IllegalStateException(WorkbenchMessages.PlatformUI_NoWorkbench); } return Workbench.getInstance(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
private void checkRemoved() { if (removed) { String message = "Preference node: " + absolutePath() + " has been removed."; //$NON-NLS-1$ //$NON-NLS-2$ throw new IllegalStateException(message); } }
// in Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
private static AbstractExpression createExpression( IConfigurationElement element) throws IllegalStateException { String tag = element.getName(); if (tag.equals(EXP_TYPE_OR)) { return new OrExpression(element); } if (tag.equals(EXP_TYPE_AND)) { return new AndExpression(element); } if (tag.equals(EXP_TYPE_NOT)) { return new NotExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_STATE)) { return new ObjectStateExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_CLASS)) { return new ObjectClassExpression(element); } if (tag.equals(EXP_TYPE_PLUG_IN_STATE)) { return new PluginStateExpression(element); } if (tag.equals(EXP_TYPE_SYSTEM_PROPERTY)) { return new SystemPropertyExpression(element); } throw new IllegalStateException( "Action expression unrecognized element: " + tag); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
public boolean isSigned() throws IllegalStateException { if (isSignedDetermined) return isSigned; BundleContext bundleContext = WorkbenchPlugin.getDefault() .getBundleContext(); ServiceReference factoryRef = bundleContext .getServiceReference(SignedContentFactory.class.getName()); if (factoryRef == null) throw new IllegalStateException(); SignedContentFactory contentFactory = (SignedContentFactory) bundleContext .getService(factoryRef); try { isSignedDetermined = true; SignedContent signedContent = contentFactory.getSignedContent(bundle); isSigned = signedContent != null && signedContent.isSigned(); } catch (IOException e) { isSigned = false; } catch (GeneralSecurityException e){ isSigned = false; } finally { bundleContext.ungetService(factoryRef); } return isSigned; }
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
private void constructElements(boolean fireEvent) { if (inElementConstruction) { String msg = NLS.bind(WorkbenchMessages.ProblemCyclicDependency, getName()); WorkbenchPlugin.log(msg); throw new IllegalStateException(msg); } inElementConstruction = true; try { Set elements = new HashSet(); IWorkingSet[] localComponents = getComponentsInternal(); for (int i = 0; i < localComponents.length; i++) { IWorkingSet workingSet = localComponents[i]; try { IAdaptable[] componentElements = workingSet.getElements(); elements.addAll(Arrays.asList(componentElements)); } catch (IllegalStateException e) { // an invalid component; remove it IWorkingSet[] tmp = new IWorkingSet[components.length - 1]; if (i > 0) System.arraycopy(components, 0, tmp, 0, i); if (components.length - i - 1 > 0) System.arraycopy(components, i + 1, tmp, i, components.length - i - 1); components = tmp; workingSetMemento = null; // toss cached info fireWorkingSetChanged(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); continue; } } internalSetElements((IAdaptable[]) elements .toArray(new IAdaptable[elements.size()])); if (fireEvent) { fireWorkingSetChanged( IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); } } finally { inElementConstruction = false; } }
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
void restoreWorkingSet() { IWorkingSetManager manager = getManager(); if (manager == null) { throw new IllegalStateException(); } IMemento[] workingSetReferences = workingSetMemento .getChildren(IWorkbenchConstants.TAG_WORKING_SET); ArrayList list = new ArrayList(workingSetReferences.length); for (int i = 0; i < workingSetReferences.length; i++) { IMemento setReference = workingSetReferences[i]; String setId = setReference.getID(); IWorkingSet set = manager.getWorkingSet(setId); if (set != null) { list.add(set); } } internalSetComponents((IWorkingSet[]) list .toArray(new IWorkingSet[list.size()])); constructElements(false); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void set(Object value) { if (value != Boolean.TRUE && value != Boolean.FALSE) throw new IllegalArgumentException(); if (value == Boolean.TRUE && ((Boolean)startupThread.get()).booleanValue()) { throw new IllegalStateException(); } super.set(value); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
public void started() { synchronized (this) { if (!isStarting) throw new IllegalStateException(); isStarting = false; for (Iterator i = pendingStartup.iterator(); i.hasNext();) { Runnable runnable = (Runnable) i.next(); try { //queue up all pending asyncs super.asyncExec(runnable); } catch (RuntimeException e) { // do nothing } } pendingStartup = null; // wake up all pending syncExecs this.notifyAll(); } }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
public final void internalBasicInitialize(IWorkbenchConfigurer configurer) { if (workbenchConfigurer != null) { throw new IllegalStateException(); } this.workbenchConfigurer = configurer; initialize(configurer); }
0 14
            
// in Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
private static AbstractExpression createExpression( IConfigurationElement element) throws IllegalStateException { String tag = element.getName(); if (tag.equals(EXP_TYPE_OR)) { return new OrExpression(element); } if (tag.equals(EXP_TYPE_AND)) { return new AndExpression(element); } if (tag.equals(EXP_TYPE_NOT)) { return new NotExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_STATE)) { return new ObjectStateExpression(element); } if (tag.equals(EXP_TYPE_OBJECT_CLASS)) { return new ObjectClassExpression(element); } if (tag.equals(EXP_TYPE_PLUG_IN_STATE)) { return new PluginStateExpression(element); } if (tag.equals(EXP_TYPE_SYSTEM_PROPERTY)) { return new SystemPropertyExpression(element); } throw new IllegalStateException( "Action expression unrecognized element: " + tag); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
public void closeTray() throws IllegalStateException { if (getTray() != null) { super.closeTray(); } //preserve state during modality switch if (!getBooleanValue(IStatusDialogConstants.MODALITY_SWITCH)) { dialogState.put(IStatusDialogConstants.TRAY_OPENED, Boolean.FALSE); } if (launchTrayLink != null && !launchTrayLink.isDisposed()) { launchTrayLink.setEnabled(providesSupport() && !getBooleanValue(IStatusDialogConstants.TRAY_OPENED)); } }
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
public void openTray(DialogTray tray) throws IllegalStateException, UnsupportedOperationException { if (launchTrayLink != null && !launchTrayLink.isDisposed()) { launchTrayLink.setEnabled(false); } if (providesSupport()) { super.openTray(tray); } dialogState.put(IStatusDialogConstants.TRAY_OPENED, Boolean.TRUE); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutBundleData.java
public boolean isSigned() throws IllegalStateException { if (isSignedDetermined) return isSigned; BundleContext bundleContext = WorkbenchPlugin.getDefault() .getBundleContext(); ServiceReference factoryRef = bundleContext .getServiceReference(SignedContentFactory.class.getName()); if (factoryRef == null) throw new IllegalStateException(); SignedContentFactory contentFactory = (SignedContentFactory) bundleContext .getService(factoryRef); try { isSignedDetermined = true; SignedContent signedContent = contentFactory.getSignedContent(bundle); isSigned = signedContent != null && signedContent.isSigned(); } catch (IOException e) { isSigned = false; } catch (GeneralSecurityException e){ isSigned = false; } finally { bundleContext.ungetService(factoryRef); } return isSigned; }
6
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (IllegalStateException e) { // This occurs if -data=@none is explicitly specified, so ignore this silently. // Is this OK? See bug 85071. return null; }
// in Eclipse UI/org/eclipse/ui/internal/ActionExpression.java
catch (IllegalStateException e) { e.printStackTrace(); root = null; }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutPluginsPage.java
catch (IllegalStateException e) { // the bundle we're testing has been unloaded. Do // nothing. }
// in Eclipse UI/org/eclipse/ui/internal/AggregateWorkingSet.java
catch (IllegalStateException e) { // an invalid component; remove it IWorkingSet[] tmp = new IWorkingSet[components.length - 1]; if (i > 0) System.arraycopy(components, 0, tmp, 0, i); if (components.length - i - 1 > 0) System.arraycopy(components, i + 1, tmp, i, components.length - i - 1); components = tmp; workingSetMemento = null; // toss cached info fireWorkingSetChanged(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null); continue; }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IllegalStateException e) { // spec'ed to ignore problems }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (IllegalStateException e) { // This occurs if -data=@none is explicitly specified, so ignore this silently. // Is this OK? See bug 85071. return null; }
0 0
unknown (Lib) InstantiationException 0 0 0 1
            
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (InstantiationException exception) { return null; }
0 0
unknown (Lib) InterruptedException 2
            
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void runInUI(final IRunnableContext context, final IRunnableWithProgress runnable, final ISchedulingRule rule) throws InvocationTargetException, InterruptedException { final RunnableWithStatus runnableWithStatus = new RunnableWithStatus( context, runnable, rule); final Display display = Display.getDefault(); display.syncExec(new Runnable() { public void run() { BusyIndicator.showWhile(display, runnableWithStatus); } }); IStatus status = runnableWithStatus.getStatus(); if (!status.isOK()) { Throwable exception = status.getException(); if (exception instanceof InvocationTargetException) throw (InvocationTargetException) exception; else if (exception instanceof InterruptedException) throw (InterruptedException) exception; else // should be OperationCanceledException throw new InterruptedException(exception.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/Semaphore.java
public synchronized boolean acquire(long delay) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } long start = System.currentTimeMillis(); long timeLeft = delay; while (true) { if (notifications > 0) { notifications--; return true; } if (timeLeft <= 0) { return false; } wait(timeLeft); timeLeft = start + delay - System.currentTimeMillis(); } }
0 14
            
// in Eclipse UI/org/eclipse/ui/preferences/WizardPropertyPage.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); dialog.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IEditorPart busyOpenEditorBatched(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { // If an editor already exists for the input, use it. IEditorPart editor = null; // Reuse an existing open editor, unless we are in "new editor tab management" mode editor = getEditorManager().findEditor(editorID, input, ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).getReuseEditorMatchFlags(matchFlags)); if (editor != null) { if (IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID.equals(editorID)) { if (editor.isDirty()) { MessageDialog dialog = new MessageDialog( getWorkbenchWindow().getShell(), WorkbenchMessages.Save, null, // accept the default window icon NLS.bind(WorkbenchMessages.WorkbenchPage_editorAlreadyOpenedMsg, input.getName()), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; int saveFile = dialog.open(); if (saveFile == 0) { try { final IEditorPart editorToSave = editor; getWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); } }); } catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); } catch (InterruptedException e) { return null; } } else if (saveFile == 2) { return null; } } } else { // do the IShowEditorInput notification before showing the editor // to reduce flicker if (editor instanceof IShowEditorInput) { ((IShowEditorInput) editor).showEditorInput(input); } showEditor(activate, editor); return editor; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
static boolean runProgressMonitorOperation(String opName, final IRunnableWithProgress progressOp, final IRunnableContext runnableContext, final IShellProvider shellProvider) { final boolean[] success = new boolean[] { false }; IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; } }; try { runnableContext.run(false, true, runnable); } catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure } catch (InterruptedException e) { // The user pressed cancel. Fall through to return failure } catch (OperationCanceledException e) { // The user pressed cancel. Fall through to return failure } return success[0]; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public static boolean waitForBackgroundSaveJobs(final List modelsToSave) { // block if any of the saveables is still saving in the background try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InterruptedException { Job.getJobManager().join(new DynamicFamily(modelsToSave), monitor); } }); } catch (InvocationTargetException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); } catch (InterruptedException e) { return true; } // remove saveables that are no longer dirty from the list for (Iterator it = modelsToSave.iterator(); it.hasNext();) { Saveable model = (Saveable) it.next(); if (!model.isDirty()) { it.remove(); } } return false; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public void run(IProgressMonitor monitor) throws InterruptedException { Job.getJobManager().join(new DynamicFamily(modelsToSave), monitor); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorJobsDialog.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { //if it is run in the UI Thread don't do anything. if (!fork) { enableDetails(false); } super.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void busyCursorWhile(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void runInUI(IRunnableContext context, IRunnableWithProgress runnable, ISchedulingRule rule) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().runInUI(context, runnable, rule); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void busyCursorWhile(final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( ProgressManagerUtil.getDefaultParent()); dialog.setOpenOnRun(false); final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; // show a busy cursor until the dialog opens Runnable dialogWaitRunnable = new Runnable() { public void run() { try { dialog.setOpenOnRun(false); setUserInterfaceActive(false); dialog.run(true, true, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0] = e; } finally { setUserInterfaceActive(true); } } }; busyCursorWhile(dialogWaitRunnable, dialog); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { if (fork == false || cancelable == false) { // backward compatible code final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( null); dialog.run(fork, cancelable, runnable); return; } busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void runInUI(final IRunnableContext context, final IRunnableWithProgress runnable, final ISchedulingRule rule) throws InvocationTargetException, InterruptedException { final RunnableWithStatus runnableWithStatus = new RunnableWithStatus( context, runnable, rule); final Display display = Display.getDefault(); display.syncExec(new Runnable() { public void run() { BusyIndicator.showWhile(display, runnableWithStatus); } }); IStatus status = runnableWithStatus.getStatus(); if (!status.isOK()) { Throwable exception = status.getException(); if (exception instanceof InvocationTargetException) throw (InvocationTargetException) exception; else if (exception instanceof InterruptedException) throw (InterruptedException) exception; else // should be OperationCanceledException throw new InterruptedException(exception.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/Semaphore.java
public synchronized boolean acquire(long delay) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } long start = System.currentTimeMillis(); long timeLeft = delay; while (true) { if (notifications > 0) { notifications--; return true; } if (timeLeft <= 0) { return false; } wait(timeLeft); timeLeft = start + delay - System.currentTimeMillis(); } }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
public void run(final boolean fork, final boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; Runnable dialogWaitRunnable = new Runnable() { public void run() { try { TimeTriggeredProgressMonitorDialog.super.run(fork, cancelable, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0]= e; } } }; final Display display = PlatformUI.getWorkbench().getDisplay(); if (display == null) { return; } //show a busy cursor until the dialog opens BusyIndicator.showWhile(display, dialogWaitRunnable); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { IWorkbenchContextSupport contextSupport = getWorkbench() .getContextSupport(); final boolean keyFilterEnabled = contextSupport.isKeyFilterEnabled(); Control fastViewBarControl = getFastViewBar() == null ? null : getFastViewBar().getControl(); boolean fastViewBarWasEnabled = fastViewBarControl == null ? false : fastViewBarControl.getEnabled(); Control perspectiveBarControl = getPerspectiveBar() == null ? null : getPerspectiveBar().getControl(); boolean perspectiveBarWasEnabled = perspectiveBarControl == null ? false : perspectiveBarControl.getEnabled(); // Cache for any disabled trim controls List disabledControls = null; try { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(false); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(false); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(false); } // Disable all trim -except- the StatusLine if (defaultLayout != null) disabledControls = defaultLayout.disableTrim(getStatusLineTrim()); super.run(fork, cancelable, runnable); } finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); } }
17
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InterruptedException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (InterruptedException e) { openWebBrowserError(d); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (InterruptedException e) { log(e); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InterruptedException e) { // The user pressed cancel. Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InterruptedException e) { return true; }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/testing/WorkbenchTestable.java
catch (InterruptedException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java
catch (InterruptedException e) { // Do not log as this is a common operation from the // lock listener }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InterruptedException e) { interrupt[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InterruptedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/AnimationEngine.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
catch (InterruptedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (InterruptedException e) { // Operation was cancelled and acknowledged by runnable with this // exception. Do nothing. return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
catch (InterruptedException e) { interrupt[0]= e; }
// in Eclipse UI/org/eclipse/ui/internal/decorators/DecorationScheduler.java
catch (InterruptedException e) { // Cancel and try again if there was an error schedule(); return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (InterruptedException e) { // Operation was cancelled and acknowledged by runnable with this // exception. // Do nothing. }
0 0
unknown (Lib) InvalidRegistryObjectException 0 0 0 2
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionDelegateHandlerProxy.java
catch (InvalidRegistryObjectException e) { buffer.append(actionId); }
// in Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java
catch (InvalidRegistryObjectException e) { visWhenMap.put(configElement, null); // TODO Auto-generated catch block e.printStackTrace(); }
0 0
unknown (Lib) InvalidSyntaxException 0 0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (InvalidSyntaxException e) { return null; }
0 0
unknown (Lib) InvocationTargetException 1
            
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
public void run(IProgressMonitor pm) throws InvocationTargetException { try { runCommand(pm); } catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); } }
1
            
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); }
16
            
// in Eclipse UI/org/eclipse/ui/preferences/WizardPropertyPage.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); dialog.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Shell getSplashShell(Display display) throws NumberFormatException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { Shell splashShell = (Shell) display.getData(DATA_SPLASH_SHELL); if (splashShell != null) return splashShell; String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); if (splashHandle == null) { return null; } // look for the 32 bit internal_new shell method try { Method method = Shell.class.getMethod( "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ // we're on a 32 bit platform so invoke it with splash // handle as an int splashShell = (Shell) method.invoke(null, new Object[] { display, new Integer(splashHandle) }); } catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } } display.setData(DATA_SPLASH_SHELL, splashShell); return splashShell; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IEditorPart busyOpenEditorBatched(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { // If an editor already exists for the input, use it. IEditorPart editor = null; // Reuse an existing open editor, unless we are in "new editor tab management" mode editor = getEditorManager().findEditor(editorID, input, ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).getReuseEditorMatchFlags(matchFlags)); if (editor != null) { if (IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID.equals(editorID)) { if (editor.isDirty()) { MessageDialog dialog = new MessageDialog( getWorkbenchWindow().getShell(), WorkbenchMessages.Save, null, // accept the default window icon NLS.bind(WorkbenchMessages.WorkbenchPage_editorAlreadyOpenedMsg, input.getName()), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; int saveFile = dialog.open(); if (saveFile == 0) { try { final IEditorPart editorToSave = editor; getWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); } }); } catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); } catch (InterruptedException e) { return null; } } else if (saveFile == 2) { return null; } } } else { // do the IShowEditorInput notification before showing the editor // to reduce flicker if (editor instanceof IShowEditorInput) { ((IShowEditorInput) editor).showEditorInput(input); } showEditor(activate, editor); return editor; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected void swingInvokeLater(Runnable methodRunnable) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final Class swingUtilitiesClass = Class .forName("javax.swing.SwingUtilities"); //$NON-NLS-1$ final Method swingUtilitiesInvokeLaterMethod = swingUtilitiesClass .getMethod("invokeLater", //$NON-NLS-1$ new Class[] { Runnable.class }); swingUtilitiesInvokeLaterMethod.invoke(swingUtilitiesClass, new Object[] { methodRunnable }); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected Object getFocusComponent() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { /* * Before JRE 1.4, one has to use * javax.swing.FocusManager.getCurrentManager().getFocusOwner(). Since * JRE 1.4, one has to use * java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager * ().getFocusOwner(); the use of the older API would install a * LegacyGlueFocusTraversalPolicy which causes endless recursions in * some situations. */ Class keyboardFocusManagerClass = null; try { keyboardFocusManagerClass = Class .forName("java.awt.KeyboardFocusManager"); //$NON-NLS-1$ } catch (ClassNotFoundException e) { // switch to the old guy } if (keyboardFocusManagerClass != null) { // Use JRE 1.4 API final Method keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod = keyboardFocusManagerClass .getMethod("getCurrentKeyboardFocusManager", null); //$NON-NLS-1$ final Object keyboardFocusManager = keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod .invoke(keyboardFocusManagerClass, null); final Method keyboardFocusManagerGetFocusOwner = keyboardFocusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = keyboardFocusManagerGetFocusOwner .invoke(keyboardFocusManager, null); return focusComponent; } // Use JRE 1.3 API final Class focusManagerClass = Class .forName("javax.swing.FocusManager"); //$NON-NLS-1$ final Method focusManagerGetCurrentManagerMethod = focusManagerClass .getMethod("getCurrentManager", null); //$NON-NLS-1$ final Object focusManager = focusManagerGetCurrentManagerMethod .invoke(focusManagerClass, null); final Method focusManagerGetFocusOwner = focusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = focusManagerGetFocusOwner .invoke(focusManager, null); return focusComponent; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
static boolean runProgressMonitorOperation(String opName, final IRunnableWithProgress progressOp, final IRunnableContext runnableContext, final IShellProvider shellProvider) { final boolean[] success = new boolean[] { false }; IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; } }; try { runnableContext.run(false, true, runnable); } catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure } catch (InterruptedException e) { // The user pressed cancel. Fall through to return failure } catch (OperationCanceledException e) { // The user pressed cancel. Fall through to return failure } return success[0]; }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { progressOp.run(monitor); // Only indicate success if the monitor wasn't canceled if (!monitor.isCanceled()) success[0] = true; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorJobsDialog.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { //if it is run in the UI Thread don't do anything. if (!fork) { enableDetails(false); } super.run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void busyCursorWhile(IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().run(fork, cancelable, runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/WorkbenchSiteProgressService.java
public void runInUI(IRunnableContext context, IRunnableWithProgress runnable, ISchedulingRule rule) throws InvocationTargetException, InterruptedException { getWorkbenchProgressService().runInUI(context, runnable, rule); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void busyCursorWhile(final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( ProgressManagerUtil.getDefaultParent()); dialog.setOpenOnRun(false); final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; // show a busy cursor until the dialog opens Runnable dialogWaitRunnable = new Runnable() { public void run() { try { dialog.setOpenOnRun(false); setUserInterfaceActive(false); dialog.run(true, true, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0] = e; } finally { setUserInterfaceActive(true); } } }; busyCursorWhile(dialogWaitRunnable, dialog); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { if (fork == false || cancelable == false) { // backward compatible code final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog( null); dialog.run(fork, cancelable, runnable); return; } busyCursorWhile(runnable); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
public void runInUI(final IRunnableContext context, final IRunnableWithProgress runnable, final ISchedulingRule rule) throws InvocationTargetException, InterruptedException { final RunnableWithStatus runnableWithStatus = new RunnableWithStatus( context, runnable, rule); final Display display = Display.getDefault(); display.syncExec(new Runnable() { public void run() { BusyIndicator.showWhile(display, runnableWithStatus); } }); IStatus status = runnableWithStatus.getStatus(); if (!status.isOK()) { Throwable exception = status.getException(); if (exception instanceof InvocationTargetException) throw (InvocationTargetException) exception; else if (exception instanceof InterruptedException) throw (InterruptedException) exception; else // should be OperationCanceledException throw new InterruptedException(exception.getMessage()); } }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
public void run(final boolean fork, final boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { final InvocationTargetException[] invokes = new InvocationTargetException[1]; final InterruptedException[] interrupt = new InterruptedException[1]; Runnable dialogWaitRunnable = new Runnable() { public void run() { try { TimeTriggeredProgressMonitorDialog.super.run(fork, cancelable, runnable); } catch (InvocationTargetException e) { invokes[0] = e; } catch (InterruptedException e) { interrupt[0]= e; } } }; final Display display = PlatformUI.getWorkbench().getDisplay(); if (display == null) { return; } //show a busy cursor until the dialog opens BusyIndicator.showWhile(display, dialogWaitRunnable); if (invokes[0] != null) { throw invokes[0]; } if (interrupt[0] != null) { throw interrupt[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { IWorkbenchContextSupport contextSupport = getWorkbench() .getContextSupport(); final boolean keyFilterEnabled = contextSupport.isKeyFilterEnabled(); Control fastViewBarControl = getFastViewBar() == null ? null : getFastViewBar().getControl(); boolean fastViewBarWasEnabled = fastViewBarControl == null ? false : fastViewBarControl.getEnabled(); Control perspectiveBarControl = getPerspectiveBar() == null ? null : getPerspectiveBar().getControl(); boolean perspectiveBarWasEnabled = perspectiveBarControl == null ? false : perspectiveBarControl.getEnabled(); // Cache for any disabled trim controls List disabledControls = null; try { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(false); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(false); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(false); } // Disable all trim -except- the StatusLine if (defaultLayout != null) disabledControls = defaultLayout.disableTrim(getStatusLineTrim()); super.run(fork, cancelable, runnable); } finally { if (fastViewBarControl != null && !fastViewBarControl.isDisposed()) { fastViewBarControl.setEnabled(fastViewBarWasEnabled); } if (perspectiveBarControl != null && !perspectiveBarControl.isDisposed()) { perspectiveBarControl.setEnabled(perspectiveBarWasEnabled); } if (keyFilterEnabled) { contextSupport.setKeyFilterEnabled(true); } // Re-enable any disabled trim if (defaultLayout != null && disabledControls != null) defaultLayout.enableTrim(disabledControls); } }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
public final void run() { if (isInvalid()) { return; } Shell parent = getWorkbenchWindow().getShell(); progressDialog = new TimeTriggeredProgressMonitorDialog(parent, getWorkbenchWindow().getWorkbench().getProgressService() .getLongOperationTime()); IRunnableWithProgress runnable = new IRunnableWithProgress() { public void run(IProgressMonitor pm) throws InvocationTargetException { try { runCommand(pm); } catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); } } }; try { boolean runInBackground = false; if (getOperation() instanceof IAdvancedUndoableOperation2) { runInBackground = ((IAdvancedUndoableOperation2) getOperation()) .runInBackground(); } progressDialog.run(runInBackground, true, runnable); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t == null) { reportException(e); } else { reportException(t); } } catch (InterruptedException e) { // Operation was cancelled and acknowledged by runnable with this // exception. // Do nothing. } catch (OperationCanceledException e) { // the operation was cancelled. Do nothing. } finally { progressDialog = null; } }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
public void run(IProgressMonitor pm) throws InvocationTargetException { try { runCommand(pm); } catch (ExecutionException e) { if (pruning) { flush(); } throw new InvocationTargetException(e); } }
23
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final InvocationTargetException e) { /* * I would like to log this exception -- * and possibly show a dialog to the * user -- but I have to go back to the * SWT event loop to do this. So, back * we go.... */ focusControl.getDisplay().asyncExec( new Runnable() { public void run() { ExceptionHandler .getInstance() .handleException( new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute .getName(), e .getTargetException())); } });
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (InvocationTargetException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java
catch (InvocationTargetException e) { log(e); }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { String title = NLS.bind(WorkbenchMessages.EditorManager_operationFailed, opName ); Throwable targetExc = e.getTargetException(); WorkbenchPlugin.log(title, new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, 0, title, targetExc)); StatusUtil.handleStatus(title, targetExc, StatusManager.SHOW, shellProvider.getShell()); // Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (InvocationTargetException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (InvocationTargetException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (InvocationTargetException e) { if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException)e.getTargetException(); } WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InvocationTargetException e) { invokes[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (InvocationTargetException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (InvocationTargetException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (InvocationTargetException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (InvocationTargetException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (InvocationTargetException e) { reportException(e, uiInfo); return IOperationHistory.OPERATION_INVALID_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.java
catch (InvocationTargetException e) { invokes[0] = e; }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (InvocationTargetException e) { // should not happen - fall through if it does }
// in Eclipse UI/org/eclipse/ui/WorkbenchEncoding.java
catch (InvocationTargetException e) { // Method.invoke can throw InvocationTargetException if there is // an exception in the invoked method. // Charset.isSupported() is specified to throw IllegalCharsetNameException only // which we want to return false for. return false; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t == null) { reportException(e); } else { reportException(t); } }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (InvocationTargetException exception) { return false; }
5
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + methodToExecute.getName(), e .getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (InvocationTargetException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (InvocationTargetException e) { throw new ExecutionException( "An exception occurred while executing " //$NON-NLS-1$ + getMethodToExecute(), e.getTargetException()); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (InvocationTargetException e) { if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException)e.getTargetException(); } WorkbenchPlugin.log(e); return; }
1
unknown (Lib) LinkageError 0 0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerPersistence.java
catch (LinkageError e) { WorkbenchPlugin.log("Failed to dispose handler for " //$NON-NLS-1$ + activation.getCommandId(), e); }
0 0
unknown (Lib) MalformedURLException 0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
private void setUpImage(URL iconsRoot, String fileName, String key) throws MalformedURLException { JFaceResources.getImageRegistry().put(key, ImageDescriptor.createFromURL(new URL(iconsRoot, fileName))); }
5
            
// in Eclipse UI/org/eclipse/ui/internal/BrandingProperties.java
catch (MalformedURLException e) { if (definingBundle != null) { return Platform.find(definingBundle, new Path(value)); } }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (MalformedURLException e) { openWebBrowserError(shell, href, e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManagerUtil.java
catch (MalformedURLException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (MalformedURLException e) { ProgressManagerUtil.logException(e); }
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
catch (MalformedURLException e) { return null; }
0 0
unknown (Lib) MissingResourceException 0 0 0 2
            
// in Eclipse UI/org/eclipse/ui/internal/ProductProperties.java
catch (MissingResourceException e) { found = false; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
catch (MissingResourceException eMissingResource) { if (signal) { WorkbenchPlugin.log(eMissingResource); } }
0 0
unknown (Domain) MultiPartInitException
public class MultiPartInitException extends WorkbenchException {

	private IWorkbenchPartReference[] references;
	private PartInitException[] exceptions;

	/**
	 * Creates a new exception object. Note that as of 3.5, this constructor
	 * expects exactly one exception object in the given array, with all other
	 * array positions being <code>null</code>. The restriction may be lifted in
	 * the future, and clients of this class must not make this assumption.
	 * 
	 * @param references
	 * @param exceptions
	 */
	public MultiPartInitException(IWorkbenchPartReference[] references,
			PartInitException[] exceptions) {
		super(exceptions[findSingleException(exceptions)].getStatus());
		this.references = references;
		this.exceptions = exceptions;
	}

	/**
	 * Returns an array of part references, containing references of parts that
	 * were intialized correctly. Any number of elements of the returned array
	 * may have a <code>null</code> value.
	 * 
	 * @return the part reference array
	 */
	public IWorkbenchPartReference[] getReferences() {
		return references;
	}

	/**
	 * Returns an array of exceptions, corresponding to parts that could not be
	 * intialized correctly. At least one element of the returned array will
	 * have a non-<code>null</code> value.
	 * 
	 * @return the exception array
	 */
	public PartInitException[] getExceptions() {
		return exceptions;
	}

	private static int findSingleException(PartInitException[] exceptions) {
		int index = -1;
		for (int i = 0; i < exceptions.length; i++) {
			if (exceptions[i] != null) {
				if (index == -1) {
					index = i;
				} else
					throw new IllegalArgumentException();
			}
		}
		if (index == -1) {
			throw new IllegalArgumentException();
		}
		return index;
	}

	private static final long serialVersionUID = -9138185942975165490L;

}
1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorReference[] openEditors(final IEditorInput[] inputs, final String[] editorIDs, final int matchFlags) throws MultiPartInitException { if (inputs == null) throw new IllegalArgumentException(); if (editorIDs == null) throw new IllegalArgumentException(); if (inputs.length != editorIDs.length) throw new IllegalArgumentException(); final IEditorReference[] results = new IEditorReference[inputs.length]; final PartInitException[] exceptions = new PartInitException[inputs.length]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } } }); boolean hasException = false; for(int i = 0 ; i < results.length; i++) { if (exceptions[i] != null) { hasException = true; } if (results[i] == null) { continue; } window.firePerspectiveChanged(this, getPerspective(), results[i], CHANGE_EDITOR_OPEN); } window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); if (hasException) { throw new MultiPartInitException(results, exceptions); } return results; }
0 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorReference[] openEditors(final IEditorInput[] inputs, final String[] editorIDs, final int matchFlags) throws MultiPartInitException { if (inputs == null) throw new IllegalArgumentException(); if (editorIDs == null) throw new IllegalArgumentException(); if (inputs.length != editorIDs.length) throw new IllegalArgumentException(); final IEditorReference[] results = new IEditorReference[inputs.length]; final PartInitException[] exceptions = new PartInitException[inputs.length]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { Workbench workbench = (Workbench) getWorkbenchWindow().getWorkbench(); workbench.largeUpdateStart(); try { deferUpdates(true); for (int i = inputs.length - 1; i >= 0; i--) { if (inputs[i] == null || editorIDs[i] == null) throw new IllegalArgumentException(); // activate the first editor boolean activate = (i == 0); try { // check if there is an editor we can reuse IEditorReference ref = batchReuseEditor(inputs[i], editorIDs[i], activate, matchFlags); if (ref == null) // otherwise, create a new one ref = batchOpenEditor(inputs[i], editorIDs[i], activate); results[i] = ref; } catch (PartInitException e) { exceptions[i] = e; results[i] = null; } } deferUpdates(false); // Update activation history. This can't be done // "as we go" or editors will be materialized. for (int i = inputs.length - 1; i >= 0; i--) { if (results[i] == null) continue; activationList.bringToTop(results[i]); } // The first request for activation done above is // required to properly position editor tabs. // However, when it is done the updates are deferred // and container of the editor is not visible. // As a result the focus is not set. // Therefore, find the first created editor and // activate it again: for (int i = 0; i < results.length; i++) { if (results[i] == null) continue; IEditorPart editorPart = results[i] .getEditor(true); if (editorPart == null) continue; if (editorPart instanceof AbstractMultiEditor) internalActivate( ((AbstractMultiEditor) editorPart) .getActiveEditor(), true); else internalActivate(editorPart, true); break; } } finally { workbench.largeUpdateEnd(); } } }); boolean hasException = false; for(int i = 0 ; i < results.length; i++) { if (exceptions[i] != null) { hasException = true; } if (results[i] == null) { continue; } window.firePerspectiveChanged(this, getPerspective(), results[i], CHANGE_EDITOR_OPEN); } window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); if (hasException) { throw new MultiPartInitException(results, exceptions); } return results; }
0 0 0
unknown (Lib) NoClassDefFoundError 0 0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoClassDefFoundError e) { // the ICU Base bundle used in place of ICU? return null; }
0 0
unknown (Lib) NoSuchMethodException 0 0 3
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected void swingInvokeLater(Runnable methodRunnable) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final Class swingUtilitiesClass = Class .forName("javax.swing.SwingUtilities"); //$NON-NLS-1$ final Method swingUtilitiesInvokeLaterMethod = swingUtilitiesClass .getMethod("invokeLater", //$NON-NLS-1$ new Class[] { Runnable.class }); swingUtilitiesInvokeLaterMethod.invoke(swingUtilitiesClass, new Object[] { methodRunnable }); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
protected Object getFocusComponent() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { /* * Before JRE 1.4, one has to use * javax.swing.FocusManager.getCurrentManager().getFocusOwner(). Since * JRE 1.4, one has to use * java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager * ().getFocusOwner(); the use of the older API would install a * LegacyGlueFocusTraversalPolicy which causes endless recursions in * some situations. */ Class keyboardFocusManagerClass = null; try { keyboardFocusManagerClass = Class .forName("java.awt.KeyboardFocusManager"); //$NON-NLS-1$ } catch (ClassNotFoundException e) { // switch to the old guy } if (keyboardFocusManagerClass != null) { // Use JRE 1.4 API final Method keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod = keyboardFocusManagerClass .getMethod("getCurrentKeyboardFocusManager", null); //$NON-NLS-1$ final Object keyboardFocusManager = keyboardFocusManagerGetCurrentKeyboardFocusManagerMethod .invoke(keyboardFocusManagerClass, null); final Method keyboardFocusManagerGetFocusOwner = keyboardFocusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = keyboardFocusManagerGetFocusOwner .invoke(keyboardFocusManager, null); return focusComponent; } // Use JRE 1.3 API final Class focusManagerClass = Class .forName("javax.swing.FocusManager"); //$NON-NLS-1$ final Method focusManagerGetCurrentManagerMethod = focusManagerClass .getMethod("getCurrentManager", null); //$NON-NLS-1$ final Object focusManager = focusManagerGetCurrentManagerMethod .invoke(focusManagerClass, null); final Method focusManagerGetFocusOwner = focusManagerClass .getMethod("getFocusOwner", null); //$NON-NLS-1$ final Object focusComponent = focusManagerGetFocusOwner .invoke(focusManager, null); return focusComponent; }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
private static ResourceMethod getResourceMethod(Widget toCall, String methodName, Class resourceType) throws NoSuchMethodException { Object oldData = toCall.getData(DISPOSE_LIST); if (oldData instanceof List) { // Check for existing data for (Iterator iter = ((List)oldData).iterator(); iter.hasNext();) { ResourceMethod method = (ResourceMethod) iter.next(); if (method.id == methodName) { return method; } } } if (oldData instanceof ResourceMethod) { if (((ResourceMethod)oldData).id == methodName) { return ((ResourceMethod)oldData); } List newList = new ArrayList(); newList.add(oldData); oldData = newList; toCall.setData(DISPOSE_LIST, oldData); } // At this point, the DISPOSE_LIST data is either null or points to an ArrayList Class clazz = toCall.getClass(); Method method; try { method = clazz.getMethod(methodName, new Class[] {resourceType}); } catch (SecurityException e) { throw e; } ResourceMethod result = new ResourceMethod(method, methodName); if (oldData == null) { toCall.setData(DISPOSE_LIST, result); toCall.addDisposeListener(disposeListener); } else { ((List)oldData).add(result); } return result; }
18
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
catch (NoSuchMethodException e2) { // cant find either method - don't do anything. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (NoSuchMethodException e) { // Fall through... }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (NoSuchMethodException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (NoSuchMethodException e) { // I can't get the text limit. Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (NoSuchMethodException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/TraversePageHandler.java
catch (NoSuchMethodException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/misc/StatusUtil.java
catch (NoSuchMethodException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/EarlyStartupRunnable.java
catch (NoSuchMethodException e) { handleException(e); }
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (NoSuchMethodException e) { WorkbenchPlugin.log(e); return; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (NoSuchMethodException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (NoSuchMethodException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (NoSuchMethodException e) { // do nothing - play it safe }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (NoSuchMethodException e) { // should not happen - fall through if it does }
// in Eclipse UI Editor Support/org/eclipse/ui/internal/editorsupport/ComponentSupport.java
catch (NoSuchMethodException exception) { //Couldn't find the method so return false return false; }
3
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/WidgetMethodHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SelectAllHandler.java
catch (final NoSuchMethodException e) { // The API has changed, which seems amazingly unlikely. throw new Error("Something is seriously wrong here"); //$NON-NLS-1$ }
3
checked (Domain) NotDefinedException
public final class NotDefinedException extends CommandException {

    /**
     * Generated serial version UID for this class.
     * 
     * @since 3.1
     */
    private static final long serialVersionUID = 3257572788998124596L;

    /**
     * Creates a new instance of this class with the specified detail message.
     * 
     * @param s
     *            the detail message.
     */
    public NotDefinedException(String s) {
        super(s);
    }

    /**
     * Constructs a legacy <code>NotDefinedException</code> based on the new
     * <code>NotDefinedException</code>.
     * 
     * @param e
     *            The exception from which this exception should be created;
     *            must not be <code>null</code>.
     * @since 3.1
     */
    public NotDefinedException(
            final org.eclipse.core.commands.common.NotDefinedException e) {
        super(e.getMessage(), e);
    }
}public final class NotDefinedException extends ContextException {

	/**
	 * Generated serial version UID for this class.
	 * 
	 * @since 3.1
	 */
	private static final long serialVersionUID = 3833750983926167092L;

	/**
	 * Creates a new instance of this class with the specified detail message.
	 * 
	 * @param message
	 *            the detail message.
	 */
	public NotDefinedException(String message) {
		super(message);
	}

	/**
	 * Constructs a new instance of <code>NotDefinedException</code>.
	 * 
	 * @param e
	 *            The exception being thrown; must not be <code>null</code>.
	 * @since 3.1
	 */
	public NotDefinedException(
			org.eclipse.core.commands.common.NotDefinedException e) {
		super(e.getMessage(), e);
	}
}public final class NotDefinedException extends Exception {

    /**
     * Generated serial version UID for this class.
     * @since 3.1
     */
    private static final long serialVersionUID = 4050201929596811061L;

    /**
     * Creates a new instance of this class with no specified detail message.
     */
    public NotDefinedException() {
        //no-op
    }

    /**
     * Creates a new instance of this class with the specified detail message.
     * 
     * @param s
     *            the detail message.
     */
    public NotDefinedException(String s) {
        super(s);
    }
}
16
            
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getDescription() throws NotDefinedException { try { return scheme.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getName() throws NotDefinedException { try { return scheme.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return scheme.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getCategoryId() throws NotDefinedException { try { return command.getCategory().getId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getDescription() throws NotDefinedException { try { return command.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getName() throws NotDefinedException { try { return command.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getName() throws NotDefinedException { try { return wrappedContext.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return wrappedContext.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
8
            
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
29
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(command, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final String commandId, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(commandId, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public Object executeCommandInContext(ParameterizedCommand command, Event event, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommandInContext(command, event, context); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return command.executeWithChecks(trigger, getCurrentState()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final String commandId, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { final Command command = commandService.getCommand(commandId); final ExecutionEvent event = new ExecutionEvent(command, Collections.EMPTY_MAP, trigger, getCurrentState()); return command.executeWithChecks(event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommandInContext( final ParameterizedCommand command, final Event trigger, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { IHandler oldHandler = command.getCommand().getHandler(); IHandler handler = findHandler(command.getId(), context); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(context); } try { command.getCommand().setHandler(handler); return command.executeWithChecks(trigger, context); } finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getDescription() throws NotDefinedException { try { return scheme.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getName() throws NotDefinedException { try { return scheme.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return scheme.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getCategoryId() throws NotDefinedException { try { return command.getCategory().getId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getDescription() throws NotDefinedException { try { return command.getDescription(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final String getName() throws NotDefinedException { try { return command.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public ParameterizedCommand deserialize( String serializedParameterizedCommand) throws NotDefinedException, SerializationException { return fParentService.deserialize(serializedParameterizedCommand); }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public final String getHelpContextId(final Command command) throws NotDefinedException { return fParentService.getHelpContextId(command); }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public final String getHelpContextId(final String commandId) throws NotDefinedException { return fParentService.getHelpContextId(commandId); }
// in Eclipse UI/org/eclipse/ui/internal/commands/SlaveCommandService.java
public IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final ParameterizedCommand deserialize( final String serializedParameterizedCommand) throws NotDefinedException, SerializationException { return commandManager.deserialize(serializedParameterizedCommand); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final String getHelpContextId(final Command command) throws NotDefinedException { return commandManager.getHelpContextId(command); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final String getHelpContextId(final String commandId) throws NotDefinedException { final Command command = getCommand(commandId); return commandManager.getHelpContextId(command); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandService.java
public final IElementReference registerElementForCommand( ParameterizedCommand command, UIElement element) throws NotDefinedException { if (!command.getCommand().isDefined()) { throw new NotDefinedException( "Cannot define a callback for undefined command " //$NON-NLS-1$ + command.getCommand().getId()); } if (element == null) { throw new NotDefinedException("No callback defined for command " //$NON-NLS-1$ + command.getCommand().getId()); } ElementReference ref = new ElementReference(command.getId(), element, command.getParameterMap()); registerElement(ref); return ref; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getName() throws NotDefinedException { try { return wrappedContext.getName(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
public String getParentId() throws NotDefinedException { try { return wrappedContext.getParentId(); } catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/CategorizedActivity.java
public String getName() throws NotDefinedException { return activity.getName(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/CategorizedActivity.java
public String getDescription() throws NotDefinedException { return activity.getDescription(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/CategorizedActivity.java
public boolean isDefaultEnabled() throws NotDefinedException { return activity.isDefaultEnabled(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getName() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return name; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public String getDescription() throws NotDefinedException { if (!defined) { throw new NotDefinedException(); } return description; }
95
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ActivityPersistanceHelper.java
catch (NotDefinedException e) { // can't happen - we're iterating over defined activities }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { // Not defined, so leave as null. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { // Not defined, so leave as null. }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotDefinedException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandProvider.java
catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/CommandElement.java
catch (NotDefinedException e) { label.append(command.toString()); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (NotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java
catch (final NotDefinedException e) { // At least we tried.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/SchemeElement.java
catch (NotDefinedException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingModel.java
catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java
catch (NotDefinedException e) { // No parentId to check }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java
catch (NotDefinedException e) { // No parentId to check }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setName(NewKeysPreferenceMessages.Undefined_Command); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setDescription(Util.ZERO_LENGTH_STRING); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/BindingElement.java
catch (NotDefinedException e) { setCategory(NewKeysPreferenceMessages.Unavailable_Category); }
// in Eclipse UI/org/eclipse/ui/internal/keys/model/ContextElement.java
catch (NotDefinedException e) { }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { return; // no name }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // At least we tried.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Oh, well. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException eNotDefined) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException eNotDefined) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException eNotDefined) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // It is safe to just ignore undefined commands. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException e) { return -1; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (NotDefinedException e) { return 1; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { // Just use the zero-length string. }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { // Let's keep looking.... }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (NotDefinedException e) { // regular condition; do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (final NotDefinedException e) { WorkbenchPlugin.log("The active scheme is not currently defined.", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/keys/CategoryPatternFilter.java
catch (NotDefinedException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotDefinedException e) { // The command is not defined. Forwarded to the IExecutionListener. }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotDefinedException nde) { // Fall through (message == null) }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (NotDefinedException e) { // Not much to do, but this shouldn't really happen. }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final NotDefinedException e) { // should not happen return 0; }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeyAssistDialog.java
catch (final NotDefinedException e) { // should not happen return 0; }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
catch (final NotDefinedException e) { // Do nothing. Stop ascending the ancestry. }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
catch (final NotDefinedException e) { // Do nothing. Stop ascending the ancestry. }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/services/RegistryPersistence.java
catch (final NotDefinedException e) { // This should not happen. }
// in Eclipse UI/org/eclipse/ui/internal/services/PreferencePersistence.java
catch (final NotDefinedException e) { // This should not happen. }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityEnabler.java
catch (NotDefinedException e) { descriptionText.setText(""); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityEnabler.java
catch (NotDefinedException e) { // this can't happen - we're iterating over defined activities. }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityLabelProvider.java
catch (NotDefinedException e) { return activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e) { activityText = activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e1) { name = selectedActivity; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/EnablementDialog.java
catch (NotDefinedException e) { desc = RESOURCE_BUNDLE.getString("noDescAvailable"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (NotDefinedException e) { return activity.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/activities/ws/ActivityCategoryLabelProvider.java
catch (NotDefinedException e) { return category.getId(); }
// in Eclipse UI/org/eclipse/ui/internal/actions/CommandAction.java
catch (NotDefinedException e) { // if we get this far it shouldn't be a problem }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (NotDefinedException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotDefinedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotDefinedException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotDefinedException e) { // this should never happen }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { // it's OK to not have a helpContextId }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager .getManager() .handle( StatusUtil .newStatus( IStatus.ERROR, "Unable to register menu item \"" + getId() //$NON-NLS-1$ + "\", command \"" + contributionParameters.commandId + "\" not defined", //$NON-NLS-1$ //$NON-NLS-2$ null)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Update item failed " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotDefinedException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { name = category.getId(); }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { descriptionText.setText(""); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/activities/ActivityCategoryPreferencePage.java
catch (NotDefinedException e) { // this can't happen - we're iterating over defined activities. }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (NotDefinedException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotDefinedException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
12
            
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "There is a programmer error in the keys preference page"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Concurrent modification of the command's defined state"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/KeysPreferencePage.java
catch (final NotDefinedException e) { throw new Error( "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final NotDefinedException e) { //this is bad - the default default scheme should always exist throw new Error( "The default default active scheme id is not defined."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/SchemeLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextLegacyWrapper.java
catch (final org.eclipse.core.commands.common.NotDefinedException e) { throw new NotDefinedException(e); }
4
unknown (Lib) NotEnabledException 0 0 6
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(command, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final String commandId, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(commandId, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public Object executeCommandInContext(ParameterizedCommand command, Event event, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommandInContext(command, event, context); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return command.executeWithChecks(trigger, getCurrentState()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final String commandId, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { final Command command = commandService.getCommand(commandId); final ExecutionEvent event = new ExecutionEvent(command, Collections.EMPTY_MAP, trigger, getCurrentState()); return command.executeWithChecks(event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommandInContext( final ParameterizedCommand command, final Event trigger, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { IHandler oldHandler = command.getCommand().getHandler(); IHandler handler = findHandler(command.getId(), context); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(context); } try { command.getCommand().setHandler(handler); return command.executeWithChecks(trigger, context); } finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } } }
13
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotEnabledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (NotEnabledException e) { // regular condition; do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotEnabledException e) { // The command is not enabled. Forwarded to the IExecutionListener. }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (NotEnabledException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotEnabledException e) { status = new Status(IStatus.WARNING, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotEnabledException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotEnabledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (NotEnabledException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotEnabledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
0 0
checked (Domain) NotHandledException
public final class NotHandledException extends CommandException {

    /**
     * Generated serial version UID for this class.
     * 
     * @since 3.1
     */
    private static final long serialVersionUID = 3256446914827726904L;

    /**
     * Creates a new instance of this class with the specified detail message.
     * 
     * @param s
     *            the detail message.
     */
    public NotHandledException(String s) {
        super(s);
    }

    /**
     * Constructs a legacy <code>NotHandledException</code> based on the new
     * <code>NotHandledException</code>
     * 
     * @param e
     *            The exception from which this exception should be created;
     *            must not be <code>null</code>.
     * @since 3.1
     */
    public NotHandledException(final org.eclipse.core.commands.NotHandledException e) {
        super(e.getMessage(), e);
    }
}
1
            
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
1
            
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); }
7
            
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(command, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public final Object executeCommand(final String commandId, final Event event) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommand(commandId, event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/SlaveHandlerService.java
public Object executeCommandInContext(ParameterizedCommand command, Event event, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return parent.executeCommandInContext(command, event, context); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final ParameterizedCommand command, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { return command.executeWithChecks(trigger, getCurrentState()); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommand(final String commandId, final Event trigger) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { final Command command = commandService.getCommand(commandId); final ExecutionEvent event = new ExecutionEvent(command, Collections.EMPTY_MAP, trigger, getCurrentState()); return command.executeWithChecks(event); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java
public final Object executeCommandInContext( final ParameterizedCommand command, final Event trigger, IEvaluationContext context) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException { IHandler oldHandler = command.getCommand().getHandler(); IHandler handler = findHandler(command.getId(), context); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(context); } try { command.getCommand().setHandler(handler); return command.executeWithChecks(trigger, context); } finally { command.getCommand().setHandler(oldHandler); if (handler instanceof IHandler2) { ((IHandler2) handler).setEnabled(getCurrentState()); } } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
public final Object execute(Map parameterValuesByName) throws ExecutionException, NotHandledException { try { return command.execute(new ExecutionEvent(command, (parameterValuesByName == null) ? Collections.EMPTY_MAP : parameterValuesByName, null, null)); } catch (final org.eclipse.core.commands.ExecutionException e) { throw new ExecutionException(e); } catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); } }
15
            
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e1) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e) { }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NotHandledException e) { }
// in Eclipse UI/org/eclipse/ui/internal/handlers/CommandLegacyActionWrapper.java
catch (final NotHandledException e) { firePropertyChange(IAction.RESULT, null, Boolean.FALSE); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
catch (NotHandledException e) { // regular condition; do nothing }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (final NotHandledException e) { // There is no handler. Forwarded to the IExecutionListener. }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java
catch (NotHandledException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressInfoItem.java
catch (NotHandledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewMenu.java
catch (NotHandledException e) { // Do nothing. }
// in Eclipse UI/org/eclipse/ui/internal/ChangeToPerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
catch (NotHandledException e) { StatusManager.getManager().handle( StatusUtil.newStatus(IStatus.ERROR, "Failed to execute item " //$NON-NLS-1$ + getId(), e)); }
// in Eclipse UI/org/eclipse/ui/actions/ContributedAction.java
catch (NotHandledException e) { // TODO some logging, perhaps? }
// in Eclipse UI/org/eclipse/ui/actions/PerspectiveMenu.java
catch (NotHandledException e) { StatusManager.getManager().handle( new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Failed to execute " + IWorkbenchCommandConstants.PERSPECTIVES_SHOW_PERSPECTIVE, e)); //$NON-NLS-1$ }
1
            
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandLegacyWrapper.java
catch (final org.eclipse.core.commands.NotHandledException e) { throw new NotHandledException(e); }
0
runtime (Lib) NullPointerException 165
            
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void put(String key, String value) { checkRemoved(); if (key == null || value == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } temporarySettings.put(key, value); if (!value.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, value); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
private String internalGet(String key, String defaultValue) { if (key == null) { throw new NullPointerException(); } if (temporarySettings.containsKey(key)) { Object value = temporarySettings.get(key); return value == null ? defaultValue : (String) value; } return getOriginal().get(key, defaultValue); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void remove(String key) { checkRemoved(); if (key == null) { throw new NullPointerException(); } Object oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = temporarySettings.get(key); } else { oldValue = original.get(key, null); } if (oldValue == null) { return; } temporarySettings.put(key, null); firePropertyChangeEvent(key, oldValue, null); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putInt(String key, int value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Integer.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putLong(String key, long value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Long.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putBoolean(String key, boolean value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = String.valueOf(value); temporarySettings.put(key, newValue); if (!newValue.equalsIgnoreCase(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putFloat(String key, float value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Float.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putDouble(String key, double value) { checkRemoved(); if (key == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = Double.toString(value); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
public void putByteArray(String key, byte[] value) { checkRemoved(); if (key == null || value == null) { throw new NullPointerException(); } String oldValue = null; if (temporarySettings.containsKey(key)) { oldValue = (String) temporarySettings.get(key); } else { oldValue = getOriginal().get(key, null); } String newValue = new String(Base64.encode(value)); temporarySettings.put(key, newValue); if (!newValue.equals(oldValue)) { firePropertyChangeEvent(key, oldValue, newValue); } }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionCommandMappingService.java
public final String getCommandId(final String actionId) { if (actionId == null) { throw new NullPointerException( "Cannot get the command identifier for a null action id"); //$NON-NLS-1$ } return (String) mapping.get(actionId); }
// in Eclipse UI/org/eclipse/ui/internal/handlers/ActionCommandMappingService.java
public final void map(final String actionId, final String commandId) { if (actionId == null) { throw new NullPointerException("The action id cannot be null"); //$NON-NLS-1$ } if (commandId == null) { throw new NullPointerException("The command id cannot be null"); //$NON-NLS-1$ } mapping.put(actionId, commandId); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
public final void addCommandManagerListener( final ICommandManagerListener commandManagerListener) { if (commandManagerListener == null) { throw new NullPointerException("Cannot add a null listener."); //$NON-NLS-1$ } if (commandManagerListeners == null) { commandManagerListeners = new ArrayList(); this.commandManager.addCommandManagerListener(this); this.bindingManager.addBindingManagerListener(this); this.contextManager.addContextManagerListener(this); } if (!commandManagerListeners.contains(commandManagerListener)) { commandManagerListeners.add(commandManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
private void fireCommandManagerChanged( CommandManagerEvent commandManagerEvent) { if (commandManagerEvent == null) { throw new NullPointerException(); } if (commandManagerListeners != null) { for (int i = 0; i < commandManagerListeners.size(); i++) { ((ICommandManagerListener) commandManagerListeners.get(i)) .commandManagerChanged(commandManagerEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
public void removeCommandManagerListener( ICommandManagerListener commandManagerListener) { if (commandManagerListener == null) { throw new NullPointerException("Cannot remove a null listener"); //$NON-NLS-1$ } if (commandManagerListeners != null) { commandManagerListeners.remove(commandManagerListener); if (commandManagerListeners.isEmpty()) { commandManagerListeners = null; this.commandManager.removeCommandManagerListener(this); this.bindingManager.removeBindingManagerListener(this); this.contextManager.removeContextManagerListener(this); } } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
private final void fireManagerChanged(final CommandImageManagerEvent event) { if (event == null) { throw new NullPointerException(); } final Object[] listeners = getListeners(); for (int i = 0; i < listeners.length; i++) { final ICommandImageManagerListener listener = (ICommandImageManagerListener) listeners[i]; listener.commandImageManagerChanged(event); } }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandImageManager.java
public final ImageDescriptor getImageDescriptor(final String commandId, final int type, final String style) { if (commandId == null) { throw new NullPointerException(); } final Object[] images = (Object[]) imagesById.get(commandId); if (images == null) { return null; } if ((type < 0) || (type >= images.length)) { throw new IllegalArgumentException( "The type must be one of TYPE_DEFAULT, TYPE_DISABLED and TYPE_HOVER."); //$NON-NLS-1$ } Object typedImage = images[type]; if (typedImage == null) { return null; } if (typedImage instanceof ImageDescriptor) { return (ImageDescriptor) typedImage; } if (typedImage instanceof Map) { final Map styleMap = (Map) typedImage; Object styledImage = styleMap.get(style); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } if (style != null) { styledImage = styleMap.get(null); if (styledImage instanceof ImageDescriptor) { return (ImageDescriptor) styledImage; } } } return null; }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
public void addContextManagerListener( IContextManagerListener contextManagerListener) { if (contextManagerListener == null) { throw new NullPointerException(); } if (contextManagerListeners == null) { contextManagerListeners = new ArrayList(); } if (!contextManagerListeners.contains(contextManagerListener)) { contextManagerListeners.add(contextManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
protected void fireContextManagerChanged( ContextManagerEvent contextManagerEvent) { if (contextManagerEvent == null) { throw new NullPointerException(); } if (contextManagerListeners != null) { for (int i = 0; i < contextManagerListeners.size(); i++) { ((IContextManagerListener) contextManagerListeners.get(i)) .contextManagerChanged(contextManagerEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextManagerLegacyWrapper.java
public void removeContextManagerListener( IContextManagerListener contextManagerListener) { if (contextManagerListener == null) { throw new NullPointerException(); } if (contextManagerListeners != null) { contextManagerListeners.remove(contextManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java
public final boolean registerShell(final Shell shell, final int type) { // We do not allow null shell registration. It is reserved. if (shell == null) { throw new NullPointerException("The shell was null"); //$NON-NLS-1$ } // Debugging output if (DEBUG) { final StringBuffer buffer = new StringBuffer("register shell '"); //$NON-NLS-1$ buffer.append(shell); buffer.append("' as "); //$NON-NLS-1$ switch (type) { case IContextService.TYPE_DIALOG: buffer.append("dialog"); //$NON-NLS-1$ break; case IContextService.TYPE_WINDOW: buffer.append("window"); //$NON-NLS-1$ break; case IContextService.TYPE_NONE: buffer.append("none"); //$NON-NLS-1$ break; default: buffer.append("unknown"); //$NON-NLS-1$ break; } Tracing.printTrace(TRACING_COMPONENT, buffer.toString()); } // Build the list of submissions. final List activations = new ArrayList(); Expression expression; IContextActivation dialogWindowActivation; switch (type) { case IContextService.TYPE_DIALOG: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation dialogActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG, expression, contextService); activateContext(dialogActivation); activations.add(dialogActivation); break; case IContextService.TYPE_NONE: break; case IContextService.TYPE_WINDOW: expression = new ActiveShellExpression(shell); dialogWindowActivation = new ContextActivation( IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression, contextService); activateContext(dialogWindowActivation); activations.add(dialogWindowActivation); final IContextActivation windowActivation = new ContextActivation( IContextService.CONTEXT_ID_WINDOW, expression, contextService); activateContext(windowActivation); activations.add(windowActivation); break; default: throw new IllegalArgumentException("The type is not recognized: " //$NON-NLS-1$ + type); } // Check to see if the activations are already present. boolean returnValue = false; final Collection previousActivations = (Collection) registeredWindows .get(shell); if (previousActivations != null) { returnValue = true; final Iterator previousActivationItr = previousActivations .iterator(); while (previousActivationItr.hasNext()) { final IContextActivation activation = (IContextActivation) previousActivationItr .next(); deactivateContext(activation); } } // Add the new submissions, and force some reprocessing to occur. registeredWindows.put(shell, activations); /* * Remember the dispose listener so that we can remove it later if we * unregister the shell. */ final DisposeListener shellDisposeListener = new DisposeListener() { /* * (non-Javadoc) * * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) */ public void widgetDisposed(DisposeEvent e) { registeredWindows.remove(shell); if (!shell.isDisposed()) { shell.removeDisposeListener(this); } /* * In the case where a dispose has happened, we are expecting an * activation event to arrive at some point in the future. If we * process the submissions now, then we will update the * activeShell before checkWindowType is called. This means that * dialogs won't be recognized as dialogs. */ final Iterator activationItr = activations.iterator(); while (activationItr.hasNext()) { deactivateContext((IContextActivation) activationItr.next()); } } }; // Make sure the submissions will be removed in event of disposal. shell.addDisposeListener(shellDisposeListener); shell.setData(DISPOSE_LISTENER, shellDisposeListener); return returnValue; }
// in Eclipse UI/org/eclipse/ui/internal/services/SourcePriorityNameMapping.java
public static final void addMapping(final String sourceName, final int sourcePriority) { if (sourceName == null) { throw new NullPointerException("The source name cannot be null."); //$NON-NLS-1$ } if (!sourcePrioritiesByName.containsKey(sourceName)) { final Integer priority = new Integer(sourcePriority); sourcePrioritiesByName.put(sourceName, priority); } }
// in Eclipse UI/org/eclipse/ui/internal/services/SourceProviderService.java
public final void registerProvider(final ISourceProvider sourceProvider) { if (sourceProvider == null) { throw new NullPointerException("The source provider cannot be null"); //$NON-NLS-1$ } final String[] sourceNames = sourceProvider.getProvidedSourceNames(); for (int i = 0; i < sourceNames.length; i++) { final String sourceName = sourceNames[i]; sourceProvidersByName.put(sourceName, sourceProvider); } sourceProviders.add(sourceProvider); }
// in Eclipse UI/org/eclipse/ui/internal/services/SourceProviderService.java
public final void unregisterProvider(ISourceProvider sourceProvider) { if (sourceProvider == null) { throw new NullPointerException("The source provider cannot be null"); //$NON-NLS-1$ } final String[] sourceNames = sourceProvider.getProvidedSourceNames(); for (int i = 0; i < sourceNames.length; i++) { sourceProvidersByName.remove(sourceNames[i]); } sourceProviders.remove(sourceProvider); }
// in Eclipse UI/org/eclipse/ui/internal/services/ServiceLocator.java
public final void registerService(final Class api, final Object service) { if (api == null) { throw new NullPointerException("The service key cannot be null"); //$NON-NLS-1$ } if (!api.isInstance(service)) { throw new IllegalArgumentException( "The service does not implement the given interface"); //$NON-NLS-1$ } if (services == null) { services = new HashMap(); } if (services.containsKey(api)) { final Object currentService = services.remove(api); if (currentService instanceof IDisposable) { final IDisposable disposable = (IDisposable) currentService; disposable.dispose(); } } if (service == null) { if (services.isEmpty()) { services = null; } } else { services.put(api, service); if (service instanceof INestable && activated) { ((INestable)service).activate(); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityRegistry.java
public void addActivityRegistryListener( IActivityRegistryListener activityRegistryListener) { if (activityRegistryListener == null) { throw new NullPointerException(); } if (activityRegistryListeners == null) { activityRegistryListeners = new ArrayList(); } if (!activityRegistryListeners.contains(activityRegistryListener)) { activityRegistryListeners.add(activityRegistryListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityRegistry.java
public void removeActivityRegistryListener( IActivityRegistryListener activityRegistryListener) { if (activityRegistryListener == null) { throw new NullPointerException(); } if (activityRegistryListeners != null) { activityRegistryListeners.remove(activityRegistryListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
public void addActivityManagerListener( IActivityManagerListener activityManagerListener) { if (activityManagerListener == null) { throw new NullPointerException(); } if (activityManagerListeners == null) { activityManagerListeners = new ArrayList(); } if (!activityManagerListeners.contains(activityManagerListener)) { activityManagerListeners.add(activityManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
protected void fireActivityManagerChanged( ActivityManagerEvent activityManagerEvent) { if (activityManagerEvent == null) { throw new NullPointerException(); } if (activityManagerListeners != null) { for (int i = 0; i < activityManagerListeners.size(); i++) { ((IActivityManagerListener) activityManagerListeners.get(i)) .activityManagerChanged(activityManagerEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/AbstractActivityManager.java
public void removeActivityManagerListener( IActivityManagerListener activityManagerListener) { if (activityManagerListener == null) { throw new NullPointerException(); } if (activityManagerListeners != null) { activityManagerListeners.remove(activityManagerListener); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityPatternBindingDefinition.java
static Map activityPatternBindingDefinitionsByActivityId( Collection activityPatternBindingDefinitions) { if (activityPatternBindingDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityPatternBindingDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityPatternBindingDefinition.class); ActivityPatternBindingDefinition activityPatternBindingDefinition = (ActivityPatternBindingDefinition) object; String activityId = activityPatternBindingDefinition .getActivityId(); if (activityId != null) { Collection activityPatternBindingDefinitions2 = (Collection) map .get(activityId); if (activityPatternBindingDefinitions2 == null) { activityPatternBindingDefinitions2 = new ArrayList(); map.put(activityId, activityPatternBindingDefinitions2); } activityPatternBindingDefinitions2 .add(activityPatternBindingDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public void addActivityListener(IActivityListener activityListener) { if (activityListener == null) { throw new NullPointerException(); } if (activityListeners == null) { activityListeners = new ArrayList(); } if (!activityListeners.contains(activityListener)) { activityListeners.add(activityListener); } strongReferences.add(this); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
void fireActivityChanged(ActivityEvent activityEvent) { if (activityEvent == null) { throw new NullPointerException(); } if (activityListeners != null) { for (int i = 0; i < activityListeners.size(); i++) { ((IActivityListener) activityListeners.get(i)) .activityChanged(activityEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Activity.java
public void removeActivityListener(IActivityListener activityListener) { if (activityListener == null) { throw new NullPointerException(); } if (activityListeners != null) { activityListeners.remove(activityListener); } if (activityListeners.isEmpty()) { strongReferences.remove(this); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public void addCategoryListener(ICategoryListener categoryListener) { if (categoryListener == null) { throw new NullPointerException(); } if (categoryListeners == null) { categoryListeners = new ArrayList(); } if (!categoryListeners.contains(categoryListener)) { categoryListeners.add(categoryListener); } strongReferences.add(this); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
void fireCategoryChanged(CategoryEvent categoryEvent) { if (categoryEvent == null) { throw new NullPointerException(); } if (categoryListeners != null) { for (int i = 0; i < categoryListeners.size(); i++) { ((ICategoryListener) categoryListeners.get(i)) .categoryChanged(categoryEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Category.java
public void removeCategoryListener(ICategoryListener categoryListener) { if (categoryListener == null) { throw new NullPointerException(); } if (categoryListeners != null) { categoryListeners.remove(categoryListener); } if (categoryListeners.isEmpty()) { strongReferences.remove(this); } }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityDefinition.java
static Map activityDefinitionsById(Collection activityDefinitions, boolean allowNullIds) { if (activityDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityDefinition.class); ActivityDefinition activityDefinition = (ActivityDefinition) object; String id = activityDefinition.getId(); if (allowNullIds || id != null) { map.put(id, activityDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityDefinition.java
static Map activityDefinitionsByName(Collection activityDefinitions, boolean allowNullNames) { if (activityDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityDefinition.class); ActivityDefinition activityDefinition = (ActivityDefinition) object; String name = activityDefinition.getName(); if (allowNullNames || name != null) { Collection activityDefinitions2 = (Collection) map.get(name); if (activityDefinitions2 == null) { activityDefinitions2 = new HashSet(); map.put(name, activityDefinitions2); } activityDefinitions2.add(activityDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/ActivityRequirementBindingDefinition.java
static Map activityRequirementBindingDefinitionsByActivityId( Collection activityRequirementBindingDefinitions) { if (activityRequirementBindingDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = activityRequirementBindingDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, ActivityRequirementBindingDefinition.class); ActivityRequirementBindingDefinition activityRequirementBindingDefinition = (ActivityRequirementBindingDefinition) object; String parentActivityId = activityRequirementBindingDefinition .getActivityId(); if (parentActivityId != null) { Collection activityRequirementBindingDefinitions2 = (Collection) map .get(parentActivityId); if (activityRequirementBindingDefinitions2 == null) { activityRequirementBindingDefinitions2 = new HashSet(); map.put(parentActivityId, activityRequirementBindingDefinitions2); } activityRequirementBindingDefinitions2 .add(activityRequirementBindingDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/CategoryDefinition.java
static Map categoryDefinitionsById(Collection categoryDefinitions, boolean allowNullIds) { if (categoryDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = categoryDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, CategoryDefinition.class); CategoryDefinition categoryDefinition = (CategoryDefinition) object; String id = categoryDefinition.getId(); if (allowNullIds || id != null) { map.put(id, categoryDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/CategoryDefinition.java
static Map categoryDefinitionsByName(Collection categoryDefinitions, boolean allowNullNames) { if (categoryDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = categoryDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util.assertInstance(object, CategoryDefinition.class); CategoryDefinition categoryDefinition = (CategoryDefinition) object; String name = categoryDefinition.getName(); if (allowNullNames || name != null) { Collection categoryDefinitions2 = (Collection) map.get(name); if (categoryDefinitions2 == null) { categoryDefinitions2 = new HashSet(); map.put(name, categoryDefinitions2); } categoryDefinitions2.add(categoryDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/CategoryActivityBindingDefinition.java
static Map categoryActivityBindingDefinitionsByCategoryId( Collection categoryActivityBindingDefinitions) { if (categoryActivityBindingDefinitions == null) { throw new NullPointerException(); } Map map = new HashMap(); Iterator iterator = categoryActivityBindingDefinitions.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); Util .assertInstance(object, CategoryActivityBindingDefinition.class); CategoryActivityBindingDefinition categoryActivityBindingDefinition = (CategoryActivityBindingDefinition) object; String categoryId = categoryActivityBindingDefinition .getCategoryId(); if (categoryId != null) { Collection categoryActivityBindingDefinitions2 = (Collection) map .get(categoryId); if (categoryActivityBindingDefinitions2 == null) { categoryActivityBindingDefinitions2 = new HashSet(); map.put(categoryId, categoryActivityBindingDefinitions2); } categoryActivityBindingDefinitions2 .add(categoryActivityBindingDefinition); } } return map; }
// in Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
public void addIdentifierListener(IIdentifierListener identifierListener) { if (identifierListener == null) { throw new NullPointerException(); } if (identifierListeners == null) { identifierListeners = new ArrayList(); } if (!identifierListeners.contains(identifierListener)) { identifierListeners.add(identifierListener); } strongReferences.add(this); }
// in Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
void fireIdentifierChanged(IdentifierEvent identifierEvent) { if (identifierEvent == null) { throw new NullPointerException(); } if (identifierListeners != null) { for (int i = 0; i < identifierListeners.size(); i++) { ((IIdentifierListener) identifierListeners.get(i)) .identifierChanged(identifierEvent); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
public void removeIdentifierListener(IIdentifierListener identifierListener) { if (identifierListener == null) { throw new NullPointerException(); } if (identifierListeners != null) { identifierListeners.remove(identifierListener); if (identifierListeners.isEmpty()) { strongReferences.remove(this); } } }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
synchronized public IActivity getActivity(String activityId) { if (activityId == null) { throw new NullPointerException(); } Activity activity = (Activity) activitiesById.get(activityId); if (activity == null) { activity = new Activity(activityId); updateActivity(activity); activitiesById.put(activityId, activity); } return activity; }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
synchronized public ICategory getCategory(String categoryId) { if (categoryId == null) { throw new NullPointerException(); } Category category = (Category) categoriesById.get(categoryId); if (category == null) { category = new Category(categoryId); updateCategory(category); categoriesById.put(categoryId, category); } return category; }
// in Eclipse UI/org/eclipse/ui/internal/activities/MutableActivityManager.java
synchronized public IIdentifier getIdentifier(String identifierId) { if (identifierId == null) { throw new NullPointerException(); } Identifier identifier = (Identifier) identifiersById.get(identifierId); if (identifier == null) { identifier = new Identifier(identifierId); updateIdentifier(identifier); identifiersById.put(identifierId, identifier); } return identifier; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void assertInstance(Object object, Class c, boolean allowNull) { if (object == null && allowNull) { return; } if (object == null || c == null) { throw new NullPointerException(); } else if (!c.isInstance(object)) { throw new IllegalArgumentException(); } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void diff(Map left, Map right, Set leftOnly, Set different, Set rightOnly) { if (left == null || right == null || leftOnly == null || different == null || rightOnly == null) { throw new NullPointerException(); } Iterator iterator = left.keySet().iterator(); while (iterator.hasNext()) { Object key = iterator.next(); if (!right.containsKey(key)) { leftOnly.add(key); } else if (!Util.equals(left.get(key), right.get(key))) { different.add(key); } } iterator = right.keySet().iterator(); while (iterator.hasNext()) { Object key = iterator.next(); if (!left.containsKey(key)) { rightOnly.add(key); } } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static void diff(Set left, Set right, Set leftOnly, Set rightOnly) { if (left == null || right == null || leftOnly == null || rightOnly == null) { throw new NullPointerException(); } Iterator iterator = left.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); if (!right.contains(object)) { leftOnly.add(object); } } iterator = right.iterator(); while (iterator.hasNext()) { Object object = iterator.next(); if (!left.contains(object)) { rightOnly.add(object); } } }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static Collection safeCopy(Collection collection, Class c, boolean allowNullElements) { if (collection == null || c == null) { throw new NullPointerException(); } collection = Collections.unmodifiableCollection(new ArrayList( collection)); Iterator iterator = collection.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return collection; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static List safeCopy(List list, Class c, boolean allowNullElements) { if (list == null || c == null) { throw new NullPointerException(); } list = Collections.unmodifiableList(new ArrayList(list)); Iterator iterator = list.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return list; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static Map safeCopy(Map map, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues) { if (map == null || keyClass == null || valueClass == null) { throw new NullPointerException(); } map = Collections.unmodifiableMap(new HashMap(map)); Iterator iterator = map.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); assertInstance(entry.getKey(), keyClass, allowNullKeys); assertInstance(entry.getValue(), valueClass, allowNullValues); } return map; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static Set safeCopy(Set set, Class c, boolean allowNullElements) { if (set == null || c == null) { throw new NullPointerException(); } set = Collections.unmodifiableSet(new HashSet(set)); Iterator iterator = set.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return set; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static SortedMap safeCopy(SortedMap sortedMap, Class keyClass, Class valueClass, boolean allowNullKeys, boolean allowNullValues) { if (sortedMap == null || keyClass == null || valueClass == null) { throw new NullPointerException(); } sortedMap = Collections.unmodifiableSortedMap(new TreeMap(sortedMap)); Iterator iterator = sortedMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); assertInstance(entry.getKey(), keyClass, allowNullKeys); assertInstance(entry.getValue(), valueClass, allowNullValues); } return sortedMap; }
// in Eclipse UI/org/eclipse/ui/internal/util/Util.java
public static SortedSet safeCopy(SortedSet sortedSet, Class c, boolean allowNullElements) { if (sortedSet == null || c == null) { throw new NullPointerException(); } sortedSet = Collections.unmodifiableSortedSet(new TreeSet(sortedSet)); Iterator iterator = sortedSet.iterator(); while (iterator.hasNext()) { assertInstance(iterator.next(), c, allowNullElements); } return sortedSet; }
// in Eclipse UI/org/eclipse/ui/keys/KeyFormatterFactory.java
public static void setDefault(IKeyFormatter defaultKeyFormatter) { if (defaultKeyFormatter == null) { throw new NullPointerException(); } KeyFormatterFactory.defaultKeyFormatter = defaultKeyFormatter; }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(ModifierKey modifierKey, NaturalKey naturalKey) { if (modifierKey == null) { throw new NullPointerException(); } return new KeyStroke( new TreeSet(Collections.singletonList(modifierKey)), naturalKey); }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } SortedSet modifierKeys = new TreeSet(); NaturalKey naturalKey = null; StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_DELIMITERS, true); int i = 0; while (stringTokenizer.hasMoreTokens()) { String token = stringTokenizer.nextToken(); if (i % 2 == 0) { if (stringTokenizer.hasMoreTokens()) { token = token.toUpperCase(); ModifierKey modifierKey = (ModifierKey) ModifierKey.modifierKeysByName .get(token); if (modifierKey == null || !modifierKeys.add(modifierKey)) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token); } } else if (token.length() == 1) { naturalKey = CharacterKey.getInstance(token.charAt(0)); break; } else { token = token.toUpperCase(); naturalKey = (NaturalKey) CharacterKey.characterKeysByName .get(token); if (naturalKey == null) { naturalKey = (NaturalKey) SpecialKey.specialKeysByName .get(token); } if (naturalKey == null) { throw new ParseException( "Cannot create key stroke with invalid natural key: " //$NON-NLS-1$ + token); } } } i++; } try { return new KeyStroke(modifierKeys, naturalKey); } catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(KeySequence keySequence, KeyStroke keyStroke) { if (keySequence == null || keyStroke == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(keySequence.getKeyStrokes()); keyStrokes.add(keyStroke); return new KeySequence(keyStrokes); }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(); StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_STROKE_DELIMITERS); while (stringTokenizer.hasMoreTokens()) { keyStrokes.add(KeyStroke.getInstance(stringTokenizer.nextToken())); } try { return new KeySequence(keyStrokes); } catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public boolean endsWith(KeySequence keySequence, boolean equals) { if (keySequence == null) { throw new NullPointerException(); } return Util.endsWith(keyStrokes, keySequence.keyStrokes, equals); }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public boolean startsWith(KeySequence keySequence, boolean equals) { if (keySequence == null) { throw new NullPointerException(); } return Util.startsWith(keyStrokes, keySequence.keyStrokes, equals); }
// in Eclipse UI/org/eclipse/ui/SubActionBars.java
protected final void setServiceLocator(final IServiceLocator locator) { if (locator == null) { throw new NullPointerException("The service locator cannot be null"); //$NON-NLS-1$ } this.serviceLocator = locator; }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public void addHandlerListener( org.eclipse.ui.commands.IHandlerListener handlerListener) { if (handlerListener == null) { throw new NullPointerException(); } if (handlerListeners == null) { handlerListeners = new ArrayList(); } if (!handlerListeners.contains(handlerListener)) { handlerListeners.add(handlerListener); } }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
protected void fireHandlerChanged( final org.eclipse.ui.commands.HandlerEvent handlerEvent) { if (handlerEvent == null) { throw new NullPointerException(); } if (handlerListeners != null) { for (int i = 0; i < handlerListeners.size(); i++) { ((org.eclipse.ui.commands.IHandlerListener) handlerListeners .get(i)).handlerChanged(handlerEvent); } } if (super.hasListeners()) { final boolean enabledChanged; final boolean handledChanged; if (handlerEvent.haveAttributeValuesByNameChanged()) { Map previousAttributes = handlerEvent .getPreviousAttributeValuesByName(); Object attribute = previousAttributes.get("enabled"); //$NON-NLS-1$ if (attribute instanceof Boolean) { enabledChanged = ((Boolean) attribute).booleanValue(); } else { enabledChanged = false; } attribute = previousAttributes .get(IHandlerAttributes.ATTRIBUTE_HANDLED); if (attribute instanceof Boolean) { handledChanged = ((Boolean) attribute).booleanValue(); } else { handledChanged = false; } } else { enabledChanged = false; handledChanged = true; } final HandlerEvent newEvent = new HandlerEvent(this, enabledChanged, handledChanged); super.fireHandlerChanged(newEvent); } }
// in Eclipse UI/org/eclipse/ui/commands/AbstractHandler.java
public void removeHandlerListener( org.eclipse.ui.commands.IHandlerListener handlerListener) { if (handlerListener == null) { throw new NullPointerException(); } if (handlerListeners == null) { return; } if (handlerListeners != null) { handlerListeners.remove(handlerListener); } if (handlerListeners.isEmpty()) { handlerListeners = null; } }
// in Eclipse UI/org/eclipse/ui/AbstractSourceProvider.java
public final void addSourceProviderListener( final ISourceProviderListener listener) { if (listener == null) { throw new NullPointerException("The listener cannot be null"); //$NON-NLS-1$ } if (listenerCount == listeners.length) { final ISourceProviderListener[] growArray = new ISourceProviderListener[listeners.length + 4]; System.arraycopy(listeners, 0, growArray, 0, listeners.length); listeners = growArray; } listeners[listenerCount++] = listener; }
// in Eclipse UI/org/eclipse/ui/AbstractSourceProvider.java
public final void removeSourceProviderListener( final ISourceProviderListener listener) { if (listener == null) { throw new NullPointerException("The listener cannot be null"); //$NON-NLS-1$ } int emptyIndex = -1; for (int i = 0; i < listenerCount; i++) { if (listeners[i] == listener) { listeners[i] = null; emptyIndex = i; } } if (emptyIndex != -1) { // Compact the array. for (int i = emptyIndex + 1; i < listenerCount; i++) { listeners[i - 1] = listeners[i]; } listenerCount--; } }
0 0 0 0 0
unknown (Lib) NumberFormatException 0 0 1
            
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public static Shell getSplashShell(Display display) throws NumberFormatException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { Shell splashShell = (Shell) display.getData(DATA_SPLASH_SHELL); if (splashShell != null) return splashShell; String splashHandle = System.getProperty(PROP_SPLASH_HANDLE); if (splashHandle == null) { return null; } // look for the 32 bit internal_new shell method try { Method method = Shell.class.getMethod( "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ // we're on a 32 bit platform so invoke it with splash // handle as an int splashShell = (Shell) method.invoke(null, new Object[] { display, new Integer(splashHandle) }); } catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } } display.setData(DATA_SPLASH_SHELL, splashShell); return splashShell; }
22
            
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return DOUBLE_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return FLOAT_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return INT_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/preferences/ScopedPreferenceStore.java
catch (NumberFormatException e) { return LONG_DEFAULT_DEFAULT; }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/preferences/WorkingCopyPreferences.java
catch (NumberFormatException e) { // use default }
// in Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java
catch (NumberFormatException e) { // leave size value at MIN_DEFAULT_WIDTH }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (NumberFormatException e) { // skip this one }
// in Eclipse UI/org/eclipse/ui/internal/ActionDescriptor.java
catch (NumberFormatException e) { WorkbenchPlugin.log("Invalid accelerator declaration for action: " + id, e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/layout/TrimDragPreferenceDialog.java
catch (NumberFormatException e) { // If it fails...just leave it... }
// in Eclipse UI/org/eclipse/ui/internal/presentations/PresentationSerializer.java
catch (NumberFormatException e) { }
// in Eclipse UI/org/eclipse/ui/internal/misc/UIStats.java
catch (NumberFormatException e) { //this is just debugging code -- ok to swallow exception }
// in Eclipse UI/org/eclipse/ui/internal/util/ConfigurationElementMemento.java
catch (NumberFormatException eNumberFormat) { }
// in Eclipse UI/org/eclipse/ui/internal/util/ConfigurationElementMemento.java
catch (NumberFormatException eNumberFormat) { }
// in Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java
catch (NumberFormatException e) { fastViewWidthRatio = IPageLayout.DEFAULT_FASTVIEW_RATIO; }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveExtensionReader.java
catch (NumberFormatException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/themes/Theme.java
catch (NumberFormatException e) { return 0; }
// in Eclipse UI/org/eclipse/ui/SelectionEnabler.java
catch (NumberFormatException e) { mode = UNKNOWN; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (NumberFormatException e) { WorkbenchPlugin.log("Memento problem - Invalid float for key: " //$NON-NLS-1$ + key + " value: " + strValue, e); //$NON-NLS-1$ return null; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (NumberFormatException e) { WorkbenchPlugin .log("Memento problem - invalid integer for key: " + key //$NON-NLS-1$ + " value: " + strValue, e); //$NON-NLS-1$ return null; }
0 0
unknown (Lib) OperationCanceledException 0 0 0 6
            
// in Eclipse UI/org/eclipse/ui/internal/SaveableHelper.java
catch (OperationCanceledException e) { // The user pressed cancel. Fall through to return failure }
// in Eclipse UI/org/eclipse/ui/internal/about/BundleSigningInfo.java
catch (OperationCanceledException e) { }
// in Eclipse UI/org/eclipse/ui/internal/testing/WorkbenchTestable.java
catch (OperationCanceledException e) { // ignore }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java
catch (OperationCanceledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e .getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/operations/AdvancedValidationUserApprover.java
catch (OperationCanceledException e) { return Status.CANCEL_STATUS; }
// in Eclipse UI/org/eclipse/ui/operations/OperationHistoryActionHandler.java
catch (OperationCanceledException e) { // the operation was cancelled. Do nothing. }
0 0
unknown (Lib) ParameterValueConversionException 2
            
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
private AbstractParameterValueConverter getConverter() throws ParameterValueConversionException { if (parameterValueConverter == null) { try { parameterValueConverter = (AbstractParameterValueConverter) converterConfigurationElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONVERTER); } catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ } } return parameterValueConverter; }
2
            
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ }
3
            
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
public final Object convertToObject(final String parameterValue) throws ParameterValueConversionException { return getConverter().convertToObject(parameterValue); }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
public final String convertToString(final Object parameterValue) throws ParameterValueConversionException { return getConverter().convertToString(parameterValue); }
// in Eclipse UI/org/eclipse/ui/internal/commands/ParameterValueConverterProxy.java
private AbstractParameterValueConverter getConverter() throws ParameterValueConversionException { if (parameterValueConverter == null) { try { parameterValueConverter = (AbstractParameterValueConverter) converterConfigurationElement .createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONVERTER); } catch (final CoreException e) { throw new ParameterValueConversionException( "Problem creating parameter value converter", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValueConversionException( "Parameter value converter was not a subclass of AbstractParameterValueConverter", e); //$NON-NLS-1$ } } return parameterValueConverter; }
0 0 0
unknown (Lib) ParameterValuesException 2
            
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
public final IParameterValues getValues() throws ParameterValuesException { if (values == null) { try { values = (IParameterValues) valuesConfigurationElement .createExecutableExtension(ATTRIBUTE_VALUES); } catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ } } return values; }
2
            
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ }
1
            
// in Eclipse UI/org/eclipse/ui/internal/commands/Parameter.java
public final IParameterValues getValues() throws ParameterValuesException { if (values == null) { try { values = (IParameterValues) valuesConfigurationElement .createExecutableExtension(ATTRIBUTE_VALUES); } catch (final CoreException e) { throw new ParameterValuesException( "Problem creating parameter values", e); //$NON-NLS-1$ } catch (final ClassCastException e) { throw new ParameterValuesException( "Parameter values were not an instance of IParameterValues", e); //$NON-NLS-1$ } } return values; }
0 0 0
checked (Domain) ParseException
public final class ParseException extends Exception {

    /**
     * Generated serial version UID for this class.
     * @since 3.1
     */
    private static final long serialVersionUID = 3257009864814376241L;

    /**
     * Constructs a <code>ParseException</code> with the specified detail
     * message.
     * 
     * @param s
     *            the detail message.
     */
    public ParseException(final String s) {
        super(s);
    }
}
4
            
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } SortedSet modifierKeys = new TreeSet(); NaturalKey naturalKey = null; StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_DELIMITERS, true); int i = 0; while (stringTokenizer.hasMoreTokens()) { String token = stringTokenizer.nextToken(); if (i % 2 == 0) { if (stringTokenizer.hasMoreTokens()) { token = token.toUpperCase(); ModifierKey modifierKey = (ModifierKey) ModifierKey.modifierKeysByName .get(token); if (modifierKey == null || !modifierKeys.add(modifierKey)) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token); } } else if (token.length() == 1) { naturalKey = CharacterKey.getInstance(token.charAt(0)); break; } else { token = token.toUpperCase(); naturalKey = (NaturalKey) CharacterKey.characterKeysByName .get(token); if (naturalKey == null) { naturalKey = (NaturalKey) SpecialKey.specialKeysByName .get(token); } if (naturalKey == null) { throw new ParseException( "Cannot create key stroke with invalid natural key: " //$NON-NLS-1$ + token); } } } i++; } try { return new KeyStroke(modifierKeys, naturalKey); } catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(); StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_STROKE_DELIMITERS); while (stringTokenizer.hasMoreTokens()) { keyStrokes.add(KeyStroke.getInstance(stringTokenizer.nextToken())); } try { return new KeySequence(keyStrokes); } catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } }
2
            
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); }
4
            
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
private static void getBindingForPlatform(KeySequence keySequence, String platform, ParameterizedCommand parameterizedCommand, String schemeId, String contextId, String locale, List bindings, String modifiedSequence, String[] platforms) throws ParseException { int j = 0; for (; j < platforms.length; j++) { if(platforms[j].equals(SWT.getPlatform())) { KeyBinding newBinding = new KeyBinding(KeySequence .getInstance(modifiedSequence), parameterizedCommand, schemeId, contextId, locale, platforms[j], null, Binding.SYSTEM); bindings.add(newBinding); break; } } if(j == platforms.length) { // platform doesn't match. use the unmodified sequence KeyBinding newBinding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, null, null, Binding.SYSTEM); bindings.add(newBinding); } }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
private static void addGenericBindings(KeySequence keySequence, ParameterizedCommand parameterizedCommand, String schemeId, String contextId, String locale, List bindings, String modifiedSequence, String[] platforms) throws ParseException { KeyBinding originalBinding = new KeyBinding(keySequence, parameterizedCommand, schemeId, contextId, locale, null, null, Binding.SYSTEM); bindings.add(originalBinding); String platform = SWT.getPlatform(); boolean modifierExists = false; for (int i = 0; i < platforms.length; i++) { if(platforms[i].equals(platform)) { modifierExists = true; break; } } if(modifierExists) { KeyBinding newBinding = new KeyBinding(KeySequence.getInstance(modifiedSequence), parameterizedCommand, schemeId, contextId, locale, SWT.getPlatform(), null, Binding.SYSTEM); KeyBinding deleteBinding = new KeyBinding(keySequence, null, schemeId, contextId, locale, SWT.getPlatform(), null, Binding.SYSTEM); bindings.add(newBinding); bindings.add(deleteBinding); } }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
public static KeyStroke getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } SortedSet modifierKeys = new TreeSet(); NaturalKey naturalKey = null; StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_DELIMITERS, true); int i = 0; while (stringTokenizer.hasMoreTokens()) { String token = stringTokenizer.nextToken(); if (i % 2 == 0) { if (stringTokenizer.hasMoreTokens()) { token = token.toUpperCase(); ModifierKey modifierKey = (ModifierKey) ModifierKey.modifierKeysByName .get(token); if (modifierKey == null || !modifierKeys.add(modifierKey)) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token); } } else if (token.length() == 1) { naturalKey = CharacterKey.getInstance(token.charAt(0)); break; } else { token = token.toUpperCase(); naturalKey = (NaturalKey) CharacterKey.characterKeysByName .get(token); if (naturalKey == null) { naturalKey = (NaturalKey) SpecialKey.specialKeysByName .get(token); } if (naturalKey == null) { throw new ParseException( "Cannot create key stroke with invalid natural key: " //$NON-NLS-1$ + token); } } } i++; } try { return new KeyStroke(modifierKeys, naturalKey); } catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
public static KeySequence getInstance(String string) throws ParseException { if (string == null) { throw new NullPointerException(); } List keyStrokes = new ArrayList(); StringTokenizer stringTokenizer = new StringTokenizer(string, KEY_STROKE_DELIMITERS); while (stringTokenizer.hasMoreTokens()) { keyStrokes.add(KeyStroke.getInstance(stringTokenizer.nextToken())); } try { return new KeySequence(keyStrokes); } catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } }
9
            
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final ParseException e) { addWarning(warningsToLog, "Could not parse", null, //$NON-NLS-1$ commandId, "keySequence", keySequenceText); //$NON-NLS-1$ continue; }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch(ParseException e) { bindings.clear(); addWarning( warningsToLog, "Cannot create modified sequence for key binding", //$NON-NLS-1$ sequenceModifier, parameterizedCommand.getId(), ATT_REPLACE, replaceSequence); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final ParseException e) { addWarning(warningsToLog, "Could not parse key sequence", //$NON-NLS-1$ configurationElement, commandId, "keySequence", //$NON-NLS-1$ keySequenceText); return null; }
// in Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java
catch (ParseException e) { outOfOrderKeys = KeySequence.getInstance(); String message = "Could not parse out-of-order keys definition: 'ESC DEL'. Continuing with no out-of-order keys."; //$NON-NLS-1$ WorkbenchPlugin.log(message, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e)); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return new HashMap(); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final org.eclipse.ui.keys.ParseException e) { return new HashMap(); }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return null; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/commands/CommandManagerLegacyWrapper.java
catch (final ParseException e) { return false; }
0 0
unknown (Lib) ParserConfigurationException 0 0 0 2
            
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }
1
            
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (ParserConfigurationException e) { // throw new Error(e); throw new Error(e.getMessage()); }
1
unknown (Domain) PartInitException
public class PartInitException extends WorkbenchException {
    
    /**
     * Generated serial version UID for this class.
     * @since 3.1
     */
    private static final long serialVersionUID = 3257284721296684850L;

    /**
     * Creates a new exception with the given message.
     * 
     * @param message the message
     */
    public PartInitException(String message) {
        super(message);
    }

    /**
     * Creates a new exception with the given message.
     * 
     * @param message the message
     * @param nestedException a exception to be wrapped by this PartInitException
     */
    public PartInitException(String message, Throwable nestedException) {
        super(message, nestedException);
    }

    /**
     * Creates a new exception with the given status object.  The message
     * of the given status is used as the exception message.
     *
     * @param status the status object to be associated with this exception
     */
    public PartInitException(IStatus status) {
        super(status);
    }
}
29
            
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public IViewPart showView(String viewId, String secondaryId) throws PartInitException { ViewFactory factory = getViewFactory(); IViewReference ref = factory.createView(viewId, secondaryId); IViewPart part = (IViewPart) ref.getPart(true); if (part == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, ref.getId())); } ViewSite site = (ViewSite) part.getSite(); ViewPane pane = (ViewPane) site.getPane(); IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE); if (openViewMode == IPreferenceConstants.OVM_FAST && fastViewManager != null) { fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, true); setActiveFastView(ref); } else if (openViewMode == IPreferenceConstants.OVM_FLOAT && presentation.canDetach()) { presentation.addDetachedPart(pane); } else { if (useNewMinMax(this)) { // Is this view going to show in the trim? LayoutPart vPart = presentation.findPart(viewId, secondaryId); // Determine if there is a trim stack that should get the view String trimId = null; // If we can locate the correct trim stack then do so if (vPart != null) { String id = null; ILayoutContainer container = vPart.getContainer(); if (container instanceof ContainerPlaceholder) id = ((ContainerPlaceholder)container).getID(); else if (container instanceof ViewStack) id = ((ViewStack)container).getID(); else if (container instanceof DetachedPlaceHolder) { // Views in a detached window don't participate in the // minimize behavior so just revert to the default // behavior presentation.addPart(pane); return part; } // Is this place-holder in the trim? if (id != null && fastViewManager.getFastViews(id).size() > 0) { trimId = id; } } // No explicit trim found; If we're maximized then we either have to find an // arbitrary stack... if (trimId == null && presentation.getMaximizedStack() != null) { if (vPart == null) { ViewStackTrimToolBar blTrimStack = fastViewManager.getBottomRightTrimStack(); if (blTrimStack != null) { // OK, we've found a trim stack to add it to... trimId = blTrimStack.getId(); // Since there was no placeholder we have to add one LayoutPart blPart = presentation.findPart(trimId, null); if (blPart instanceof ContainerPlaceholder) { ContainerPlaceholder cph = (ContainerPlaceholder) blPart; if (cph.getRealContainer() instanceof ViewStack) { ViewStack vs = (ViewStack) cph.getRealContainer(); // Create a 'compound' id if this is a multi-instance part String compoundId = ref.getId(); if (ref.getSecondaryId() != null) compoundId = compoundId + ':' + ref.getSecondaryId(); // Add the new placeholder vs.add(new PartPlaceholder(compoundId)); } } } } } // If we have a trim stack located then add the view to it if (trimId != null) { fastViewManager.addViewReference(trimId, -1, ref, true); } else { boolean inMaximizedStack = vPart != null && vPart.getContainer() == presentation.getMaximizedStack(); // Do the default behavior presentation.addPart(pane); // Now, if we're maximized then we have to minimize the new stack if (presentation.getMaximizedStack() != null && !inMaximizedStack) { vPart = presentation.findPart(viewId, secondaryId); if (vPart != null && vPart.getContainer() instanceof ViewStack) { ViewStack vs = (ViewStack)vPart.getContainer(); vs.setState(IStackPresentationSite.STATE_MINIMIZED); // setting the state to minimized will create the trim toolbar // so we don't need a null pointer check here... fastViewManager.getViewStackTrimToolbar(vs.getID()).setRestoreOnUnzoom(true); } } } } else { presentation.addPart(pane); } } // Ensure that the newly showing part is enabled if (pane != null && pane.getControl() != null) pane.getControl().setEnabled(true); return part; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(final String viewID, final String secondaryID, final int mode) throws PartInitException { if (secondaryID != null) { if (secondaryID.length() == 0 || secondaryID.indexOf(ViewFactory.ID_SEP) != -1) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalSecondaryId); } } if (!certifyMode(mode)) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalViewMode); } // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyShowView(viewID, secondaryID, mode); } catch (PartInitException e) { result[0] = e; } } }); if (result[0] instanceof IViewPart) { return (IViewPart) result[0]; } else if (result[0] instanceof PartInitException) { throw (PartInitException) result[0]; } else { throw new PartInitException(WorkbenchMessages.WorkbenchPage_AbnormalWorkbenchCondition); } }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithPartInitExceptions(StartupRunnable r) throws PartInitException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (PartInitException) throwable; } else { throw new PartInitException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
public void openURL(URL url) throws PartInitException { // format the href for an html file (file:///<filename.html> // required for Mac only. String href = url.toString(); if (href.startsWith("file:")) { //$NON-NLS-1$ href = href.substring(5); while (href.startsWith("/")) { //$NON-NLS-1$ href = href.substring(1); } href = "file:///" + href; //$NON-NLS-1$ } final String localHref = href; final Display d = Display.getCurrent(); if (Util.isWindows()) { Program.launch(localHref); } else if (Util.isMac()) { try { Runtime.getRuntime().exec("/usr/bin/open " + localHref); //$NON-NLS-1$ } catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); } } else { Thread launcher = new Thread("About Link Launcher") {//$NON-NLS-1$ public void run() { try { /* * encoding the href as the browser does not open if * there is a space in the url. Bug 77840 */ String encodedLocalHref = urlEncodeForSpaces(localHref .toCharArray()); if (webBrowserOpened) { Runtime .getRuntime() .exec( webBrowser + " -remote openURL(" + encodedLocalHref + ")"); //$NON-NLS-1$ //$NON-NLS-2$ } else { Process p = openWebBrowser(encodedLocalHref); webBrowserOpened = true; try { if (p != null) { p.waitFor(); } } catch (InterruptedException e) { openWebBrowserError(d); } finally { webBrowserOpened = false; } } } catch (IOException e) { openWebBrowserError(d); } } }; launcher.start(); } }
// in Eclipse UI/org/eclipse/ui/internal/ViewFactory.java
public IViewReference createView(String id, String secondaryId) throws PartInitException { IViewDescriptor desc = viewReg.find(id); // ensure that the view id is valid if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, id )); } // ensure that multiple instances are allowed if a secondary id is given if (secondaryId != null) { if (!desc.getAllowMultiple()) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_noMultiple, id)); } } String key = getKey(id, secondaryId); IViewReference ref = (IViewReference) counter.get(key); if (ref == null) { IMemento memento = (IMemento) mementoTable.get(key); ref = new ViewReference(this, id, secondaryId, memento); mementoTable.remove(key); counter.put(key, ref); getWorkbenchPage().partAdded((ViewReference)ref); } else { counter.addRef(key); } return ref; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditor(String editorId, IEditorInput input, boolean setVisible, IMemento editorState) throws PartInitException { if (editorId == null || input == null) { throw new IllegalArgumentException(); } IEditorDescriptor desc = getEditorRegistry().findEditor(editorId); if (desc != null && !desc.isOpenExternal() && isLargeDocument(input)) { desc = getAlternateEditor(); if (desc == null) { // the user pressed cancel in the editor selection dialog return null; } } if (desc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorId)); } IEditorReference result = openEditorFromDescriptor((EditorDescriptor) desc, input, editorState); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditorFromDescriptor(EditorDescriptor desc, IEditorInput input, IMemento editorState) throws PartInitException { IEditorReference result = null; if (desc.isInternal()) { result = reuseInternalEditor(desc, input); if (result == null) { result = new EditorReference(this, input, desc, editorState); } } else if (desc.getId() .equals(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { if (ComponentSupport.inPlaceEditorSupported()) { result = new EditorReference(this, input, desc); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)) { IPathEditorInput pathInput = getPathEditorInput(input); if (pathInput != null) { result = openSystemExternalEditor(pathInput.getPath()); } else { throw new PartInitException( WorkbenchMessages.EditorManager_systemEditorError); } } else if (desc.isOpenExternal()) { result = openExternalEditor(desc, input); } else { // this should never happen throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_invalidDescriptor, desc .getId())); } if (result != null) { createEditorTab((EditorReference) result, ""); //$NON-NLS-1$ } Workbench wb = (Workbench) window.getWorkbench(); wb.getEditorHistory().add(input, desc); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorReference[] openMultiEditor(final IEditorReference ref, final AbstractMultiEditor part, final MultiEditorInput input) throws PartInitException { String[] editorArray = input.getEditors(); IEditorInput[] inputArray = input.getInput(); // find all descriptors EditorDescriptor[] descArray = new EditorDescriptor[editorArray.length]; IEditorReference refArray[] = new IEditorReference[editorArray.length]; IEditorPart partArray[] = new IEditorPart[editorArray.length]; IEditorRegistry reg = getEditorRegistry(); for (int i = 0; i < editorArray.length; i++) { EditorDescriptor innerDesc = (EditorDescriptor) reg .findEditor(editorArray[i]); if (innerDesc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorArray[i])); } descArray[i] = innerDesc; InnerEditor innerRef = new InnerEditor(ref, part, inputArray[i], descArray[i]); refArray[i] = innerRef; partArray[i] = innerRef.getEditor(true); } part.setChildren(partArray); return refArray; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
EditorSite createSite(final IEditorReference ref, final IEditorPart part, final EditorDescriptor desc, final IEditorInput input) throws PartInitException { EditorSite site = new EditorSite(ref, part, page, desc); if (desc != null) { site.setActionBars(createEditorActionBars(desc, site)); } else { site.setActionBars(createEmptyEditorActionBars(site)); } final String label = part.getTitle(); // debugging only try { try { UIStats.start(UIStats.INIT_PART, label); part.init(site, input); } finally { UIStats.end(UIStats.INIT_PART, part, label); } // Sanity-check the site if (part.getSite() != site || part.getEditorSite() != site) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_siteIncorrect, desc .getId())); } } catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); } return site; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorPart createPart(final EditorDescriptor desc) throws PartInitException { try { IEditorPart result = desc.createEditor(); IConfigurationElement element = desc.getConfigurationElement(); if (element != null) { page.getExtensionTracker().registerObject( element.getDeclaringExtension(), result, IExtensionTracker.REF_WEAK); } return result; } catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openSystemExternalEditor(final IPath location) throws PartInitException { if (location == null) { throw new IllegalArgumentException(); } final boolean result[] = { false }; BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { if (location != null) { result[0] = Program.launch(location.toOSString()); } } }); if (!result[0]) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unableToOpenExternalEditor, location)); } // We do not have an editor part for external editors return null; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorInput getRestoredInput() throws PartInitException { if (restoredInput != null) { return restoredInput; } // Get the input factory. IMemento editorMem = getMemento(); if (editorMem == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_persisted_state, getId(), getName())); } IMemento inputMem = editorMem .getChild(IWorkbenchConstants.TAG_INPUT); String factoryID = null; if (inputMem != null) { factoryID = inputMem .getString(IWorkbenchConstants.TAG_FACTORY_ID); } if (factoryID == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_input_factory_ID, getId(), getName())); } IAdaptable input = null; String label = null; // debugging only if (UIStats.isDebugging(UIStats.CREATE_PART_INPUT)) { label = getName() != null ? getName() : factoryID; } try { UIStats.start(UIStats.CREATE_PART_INPUT, label); IElementFactory factory = PlatformUI.getWorkbench() .getElementFactory(factoryID); if (factory == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_bad_element_factory, new Object[] { factoryID, getId(), getName() })); } // Get the input element. input = factory.createElement(inputMem); if (input == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_create_element_returned_null, new Object[] { factoryID, getId(), getName() })); } } finally { UIStats.end(UIStats.CREATE_PART_INPUT, input, label); } if (!(input instanceof IEditorInput)) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_wrong_createElement_result, new Object[] { factoryID, getId(), getName() })); } restoredInput = (IEditorInput) input; return restoredInput; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorPart createPartHelper() throws PartInitException { // Things that will need to be disposed if an exception occurs (listed // in the order they // need to be disposed, and set to null if they haven't been created yet) Composite content = null; IEditorPart part = null; EditorActionBars actionBars = null; EditorSite site = null; try { IEditorInput editorInput = getEditorInput(); // Get the editor descriptor. String editorID = getId(); EditorDescriptor desc = getDescriptor(); if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_missing_editor_descriptor, editorID)); } if (desc.isInternal()) { // Create an editor instance. try { UIStats.start(UIStats.CREATE_PART, editorID); part = manager.createPart(desc); // MultiEditor backwards compatibility if (part != null && part instanceof MultiEditor) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } if (part instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)part); } } finally { UIStats.end(UIStats.CREATE_PART, this, editorID); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { part = ComponentSupport.getSystemInPlaceEditor(); if (part == null) { throw new PartInitException(WorkbenchMessages.EditorManager_no_in_place_support); } } else { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_invalid_editor_descriptor, editorID)); } // Create a pane for this part PartPane pane = getPane(); pane.createControl(getPaneControlContainer()); // Create controls int style = SWT.NONE; if(part instanceof IWorkbenchPartOrientation){ style = ((IWorkbenchPartOrientation) part).getOrientation(); } // Link everything up to the part reference (the part reference itself should not have // been modified until this point) site = manager.createSite(this, part, desc, editorInput); // if there is saved state that's appropriate, pass it on if (part instanceof IPersistableEditor && editorState != null) { ((IPersistableEditor) part).restoreState(editorState); } // Remember the site and the action bars (now that we've created them, we'll need to dispose // them if an exception occurs) actionBars = (EditorActionBars) site.getActionBars(); Composite parent = (Composite)pane.getControl(); EditorDescriptor descriptor = getDescriptor(); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_Editor, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, editorID); part.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, part, editorID); } // Create the inner editors of an AbstractMultiEditor (but not MultiEditor) here // MultiEditor backwards compatibility if (part != null && part instanceof AbstractMultiEditor && !(part instanceof MultiEditor)) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } // The editor should now be fully created. Exercise its public interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave badly, it's much better // that it does so now while we can still cancel creation of the part. PartTester.testEditor(part); return part; } catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); } }
// in Eclipse UI/org/eclipse/ui/internal/FolderLayout.java
public void addView(String viewId) { if (pageLayout.checkPartInLayout(viewId)) { return; } try { IViewDescriptor descriptor = viewFactory.getViewRegistry().find( ViewFactory.extractPrimaryId(viewId)); if (descriptor == null) { throw new PartInitException("View descriptor not found: " + viewId); //$NON-NLS-1$ } if (WorkbenchActivityHelper.filterItem(descriptor)) { //create a placeholder instead. addPlaceholder(viewId); LayoutHelper.addViewActivator(pageLayout, viewId); } else { ViewPane newPart = LayoutHelper.createView(pageLayout .getViewFactory(), viewId); linkPartToPageLayout(viewId, newPart); folder.add(newPart); } } catch (PartInitException e) { // cannot safely open the dialog so log the problem WorkbenchPlugin.log(getClass(), "addView(String)", e); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
private IWorkbenchPart createPartHelper() throws PartInitException { IWorkbenchPart result = null; IMemento stateMem = null; if (memento != null) { stateMem = memento.getChild(IWorkbenchConstants.TAG_VIEW_STATE); } IViewDescriptor desc = factory.viewReg.find(getId()); if (desc == null) { throw new PartInitException( NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, getId())); } // Create the part pane PartPane pane = getPane(); // Create the pane's top-level control pane.createControl(factory.page.getClientComposite()); String label = desc.getLabel(); // debugging only // Things that will need to be disposed if an exception occurs (they are // listed here // in the order they should be disposed) Composite content = null; IViewPart initializedView = null; ViewSite site = null; ViewActionBars actionBars = null; // End of things that need to be explicitly disposed from the try block try { IViewPart view = null; try { UIStats.start(UIStats.CREATE_PART, label); view = desc.createView(); } finally { UIStats.end(UIStats.CREATE_PART, view, label); } if (view instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)view); } // Create site site = new ViewSite(this, view, factory.page, desc); actionBars = new ViewActionBars(factory.page.getActionBars(), site, (ViewPane) pane); site.setActionBars(actionBars); try { UIStats.start(UIStats.INIT_PART, label); view.init(site, stateMem); // Once we've called init, we MUST dispose the view. Remember // the fact that // we've initialized the view in case an exception is thrown. initializedView = view; } finally { UIStats.end(UIStats.INIT_PART, view, label); } if (view.getSite() != site) { throw new PartInitException( WorkbenchMessages.ViewFactory_siteException, null); } int style = SWT.NONE; if (view instanceof IWorkbenchPartOrientation) { style = ((IWorkbenchPartOrientation) view).getOrientation(); } // Create the top-level composite { Composite parent = (Composite) pane.getControl(); ViewDescriptor descriptor = (ViewDescriptor) this.factory.viewReg.find(getId()); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_View, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, label); view.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, view, label); } } // Install the part's tools and menu { // // 3.3 start // IMenuService menuService = (IMenuService) site .getService(IMenuService.class); menuService.populateContributionManager( (ContributionManager) site.getActionBars() .getMenuManager(), "menu:" //$NON-NLS-1$ + site.getId()); menuService .populateContributionManager((ContributionManager) site .getActionBars().getToolBarManager(), "toolbar:" + site.getId()); //$NON-NLS-1$ // 3.3 end actionBuilder = new ViewActionBuilder(); actionBuilder.readActionExtensions(view); ActionDescriptor[] actionDescriptors = actionBuilder .getExtendedActions(); IKeyBindingService keyBindingService = view.getSite() .getKeyBindingService(); if (actionDescriptors != null) { for (int i = 0; i < actionDescriptors.length; i++) { ActionDescriptor actionDescriptor = actionDescriptors[i]; if (actionDescriptor != null) { IAction action = actionDescriptors[i].getAction(); if (action != null && action.getActionDefinitionId() != null) { keyBindingService.registerAction(action); } } } } site.getActionBars().updateActionBars(); } // The editor should now be fully created. Exercise its public // interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave // badly, it's much better // that it does so now while we can still cancel creation of the // part. PartTester.testView(view); result = view; IConfigurationElement element = (IConfigurationElement) Util.getAdapter(desc, IConfigurationElement.class); if (element != null) { factory.page.getExtensionTracker().registerObject( element.getDeclaringExtension(), view, IExtensionTracker.REF_WEAK); } } catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); } return result; }
5
            
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
50
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
private final void openView(final String viewId, final String secondaryId, final IWorkbenchWindow activeWorkbenchWindow) throws PartInitException { final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage == null) { return; } if (makeFast) { WorkbenchPage wp = (WorkbenchPage) activePage; Perspective persp = wp.getActivePerspective(); // If we're making a fast view then use the new mechanism directly boolean useNewMinMax = Perspective.useNewMinMax(persp); if (useNewMinMax) { IViewReference ref = persp.getViewReference(viewId, secondaryId); if (ref == null) return; persp.getFastViewManager().addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, true); wp.activate(ref.getPart(true)); return; } IViewReference ref = wp.findViewReference(viewId, secondaryId); if (ref == null) { IViewPart part = wp.showView(viewId, secondaryId, IWorkbenchPage.VIEW_CREATE); ref = (IViewReference)wp.getReference(part); } if (!wp.isFastView(ref)) { wp.addFastView(ref); } wp.activate(ref.getPart(true)); } else { activePage.showView(viewId, secondaryId, IWorkbenchPage.VIEW_ACTIVATE); } }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public IViewPart showView(String viewId, String secondaryId) throws PartInitException { ViewFactory factory = getViewFactory(); IViewReference ref = factory.createView(viewId, secondaryId); IViewPart part = (IViewPart) ref.getPart(true); if (part == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, ref.getId())); } ViewSite site = (ViewSite) part.getSite(); ViewPane pane = (ViewPane) site.getPane(); IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE); if (openViewMode == IPreferenceConstants.OVM_FAST && fastViewManager != null) { fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, true); setActiveFastView(ref); } else if (openViewMode == IPreferenceConstants.OVM_FLOAT && presentation.canDetach()) { presentation.addDetachedPart(pane); } else { if (useNewMinMax(this)) { // Is this view going to show in the trim? LayoutPart vPart = presentation.findPart(viewId, secondaryId); // Determine if there is a trim stack that should get the view String trimId = null; // If we can locate the correct trim stack then do so if (vPart != null) { String id = null; ILayoutContainer container = vPart.getContainer(); if (container instanceof ContainerPlaceholder) id = ((ContainerPlaceholder)container).getID(); else if (container instanceof ViewStack) id = ((ViewStack)container).getID(); else if (container instanceof DetachedPlaceHolder) { // Views in a detached window don't participate in the // minimize behavior so just revert to the default // behavior presentation.addPart(pane); return part; } // Is this place-holder in the trim? if (id != null && fastViewManager.getFastViews(id).size() > 0) { trimId = id; } } // No explicit trim found; If we're maximized then we either have to find an // arbitrary stack... if (trimId == null && presentation.getMaximizedStack() != null) { if (vPart == null) { ViewStackTrimToolBar blTrimStack = fastViewManager.getBottomRightTrimStack(); if (blTrimStack != null) { // OK, we've found a trim stack to add it to... trimId = blTrimStack.getId(); // Since there was no placeholder we have to add one LayoutPart blPart = presentation.findPart(trimId, null); if (blPart instanceof ContainerPlaceholder) { ContainerPlaceholder cph = (ContainerPlaceholder) blPart; if (cph.getRealContainer() instanceof ViewStack) { ViewStack vs = (ViewStack) cph.getRealContainer(); // Create a 'compound' id if this is a multi-instance part String compoundId = ref.getId(); if (ref.getSecondaryId() != null) compoundId = compoundId + ':' + ref.getSecondaryId(); // Add the new placeholder vs.add(new PartPlaceholder(compoundId)); } } } } } // If we have a trim stack located then add the view to it if (trimId != null) { fastViewManager.addViewReference(trimId, -1, ref, true); } else { boolean inMaximizedStack = vPart != null && vPart.getContainer() == presentation.getMaximizedStack(); // Do the default behavior presentation.addPart(pane); // Now, if we're maximized then we have to minimize the new stack if (presentation.getMaximizedStack() != null && !inMaximizedStack) { vPart = presentation.findPart(viewId, secondaryId); if (vPart != null && vPart.getContainer() instanceof ViewStack) { ViewStack vs = (ViewStack)vPart.getContainer(); vs.setState(IStackPresentationSite.STATE_MINIMIZED); // setting the state to minimized will create the trim toolbar // so we don't need a null pointer check here... fastViewManager.getViewStackTrimToolbar(vs.getID()).setRestoreOnUnzoom(true); } } } } else { presentation.addPart(pane); } } // Ensure that the newly showing part is enabled if (pane != null && pane.getControl() != null) pane.getControl().setEnabled(true); return part; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IViewPart busyShowView(String viewID, String secondaryID, int mode) throws PartInitException { Perspective persp = getActivePerspective(); if (persp == null) { return null; } // If this view is already visible just return. IViewReference ref = persp.findView(viewID, secondaryID); IViewPart view = null; if (ref != null) { view = ref.getView(true); } if (view != null) { busyShowView(view, mode); return view; } // Show the view. view = persp.showView(viewID, secondaryID); if (view != null) { busyShowView(view, mode); IWorkbenchPartReference partReference = getReference(view); PartPane partPane = getPane(partReference); partPane.setInLayout(true); window.firePerspectiveChanged(this, getPerspective(), partReference, CHANGE_VIEW_SHOW); window.firePerspectiveChanged(this, getPerspective(), CHANGE_VIEW_SHOW); } return view; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(IEditorInput input, String editorID) throws PartInitException { return openEditor(input, editorID, true, MATCH_INPUT); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(IEditorInput input, String editorID, boolean activate) throws PartInitException { return openEditor(input, editorID, activate, MATCH_INPUT); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(final IEditorInput input, final String editorID, final boolean activate, final int matchFlags) throws PartInitException { return openEditor(input, editorID, activate, matchFlags, null); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditor(final IEditorInput input, final String editorID, final boolean activate, final int matchFlags, final IMemento editorState) throws PartInitException { if (input == null || editorID == null) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditor(input, editorID, activate, matchFlags, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IEditorPart openEditorFromDescriptor(final IEditorInput input, final IEditorDescriptor editorDescriptor, final boolean activate, final IMemento editorState) throws PartInitException { if (input == null || !(editorDescriptor instanceof EditorDescriptor)) { throw new IllegalArgumentException(); } final IEditorPart result[] = new IEditorPart[1]; final PartInitException ex[] = new PartInitException[1]; BusyIndicator.showWhile(window.getWorkbench().getDisplay(), new Runnable() { public void run() { try { result[0] = busyOpenEditorFromDescriptor(input, (EditorDescriptor)editorDescriptor, activate, editorState); } catch (PartInitException e) { ex[0] = e; } } }); if (ex[0] != null) { throw ex[0]; } return result[0]; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorPart busyOpenEditor(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { final Workbench workbench = (Workbench) getWorkbenchWindow() .getWorkbench(); workbench.largeUpdateStart(); try { return busyOpenEditorBatched(input, editorID, activate, matchFlags, editorState); } finally { workbench.largeUpdateEnd(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorPart busyOpenEditorFromDescriptor(IEditorInput input, EditorDescriptor editorDescriptor, boolean activate, IMemento editorState) throws PartInitException { final Workbench workbench = (Workbench) getWorkbenchWindow() .getWorkbench(); workbench.largeUpdateStart(); try { return busyOpenEditorFromDescriptorBatched(input, editorDescriptor, activate, editorState); } finally { workbench.largeUpdateEnd(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
protected IEditorPart busyOpenEditorBatched(IEditorInput input, String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { // If an editor already exists for the input, use it. IEditorPart editor = null; // Reuse an existing open editor, unless we are in "new editor tab management" mode editor = getEditorManager().findEditor(editorID, input, ((TabBehaviour)Tweaklets.get(TabBehaviour.KEY)).getReuseEditorMatchFlags(matchFlags)); if (editor != null) { if (IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID.equals(editorID)) { if (editor.isDirty()) { MessageDialog dialog = new MessageDialog( getWorkbenchWindow().getShell(), WorkbenchMessages.Save, null, // accept the default window icon NLS.bind(WorkbenchMessages.WorkbenchPage_editorAlreadyOpenedMsg, input.getName()), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; int saveFile = dialog.open(); if (saveFile == 0) { try { final IEditorPart editorToSave = editor; getWorkbenchWindow().run(false, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { editorToSave.doSave(monitor); } }); } catch (InvocationTargetException e) { throw (RuntimeException) e.getTargetException(); } catch (InterruptedException e) { return null; } } else if (saveFile == 2) { return null; } } } else { // do the IShowEditorInput notification before showing the editor // to reduce flicker if (editor instanceof IShowEditorInput) { ((IShowEditorInput) editor).showEditorInput(input); } showEditor(activate, editor); return editor; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorPart busyOpenEditorFromDescriptorBatched(IEditorInput input, EditorDescriptor editorDescriptor, boolean activate, IMemento editorState) throws PartInitException { IEditorPart editor = null; // Create a new one. This may cause the new editor to // become the visible (i.e top) editor. IEditorReference ref = null; ref = getEditorManager().openEditorFromDescriptor(editorDescriptor, input, editorState); if (ref != null) { editor = ref.getEditor(true); } if (editor != null) { setEditorAreaVisible(true); if (activate) { if (editor instanceof AbstractMultiEditor) { activate(((AbstractMultiEditor) editor).getActiveEditor()); } else { activate(editor); } } else { bringToTop(editor); } window.firePerspectiveChanged(this, getPerspective(), ref, CHANGE_EDITOR_OPEN); window.firePerspectiveChanged(this, getPerspective(), CHANGE_EDITOR_OPEN); } return editor; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(String viewID) throws PartInitException { return showView(viewID, null, VIEW_ACTIVATE); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IViewPart showView(final String viewID, final String secondaryID, final int mode) throws PartInitException { if (secondaryID != null) { if (secondaryID.length() == 0 || secondaryID.indexOf(ViewFactory.ID_SEP) != -1) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalSecondaryId); } } if (!certifyMode(mode)) { throw new IllegalArgumentException(WorkbenchMessages.WorkbenchPage_IllegalViewMode); } // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyShowView(viewID, secondaryID, mode); } catch (PartInitException e) { result[0] = e; } } }); if (result[0] instanceof IViewPart) { return (IViewPart) result[0]; } else if (result[0] instanceof PartInitException) { throw (PartInitException) result[0]; } else { throw new PartInitException(WorkbenchMessages.WorkbenchPage_AbnormalWorkbenchCondition); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private IEditorReference batchOpenEditor(IEditorInput input, String editorID, boolean activate) throws PartInitException { IEditorPart editor = null; IEditorReference ref; try { partBeingOpened = true; ref = getEditorManager().openEditor(editorID, input, true, null); if (ref != null) editor = ref.getEditor(activate); } finally { partBeingOpened = false; } if (editor != null) { setEditorAreaVisible(true); if (activate) { if (editor instanceof AbstractMultiEditor) activate(((AbstractMultiEditor) editor).getActiveEditor()); else activate(editor); } else bringToTop(editor); } return ref; }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithPartInitExceptions(StartupRunnable r) throws PartInitException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (PartInitException) throwable; } else { throw new PartInitException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWebBrowser.java
public void openURL(URL url) throws PartInitException { // format the href for an html file (file:///<filename.html> // required for Mac only. String href = url.toString(); if (href.startsWith("file:")) { //$NON-NLS-1$ href = href.substring(5); while (href.startsWith("/")) { //$NON-NLS-1$ href = href.substring(1); } href = "file:///" + href; //$NON-NLS-1$ } final String localHref = href; final Display d = Display.getCurrent(); if (Util.isWindows()) { Program.launch(localHref); } else if (Util.isMac()) { try { Runtime.getRuntime().exec("/usr/bin/open " + localHref); //$NON-NLS-1$ } catch (IOException e) { throw new PartInitException( WorkbenchMessages.ProductInfoDialog_unableToOpenWebBrowser, e); } } else { Thread launcher = new Thread("About Link Launcher") {//$NON-NLS-1$ public void run() { try { /* * encoding the href as the browser does not open if * there is a space in the url. Bug 77840 */ String encodedLocalHref = urlEncodeForSpaces(localHref .toCharArray()); if (webBrowserOpened) { Runtime .getRuntime() .exec( webBrowser + " -remote openURL(" + encodedLocalHref + ")"); //$NON-NLS-1$ //$NON-NLS-2$ } else { Process p = openWebBrowser(encodedLocalHref); webBrowserOpened = true; try { if (p != null) { p.waitFor(); } } catch (InterruptedException e) { openWebBrowserError(d); } finally { webBrowserOpened = false; } } } catch (IOException e) { openWebBrowserError(d); } } }; launcher.start(); } }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
public IWebBrowser createBrowser(int style, String browserId, String name, String tooltip) throws PartInitException { return getActiveSupport() .createBrowser(style, browserId, name, tooltip); }
// in Eclipse UI/org/eclipse/ui/internal/browser/WorkbenchBrowserSupport.java
public IWebBrowser createBrowser(String browserId) throws PartInitException { return getActiveSupport().createBrowser(browserId); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java
protected IWebBrowser doCreateBrowser(int style, String browserId, String name, String tooltip) throws PartInitException { return new DefaultWebBrowser(this, browserId); }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java
public IWebBrowser createBrowser(int style, String browserId, String name, String tooltip) throws PartInitException { String id = browserId == null? getDefaultId():browserId; IWebBrowser browser = findBrowser(id); if (browser != null) { return browser; } browser = doCreateBrowser(style, id, name, tooltip); registerBrowser(browser); return browser; }
// in Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java
public IWebBrowser createBrowser(String browserId) throws PartInitException { return createBrowser(AS_EXTERNAL, browserId, null, null); }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
private LayoutPart createView(String partID) throws PartInitException { if (partID.equals(ID_EDITOR_AREA)) { return editorFolder; } IViewDescriptor viewDescriptor = null; IViewRegistry viewRegistry = viewFactory.getViewRegistry(); String primaryId = ViewFactory.extractPrimaryId(partID); if (viewRegistry instanceof ViewRegistry) { viewDescriptor = ((ViewRegistry) viewRegistry).findInternal(primaryId); if (viewDescriptor != null && WorkbenchActivityHelper.restrictUseOf(viewDescriptor)) { return null; } } else { viewDescriptor = viewRegistry.find(primaryId); } if (WorkbenchActivityHelper.filterItem(viewDescriptor)) { return null; } return LayoutHelper.createView(getViewFactory(), partID); }
// in Eclipse UI/org/eclipse/ui/internal/ViewFactory.java
public IViewReference createView(final String id) throws PartInitException { return createView(id, null); }
// in Eclipse UI/org/eclipse/ui/internal/ViewFactory.java
public IViewReference createView(String id, String secondaryId) throws PartInitException { IViewDescriptor desc = viewReg.find(id); // ensure that the view id is valid if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, id )); } // ensure that multiple instances are allowed if a secondary id is given if (secondaryId != null) { if (!desc.getAllowMultiple()) { throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_noMultiple, id)); } } String key = getKey(id, secondaryId); IViewReference ref = (IViewReference) counter.get(key); if (ref == null) { IMemento memento = (IMemento) mementoTable.get(key); ref = new ViewReference(this, id, secondaryId, memento); mementoTable.remove(key); counter.put(key, ref); getWorkbenchPage().partAdded((ViewReference)ref); } else { counter.addRef(key); } return ref; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditor(String editorId, IEditorInput input, boolean setVisible, IMemento editorState) throws PartInitException { if (editorId == null || input == null) { throw new IllegalArgumentException(); } IEditorDescriptor desc = getEditorRegistry().findEditor(editorId); if (desc != null && !desc.isOpenExternal() && isLargeDocument(input)) { desc = getAlternateEditor(); if (desc == null) { // the user pressed cancel in the editor selection dialog return null; } } if (desc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorId)); } IEditorReference result = openEditorFromDescriptor((EditorDescriptor) desc, input, editorState); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IEditorReference openEditorFromDescriptor(EditorDescriptor desc, IEditorInput input, IMemento editorState) throws PartInitException { IEditorReference result = null; if (desc.isInternal()) { result = reuseInternalEditor(desc, input); if (result == null) { result = new EditorReference(this, input, desc, editorState); } } else if (desc.getId() .equals(IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { if (ComponentSupport.inPlaceEditorSupported()) { result = new EditorReference(this, input, desc); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)) { IPathEditorInput pathInput = getPathEditorInput(input); if (pathInput != null) { result = openSystemExternalEditor(pathInput.getPath()); } else { throw new PartInitException( WorkbenchMessages.EditorManager_systemEditorError); } } else if (desc.isOpenExternal()) { result = openExternalEditor(desc, input); } else { // this should never happen throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_invalidDescriptor, desc .getId())); } if (result != null) { createEditorTab((EditorReference) result, ""); //$NON-NLS-1$ } Workbench wb = (Workbench) window.getWorkbench(); wb.getEditorHistory().add(input, desc); return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openExternalEditor(final EditorDescriptor desc, IEditorInput input) throws PartInitException { final CoreException ex[] = new CoreException[1]; final IPathEditorInput pathInput = getPathEditorInput(input); if (pathInput != null && pathInput.getPath() != null) { BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { try { if (desc.getLauncher() != null) { // open using launcher Object launcher = WorkbenchPlugin.createExtension( desc.getConfigurationElement(), "launcher"); //$NON-NLS-1$ ((IEditorLauncher) launcher).open(pathInput .getPath()); } else { // open using command ExternalEditor oEditor = new ExternalEditor( pathInput.getPath(), desc); oEditor.open(); } } catch (CoreException e) { ex[0] = e; } } }); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorReference[] openMultiEditor(final IEditorReference ref, final AbstractMultiEditor part, final MultiEditorInput input) throws PartInitException { String[] editorArray = input.getEditors(); IEditorInput[] inputArray = input.getInput(); // find all descriptors EditorDescriptor[] descArray = new EditorDescriptor[editorArray.length]; IEditorReference refArray[] = new IEditorReference[editorArray.length]; IEditorPart partArray[] = new IEditorPart[editorArray.length]; IEditorRegistry reg = getEditorRegistry(); for (int i = 0; i < editorArray.length; i++) { EditorDescriptor innerDesc = (EditorDescriptor) reg .findEditor(editorArray[i]); if (innerDesc == null) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unknownEditorIDMessage, editorArray[i])); } descArray[i] = innerDesc; InnerEditor innerRef = new InnerEditor(ref, part, inputArray[i], descArray[i]); refArray[i] = innerRef; partArray[i] = innerRef.getEditor(true); } part.setChildren(partArray); return refArray; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private void createEditorTab(final EditorReference ref, final String workbookId) throws PartInitException { editorPresentation.addEditor(ref, workbookId, true); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
EditorSite createSite(final IEditorReference ref, final IEditorPart part, final EditorDescriptor desc, final IEditorInput input) throws PartInitException { EditorSite site = new EditorSite(ref, part, page, desc); if (desc != null) { site.setActionBars(createEditorActionBars(desc, site)); } else { site.setActionBars(createEmptyEditorActionBars(site)); } final String label = part.getTitle(); // debugging only try { try { UIStats.start(UIStats.INIT_PART, label); part.init(site, input); } finally { UIStats.end(UIStats.INIT_PART, part, label); } // Sanity-check the site if (part.getSite() != site || part.getEditorSite() != site) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_siteIncorrect, desc .getId())); } } catch (Exception e) { disposeEditorActionBars((EditorActionBars) site.getActionBars()); site.dispose(); if (e instanceof PartInitException) { throw (PartInitException) e; } throw new PartInitException( WorkbenchMessages.EditorManager_errorInInit, e); } return site; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference reuseInternalEditor(EditorDescriptor desc, IEditorInput input) throws PartInitException { Assert.isNotNull(desc, "descriptor must not be null"); //$NON-NLS-1$ Assert.isNotNull(input, "input must not be null"); //$NON-NLS-1$ IEditorReference reusableEditorRef = findReusableEditor(desc); if (reusableEditorRef != null) { return ((TabBehaviour) Tweaklets.get(TabBehaviour.KEY)) .reuseInternalEditor(page, this, editorPresentation, desc, input, reusableEditorRef); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
IEditorPart createPart(final EditorDescriptor desc) throws PartInitException { try { IEditorPart result = desc.createEditor(); IConfigurationElement element = desc.getConfigurationElement(); if (element != null) { page.getExtensionTracker().registerObject( element.getDeclaringExtension(), result, IExtensionTracker.REF_WEAK); } return result; } catch (CoreException e) { throw new PartInitException(StatusUtil.newStatus( desc.getPluginID(), WorkbenchMessages.EditorManager_instantiationError, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
private IEditorReference openSystemExternalEditor(final IPath location) throws PartInitException { if (location == null) { throw new IllegalArgumentException(); } final boolean result[] = { false }; BusyIndicator.showWhile(getDisplay(), new Runnable() { public void run() { if (location != null) { result[0] = Program.launch(location.toOSString()); } } }); if (!result[0]) { throw new PartInitException(NLS.bind( WorkbenchMessages.EditorManager_unableToOpenExternalEditor, location)); } // We do not have an editor part for external editors return null; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
public IEditorInput getEditorInput() throws PartInitException { if (isDisposed()) { if (!(restoredInput instanceof NullEditorInput)) { restoredInput = new NullEditorInput(); } return restoredInput; } IEditorPart part = getEditor(false); if (part != null) { return part.getEditorInput(); } return getRestoredInput(); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorInput getRestoredInput() throws PartInitException { if (restoredInput != null) { return restoredInput; } // Get the input factory. IMemento editorMem = getMemento(); if (editorMem == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_persisted_state, getId(), getName())); } IMemento inputMem = editorMem .getChild(IWorkbenchConstants.TAG_INPUT); String factoryID = null; if (inputMem != null) { factoryID = inputMem .getString(IWorkbenchConstants.TAG_FACTORY_ID); } if (factoryID == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_no_input_factory_ID, getId(), getName())); } IAdaptable input = null; String label = null; // debugging only if (UIStats.isDebugging(UIStats.CREATE_PART_INPUT)) { label = getName() != null ? getName() : factoryID; } try { UIStats.start(UIStats.CREATE_PART_INPUT, label); IElementFactory factory = PlatformUI.getWorkbench() .getElementFactory(factoryID); if (factory == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_bad_element_factory, new Object[] { factoryID, getId(), getName() })); } // Get the input element. input = factory.createElement(inputMem); if (input == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_create_element_returned_null, new Object[] { factoryID, getId(), getName() })); } } finally { UIStats.end(UIStats.CREATE_PART_INPUT, input, label); } if (!(input instanceof IEditorInput)) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_wrong_createElement_result, new Object[] { factoryID, getId(), getName() })); } restoredInput = (IEditorInput) input; return restoredInput; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
private IEditorPart createPartHelper() throws PartInitException { // Things that will need to be disposed if an exception occurs (listed // in the order they // need to be disposed, and set to null if they haven't been created yet) Composite content = null; IEditorPart part = null; EditorActionBars actionBars = null; EditorSite site = null; try { IEditorInput editorInput = getEditorInput(); // Get the editor descriptor. String editorID = getId(); EditorDescriptor desc = getDescriptor(); if (desc == null) { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_missing_editor_descriptor, editorID)); } if (desc.isInternal()) { // Create an editor instance. try { UIStats.start(UIStats.CREATE_PART, editorID); part = manager.createPart(desc); // MultiEditor backwards compatibility if (part != null && part instanceof MultiEditor) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } if (part instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)part); } } finally { UIStats.end(UIStats.CREATE_PART, this, editorID); } } else if (desc.getId().equals( IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID)) { part = ComponentSupport.getSystemInPlaceEditor(); if (part == null) { throw new PartInitException(WorkbenchMessages.EditorManager_no_in_place_support); } } else { throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_invalid_editor_descriptor, editorID)); } // Create a pane for this part PartPane pane = getPane(); pane.createControl(getPaneControlContainer()); // Create controls int style = SWT.NONE; if(part instanceof IWorkbenchPartOrientation){ style = ((IWorkbenchPartOrientation) part).getOrientation(); } // Link everything up to the part reference (the part reference itself should not have // been modified until this point) site = manager.createSite(this, part, desc, editorInput); // if there is saved state that's appropriate, pass it on if (part instanceof IPersistableEditor && editorState != null) { ((IPersistableEditor) part).restoreState(editorState); } // Remember the site and the action bars (now that we've created them, we'll need to dispose // them if an exception occurs) actionBars = (EditorActionBars) site.getActionBars(); Composite parent = (Composite)pane.getControl(); EditorDescriptor descriptor = getDescriptor(); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_Editor, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, editorID); part.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, part, editorID); } // Create the inner editors of an AbstractMultiEditor (but not MultiEditor) here // MultiEditor backwards compatibility if (part != null && part instanceof AbstractMultiEditor && !(part instanceof MultiEditor)) { multiEditorChildren = manager.openMultiEditor(this, (AbstractMultiEditor) part, (MultiEditorInput) editorInput); } // The editor should now be fully created. Exercise its public interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave badly, it's much better // that it does so now while we can still cancel creation of the part. PartTester.testEditor(part); return part; } catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); } }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
public static final ViewPane createView(ViewFactory factory, String viewId) throws PartInitException { WorkbenchPartReference ref = (WorkbenchPartReference) factory .createView(ViewFactory.extractPrimaryId(viewId), ViewFactory .extractSecondaryId(viewId)); ViewPane newPart = (ViewPane) ref.getPane(); return newPart; }
// in Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
public void init(IViewSite site, IMemento memento) throws PartInitException { super.init(site); Workbench workbench = (Workbench) site.getWorkbenchWindow() .getWorkbench(); try { introPart = workbench.getWorkbenchIntroManager() .createNewIntroPart(); // reset the part name of this view to be that of the intro title setPartName(introPart.getTitle()); introPart.addPropertyListener(new IPropertyListener() { public void propertyChanged(Object source, int propId) { firePropertyChange(propId); } }); introSite = new ViewIntroAdapterSite(site, workbench .getIntroDescriptor()); introPart.init(introSite, memento); } catch (CoreException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
private IWorkbenchPart createPartHelper() throws PartInitException { IWorkbenchPart result = null; IMemento stateMem = null; if (memento != null) { stateMem = memento.getChild(IWorkbenchConstants.TAG_VIEW_STATE); } IViewDescriptor desc = factory.viewReg.find(getId()); if (desc == null) { throw new PartInitException( NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, getId())); } // Create the part pane PartPane pane = getPane(); // Create the pane's top-level control pane.createControl(factory.page.getClientComposite()); String label = desc.getLabel(); // debugging only // Things that will need to be disposed if an exception occurs (they are // listed here // in the order they should be disposed) Composite content = null; IViewPart initializedView = null; ViewSite site = null; ViewActionBars actionBars = null; // End of things that need to be explicitly disposed from the try block try { IViewPart view = null; try { UIStats.start(UIStats.CREATE_PART, label); view = desc.createView(); } finally { UIStats.end(UIStats.CREATE_PART, view, label); } if (view instanceof IWorkbenchPart3) { createPartProperties((IWorkbenchPart3)view); } // Create site site = new ViewSite(this, view, factory.page, desc); actionBars = new ViewActionBars(factory.page.getActionBars(), site, (ViewPane) pane); site.setActionBars(actionBars); try { UIStats.start(UIStats.INIT_PART, label); view.init(site, stateMem); // Once we've called init, we MUST dispose the view. Remember // the fact that // we've initialized the view in case an exception is thrown. initializedView = view; } finally { UIStats.end(UIStats.INIT_PART, view, label); } if (view.getSite() != site) { throw new PartInitException( WorkbenchMessages.ViewFactory_siteException, null); } int style = SWT.NONE; if (view instanceof IWorkbenchPartOrientation) { style = ((IWorkbenchPartOrientation) view).getOrientation(); } // Create the top-level composite { Composite parent = (Composite) pane.getControl(); ViewDescriptor descriptor = (ViewDescriptor) this.factory.viewReg.find(getId()); if (descriptor != null && descriptor.getPluginId() != null) { parent.setData(new ContributionInfo(descriptor.getPluginId(), ContributionInfoMessages.ContributionInfo_View, null)); } content = new Composite(parent, style); content.setLayout(new FillLayout()); try { UIStats.start(UIStats.CREATE_PART_CONTROL, label); view.createPartControl(content); parent.layout(true); } finally { UIStats.end(UIStats.CREATE_PART_CONTROL, view, label); } } // Install the part's tools and menu { // // 3.3 start // IMenuService menuService = (IMenuService) site .getService(IMenuService.class); menuService.populateContributionManager( (ContributionManager) site.getActionBars() .getMenuManager(), "menu:" //$NON-NLS-1$ + site.getId()); menuService .populateContributionManager((ContributionManager) site .getActionBars().getToolBarManager(), "toolbar:" + site.getId()); //$NON-NLS-1$ // 3.3 end actionBuilder = new ViewActionBuilder(); actionBuilder.readActionExtensions(view); ActionDescriptor[] actionDescriptors = actionBuilder .getExtendedActions(); IKeyBindingService keyBindingService = view.getSite() .getKeyBindingService(); if (actionDescriptors != null) { for (int i = 0; i < actionDescriptors.length; i++) { ActionDescriptor actionDescriptor = actionDescriptors[i]; if (actionDescriptor != null) { IAction action = actionDescriptors[i].getAction(); if (action != null && action.getActionDefinitionId() != null) { keyBindingService.registerAction(action); } } } } site.getActionBars().updateActionBars(); } // The editor should now be fully created. Exercise its public // interface, and sanity-check // it wherever possible. If it's going to throw exceptions or behave // badly, it's much better // that it does so now while we can still cancel creation of the // part. PartTester.testView(view); result = view; IConfigurationElement element = (IConfigurationElement) Util.getAdapter(desc, IConfigurationElement.class); if (element != null) { factory.page.getExtensionTracker().registerObject( element.getDeclaringExtension(), view, IExtensionTracker.REF_WEAK); } } catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); } return result; }
// in Eclipse UI/org/eclipse/ui/browser/AbstractWorkbenchBrowserSupport.java
public IWebBrowser getExternalBrowser() throws PartInitException { return createBrowser(AS_EXTERNAL, SHARED_EXTERNAL_BROWSER_ID, null, null); }
// in Eclipse UI/org/eclipse/ui/part/ViewPart.java
public void init(IViewSite site) throws PartInitException { setSite(site); setDefaultContentDescription(); }
// in Eclipse UI/org/eclipse/ui/part/ViewPart.java
public void init(IViewSite site, IMemento memento) throws PartInitException { /* * Initializes this view with the given view site. A memento is passed to * the view which contains a snapshot of the views state from a previous * session. Where possible, the view should try to recreate that state * within the part controls. * <p> * This implementation will ignore the memento and initialize the view in * a fresh state. Subclasses may override the implementation to perform any * state restoration as needed. */ init(site); }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public int addPage(IEditorPart editor, IEditorInput input) throws PartInitException { int index = getPageCount(); addPage(index, editor, input); return index; }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public void addPage(int index, IEditorPart editor, IEditorInput input) throws PartInitException { IEditorSite site = createSite(editor); // call init first so that if an exception is thrown, we have created no // new widgets editor.init(site, input); Composite parent2 = new Composite(getContainer(), getOrientation(editor)); parent2.setLayout(new FillLayout()); editor.createPartControl(parent2); editor.addPropertyListener(new IPropertyListener() { public void propertyChanged(Object source, int propertyId) { MultiPageEditorPart.this.handlePropertyChange(propertyId); } }); // create item for page only after createPartControl has succeeded Item item = createItem(index, parent2); // remember the editor, as both data on the item, and in the list of // editors (see field comment) item.setData(editor); nestedEditors.add(editor); }
// in Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java
public void init(IEditorSite site, IEditorInput input) throws PartInitException { setSite(site); setInput(input); site.setSelectionProvider(new MultiPageSelectionProvider(this)); }
// in Eclipse UI/org/eclipse/ui/part/IntroPart.java
public void init(IIntroSite site, IMemento memento) throws PartInitException { setSite(site); }
// in Eclipse UI/org/eclipse/ui/part/AbstractMultiEditor.java
public void init(IEditorSite site, IEditorInput input) throws PartInitException { init(site, (MultiEditorInput) input); }
// in Eclipse UI/org/eclipse/ui/part/AbstractMultiEditor.java
public void init(IEditorSite site, MultiEditorInput input) throws PartInitException { setInput(input); setSite(site); setPartName(input.getName()); setTitleToolTip(input.getToolTipText()); setupEvents(); }
// in Eclipse UI/org/eclipse/ui/part/PageBookView.java
public void init(IViewSite site) throws PartInitException { site.setSelectionProvider(selectionProvider); super.init(site); }
40
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.ShowView_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { childMem.putString(IWorkbenchConstants.TAG_REMOVED, "true"); //$NON-NLS-1$ result.add(StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e)); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (PartInitException e) { IStatus status = StatusUtil.newStatus(IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), //$NON-NLS-1$ e); StatusUtil.handleStatus(status, "Failed to create view: id=" + viewId, //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { WorkbenchPlugin.log("Could not restore intro", //$NON-NLS-1$ WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { ex[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { ex[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { result[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (PartInitException e) { exceptions[i] = e; results[i] = null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/NewEditorHandler.java
catch (PartInitException e) { DialogUtil.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.Error, e.getMessage(), e); }
// in Eclipse UI/org/eclipse/ui/internal/DefaultSaveable.java
catch (PartInitException e) { return false; }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/ViewElement.java
catch (PartInitException e) { }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchEditorsDialog.java
catch (PartInitException e) { }
// in Eclipse UI/org/eclipse/ui/internal/StickyViewManager32.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open view :" + viewId, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open view :" + viewId, e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addEditorArea()", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addFastView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "addView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PageLayout.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "stackView", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e1) { WorkbenchPlugin.log(e1); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException ex) { result.add(ex.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (PartInitException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
// in Eclipse UI/org/eclipse/ui/internal/about/AboutUtils.java
catch (PartInitException e) { openWebBrowserError(shell, href, e); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( "Could not open intro", new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open intro", e)); //$NON-NLS-1$ //$NON-NLS-2$ }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
catch (PartInitException e) { WorkbenchPlugin .log( IntroMessages.Intro_could_not_create_part, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_part, e)); }
// in Eclipse UI/org/eclipse/ui/internal/progress/ProgressManagerUtil.java
catch (PartInitException exception) { logException(exception); }
// in Eclipse UI/org/eclipse/ui/internal/registry/ShowViewHandler.java
catch (PartInitException e) { IStatus status = StatusUtil .newStatus(e.getStatus(), e.getMessage()); StatusManager.getManager().handle(status, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (PartInitException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (PartInitException e1) { input = new NullEditorInput(this); }
// in Eclipse UI/org/eclipse/ui/internal/ShowViewAction.java
catch (PartInitException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.ShowView_errorTitle, e.getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "identifierChanged", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/LayoutHelper.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "perspectiveActivated", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/NavigationHistoryEntry.java
catch (PartInitException e) { // ignore for now }
// in Eclipse UI/org/eclipse/ui/internal/ReopenEditorMenu.java
catch (PartInitException e2) { String title = WorkbenchMessages.OpenRecent_errorTitle; MessageDialog.openWarning(window.getShell(), title, e2 .getMessage()); history.remove(item); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
catch (PartInitException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/FolderLayout.java
catch (PartInitException e) { // cannot safely open the dialog so log the problem WorkbenchPlugin.log(getClass(), "addView(String)", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (PartInitException e) { exception = e; }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (PartInitException e) { StatusUtil.handleStatus(e, StatusManager.SHOW | StatusManager.LOG); return null; }
// in Eclipse UI/org/eclipse/ui/part/PageBookView.java
catch (PartInitException e) { WorkbenchPlugin.log(getClass(), "initPage", e); //$NON-NLS-1$ }
2
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowViewHandler.java
catch (PartInitException e) { throw new ExecutionException("Part could not be initialized", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/ShowInHandler.java
catch (PartInitException e) { throw new ExecutionException("Failed to show in", e); //$NON-NLS-1$ }
0
runtime (Lib) RuntimeException 3
            
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithoutExceptions(StartupRunnable r) throws RuntimeException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RuntimeException(throwable); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
protected void checkReference() { if (state == STATE_DISPOSED) { throw new RuntimeException("Error: IWorkbenchPartReference disposed"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/ExceptionHandler.java
public void handleException(Throwable t) { try { // Ignore ThreadDeath error as its normal to get this when thread dies if (t instanceof ThreadDeath) { throw (ThreadDeath) t; } // Check to avoid recursive errors exceptionCount++; if (exceptionCount > 2) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } else if (t instanceof Error) { throw (Error) t; } else { throw new RuntimeException(t); } } // Let the advisor handle this now Workbench wb = Workbench.getInstance(); if (wb != null) { wb.getAdvisor().eventLoopException(t); } } finally { exceptionCount--; } }
0 1
            
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithoutExceptions(StartupRunnable r) throws RuntimeException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RuntimeException(throwable); } } }
14
            
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (RuntimeException e) { activeFastView = null; }
// in Eclipse UI/org/eclipse/ui/internal/PartPane.java
catch (RuntimeException ex) { StatusUtil.handleStatus(ex, StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/UISynchronizer.java
catch (RuntimeException e) { // do nothing }
// in Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
catch (RuntimeException e) { WorkbenchPlugin.log(RESOURCE_BUNDLE.getString("errorDisposePreviewLog"), //$NON-NLS-1$ StatusUtil.newStatus(IStatus.ERROR, e.getMessage(), e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); }
// in Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
catch (RuntimeException e) { WorkbenchPlugin.log(e); }
// in Eclipse UI/org/eclipse/ui/part/WorkbenchPart.java
catch (RuntimeException e) { WorkbenchPlugin.log(e); }
0
            
// in Eclipse UI/org/eclipse/ui/internal/EditorReference.java
catch (Exception e) { // Dispose anything which we allocated in the try block if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (part != null) { try { part.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { manager.disposeEditorActionBars(actionBars); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(StatusUtil.getLocalizedMessage(e), StatusUtil.getCause(e)); }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
0
unknown (Lib) SAXException 0 0 3
            
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createReadRoot(Reader reader, String baseDir) throws WorkbenchException { String errorMessage = null; Exception exception = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); InputSource source = new InputSource(reader); if (baseDir != null) { source.setSystemId(baseDir); } parser.setErrorHandler(new ErrorHandler() { /** * @throws SAXException */ public void warning(SAXParseException exception) throws SAXException { // ignore } /** * @throws SAXException */ public void error(SAXParseException exception) throws SAXException { // ignore } public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }); Document document = parser.parse(source); NodeList list = document.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); if (node instanceof Element) { return new XMLMemento(document, (Element) node); } } } catch (ParserConfigurationException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; } catch (IOException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_ioError; } catch (SAXException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_formatError; } String problemText = null; if (exception != null) { problemText = exception.getMessage(); } if (problemText == null || problemText.length() == 0) { problemText = errorMessage != null ? errorMessage : WorkbenchMessages.XMLMemento_noElement; } throw new WorkbenchException(problemText, exception); }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public void warning(SAXParseException exception) throws SAXException { // ignore }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public void error(SAXParseException exception) throws SAXException { // ignore }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public void fatalError(SAXParseException exception) throws SAXException { throw exception; }
1
            
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
catch (SAXException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_formatError; }
0 0
unknown (Lib) SWTError 1
            
// in Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java
protected ImageRegistry createImageRegistry() { //If we are in the UI Thread use that if(Display.getCurrent() != null) { return new ImageRegistry(Display.getCurrent()); } if(PlatformUI.isWorkbenchRunning()) { return new ImageRegistry(PlatformUI.getWorkbench().getDisplay()); } //Invalid thread access if it is not the UI Thread //and the workbench is not created. throw new SWTError(SWT.ERROR_THREAD_INVALID_ACCESS); }
0 0 0 0 0
unknown (Lib) SWTException 0 0 0 2
            
// in Eclipse UI/org/eclipse/ui/internal/ImageCycleFeedbackBase.java
catch (SWTException ex) { IStatus status = StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, ex); StatusManager.getManager().handle(status); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (SWTException e) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e)); }
0 0
unknown (Lib) SecurityException 0 0 0 4
            
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (SecurityException e) { throw e; }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (SecurityException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (SecurityException e) { // shouldn't happen - but play it safe }
// in Eclipse UI/org/eclipse/ui/internal/LegacyResourceSupport.java
catch (SecurityException e) { // do nothing - play it safe }
1
            
// in Eclipse UI/org/eclipse/ui/internal/util/Descriptors.java
catch (SecurityException e) { throw e; }
0
checked (Lib) Throwable 0 0 46
            
// in Eclipse UI/org/eclipse/ui/splash/BasicSplashHandler.java
private void updateUI(final Runnable r) { Shell splashShell = getSplash(); if (splashShell == null || splashShell.isDisposed()) return; Display display = splashShell.getDisplay(); if (Thread.currentThread() == display.getThread()) r.run(); // run immediatley if we're on the UI thread else { // wrapper with a StartupRunnable to ensure that it will run before // the UI is fully initialized StartupRunnable startupRunnable = new StartupRunnable() { public void runWithException() throws Throwable { r.run(); } }; display.asyncExec(startupRunnable); } }
// in Eclipse UI/org/eclipse/ui/splash/BasicSplashHandler.java
public void runWithException() throws Throwable { r.run(); }
// in Eclipse UI/org/eclipse/ui/internal/ViewSashContainer.java
public IStatus restoreState(IMemento memento) { MultiStatus result = new MultiStatus( PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.RootLayoutContainer_problemsRestoringPerspective, null); // Read the info elements. IMemento[] children = memento.getChildren(IWorkbenchConstants.TAG_INFO); // Create a part ID to part hashtable. final Map mapIDtoPart = new HashMap(children.length); // Loop through the info elements. for (int i = 0; i < children.length; i++) { // Get the info details. IMemento childMem = children[i]; String partID = childMem.getString(IWorkbenchConstants.TAG_PART); final String relativeID = childMem .getString(IWorkbenchConstants.TAG_RELATIVE); int relationship = 0; float ratio = 0.0f; int left = 0, right = 0; if (relativeID != null) { relationship = childMem.getInteger( IWorkbenchConstants.TAG_RELATIONSHIP).intValue(); // Note: the ratio is used for reading pre-3.0 eclipse workspaces. It should be ignored // if "left" and "right" are available. Float ratioFloat = childMem .getFloat(IWorkbenchConstants.TAG_RATIO); Integer leftInt = childMem .getInteger(IWorkbenchConstants.TAG_RATIO_LEFT); Integer rightInt = childMem .getInteger(IWorkbenchConstants.TAG_RATIO_RIGHT); if (leftInt != null && rightInt != null) { left = leftInt.intValue(); right = rightInt.intValue(); } else { if (ratioFloat != null) { ratio = ratioFloat.floatValue(); } } } String strFolder = childMem .getString(IWorkbenchConstants.TAG_FOLDER); // Create the part. LayoutPart part = null; if (strFolder == null) { part = new PartPlaceholder(partID); } else { ViewStack folder = new ViewStack(page); folder.setID(partID); result.add(folder.restoreState(childMem .getChild(IWorkbenchConstants.TAG_FOLDER))); ContainerPlaceholder placeholder = new ContainerPlaceholder( partID); placeholder.setRealContainer(folder); part = placeholder; } // 1FUN70C: ITPUI:WIN - Shouldn't set Container when not active part.setContainer(this); final int myLeft = left, myRight= right, myRelationship = relationship; final float myRatio = ratio; final LayoutPart myPart = part; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { // Add the part to the layout if (relativeID == null) { add(myPart); } else { LayoutPart refPart = (LayoutPart) mapIDtoPart.get(relativeID); if (refPart != null) { if (myLeft != 0) { add(myPart, myRelationship, myLeft, myRight, refPart); } else { add(myPart, myRelationship, myRatio, refPart); } } else { WorkbenchPlugin .log("Unable to find part for ID: " + relativeID);//$NON-NLS-1$ } } }}); mapIDtoPart.put(partID, part); } return result; }
// in Eclipse UI/org/eclipse/ui/internal/ViewSashContainer.java
public void runWithException() throws Throwable { // Add the part to the layout if (relativeID == null) { add(myPart); } else { LayoutPart refPart = (LayoutPart) mapIDtoPart.get(relativeID); if (refPart != null) { if (myLeft != 0) { add(myPart, myRelationship, myLeft, myRight, refPart); } else { add(myPart, myRelationship, myRatio, refPart); } } else { WorkbenchPlugin .log("Unable to find part for ID: " + relativeID);//$NON-NLS-1$ } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public IPerspectiveRegistry getPerspectiveRegistry() { if (perspRegistry == null) { perspRegistry = new PerspectiveRegistry(); // the load methods can touch on WorkbenchImages if an image is // missing so we need to wrap the call in // a startup block for the case where a custom descriptor exists on // startup that does not have an image // associated with it. See bug 196352. StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { perspRegistry.load(); } }); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
public void runWithException() throws Throwable { perspRegistry.load(); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public IStatus restoreState() { if (this.memento == null) { return Status.OK_STATUS; } MultiStatus result = new MultiStatus( PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.Perspective_problemsRestoringPerspective, null); IMemento memento = this.memento; this.memento = null; final IMemento boundsMem = memento.getChild(IWorkbenchConstants.TAG_WINDOW); if (boundsMem != null) { final Rectangle r = new Rectangle(0, 0, 0, 0); r.x = boundsMem.getInteger(IWorkbenchConstants.TAG_X).intValue(); r.y = boundsMem.getInteger(IWorkbenchConstants.TAG_Y).intValue(); r.height = boundsMem.getInteger(IWorkbenchConstants.TAG_HEIGHT) .intValue(); r.width = boundsMem.getInteger(IWorkbenchConstants.TAG_WIDTH) .intValue(); StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { if (page.getWorkbenchWindow().getPages().length == 0) { page.getWorkbenchWindow().getShell().setBounds(r); } } }); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public void runWithException() throws Throwable { if (page.getWorkbenchWindow().getPages().length == 0) { page.getWorkbenchWindow().getShell().setBounds(r); } }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public void runWithException() throws Throwable { ViewSashContainer mainLayout = new ViewSashContainer(page, getClientComposite()); presArray[0] = new PerspectiveHelper(page, mainLayout, Perspective.this); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public void runWithException() throws Throwable { // Add the editor workbook. Do not hide it now. pres.replacePlaceholderWithPart(editorArea); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public void runWithException() throws Throwable { addAlwaysOn(d); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public void runWithException() throws Throwable { addAlwaysOff(d); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public void runWithException() throws Throwable { addAlwaysOn(d); }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
public void runWithException() throws Throwable { service.deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public IStatus restoreState(IMemento memento, final IPerspectiveDescriptor activeDescriptor) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { deferUpdates(true); }}); try { // Restore working set String pageName = memento.getString(IWorkbenchConstants.TAG_LABEL); String label = null; // debugging only if (UIStats.isDebugging(UIStats.RESTORE_WORKBENCH)) { label = pageName == null ? "" : "::" + pageName; //$NON-NLS-1$ //$NON-NLS-2$ } try { UIStats.start(UIStats.RESTORE_WORKBENCH, "WorkbenchPage" + label); //$NON-NLS-1$ if (pageName == null) { pageName = ""; //$NON-NLS-1$ } final MultiStatus result = new MultiStatus( PlatformUI.PLUGIN_ID, IStatus.OK, NLS.bind(WorkbenchMessages.WorkbenchPage_unableToRestorePerspective, pageName ), null); String workingSetName = memento .getString(IWorkbenchConstants.TAG_WORKING_SET); if (workingSetName != null) { AbstractWorkingSetManager workingSetManager = (AbstractWorkingSetManager) getWorkbenchWindow() .getWorkbench().getWorkingSetManager(); setWorkingSet(workingSetManager.getWorkingSet(workingSetName)); } IMemento workingSetMem = memento .getChild(IWorkbenchConstants.TAG_WORKING_SETS); if (workingSetMem != null) { IMemento[] workingSetChildren = workingSetMem .getChildren(IWorkbenchConstants.TAG_WORKING_SET); List workingSetList = new ArrayList( workingSetChildren.length); for (int i = 0; i < workingSetChildren.length; i++) { IWorkingSet set = getWorkbenchWindow().getWorkbench() .getWorkingSetManager().getWorkingSet( workingSetChildren[i].getID()); if (set != null) { workingSetList.add(set); } } workingSets = (IWorkingSet[]) workingSetList .toArray(new IWorkingSet[workingSetList.size()]); } aggregateWorkingSetId = memento.getString(ATT_AGGREGATE_WORKING_SET_ID); IWorkingSet setWithId = window.getWorkbench().getWorkingSetManager().getWorkingSet(aggregateWorkingSetId); // check to see if the set has already been made and assign it if it has if (setWithId instanceof AggregateWorkingSet) { aggregateWorkingSet = (AggregateWorkingSet) setWithId; } // Restore editor manager. IMemento childMem = memento .getChild(IWorkbenchConstants.TAG_EDITORS); result.merge(getEditorManager().restoreState(childMem)); childMem = memento.getChild(IWorkbenchConstants.TAG_VIEWS); if (childMem != null) { result.merge(getViewFactory().restoreState(childMem)); } // Get persp block. childMem = memento.getChild(IWorkbenchConstants.TAG_PERSPECTIVES); String activePartID = childMem .getString(IWorkbenchConstants.TAG_ACTIVE_PART); String activePartSecondaryID = null; if (activePartID != null) { activePartSecondaryID = ViewFactory .extractSecondaryId(activePartID); if (activePartSecondaryID != null) { activePartID = ViewFactory.extractPrimaryId(activePartID); } } final String activePerspectiveID = childMem .getString(IWorkbenchConstants.TAG_ACTIVE_PERSPECTIVE); // Restore perspectives. final IMemento perspMems[] = childMem .getChildren(IWorkbenchConstants.TAG_PERSPECTIVE); final Perspective activePerspectiveArray [] = new Perspective[1]; for (int i = 0; i < perspMems.length; i++) { final IMemento current = perspMems[i]; StartupThreading .runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { Perspective persp = ((WorkbenchImplementation) Tweaklets .get(WorkbenchImplementation.KEY)).createPerspective(null, WorkbenchPage.this); result.merge(persp.restoreState(current)); final IPerspectiveDescriptor desc = persp .getDesc(); if (desc.equals(activeDescriptor)) { activePerspectiveArray[0] = persp; } else if ((activePerspectiveArray[0] == null) && desc.getId().equals( activePerspectiveID)) { activePerspectiveArray[0] = persp; } perspList.add(persp); window.firePerspectiveOpened( WorkbenchPage.this, desc); } }); } Perspective activePerspective = activePerspectiveArray[0]; boolean restoreActivePerspective = false; if (activeDescriptor == null) { restoreActivePerspective = true; } else if (activePerspective != null && activePerspective.getDesc().equals(activeDescriptor)) { restoreActivePerspective = true; } else { restoreActivePerspective = false; activePerspective = createPerspective((PerspectiveDescriptor) activeDescriptor, true); if (activePerspective == null) { result .merge(new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError, activeDescriptor.getId() ), null)); } } perspList.setActive(activePerspective); // Make sure we have a valid perspective to work with, // otherwise return. activePerspective = perspList.getActive(); if (activePerspective == null) { activePerspective = perspList.getNextActive(); perspList.setActive(activePerspective); } if (activePerspective != null && restoreActivePerspective) { result.merge(activePerspective.restoreState()); } if (activePerspective != null) { final Perspective myPerspective = activePerspective; final String myActivePartId = activePartID, mySecondaryId = activePartSecondaryID; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { window.firePerspectiveActivated(WorkbenchPage.this, myPerspective .getDesc()); // Restore active part. if (myActivePartId != null) { IViewReference ref = myPerspective.findView( myActivePartId, mySecondaryId); if (ref != null) { activationList.setActive(ref); } } }}); } childMem = memento .getChild(IWorkbenchConstants.TAG_NAVIGATION_HISTORY); if (childMem != null) { navigationHistory.restoreState(childMem); } else if (getActiveEditor() != null) { navigationHistory.markEditor(getActiveEditor()); } // restore sticky view state stickyViewMan.restore(memento); return result; } finally { String blame = activeDescriptor == null ? pageName : activeDescriptor.getId(); UIStats.end(UIStats.RESTORE_WORKBENCH, blame, "WorkbenchPage" + label); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void runWithException() throws Throwable { deferUpdates(true); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void runWithException() throws Throwable { Perspective persp = ((WorkbenchImplementation) Tweaklets .get(WorkbenchImplementation.KEY)).createPerspective(null, WorkbenchPage.this); result.merge(persp.restoreState(current)); final IPerspectiveDescriptor desc = persp .getDesc(); if (desc.equals(activeDescriptor)) { activePerspectiveArray[0] = persp; } else if ((activePerspectiveArray[0] == null) && desc.getId().equals( activePerspectiveID)) { activePerspectiveArray[0] = persp; } perspList.add(persp); window.firePerspectiveOpened( WorkbenchPage.this, desc); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void runWithException() throws Throwable { window.firePerspectiveActivated(WorkbenchPage.this, myPerspective .getDesc()); // Restore active part. if (myActivePartId != null) { IViewReference ref = myPerspective.findView( myActivePartId, mySecondaryId); if (ref != null) { activationList.setActive(ref); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
public void runWithException() throws Throwable { deferUpdates(false); }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithThrowable(StartupRunnable r) throws Throwable { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { throw throwable; } }
// in Eclipse UI/org/eclipse/ui/internal/EditorSashContainer.java
public IStatus restoreState(IMemento memento) { MultiStatus result = new MultiStatus( PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.RootLayoutContainer_problemsRestoringPerspective, null); // Remove the default editor workbook that is // initialy created with the editor area. if (children != null) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { EditorStack defaultWorkbook = null; for (int i = 0; i < children.size(); i++) { LayoutPart child = (LayoutPart) children.get(i); if (child.getID() == DEFAULT_WORKBOOK_ID) { defaultWorkbook = (EditorStack) child; if (defaultWorkbook.getItemCount() > 0) { defaultWorkbook = null; } } } if (defaultWorkbook != null) { remove(defaultWorkbook); defaultWorkbook.dispose(); } }}); }
// in Eclipse UI/org/eclipse/ui/internal/EditorSashContainer.java
public void runWithException() throws Throwable { EditorStack defaultWorkbook = null; for (int i = 0; i < children.size(); i++) { LayoutPart child = (LayoutPart) children.get(i); if (child.getID() == DEFAULT_WORKBOOK_ID) { defaultWorkbook = (EditorStack) child; if (defaultWorkbook.getItemCount() > 0) { defaultWorkbook = null; } } } if (defaultWorkbook != null) { remove(defaultWorkbook); defaultWorkbook.dispose(); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorSashContainer.java
public void runWithException() throws Throwable { // Create the part. workbook[0] = EditorStack.newEditorWorkbook(EditorSashContainer.this, page); workbook[0].setID(partID); // 1FUN70C: ITPUI:WIN - Shouldn't set Container when not active workbook[0].setContainer(EditorSashContainer.this); }
// in Eclipse UI/org/eclipse/ui/internal/EditorSashContainer.java
public void runWithException() throws Throwable { // Add the part to the layout if (relativeID == null) { add(workbook[0]); } else { LayoutPart refPart = (LayoutPart) mapIDtoPart.get(relativeID); if (refPart != null) { //$TODO pass in left and right if (myLeft == 0 || myRight == 0) { add(workbook[0], myRelationship, myRatio, refPart); } else { add(workbook[0], myRelationship, myLeft, myRight, refPart); } } else { WorkbenchPlugin .log("Unable to find part for ID: " + relativeID);//$NON-NLS-1$ } } }
// in Eclipse UI/org/eclipse/ui/internal/EditorSashContainer.java
public IStatus restorePresentationState(IMemento areaMem) { for (Iterator i = getEditorWorkbooks().iterator(); i.hasNext();) { final EditorStack workbook = (EditorStack) i.next(); final IMemento memento = workbook.getSavedPresentationState(); if (memento == null) { continue; } final PresentationSerializer serializer = new PresentationSerializer( workbook.getPresentableParts()); StartupThreading.runWithoutExceptions(new StartupRunnable(){ public void runWithException() throws Throwable { workbook.getPresentation().restoreState(serializer, memento); }}); } return Status.OK_STATUS; }
// in Eclipse UI/org/eclipse/ui/internal/EditorSashContainer.java
public void runWithException() throws Throwable { workbook.getPresentation().restoreState(serializer, memento); }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public IStatus restoreState(IMemento memento) { // Restore the editor area workbooks layout/relationship final MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.EditorManager_problemsRestoringEditors, null); final String activeWorkbookID[] = new String[1]; final ArrayList visibleEditors = new ArrayList(5); final IEditorReference activeEditor[] = new IEditorReference[1]; IMemento areaMem = memento.getChild(IWorkbenchConstants.TAG_AREA); if (areaMem != null) { result.add(editorPresentation.restoreState(areaMem)); activeWorkbookID[0] = areaMem .getString(IWorkbenchConstants.TAG_ACTIVE_WORKBOOK); } // Loop through the editors. IMemento[] editorMems = memento .getChildren(IWorkbenchConstants.TAG_EDITOR); for (int x = 0; x < editorMems.length; x++) { // for dynamic UI - call restoreEditorState to replace code which is // commented out restoreEditorState(editorMems[x], visibleEditors, activeEditor, result); } // restore the presentation if (areaMem != null) { result.add(editorPresentation.restorePresentationState(areaMem)); } try { StartupThreading.runWithThrowable(new StartupRunnable(){ public void runWithException() throws Throwable { // Update each workbook with its visible editor. for (int i = 0; i < visibleEditors.size(); i++) { setVisibleEditor((IEditorReference) visibleEditors.get(i), false); } // Update the active workbook if (activeWorkbookID[0] != null) { editorPresentation .setActiveEditorWorkbookFromID(activeWorkbookID[0]); } if (activeEditor[0] != null) { IWorkbenchPart editor = activeEditor[0].getPart(true); if (editor != null) { page.activate(editor); } } }}); } catch (Throwable t) { // The exception is already logged. result .add(new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, WorkbenchMessages.EditorManager_exceptionRestoringEditor, t)); } return result; }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public void runWithException() throws Throwable { // Update each workbook with its visible editor. for (int i = 0; i < visibleEditors.size(); i++) { setVisibleEditor((IEditorReference) visibleEditors.get(i), false); } // Update the active workbook if (activeWorkbookID[0] != null) { editorPresentation .setActiveEditorWorkbookFromID(activeWorkbookID[0]); } if (activeEditor[0] != null) { IWorkbenchPart editor = activeEditor[0].getPart(true); if (editor != null) { page.activate(editor); } } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public void restoreEditorState(IMemento editorMem, ArrayList visibleEditors, IEditorReference[] activeEditor, MultiStatus result) { // String strFocus = editorMem.getString(IWorkbenchConstants.TAG_FOCUS); // boolean visibleEditor = "true".equals(strFocus); //$NON-NLS-1$ final EditorReference e = new EditorReference(this, editorMem); // if the editor is not visible, ensure it is put in the correct // workbook. PR 24091 final String workbookID = editorMem .getString(IWorkbenchConstants.TAG_WORKBOOK); try { StartupThreading.runWithPartInitExceptions(new StartupRunnable () { public void runWithException() throws Throwable { createEditorTab(e, workbookID); }}); } catch (PartInitException ex) { result.add(ex.getStatus()); } String strActivePart = editorMem .getString(IWorkbenchConstants.TAG_ACTIVE_PART); if ("true".equals(strActivePart)) { //$NON-NLS-1$ activeEditor[0] = e; } String strFocus = editorMem.getString(IWorkbenchConstants.TAG_FOCUS); boolean visibleEditor = "true".equals(strFocus); //$NON-NLS-1$ if (visibleEditor) { visibleEditors.add(e); } }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
public void runWithException() throws Throwable { createEditorTab(e, workbookID); }
// in Eclipse UI/org/eclipse/ui/internal/FastViewManager.java
public void restoreState(IMemento memento, MultiStatus result) { // Load the fast views IMemento fastViewsMem = memento .getChild(IWorkbenchConstants.TAG_FAST_VIEWS); // -Replace- the current list with the one from the store List refsList = new ArrayList(); idToFastViewsMap.put(FastViewBar.FASTVIEWBAR_ID, refsList); if (fastViewsMem != null) { IMemento[] views = fastViewsMem .getChildren(IWorkbenchConstants.TAG_VIEW); for (int x = 0; x < views.length; x++) { // Get the view details. IMemento childMem = views[x]; IViewReference ref = perspective.restoreFastView(childMem, result); if (ref != null) refsList.add(ref); } } // Load the Trim Stack info IMemento barsMem = memento .getChild(IWorkbenchConstants.TAG_FAST_VIEW_BARS); // It's not there for old workspaces if (barsMem == null) return; IMemento[] bars = barsMem .getChildren(IWorkbenchConstants.TAG_FAST_VIEW_BAR); for (int i = 0; i < bars.length; i++) { final String id = bars[i].getString(IWorkbenchConstants.TAG_ID); fastViewsMem = bars[i].getChild(IWorkbenchConstants.TAG_FAST_VIEWS); // -Replace- the current list with the one from the store refsList = new ArrayList(); idToFastViewsMap.put(id, refsList); if (fastViewsMem != null) { IMemento[] views = fastViewsMem .getChildren(IWorkbenchConstants.TAG_VIEW); result.merge(perspective.createReferences(views)); // Create the trim area for the trim stack // Only create the TB if there are views in it if (views.length > 0) { final int side = bars[i].getInteger( IWorkbenchConstants.TAG_FAST_VIEW_SIDE) .intValue(); final int orientation = bars[i].getInteger( IWorkbenchConstants.TAG_FAST_VIEW_ORIENTATION) .intValue(); int boolVal = bars[i].getInteger( IWorkbenchConstants.TAG_FAST_VIEW_STYLE).intValue(); final boolean restoreOnUnzoom = (boolVal > 0); final String selId = bars[i].getString(IWorkbenchConstants.TAG_FAST_VIEW_SEL_ID); // Create the stack StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ViewStackTrimToolBar vstb = getTrimForViewStack(id, side, orientation); vstb.setRestoreOnUnzoom(restoreOnUnzoom); if (selId != null) vstb.setSelectedTabId(selId); } }); } for (int x = 0; x < views.length; x++) { // Get the view details. IMemento childMem = views[x]; IViewReference ref = perspective.restoreFastView(childMem, result); if (ref != null) refsList.add(ref); } } }
// in Eclipse UI/org/eclipse/ui/internal/FastViewManager.java
public void runWithException() throws Throwable { ViewStackTrimToolBar vstb = getTrimForViewStack(id, side, orientation); vstb.setRestoreOnUnzoom(restoreOnUnzoom); if (selId != null) vstb.setSelectedTabId(selId); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private boolean init() { // setup debug mode if required. if (WorkbenchPlugin.getDefault().isDebugging()) { WorkbenchPlugin.DEBUG = true; ModalContext.setDebugMode(true); } // Set up the JFace preference store JFaceUtil.initializeJFacePreferences(); // create workbench window manager windowManager = new WindowManager(); IIntroRegistry introRegistry = WorkbenchPlugin.getDefault() .getIntroRegistry(); if (introRegistry.getIntroCount() > 0) { IProduct product = Platform.getProduct(); if (product != null) { introDescriptor = (IntroDescriptor) introRegistry .getIntroForProduct(product.getId()); } } // TODO Correctly order service initialization // there needs to be some serious consideration given to // the services, and hooking them up in the correct order final EvaluationService evaluationService = new EvaluationService(); StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { serviceLocator.registerService(IEvaluationService.class, evaluationService); } }); // Initialize the activity support. workbenchActivitySupport = new WorkbenchActivitySupport(); activityHelper = ActivityPersistanceHelper.getInstance(); StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { WorkbenchImages.getImageRegistry(); } }); initializeDefaultServices(); initializeFonts(); initializeColors(); initializeApplicationColors(); // now that the workbench is sufficiently initialized, let the advisor // have a turn. StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { advisor.internalBasicInitialize(getWorkbenchConfigurer()); } }); // configure use of color icons in toolbars boolean useColorIcons = PrefUtil.getInternalPreferenceStore() .getBoolean(IPreferenceConstants.COLOR_ICONS); ActionContributionItem.setUseColorIconsInToolbars(useColorIcons); // initialize workbench single-click vs double-click behavior initializeSingleClickOption(); initializeWorkbenchImages(); StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { ((GrabFocus) Tweaklets.get(GrabFocus.KEY)) .init(getDisplay()); } }); StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { startSourceProviders(); } }); StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { activateWorkbenchContext(); } }); StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { createApplicationMenu(); } }); // attempt to restore a previous workbench state try { UIStats.start(UIStats.RESTORE_WORKBENCH, "Workbench"); //$NON-NLS-1$ final boolean bail [] = new boolean[1]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { advisor.preStartup(); if (isClosing() || !advisor.openWindows()) { bail[0] = true; } }}); if (bail[0]) return false; } finally { UIStats.end(UIStats.RESTORE_WORKBENCH, this, "Workbench"); //$NON-NLS-1$ } forceOpenPerspective(); return true; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { advisor.preStartup(); if (isClosing() || !advisor.openWindows()) { bail[0] = true; } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private void forceOpenPerspective() { if (getWorkbenchWindowCount() == 0) { // there should be an open window by now, bail out. return; } String perspId = null; String[] commandLineArgs = Platform.getCommandLineArgs(); for (int i = 0; i < commandLineArgs.length - 1; i++) { if (commandLineArgs[i].equalsIgnoreCase("-perspective")) { //$NON-NLS-1$ perspId = commandLineArgs[i + 1]; break; } } if (perspId == null) { return; } IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspId); if (desc == null) { return; } IWorkbenchWindow win = getActiveWorkbenchWindow(); if (win == null) { win = getWorkbenchWindows()[0]; } final String threadPerspId = perspId; final IWorkbenchWindow threadWin = win; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { try { showPerspective(threadPerspId, threadWin); } catch (WorkbenchException e) { String msg = "Workbench exception showing specified command line perspective on startup."; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); } }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { try { showPerspective(threadPerspId, threadWin); } catch (WorkbenchException e) { String msg = "Workbench exception showing specified command line perspective on startup."; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private void doOpenFirstTimeWindow() { try { final IAdaptable input [] = new IAdaptable[1]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { input[0] = getDefaultPageInput(); }}); busyOpenWorkbenchWindow(getPerspectiveRegistry() .getDefaultPerspective(), input[0]); } catch (final WorkbenchException e) { // Don't use the window's shell as the dialog parent, // as the window is not open yet (bug 76724). StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }}); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { input[0] = getDefaultPageInput(); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
IStatus restoreState() { if (!getWorkbenchConfigurer().getSaveAndRestore()) { String msg = WorkbenchMessages.Workbench_restoreDisabled; return new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } // Read the workbench state file. final File stateFile = getWorkbenchStateFile(); // If there is no state file cause one to open. if (stateFile == null || !stateFile.exists()) { String msg = WorkbenchMessages.Workbench_noStateToRestore; return new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } final IStatus result[] = { Status.OK_STATUS }; SafeRunner.run(new SafeRunnable(WorkbenchMessages.ErrorReadingState) { public void run() throws Exception { FileInputStream input = new FileInputStream(stateFile); BufferedReader reader = new BufferedReader( new InputStreamReader(input, "utf-8")); //$NON-NLS-1$ IMemento memento = XMLMemento.createReadRoot(reader); // Validate known version format String version = memento .getString(IWorkbenchConstants.TAG_VERSION); boolean valid = false; for (int i = 0; i < VERSION_STRING.length; i++) { if (VERSION_STRING[i].equals(version)) { valid = true; break; } } if (!valid) { reader.close(); String msg = WorkbenchMessages.Invalid_workbench_state_ve; MessageDialog.openError((Shell) null, WorkbenchMessages.Restoring_Problems, msg); stateFile.delete(); result[0] = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); return; } // Validate compatible version format // We no longer support the release 1.0 format if (VERSION_STRING[0].equals(version)) { reader.close(); String msg = WorkbenchMessages.Workbench_incompatibleSavedStateVersion; boolean ignoreSavedState = new MessageDialog(null, WorkbenchMessages.Workbench_incompatibleUIState, null, msg, MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0).open() == 0; // OK is the default if (ignoreSavedState) { stateFile.delete(); result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } else { result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_EXIT, msg, null); } return; } // Restore the saved state final IStatus restoreResult = restoreState(memento); reader.close(); if (restoreResult.getSeverity() == IStatus.ERROR) { StartupThreading .runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { StatusManager.getManager().handle(restoreResult, StatusManager.LOG); } }); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void run() throws Exception { FileInputStream input = new FileInputStream(stateFile); BufferedReader reader = new BufferedReader( new InputStreamReader(input, "utf-8")); //$NON-NLS-1$ IMemento memento = XMLMemento.createReadRoot(reader); // Validate known version format String version = memento .getString(IWorkbenchConstants.TAG_VERSION); boolean valid = false; for (int i = 0; i < VERSION_STRING.length; i++) { if (VERSION_STRING[i].equals(version)) { valid = true; break; } } if (!valid) { reader.close(); String msg = WorkbenchMessages.Invalid_workbench_state_ve; MessageDialog.openError((Shell) null, WorkbenchMessages.Restoring_Problems, msg); stateFile.delete(); result[0] = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); return; } // Validate compatible version format // We no longer support the release 1.0 format if (VERSION_STRING[0].equals(version)) { reader.close(); String msg = WorkbenchMessages.Workbench_incompatibleSavedStateVersion; boolean ignoreSavedState = new MessageDialog(null, WorkbenchMessages.Workbench_incompatibleUIState, null, msg, MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0).open() == 0; // OK is the default if (ignoreSavedState) { stateFile.delete(); result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null); } else { result[0] = new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, IWorkbenchConfigurer.RESTORE_CODE_EXIT, msg, null); } return; } // Restore the saved state final IStatus restoreResult = restoreState(memento); reader.close(); if (restoreResult.getSeverity() == IStatus.ERROR) { StartupThreading .runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { StatusManager.getManager().handle(restoreResult, StatusManager.LOG); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { StatusManager.getManager().handle(restoreResult, StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private XMLMemento recordWorkbenchState() { XMLMemento memento = XMLMemento .createWriteRoot(IWorkbenchConstants.TAG_WORKBENCH); final IStatus status = saveState(memento); if (status.getSeverity() != IStatus.OK) { // don't use newWindow as parent because it has not yet been opened // (bug 76724) StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Workbench_problemsSaving, WorkbenchMessages.Workbench_problemsSavingMsg, status); }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Workbench_problemsSaving, WorkbenchMessages.Workbench_problemsSavingMsg, status); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private void doRestoreState(final IMemento memento, final MultiStatus status) { IMemento childMem; try { UIStats.start(UIStats.RESTORE_WORKBENCH, "MRUList"); //$NON-NLS-1$ IMemento mruMemento = memento .getChild(IWorkbenchConstants.TAG_MRU_LIST); if (mruMemento != null) { status.add(getEditorHistory().restoreState(mruMemento)); } } finally { UIStats.end(UIStats.RESTORE_WORKBENCH, this, "MRUList"); //$NON-NLS-1$ } // Restore advisor state. IMemento advisorState = memento .getChild(IWorkbenchConstants.TAG_WORKBENCH_ADVISOR); if (advisorState != null) { status.add(getAdvisor().restoreState(advisorState)); } // Get the child windows. IMemento[] children = memento .getChildren(IWorkbenchConstants.TAG_WINDOW); createdWindows = new WorkbenchWindow[children.length]; // Read the workbench windows. for (int i = 0; i < children.length; i++) { childMem = children[i]; final WorkbenchWindow [] newWindow = new WorkbenchWindow[1]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { newWindow[0] = newWorkbenchWindow(); newWindow[0].create(); }}); createdWindows[i] = newWindow[0]; // allow the application to specify an initial perspective to open // @issue temporary workaround for ignoring initial perspective // String initialPerspectiveId = // getAdvisor().getInitialWindowPerspectiveId(); // if (initialPerspectiveId != null) { // IPerspectiveDescriptor desc = // getPerspectiveRegistry().findPerspectiveWithId(initialPerspectiveId); // result.merge(newWindow.restoreState(childMem, desc)); // } // add the window so that any work done in newWindow.restoreState // that relies on Workbench methods has windows to work with windowManager.add(newWindow[0]); // now that we've added it to the window manager we need to listen // for any exception that might hose us before we get a chance to // open it. If one occurs, remove the new window from the manager. // Assume that the new window is a phantom for now boolean restored = false; try { status.merge(newWindow[0].restoreState(childMem, null)); try { newWindow[0].fireWindowRestored(); } catch (WorkbenchException e) { status.add(e.getStatus()); } // everything worked so far, don't close now restored = true; } finally { if (!restored) { // null the window in newWindowHolder so that it won't be // opened later on createdWindows[i] = null; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { newWindow[0].close(); }}); } } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { newWindow[0].close(); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private void openWindowsAfterRestore() { if (createdWindows == null) { return; } // now open the windows (except the ones that were nulled because we // closed them above) for (int i = 0; i < createdWindows.length; i++) { if (createdWindows[i] != null) { final WorkbenchWindow myWindow = createdWindows[i]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { boolean opened = false; try { myWindow.open(); opened = true; } finally { if (!opened) { myWindow.close(); } } }}); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public void runWithException() throws Throwable { boolean opened = false; try { myWindow.open(); opened = true; } finally { if (!opened) { myWindow.close(); } } }
// in Eclipse UI/org/eclipse/ui/internal/NavigationHistory.java
void restoreState(IMemento memento) { IMemento editorsMem = memento.getChild(IWorkbenchConstants.TAG_EDITORS); IMemento items[] = memento.getChildren(IWorkbenchConstants.TAG_ITEM); if (items.length == 0 || editorsMem == null) { if (page.getActiveEditor() != null) { markLocation(page.getActiveEditor()); } return; } IMemento children[] = editorsMem .getChildren(IWorkbenchConstants.TAG_EDITOR); NavigationHistoryEditorInfo editorsInfo[] = new NavigationHistoryEditorInfo[children.length]; for (int i = 0; i < editorsInfo.length; i++) { editorsInfo[i] = new NavigationHistoryEditorInfo(children[i]); editors.add(editorsInfo[i]); } for (int i = 0; i < items.length; i++) { IMemento item = items[i]; int index = item.getInteger(IWorkbenchConstants.TAG_INDEX) .intValue(); NavigationHistoryEditorInfo info = editorsInfo[index]; info.refCount++; NavigationHistoryEntry entry = new NavigationHistoryEntry(info, page, null, null); history.add(entry); entry.restoreState(item); if (item.getString(IWorkbenchConstants.TAG_ACTIVE) != null) { activeEntry = i; } } final NavigationHistoryEntry entry = getEntry(activeEntry); if (entry != null && entry.editorInfo.editorInput != null) { if (page.getActiveEditor() == page .findEditor(entry.editorInfo.editorInput)) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { gotoEntry(entry); }}); } }
// in Eclipse UI/org/eclipse/ui/internal/NavigationHistory.java
public void runWithException() throws Throwable { gotoEntry(entry); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
public IStatus restoreState(IMemento memento) { // Read the active tab. String activeTabID = memento .getString(IWorkbenchConstants.TAG_ACTIVE_PAGE_ID); // Read the page elements. IMemento[] children = memento.getChildren(IWorkbenchConstants.TAG_PAGE); if (children != null) { // Loop through the page elements. for (int i = 0; i < children.length; i++) { // Get the info details. IMemento childMem = children[i]; String partID = childMem .getString(IWorkbenchConstants.TAG_CONTENT); // Create the part. LayoutPart part = new PartPlaceholder(partID); part.setContainer(this); add(part); //1FUN70C: ITPUI:WIN - Shouldn't set Container when not active //part.setContainer(this); if (partID.equals(activeTabID)) { setSelection(part); // Mark this as the active part. //current = part; } } } IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore(); boolean useNewMinMax = preferenceStore.getBoolean(IWorkbenchPreferenceConstants.ENABLE_NEW_MIN_MAX); final Integer expanded = memento.getInteger(IWorkbenchConstants.TAG_EXPANDED); if (useNewMinMax && expanded != null) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { setState((expanded == null || expanded.intValue() != IStackPresentationSite.STATE_MINIMIZED) ? IStackPresentationSite.STATE_RESTORED : IStackPresentationSite.STATE_MINIMIZED); } }); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
public void runWithException() throws Throwable { setState((expanded == null || expanded.intValue() != IStackPresentationSite.STATE_MINIMIZED) ? IStackPresentationSite.STATE_RESTORED : IStackPresentationSite.STATE_MINIMIZED); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
protected void setState(final int newState) { final int oldState = presentationSite.getState(); if (!supportsState(newState) || newState == oldState) { return; } final WorkbenchWindow wbw = (WorkbenchWindow) getPage().getWorkbenchWindow(); if (wbw == null || wbw.getShell() == null || wbw.getActiveWorkbenchPage() == null) return; WorkbenchPage page = wbw.getActiveWorkbenchPage(); if (page == null) return; boolean useNewMinMax = Perspective.useNewMinMax(page.getActivePerspective()); // we have to fiddle with the zoom behavior to satisfy Intro req's // by using the old zoom behavior for its stack if (newState == IStackPresentationSite.STATE_MAXIMIZED) useNewMinMax = useNewMinMax && !isIntroInStack(); else if (newState == IStackPresentationSite.STATE_RESTORED) { PartStack maxStack = page.getActivePerspective().getPresentation().getMaximizedStack(); useNewMinMax = useNewMinMax && (maxStack == this || maxStack instanceof EditorStack); } if (useNewMinMax) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { wbw.getPageComposite().setRedraw(false); try { if (newState == IStackPresentationSite.STATE_MAXIMIZED) { smartZoom(); } else if (oldState == IStackPresentationSite.STATE_MAXIMIZED) { smartUnzoom(); } if (newState == IStackPresentationSite.STATE_MINIMIZED) { setMinimized(true); } } finally { wbw.getPageComposite().setRedraw(true); // Force a redraw (fixes Mac refresh) wbw.getShell().redraw(); } setPresentationState(newState); } }); }
// in Eclipse UI/org/eclipse/ui/internal/PartStack.java
public void runWithException() throws Throwable { wbw.getPageComposite().setRedraw(false); try { if (newState == IStackPresentationSite.STATE_MAXIMIZED) { smartZoom(); } else if (oldState == IStackPresentationSite.STATE_MAXIMIZED) { smartUnzoom(); } if (newState == IStackPresentationSite.STATE_MINIMIZED) { setMinimized(true); } } finally { wbw.getPageComposite().setRedraw(true); // Force a redraw (fixes Mac refresh) wbw.getShell().redraw(); } setPresentationState(newState); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
private AbstractPresentationFactory createDefaultPresentationFactory() { final String factoryId = ((Workbench) window.getWorkbench()) .getPresentationId(); if (factoryId != null && factoryId.length() > 0) { final AbstractPresentationFactory [] factory = new AbstractPresentationFactory[1]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { factory[0] = WorkbenchPlugin.getDefault() .getPresentationFactory(factoryId); } }); if (factory[0] != null) { return factory[0]; } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindowConfigurer.java
public void runWithException() throws Throwable { factory[0] = WorkbenchPlugin.getDefault() .getPresentationFactory(factoryId); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
void fireWindowRestored() throws WorkbenchException { StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() { public void runWithException() throws Throwable { getWindowAdvisor().postWindowRestore(); } }); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { getWindowAdvisor().postWindowRestore(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { IElementFactory factory = PlatformUI .getWorkbench().getElementFactory( factoryID); if (factory == null) { WorkbenchPlugin .log("Unable to restore page - cannot instantiate input factory: " + factoryID); //$NON-NLS-1$ result .add(unableToRestorePage(pageMem)); return; } // Get the input element. input[0] = factory.createElement(inputMem); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { firePageOpened(newPage[0]); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { newPage[0] = ((WorkbenchImplementation) Tweaklets .get(WorkbenchImplementation.KEY)).createWorkbenchPage(WorkbenchWindow.this, defPerspID, getDefaultPageInput()); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { firePageOpened(newPage[0]); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { setActivePage(myPage); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { getWorkbench() .getIntroManager() .showIntro( WorkbenchWindow.this, Boolean .valueOf( introMem .getString(IWorkbenchConstants.TAG_STANDBY)) .booleanValue()); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
private IStatus restoreTrimState(IMemento memento) { // Determine if we have saved state. If we don't have any 3.2 // type state we're not done because the FastViewBar maintained // its own 'side' state in 3.1 so we'll honor its value IMemento trimState = memento.getChild(IWorkbenchConstants.TAG_TRIM); if (trimState != null) { // first pass sets up ordering for all trim areas IMemento[] areas = trimState .getChildren(IWorkbenchConstants.TAG_TRIM_AREA); // We need to remember all the trim that was repositioned // here so we can re-site -newly contributed- trim after // we're done final List knownIds = new ArrayList(); List[] trimOrder = new List[areas.length]; for (int i = 0; i < areas.length; i++) { trimOrder[i] = new ArrayList(); List preferredLocations = new ArrayList(); IMemento area = areas[i]; IMemento[] items = area .getChildren(IWorkbenchConstants.TAG_TRIM_ITEM); for (int j = 0; j < items.length; j++) { IMemento item = items[j]; String id = item.getID(); knownIds.add(id); preferredLocations.add(id); IWindowTrim t = defaultLayout.getTrim(id); if (t != null) { trimOrder[i].add(t); } } // Inform the TrimLayout of the preferred location for this area String areaIdString = areas[i].getID(); int areaId = Integer.parseInt(areaIdString); defaultLayout.setPreferredLocations(areaId, preferredLocations); } // second pass applies all of the window trim for (int i = 0; i < areas.length; i++) { IMemento area = areas[i]; final int id = Integer.parseInt(area.getID()); final List myTrimOrderList = trimOrder[i]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { defaultLayout.updateAreaTrim(id, myTrimOrderList, false); }}); } // get the trim manager to re-locate any -newly contributed- // trim widgets // Legacy (3.2) trim if (trimMgr2 != null) { StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { trimMgr2.updateLocations(knownIds); }}); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { defaultLayout.updateAreaTrim(id, myTrimOrderList, false); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { trimMgr2.updateLocations(knownIds); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { trimContributionMgr.updateLocations(knownIds); // Update the GUI with the new locations WorkbenchPage page = getActiveWorkbenchPage(); if (page != null) { Perspective perspective = page.getActivePerspective(); if (perspective != null) { // Ensure that only the upper/right editor stack has // min/max buttons page.getEditorPresentation().updateStackButtons(); // The perspective's onActivate manipulates the trim under the // new min/max story so cause it to refresh... perspective.onActivate(); } } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws Throwable { fastViewBar.dock(bigInt.intValue()); getTrimManager().addTrim(bigInt.intValue(), fastViewBar); }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
public boolean openWindows() { final Display display = PlatformUI.getWorkbench().getDisplay(); final boolean result [] = new boolean[1]; // spawn another init thread. For API compatibility We guarantee this method is called from // the UI thread but it could take enough time to disrupt progress reporting. // spawn a new thread to do the grunt work of this initialization and spin the event loop // ourselves just like it's done in Workbench. final boolean[] initDone = new boolean[]{false}; final Throwable [] error = new Throwable[1]; Thread initThread = new Thread() { /* (non-Javadoc) * @see java.lang.Thread#run() */ public void run() { try { //declare us to be a startup thread so that our syncs will be executed UISynchronizer.startupThread.set(Boolean.TRUE); final IWorkbenchConfigurer [] myConfigurer = new IWorkbenchConfigurer[1]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { myConfigurer[0] = getWorkbenchConfigurer(); }}); IStatus status = myConfigurer[0].restoreState(); if (!status.isOK()) { if (status.getCode() == IWorkbenchConfigurer.RESTORE_CODE_EXIT) { result[0] = false; return; } if (status.getCode() == IWorkbenchConfigurer.RESTORE_CODE_RESET) { myConfigurer[0].openFirstTimeWindow(); } } result[0] = true; } catch (Throwable e) { error[0] = e; } finally { initDone[0] = true; display.wake(); } }}; initThread.start(); while (true) { if (!display.readAndDispatch()) { if (initDone[0]) break; display.sleep(); } } // can only be a runtime or error if (error[0] instanceof Error) throw (Error)error[0]; else if (error[0] instanceof RuntimeException) throw (RuntimeException)error[0]; return result[0]; }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
public void run() { try { //declare us to be a startup thread so that our syncs will be executed UISynchronizer.startupThread.set(Boolean.TRUE); final IWorkbenchConfigurer [] myConfigurer = new IWorkbenchConfigurer[1]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { myConfigurer[0] = getWorkbenchConfigurer(); }}); IStatus status = myConfigurer[0].restoreState(); if (!status.isOK()) { if (status.getCode() == IWorkbenchConfigurer.RESTORE_CODE_EXIT) { result[0] = false; return; } if (status.getCode() == IWorkbenchConfigurer.RESTORE_CODE_RESET) { myConfigurer[0].openFirstTimeWindow(); } } result[0] = true; } catch (Throwable e) { error[0] = e; } finally { initDone[0] = true; display.wake(); } }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
public void runWithException() throws Throwable { myConfigurer[0] = getWorkbenchConfigurer(); }
16
            
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
catch (Throwable t) { this.throwable = t; }
// in Eclipse UI/org/eclipse/ui/internal/dialogs/EventLoopProgressMonitor.java
catch (Throwable e) {//Handle the exception the same way as the workbench handler.handleException(e); break; }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimBarManager2.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dock.", e); //$NON-NLS-1$ } StatusUtil.handleStatus(status, "widget delegate failed on dock: id = " + proxy.getId(), //$NON-NLS-1$ StatusManager.LOG); }
// in Eclipse UI/org/eclipse/ui/internal/menus/TrimContributionManager.java
catch (Throwable e) { IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in widget delegate error on dispose.", e); //$NON-NLS-1$ } StatusUtil .handleStatus( status, "widget delegate failed on dispose: id = " + proxy.getId(), StatusManager.LOG); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorManager.java
catch (Throwable t) { // The exception is already logged. result .add(new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, WorkbenchMessages.EditorManager_exceptionRestoringEditor, t)); }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
catch (Throwable e) { runAttribute = null; IStatus status = null; if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else { status = StatusUtil .newStatus( IStatus.ERROR, "Internal plug-in action delegate error on creation.", e); //$NON-NLS-1$ } String id = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ID); WorkbenchPlugin .log( "Could not create action delegate for id: " + id, status); //$NON-NLS-1$ return; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Throwable e) { error[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (Throwable t) { handler.handleException(t); // In case Display was closed under us if (display.isDisposed()) runEventLoop = false; }
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
catch (Throwable e) { // One of the log listeners probably failed. Core should have logged // the // exception since its the first listener. System.err.println("Error while logging event loop exception:"); //$NON-NLS-1$ exception.printStackTrace(); System.err.println("Logging exception:"); //$NON-NLS-1$ e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
catch (Throwable e) { error[0] = e; }
// in Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java
catch (Throwable ex) { // The used status handler failed logError(statusAdapter.getStatus()); logError("Error occurred during status handling", ex); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/progress/UIJob.java
catch(Throwable t){ throwable = t; }
4
            
// in Eclipse UI/org/eclipse/ui/internal/ViewReference.java
catch (Throwable e) { if ((e instanceof Error) && !(e instanceof LinkageError)) { throw (Error) e; } // An exception occurred. First deallocate anything we've allocated // in the try block (see the top // of the try block for a list of objects that need to be explicitly // disposed) if (content != null) { try { content.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (initializedView != null) { try { initializedView.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (actionBars != null) { try { actionBars.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } if (site != null) { try { site.dispose(); } catch (RuntimeException re) { StatusManager.getManager().handle( StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, re)); } } throw new PartInitException(WorkbenchPlugin.getStatus(e)); }
// in Eclipse UI/org/eclipse/ui/keys/KeyStroke.java
catch (Throwable t) { throw new ParseException("Cannot create key stroke with " //$NON-NLS-1$ + modifierKeys + " and " + naturalKey); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/keys/KeySequence.java
catch (Throwable t) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); }
0
runtime (Lib) UnsupportedOperationException 13
            
// in Eclipse UI/org/eclipse/ui/internal/preferences/ThemeAdapter.java
public void setValue(String propertyId, Object newValue) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java
public Set keySet() { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/preferences/ThemeManagerAdapter.java
public void setValue(String propertyId, Object newValue) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PopupMenuExtender.java
public void addSelectionChangedListener( ISelectionChangedListener listener) { throw new UnsupportedOperationException( "This ISelectionProvider is static, and cannot be modified."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PopupMenuExtender.java
public void removeSelectionChangedListener( ISelectionChangedListener listener) { throw new UnsupportedOperationException( "This ISelectionProvider is static, and cannot be modified."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PopupMenuExtender.java
public void setSelection(ISelection selection) { throw new UnsupportedOperationException( "This ISelectionProvider is static, and cannot be modified."); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(Composite parent) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(CoolBar parent, int index) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(Menu parent, int index) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/internal/PlaceholderContributionItem.java
public void fill(ToolBar parent, int index) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/databinding/WorkbenchProperties.java
protected void doSetValue(Object source, Object value) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/databinding/WorkbenchProperties.java
protected void doSetValue(Object source, Object value) { throw new UnsupportedOperationException(); }
// in Eclipse UI/org/eclipse/ui/databinding/WorkbenchProperties.java
protected void doSetList(Object source, List list, ListDiff diff) { throw new UnsupportedOperationException(); }
0 1
            
// in Eclipse UI/org/eclipse/ui/internal/statushandlers/InternalDialog.java
public void openTray(DialogTray tray) throws IllegalStateException, UnsupportedOperationException { if (launchTrayLink != null && !launchTrayLink.isDisposed()) { launchTrayLink.setEnabled(false); } if (providesSupport()) { super.openTray(tray); } dialogState.put(IStatusDialogConstants.TRAY_OPENED, Boolean.TRUE); }
0 0 0
unknown (Domain) WorkbenchException
public class WorkbenchException extends CoreException {

    /**
     * Generated serial version UID for this class.
     * @since 3.1
     */
    private static final long serialVersionUID = 3258125864872129078L;

    /**
     * Creates a new exception with the given message.
     * 
     * @param message the message
     */
    public WorkbenchException(String message) {
        this(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message, null));
    }

    /**
     * Creates a new exception with the given message.
     *
     * @param message the message
     * @param nestedException an exception to be wrapped by this WorkbenchException
     */
    public WorkbenchException(String message, Throwable nestedException) {
        this(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message,
                nestedException));
    }

    /**
     * Creates a new exception with the given status object.  The message
     * of the given status is used as the exception message.
     *
     * @param status the status object to be associated with this exception
     */
    public WorkbenchException(IStatus status) {
        super(status);
    }
}
20
            
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
protected void loadPredefinedPersp(PerspectiveDescriptor persp) throws WorkbenchException { // Create layout engine. IPerspectiveFactory factory = null; try { factory = persp.createFactory(); } catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } /* * IPerspectiveFactory#createFactory() can return null */ if (factory == null) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } // Create layout factory. ViewSashContainer container = new ViewSashContainer(page, getClientComposite()); layout = new PageLayout(container, getViewFactory(), editorArea, descriptor); layout.setFixed(descriptor.getFixed()); // add the placeholders for the sticky folders and their contents IPlaceholderFolderLayout stickyFolderRight = null, stickyFolderLeft = null, stickyFolderTop = null, stickyFolderBottom = null; IStickyViewDescriptor[] descs = WorkbenchPlugin.getDefault() .getViewRegistry().getStickyViews(); for (int i = 0; i < descs.length; i++) { IStickyViewDescriptor stickyViewDescriptor = descs[i]; String id = stickyViewDescriptor.getId(); switch (stickyViewDescriptor.getLocation()) { case IPageLayout.RIGHT: if (stickyFolderRight == null) { stickyFolderRight = layout .createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_RIGHT, IPageLayout.RIGHT, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderRight.addPlaceholder(id); break; case IPageLayout.LEFT: if (stickyFolderLeft == null) { stickyFolderLeft = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_LEFT, IPageLayout.LEFT, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderLeft.addPlaceholder(id); break; case IPageLayout.TOP: if (stickyFolderTop == null) { stickyFolderTop = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_TOP, IPageLayout.TOP, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderTop.addPlaceholder(id); break; case IPageLayout.BOTTOM: if (stickyFolderBottom == null) { stickyFolderBottom = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_BOTTOM, IPageLayout.BOTTOM, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderBottom.addPlaceholder(id); break; } //should never be null as we've just added the view above IViewLayout viewLayout = layout.getViewLayout(id); viewLayout.setCloseable(stickyViewDescriptor.isCloseable()); viewLayout.setMoveable(stickyViewDescriptor.isMoveable()); } // Run layout engine. factory.createInitialLayout(layout); PerspectiveExtensionReader extender = new PerspectiveExtensionReader(); extender.extendLayout(page.getExtensionTracker(), descriptor.getId(), layout); // Retrieve view layout info stored in the page layout. mapIDtoViewLayoutRec.putAll(layout.getIDtoViewLayoutRecMap()); // Create action sets. List temp = new ArrayList(); createInitialActionSets(temp, layout.getActionSets()); IContextService service = null; if (page != null) { service = (IContextService) page.getWorkbenchWindow().getService( IContextService.class); } try { if (service!=null) { service.deferUpdates(true); } for (Iterator iter = temp.iterator(); iter.hasNext();) { IActionSetDescriptor descriptor = (IActionSetDescriptor) iter .next(); addAlwaysOn(descriptor); } } finally { if (service!=null) { service.deferUpdates(false); } } newWizardShortcuts = layout.getNewWizardShortcuts(); showViewShortcuts = layout.getShowViewShortcuts(); perspectiveShortcuts = layout.getPerspectiveShortcuts(); showInPartIds = layout.getShowInPartIds(); hideMenuIDs = layout.getHiddenMenuItems(); hideToolBarIDs = layout.getHiddenToolBarItems(); // Retrieve fast views if (fastViewManager != null) { ArrayList fastViews = layout.getFastViews(); for (Iterator fvIter = fastViews.iterator(); fvIter.hasNext();) { IViewReference ref = (IViewReference) fvIter.next(); fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, !fvIter.hasNext()); } } // Is the layout fixed fixed = layout.isFixed(); // Create presentation. presentation = new PerspectiveHelper(page, container, this); // Hide editor area if requested by factory if (!layout.isEditorAreaVisible()) { hideEditorArea(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private void init(WorkbenchWindow w, String layoutID, IAdaptable input, boolean openExtras) throws WorkbenchException { // Save args. this.window = w; this.input = input; actionSets = new ActionSetManager(w); // Create presentation. createClientComposite(); editorPresentation = new EditorAreaHelper(this); editorMgr = new EditorManager(window, this, editorPresentation); // add this page as a client to be notified when the UI has re-orded perspectives // so that the order can be properly maintained in the receiver. // E.g. a UI might support drag-and-drop and will need to make this known to ensure // #saveState and #restoreState do not lose this re-ordering w.addPerspectiveReorderListener(new IReorderListener() { public void reorder(Object perspective, int newLoc) { perspList.reorder((IPerspectiveDescriptor)perspective, newLoc); } }); if (openExtras) { openPerspectiveExtras(); } // Get perspective descriptor. if (layoutID != null) { PerspectiveDescriptor desc = (PerspectiveDescriptor) WorkbenchPlugin .getDefault().getPerspectiveRegistry() .findPerspectiveWithId(layoutID); if (desc == null) { throw new WorkbenchException( NLS.bind(WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,layoutID )); } Perspective persp = findPerspective(desc); if (persp == null) { persp = createPerspective(desc, true); } perspList.setActive(persp); window.firePerspectiveActivated(this, desc); } getExtensionTracker() .registerHandler( perspectiveChangeHandler, ExtensionTracker .createExtensionPointFilter(getPerspectiveExtensionPoint())); }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithWorkbenchExceptions(StartupRunnable r) throws WorkbenchException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (WorkbenchException) throwable; } else { throw new WorkbenchException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowActionDelegate) { return (IWorkbenchWindowActionDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IEditorActionDelegate) { return (IEditorActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IEditorActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/ViewPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IViewActionDelegate) { return (IViewActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IViewActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
private void loadCustom() { Reader reader = null; /* Get the entries from the Preference store */ IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); /* Get the space-delimited list of custom perspective ids */ String customPerspectives = store .getString(IPreferenceConstants.PERSPECTIVES); String[] perspectivesList = StringConverter.asArray(customPerspectives); for (int i = 0; i < perspectivesList.length; i++) { try { String xmlString = store.getString(perspectivesList[i] + PERSP); if (xmlString != null && xmlString.length() != 0) { reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, perspectivesList[i]))); } // Restore the layout state. XMLMemento memento = XMLMemento.createReadRoot(reader); PerspectiveDescriptor newPersp = new PerspectiveDescriptor( null, null, null); newPersp.restoreState(memento); String id = newPersp.getId(); IPerspectiveDescriptor oldPersp = findPerspectiveWithId(id); if (oldPersp == null) { add(newPersp); } reader.close(); } catch (IOException e) { unableToLoadPerspective(null); } catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); } } // Get the entries from files, if any // if -data @noDefault specified the state location may not be // initialized IPath path = WorkbenchPlugin.getDefault().getDataLocation(); if (path == null) { return; } File folder = path.toFile(); if (folder.isDirectory()) { File[] fileList = folder.listFiles(); int nSize = fileList.length; for (int nX = 0; nX < nSize; nX++) { File file = fileList[nX]; if (file.getName().endsWith(EXT)) { // get the memento InputStream stream = null; try { stream = new FileInputStream(file); reader = new BufferedReader(new InputStreamReader( stream, "utf-8")); //$NON-NLS-1$ // Restore the layout state. XMLMemento memento = XMLMemento.createReadRoot(reader); PerspectiveDescriptor newPersp = new PerspectiveDescriptor( null, null, null); newPersp.restoreState(memento); IPerspectiveDescriptor oldPersp = findPerspectiveWithId(newPersp .getId()); if (oldPersp == null) { add(newPersp); } // save to the preference store saveCustomPersp(newPersp, memento); // delete the file file.delete(); reader.close(); stream.close(); } catch (IOException e) { unableToLoadPerspective(null); } catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); } } } } }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IMemento getCustomPersp(String id) throws WorkbenchException, IOException { Reader reader = null; IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); String xmlString = store.getString(id + PERSP); if (xmlString != null && xmlString.length() != 0) { // defined in store reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, id))); } XMLMemento memento = XMLMemento.createReadRoot(reader); reader.close(); return memento; }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IActionDelegate) { return (IActionDelegate) obj; } throw new WorkbenchException( "Action must implement IActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchWindow openWorkbenchWindow(final String perspID, final IAdaptable input) throws WorkbenchException { // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenWorkbenchWindow(perspID, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchWindow) { return (IWorkbenchWindow) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.Abnormal_Workbench_Conditi); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open, then the // window // is given focus and the perspective is shown. The page's input is // ignored. WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } // If another window that has the workspace root as input and the // requested // perpective open and active, then the window is given focus. IAdaptable input = getDefaultPageInput(); IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { Shell shell = win.getShell(); shell.open(); if (shell.getMinimized()) { shell.setMinimized(false); } return page; } } } } } } } // Otherwise the requested perspective is opened and shown in the // specified // window or in a new window depending on the current user preference // for opening // perspectives, and that window is given focus. win = (WorkbenchWindow) window; if (win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } // Only open a new window if user preference is set and the window // has an active perspective. if (IPreferenceConstants.OPM_NEW_WINDOW == mode && persp != null) { IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); } IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } // Just throw an exception.... throw new WorkbenchException(NLS .bind(WorkbenchMessages.Workbench_showPerspectiveError, perspectiveId)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window, IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open and the // same requested // input, then the window is given focus and the perspective is shown. boolean inputSameAsWindow = false; WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { inputSameAsWindow = true; IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } } // If another window has the requested input and the requested // perpective open and active, then that window is given focus. IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { win.getShell().open(); return page; } } } } } } } // If the specified window has the same requested input but not the // requested // perspective, then the window is given focus and the perspective is // opened and shown // on condition that the user preference is not to open perspectives in // a new window. win = (WorkbenchWindow) window; if (inputSameAsWindow && win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); if (IPreferenceConstants.OPM_NEW_WINDOW != mode) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // If the specified window has no active perspective, then open the // requested perspective and show the specified window. if (win != null) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } if (persp == null) { IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // Otherwise the requested perspective is opened and shown in a new // window, and the // window is given focus. IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public IWorkbenchPage openPage(final String perspId, final IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspId); // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenPage(perspId, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchPage) { return (IWorkbenchPage) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.WorkbenchWindow_exceptionMessage); } }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginPulldown.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowPulldownDelegate) { return (IWorkbenchWindowPulldownDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowPulldownDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createReadRoot(Reader reader, String baseDir) throws WorkbenchException { String errorMessage = null; Exception exception = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); InputSource source = new InputSource(reader); if (baseDir != null) { source.setSystemId(baseDir); } parser.setErrorHandler(new ErrorHandler() { /** * @throws SAXException */ public void warning(SAXParseException exception) throws SAXException { // ignore } /** * @throws SAXException */ public void error(SAXParseException exception) throws SAXException { // ignore } public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }); Document document = parser.parse(source); NodeList list = document.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); if (node instanceof Element) { return new XMLMemento(document, (Element) node); } } } catch (ParserConfigurationException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; } catch (IOException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_ioError; } catch (SAXException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_formatError; } String problemText = null; if (exception != null) { problemText = exception.getMessage(); } if (problemText == null || problemText.length() == 0) { problemText = errorMessage != null ? errorMessage : WorkbenchMessages.XMLMemento_noElement; } throw new WorkbenchException(problemText, exception); }
1
            
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); }
37
            
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
private void createPresentation(PerspectiveDescriptor persp) throws WorkbenchException { if (persp.hasCustomDefinition()) { loadCustomPersp(persp); } else { loadPredefinedPersp(persp); } }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
protected void loadPredefinedPersp(PerspectiveDescriptor persp) throws WorkbenchException { // Create layout engine. IPerspectiveFactory factory = null; try { factory = persp.createFactory(); } catch (CoreException e) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } /* * IPerspectiveFactory#createFactory() can return null */ if (factory == null) { throw new WorkbenchException(NLS.bind(WorkbenchMessages.Perspective_unableToLoad, persp.getId() )); } // Create layout factory. ViewSashContainer container = new ViewSashContainer(page, getClientComposite()); layout = new PageLayout(container, getViewFactory(), editorArea, descriptor); layout.setFixed(descriptor.getFixed()); // add the placeholders for the sticky folders and their contents IPlaceholderFolderLayout stickyFolderRight = null, stickyFolderLeft = null, stickyFolderTop = null, stickyFolderBottom = null; IStickyViewDescriptor[] descs = WorkbenchPlugin.getDefault() .getViewRegistry().getStickyViews(); for (int i = 0; i < descs.length; i++) { IStickyViewDescriptor stickyViewDescriptor = descs[i]; String id = stickyViewDescriptor.getId(); switch (stickyViewDescriptor.getLocation()) { case IPageLayout.RIGHT: if (stickyFolderRight == null) { stickyFolderRight = layout .createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_RIGHT, IPageLayout.RIGHT, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderRight.addPlaceholder(id); break; case IPageLayout.LEFT: if (stickyFolderLeft == null) { stickyFolderLeft = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_LEFT, IPageLayout.LEFT, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderLeft.addPlaceholder(id); break; case IPageLayout.TOP: if (stickyFolderTop == null) { stickyFolderTop = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_TOP, IPageLayout.TOP, .25f, IPageLayout.ID_EDITOR_AREA); } stickyFolderTop.addPlaceholder(id); break; case IPageLayout.BOTTOM: if (stickyFolderBottom == null) { stickyFolderBottom = layout.createPlaceholderFolder( StickyViewDescriptor.STICKY_FOLDER_BOTTOM, IPageLayout.BOTTOM, .75f, IPageLayout.ID_EDITOR_AREA); } stickyFolderBottom.addPlaceholder(id); break; } //should never be null as we've just added the view above IViewLayout viewLayout = layout.getViewLayout(id); viewLayout.setCloseable(stickyViewDescriptor.isCloseable()); viewLayout.setMoveable(stickyViewDescriptor.isMoveable()); } // Run layout engine. factory.createInitialLayout(layout); PerspectiveExtensionReader extender = new PerspectiveExtensionReader(); extender.extendLayout(page.getExtensionTracker(), descriptor.getId(), layout); // Retrieve view layout info stored in the page layout. mapIDtoViewLayoutRec.putAll(layout.getIDtoViewLayoutRecMap()); // Create action sets. List temp = new ArrayList(); createInitialActionSets(temp, layout.getActionSets()); IContextService service = null; if (page != null) { service = (IContextService) page.getWorkbenchWindow().getService( IContextService.class); } try { if (service!=null) { service.deferUpdates(true); } for (Iterator iter = temp.iterator(); iter.hasNext();) { IActionSetDescriptor descriptor = (IActionSetDescriptor) iter .next(); addAlwaysOn(descriptor); } } finally { if (service!=null) { service.deferUpdates(false); } } newWizardShortcuts = layout.getNewWizardShortcuts(); showViewShortcuts = layout.getShowViewShortcuts(); perspectiveShortcuts = layout.getPerspectiveShortcuts(); showInPartIds = layout.getShowInPartIds(); hideMenuIDs = layout.getHiddenMenuItems(); hideToolBarIDs = layout.getHiddenToolBarItems(); // Retrieve fast views if (fastViewManager != null) { ArrayList fastViews = layout.getFastViews(); for (Iterator fvIter = fastViews.iterator(); fvIter.hasNext();) { IViewReference ref = (IViewReference) fvIter.next(); fastViewManager.addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, !fvIter.hasNext()); } } // Is the layout fixed fixed = layout.isFixed(); // Create presentation. presentation = new PerspectiveHelper(page, container, this); // Hide editor area if requested by factory if (!layout.isEditorAreaVisible()) { hideEditorArea(); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
private void init(WorkbenchWindow w, String layoutID, IAdaptable input, boolean openExtras) throws WorkbenchException { // Save args. this.window = w; this.input = input; actionSets = new ActionSetManager(w); // Create presentation. createClientComposite(); editorPresentation = new EditorAreaHelper(this); editorMgr = new EditorManager(window, this, editorPresentation); // add this page as a client to be notified when the UI has re-orded perspectives // so that the order can be properly maintained in the receiver. // E.g. a UI might support drag-and-drop and will need to make this known to ensure // #saveState and #restoreState do not lose this re-ordering w.addPerspectiveReorderListener(new IReorderListener() { public void reorder(Object perspective, int newLoc) { perspList.reorder((IPerspectiveDescriptor)perspective, newLoc); } }); if (openExtras) { openPerspectiveExtras(); } // Get perspective descriptor. if (layoutID != null) { PerspectiveDescriptor desc = (PerspectiveDescriptor) WorkbenchPlugin .getDefault().getPerspectiveRegistry() .findPerspectiveWithId(layoutID); if (desc == null) { throw new WorkbenchException( NLS.bind(WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective,layoutID )); } Perspective persp = findPerspective(desc); if (persp == null) { persp = createPerspective(desc, true); } perspList.setActive(persp); window.firePerspectiveActivated(this, desc); } getExtensionTracker() .registerHandler( perspectiveChangeHandler, ExtensionTracker .createExtensionPointFilter(getPerspectiveExtensionPoint())); }
// in Eclipse UI/org/eclipse/ui/internal/StartupThreading.java
public static void runWithWorkbenchExceptions(StartupRunnable r) throws WorkbenchException { workbench.getDisplay().syncExec(r); Throwable throwable = r.getThrowable(); if (throwable != null) { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else if (throwable instanceof WorkbenchException) { throw (WorkbenchException) throwable; } else { throw new WorkbenchException(StatusUtil.newStatus( WorkbenchPlugin.PI_WORKBENCH, throwable)); } } }
// in Eclipse UI/org/eclipse/ui/internal/application/CompatibilityWorkbenchWindowAdvisor.java
public void postWindowRestore() throws WorkbenchException { wbAdvisor.postWindowRestore(getWindowConfigurer()); }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowActionDelegate) { return (IWorkbenchWindowActionDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/EditorPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IEditorActionDelegate) { return (IEditorActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IEditorActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Workbench3xImplementation.java
public WorkbenchPage createWorkbenchPage(WorkbenchWindow workbenchWindow, String perspID, IAdaptable input) throws WorkbenchException { return new WorkbenchPage(workbenchWindow, perspID, input); }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Workbench3xImplementation.java
public WorkbenchPage createWorkbenchPage(WorkbenchWindow workbenchWindow, IAdaptable finalInput) throws WorkbenchException { return new WorkbenchPage(workbenchWindow, finalInput); }
// in Eclipse UI/org/eclipse/ui/internal/tweaklets/Workbench3xImplementation.java
public Perspective createPerspective(PerspectiveDescriptor desc, WorkbenchPage workbenchPage) throws WorkbenchException { return new Perspective(desc, workbenchPage); }
// in Eclipse UI/org/eclipse/ui/internal/ViewPluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IViewActionDelegate) { return (IViewActionDelegate) obj; } else { throw new WorkbenchException( "Action must implement IViewActionDelegate"); //$NON-NLS-1$ } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
public IWorkbenchWindowConfigurer restoreWorkbenchWindow(IMemento memento) throws WorkbenchException { return getWindowConfigurer(((Workbench) getWorkbench()).restoreWorkbenchWindow(memento)); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
public IMemento getCustomPersp(String id) throws WorkbenchException, IOException { Reader reader = null; IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); String xmlString = store.getString(id + PERSP); if (xmlString != null && xmlString.length() != 0) { // defined in store reader = new StringReader(xmlString); } else { throw new WorkbenchException( new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, NLS .bind( WorkbenchMessages.Perspective_couldNotBeFound, id))); } XMLMemento memento = XMLMemento.createReadRoot(reader); reader.close(); return memento; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
public void readResources(Map editorTable, Reader reader) throws WorkbenchException { XMLMemento memento = XMLMemento.createReadRoot(reader); String versionString = memento.getString(IWorkbenchConstants.TAG_VERSION); boolean versionIs31 = "3.1".equals(versionString); //$NON-NLS-1$ IMemento[] extMementos = memento .getChildren(IWorkbenchConstants.TAG_INFO); for (int i = 0; i < extMementos.length; i++) { String name = extMementos[i] .getString(IWorkbenchConstants.TAG_NAME); if (name == null) { name = "*"; //$NON-NLS-1$ } String extension = extMementos[i] .getString(IWorkbenchConstants.TAG_EXTENSION); IMemento[] idMementos = extMementos[i] .getChildren(IWorkbenchConstants.TAG_EDITOR); String[] editorIDs = new String[idMementos.length]; for (int j = 0; j < idMementos.length; j++) { editorIDs[j] = idMementos[j] .getString(IWorkbenchConstants.TAG_ID); } idMementos = extMementos[i] .getChildren(IWorkbenchConstants.TAG_DELETED_EDITOR); String[] deletedEditorIDs = new String[idMementos.length]; for (int j = 0; j < idMementos.length; j++) { deletedEditorIDs[j] = idMementos[j] .getString(IWorkbenchConstants.TAG_ID); } FileEditorMapping mapping = getMappingFor(name + "." + extension); //$NON-NLS-1$ if (mapping == null) { mapping = new FileEditorMapping(name, extension); } List editors = new ArrayList(); for (int j = 0; j < editorIDs.length; j++) { if (editorIDs[j] != null) { EditorDescriptor editor = (EditorDescriptor) editorTable .get(editorIDs[j]); if (editor != null) { editors.add(editor); } } } List deletedEditors = new ArrayList(); for (int j = 0; j < deletedEditorIDs.length; j++) { if (deletedEditorIDs[j] != null) { EditorDescriptor editor = (EditorDescriptor) editorTable .get(deletedEditorIDs[j]); if (editor != null) { deletedEditors.add(editor); } } } List defaultEditors = new ArrayList(); if (versionIs31) { // parse the new format idMementos = extMementos[i] .getChildren(IWorkbenchConstants.TAG_DEFAULT_EDITOR); String[] defaultEditorIds = new String[idMementos.length]; for (int j = 0; j < idMementos.length; j++) { defaultEditorIds[j] = idMementos[j] .getString(IWorkbenchConstants.TAG_ID); } for (int j = 0; j < defaultEditorIds.length; j++) { if (defaultEditorIds[j] != null) { EditorDescriptor editor = (EditorDescriptor) editorTable .get(defaultEditorIds[j]); if (editor != null) { defaultEditors.add(editor); } } } } else { // guess at pre 3.1 format defaults if (!editors.isEmpty()) { EditorDescriptor editor = (EditorDescriptor) editors.get(0); if (editor != null) { defaultEditors.add(editor); } } defaultEditors.addAll(Arrays.asList(mapping.getDeclaredDefaultEditors())); } // Add any new editors that have already been read from the registry // which were not deleted. IEditorDescriptor[] editorsArray = mapping.getEditors(); for (int j = 0; j < editorsArray.length; j++) { if (!contains(editors, editorsArray[j]) && !deletedEditors.contains(editorsArray[j])) { editors.add(editorsArray[j]); } } // Map the editor(s) to the file type mapping.setEditorsList(editors); mapping.setDeletedEditorsList(deletedEditors); mapping.setDefaultEditors(defaultEditors); typeEditorMappings.put(mappingKeyFor(mapping), mapping); } }
// in Eclipse UI/org/eclipse/ui/internal/PluginAction.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IActionDelegate) { return (IActionDelegate) obj; } throw new WorkbenchException( "Action must implement IActionDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
private IWorkbenchWindow busyOpenWorkbenchWindow(final String perspID, final IAdaptable input) throws WorkbenchException { // Create a workbench window (becomes active window) final WorkbenchWindow newWindowArray[] = new WorkbenchWindow[1]; StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() { public void runWithException() { newWindowArray[0] = newWorkbenchWindow(); } }); final WorkbenchWindow newWindow = newWindowArray[0]; StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() { newWindow.create(); // must be created before adding to window // manager } }); windowManager.add(newWindow); final WorkbenchException [] exceptions = new WorkbenchException[1]; // Create the initial page. if (perspID != null) { StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() { public void runWithException() { try { newWindow.busyOpenPage(perspID, input); } catch (WorkbenchException e) { windowManager.remove(newWindow); exceptions[0] = e; } }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchWindow openWorkbenchWindow(IAdaptable input) throws WorkbenchException { return openWorkbenchWindow(getPerspectiveRegistry() .getDefaultPerspective(), input); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchWindow openWorkbenchWindow(final String perspID, final IAdaptable input) throws WorkbenchException { // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenWorkbenchWindow(perspID, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchWindow) { return (IWorkbenchWindow) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.Abnormal_Workbench_Conditi); } }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
IWorkbenchWindow restoreWorkbenchWindow(IMemento memento) throws WorkbenchException { WorkbenchWindow newWindow = newWorkbenchWindow(); newWindow.create(); windowManager.add(newWindow); // whether the window was opened boolean opened = false; try { newWindow.restoreState(memento, null); newWindow.fireWindowRestored(); newWindow.open(); opened = true; } finally { if (!opened) { newWindow.close(); } } return newWindow; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open, then the // window // is given focus and the perspective is shown. The page's input is // ignored. WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } // If another window that has the workspace root as input and the // requested // perpective open and active, then the window is given focus. IAdaptable input = getDefaultPageInput(); IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { Shell shell = win.getShell(); shell.open(); if (shell.getMinimized()) { shell.setMinimized(false); } return page; } } } } } } } // Otherwise the requested perspective is opened and shown in the // specified // window or in a new window depending on the current user preference // for opening // perspectives, and that window is given focus. win = (WorkbenchWindow) window; if (win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } // Only open a new window if user preference is set and the window // has an active perspective. if (IPreferenceConstants.OPM_NEW_WINDOW == mode && persp != null) { IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); } IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } // Just throw an exception.... throw new WorkbenchException(NLS .bind(WorkbenchMessages.Workbench_showPerspectiveError, perspectiveId)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window, IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspectiveId); // If the specified window has the requested perspective open and the // same requested // input, then the window is given focus and the perspective is shown. boolean inputSameAsWindow = false; WorkbenchWindow win = (WorkbenchWindow) window; if (win != null) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { inputSameAsWindow = true; IPerspectiveDescriptor perspectives[] = page .getOpenPerspectives(); for (int i = 0; i < perspectives.length; i++) { IPerspectiveDescriptor persp = perspectives[i]; if (perspectiveId.equals(persp.getId())) { win.makeVisible(); page.setPerspective(persp); return page; } } } } } // If another window has the requested input and the requested // perpective open and active, then that window is given focus. IWorkbenchWindow[] windows = getWorkbenchWindows(); for (int i = 0; i < windows.length; i++) { win = (WorkbenchWindow) windows[i]; if (window != win) { WorkbenchPage page = win.getActiveWorkbenchPage(); if (page != null) { boolean inputSame = false; if (input == null) { inputSame = (page.getInput() == null); } else { inputSame = input.equals(page.getInput()); } if (inputSame) { Perspective persp = page.getActivePerspective(); if (persp != null) { IPerspectiveDescriptor desc = persp.getDesc(); if (desc != null) { if (perspectiveId.equals(desc.getId())) { win.getShell().open(); return page; } } } } } } } // If the specified window has the same requested input but not the // requested // perspective, then the window is given focus and the perspective is // opened and shown // on condition that the user preference is not to open perspectives in // a new window. win = (WorkbenchWindow) window; if (inputSameAsWindow && win != null) { IPreferenceStore store = WorkbenchPlugin.getDefault() .getPreferenceStore(); int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); if (IPreferenceConstants.OPM_NEW_WINDOW != mode) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // If the specified window has no active perspective, then open the // requested perspective and show the specified window. if (win != null) { IWorkbenchPage page = win.getActiveWorkbenchPage(); IPerspectiveDescriptor persp = null; if (page != null) { persp = page.getPerspective(); } if (persp == null) { IPerspectiveDescriptor desc = getPerspectiveRegistry() .findPerspectiveWithId(perspectiveId); if (desc == null) { throw new WorkbenchException( NLS .bind( WorkbenchMessages.WorkbenchPage_ErrorCreatingPerspective, perspectiveId)); } win.getShell().open(); if (page == null) { page = win.openPage(perspectiveId, input); } else { page.setPerspective(desc); } return page; } } // Otherwise the requested perspective is opened and shown in a new // window, and the // window is given focus. IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); return newWindow.getActivePage(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
protected IWorkbenchPage busyOpenPage(String perspID, IAdaptable input) throws WorkbenchException { IWorkbenchPage newPage = null; if (pageList.isEmpty()) { newPage = ((WorkbenchImplementation) Tweaklets .get(WorkbenchImplementation.KEY)).createWorkbenchPage(this, perspID, input); pageList.add(newPage); firePageOpened(newPage); setActivePage(newPage); } else { IWorkbenchWindow window = getWorkbench().openWorkbenchWindow( perspID, input); newPage = window.getActivePage(); } return newPage; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
void fireWindowRestored() throws WorkbenchException { StartupThreading.runWithWorkbenchExceptions(new StartupRunnable() { public void runWithException() throws Throwable { getWindowAdvisor().postWindowRestore(); } }); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public IWorkbenchPage openPage(final String perspId, final IAdaptable input) throws WorkbenchException { Assert.isNotNull(perspId); // Run op in busy cursor. final Object[] result = new Object[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { result[0] = busyOpenPage(perspId, input); } catch (WorkbenchException e) { result[0] = e; } } }); if (result[0] instanceof IWorkbenchPage) { return (IWorkbenchPage) result[0]; } else if (result[0] instanceof WorkbenchException) { throw (WorkbenchException) result[0]; } else { throw new WorkbenchException( WorkbenchMessages.WorkbenchWindow_exceptionMessage); } }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public IWorkbenchPage openPage(IAdaptable input) throws WorkbenchException { String perspId = getWorkbenchImpl().getPerspectiveRegistry() .getDefaultPerspective(); return openPage(perspId, input); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
public void runWithException() throws WorkbenchException { newPage[0] = ((WorkbenchImplementation) Tweaklets .get(WorkbenchImplementation.KEY)).createWorkbenchPage(WorkbenchWindow.this, finalInput); }
// in Eclipse UI/org/eclipse/ui/internal/WWinPluginPulldown.java
protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException { if (obj instanceof IWorkbenchWindowPulldownDelegate) { return (IWorkbenchWindowPulldownDelegate) obj; } throw new WorkbenchException( "Action must implement IWorkbenchWindowPulldownDelegate"); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java
public void postWindowRestore() throws WorkbenchException { // do nothing }
// in Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
public void postWindowRestore(IWorkbenchWindowConfigurer configurer) throws WorkbenchException { // do nothing }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
private EditorInputData readEditorInput(DataInputStream dataIn) throws IOException, WorkbenchException { String editorId = dataIn.readUTF(); String factoryId = dataIn.readUTF(); String xmlString = dataIn.readUTF(); if (xmlString == null || xmlString.length() == 0) { return null; } StringReader reader = new StringReader(xmlString); // Restore the editor input XMLMemento memento = XMLMemento.createReadRoot(reader); IElementFactory factory = PlatformUI.getWorkbench().getElementFactory( factoryId); if (factory != null) { IAdaptable adaptable = factory.createElement(memento); if (adaptable != null && (adaptable instanceof IEditorInput)) { return new EditorInputData(editorId, (IEditorInput) adaptable); } } return null; }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createReadRoot(Reader reader) throws WorkbenchException { return createReadRoot(reader, null); }
// in Eclipse UI/org/eclipse/ui/XMLMemento.java
public static XMLMemento createReadRoot(Reader reader, String baseDir) throws WorkbenchException { String errorMessage = null; Exception exception = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); InputSource source = new InputSource(reader); if (baseDir != null) { source.setSystemId(baseDir); } parser.setErrorHandler(new ErrorHandler() { /** * @throws SAXException */ public void warning(SAXParseException exception) throws SAXException { // ignore } /** * @throws SAXException */ public void error(SAXParseException exception) throws SAXException { // ignore } public void fatalError(SAXParseException exception) throws SAXException { throw exception; } }); Document document = parser.parse(source); NodeList list = document.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node node = list.item(i); if (node instanceof Element) { return new XMLMemento(document, (Element) node); } } } catch (ParserConfigurationException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; } catch (IOException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_ioError; } catch (SAXException e) { exception = e; errorMessage = WorkbenchMessages.XMLMemento_formatError; } String problemText = null; if (exception != null) { problemText = exception.getMessage(); } if (problemText == null || problemText.length() == 0) { problemText = errorMessage != null ? errorMessage : WorkbenchMessages.XMLMemento_noElement; } throw new WorkbenchException(problemText, exception); }
28
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { ErrorDialog.openError(activeWorkbenchWindow.getShell(), WorkbenchMessages.ChangeToPerspectiveMenu_errorTitle, e .getMessage(), e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ }
// in Eclipse UI/org/eclipse/ui/internal/Perspective.java
catch (WorkbenchException e) { unableToOpenPerspective(persp, e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
catch (WorkbenchException e) { if (!((Workbench) window.getWorkbench()).isStarting()) { MessageDialog .openError( window.getShell(), WorkbenchMessages.Error, NLS.bind(WorkbenchMessages.Workbench_showPerspectiveError,desc.getId() )); } return null; }
// in Eclipse UI/org/eclipse/ui/internal/handlers/OpenInNewWindowHandler.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/quickaccess/PerspectiveElement.java
catch (WorkbenchException e) { IStatus errorStatus = WorkbenchPlugin.newError(NLS.bind( WorkbenchMessages.Workbench_showPerspectiveError, descriptor.getLabel()), e); StatusManager.getManager().handle(errorStatus, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
catch (final WorkbenchException e) { // Could not initialize the preference memento. }
// in Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
catch (WorkbenchException e) { handleInternalError( e, WorkbenchMessages.ProblemRestoringWorkingSetState_title, WorkbenchMessages.ProblemRestoringWorkingSetState_message); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java
catch (WorkbenchException e) { unableToLoadPerspective(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/registry/EditorRegistry.java
catch (WorkbenchException e) { ErrorDialog.openError((Shell) null, WorkbenchMessages.EditorRegistry_errorTitle, WorkbenchMessages.EditorRegistry_errorMessage, e.getStatus()); return false; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { windowManager.remove(newWindow); exceptions[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { String msg = "Workbench exception showing specified command line perspective on startup."; //$NON-NLS-1$ WorkbenchPlugin.log(msg, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (final WorkbenchException e) { // Don't use the window's shell as the dialog parent, // as the window is not open yet (bug 76724). StartupThreading.runWithoutExceptions(new StartupRunnable() { public void runWithException() throws Throwable { ErrorDialog.openError(null, WorkbenchMessages.Problems_Opening_Page, e.getMessage(), e .getStatus()); }}); }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { result[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/Workbench.java
catch (WorkbenchException e) { status.add(e.getStatus()); }
// in Eclipse UI/org/eclipse/ui/internal/PlatformUIPreferenceListener.java
catch (WorkbenchException e) { e.printStackTrace(); }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { result[0] = e; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to restore perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); continue; }
// in Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
catch (WorkbenchException e) { WorkbenchPlugin .log( "Unable to create default perspective - constructor failed.", e); //$NON-NLS-1$ result.add(e.getStatus()); String productName = WorkbenchPlugin.getDefault() .getProductName(); if (productName == null) { productName = ""; //$NON-NLS-1$ } getShell().setText(productName); }
// in Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
catch (WorkbenchException e) { // Simply don't restore the settings StatusManager .getManager() .handle( new Status( IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.ERROR, WorkbenchMessages.FilteredItemsSelectionDialog_restoreError, e)); }
// in Eclipse UI/org/eclipse/ui/actions/OpenPerspectiveMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( PAGE_PROBLEMS_TITLE + ": " + e.getMessage(), e, //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewWindowMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewWindowMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenInNewWindowAction.java
catch (WorkbenchException e) { StatusUtil.handleStatus(e.getStatus(), WorkbenchMessages.OpenInNewWindowAction_errorTitle + ": " + e.getMessage(), //$NON-NLS-1$ StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/actions/OpenNewPageMenu.java
catch (WorkbenchException e) { StatusUtil.handleStatus( WorkbenchMessages.OpenNewPageMenu_dialogTitle + ": " + //$NON-NLS-1$ e.getMessage(), e, StatusManager.SHOW); }
// in Eclipse UI/org/eclipse/ui/part/EditorInputTransfer.java
catch (WorkbenchException e) { return null; }
1
            
// in Eclipse UI/org/eclipse/ui/handlers/ShowPerspectiveHandler.java
catch (WorkbenchException e) { throw new ExecutionException("Perspective could not be opened.", e); //$NON-NLS-1$ }
0

Miscellanous Metrics

nF = Number of Finally 126
nF = Number of Try-Finally (without catch) 97
Number of Methods with Finally (nMF) 118 / 13568 (0.9%)
Number of Finally with a Continue 0
Number of Finally with a Return 4
Number of Finally with a Throw 0
Number of Finally with a Break 0
Number of different exception types thrown 21
Number of Domain exception types thrown 8
Number of different exception types caught 41
Number of Domain exception types caught 7
Number of exception declarations in signatures 549
Number of different exceptions types declared in method signatures 32
Number of library exceptions types declared in method signatures 23
Number of Domain exceptions types declared in method signatures 9
Number of Catch with a continue 3
Number of Catch with a return 106
Number of Catch with a Break 1
nbIf = Number of If 12660
nbFor = Number of For 1724
Number of Method with an if 5803 / 13568
Number of Methods with a for 1426 / 13568
Number of Method starting with a try 83 / 13568 (0.6%)
Number of Expressions 125114
Number of Expressions in try 6776 (5.4%)