Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 16878 Details for
Bug 49497
[RCP] JFace dependency on org.eclipse.core.runtime enlarges standalone JFace applications
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
JFace patch
patch_49497_jface.txt (text/plain), 31.34 KB, created by
Chris Gross
on 2005-01-01 10:50:28 EST
(
hide
)
Description:
JFace patch
Filename:
MIME Type:
Creator:
Chris Gross
Created:
2005-01-01 10:50:28 EST
Size:
31.34 KB
patch
obsolete
>Index: plugin.xml >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/plugin.xml,v >retrieving revision 1.13 >diff -u -r1.13 plugin.xml >--- plugin.xml 26 Oct 2004 18:14:30 -0000 1.13 >+++ plugin.xml 1 Jan 2005 15:33:56 -0000 >@@ -4,7 +4,8 @@ > id="org.eclipse.jface" > name="%pluginName" > version="3.1.0" >- provider-name="%providerName"> >+ provider-name="%providerName" >+ class="org.eclipse.jface.JFacePlugin"> > > <runtime> > <library name="jface.jar"> >Index: src/org/eclipse/jface/preference/PreferenceDialog.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java,v >retrieving revision 1.59 >diff -u -r1.59 PreferenceDialog.java >--- src/org/eclipse/jface/preference/PreferenceDialog.java 21 Dec 2004 14:43:11 -0000 1.59 >+++ src/org/eclipse/jface/preference/PreferenceDialog.java 1 Jan 2005 15:33:57 -0000 >@@ -16,7 +16,6 @@ > > import org.eclipse.core.runtime.ISafeRunnable; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.DialogMessageArea; >@@ -29,6 +28,7 @@ > import org.eclipse.jface.resource.JFaceResources; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.Policy; > import org.eclipse.jface.util.PropertyChangeEvent; > import org.eclipse.jface.util.SafeRunnable; > import org.eclipse.jface.viewers.ISelection; >@@ -242,7 +242,7 @@ > while (nodes.hasNext()) { > final IPreferenceNode node = (IPreferenceNode) nodes.next(); > if (getPage(node) != null) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > if (!getPage(node).performCancel()) > return; >@@ -830,7 +830,7 @@ > * save any state, and then calls <code>close</code> to close this dialog. > */ > protected void okPressed() { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > private boolean errorOccurred; > > /* >@@ -872,12 +872,9 @@ > */ > public void handleException(Throwable e) { > errorOccurred = true; >- if (Platform.isRunning()) { >- String bundle = Platform.PI_RUNTIME; >- Platform.getLog(Platform.getBundle(bundle)).log( >- new Status(IStatus.ERROR, bundle, 0, e.toString(), e)); >- } else >- e.printStackTrace(); >+ >+ Policy.getLog().log(new Status(IStatus.ERROR, Policy.JFACE, 0, e.toString(), e)); >+ > clearSelectedNode(); > String message = JFaceResources.getString("SafeRunnable.errorMessage"); //$NON-NLS-1$ > MessageDialog.openError(getShell(), JFaceResources.getString("Error"), message); //$NON-NLS-1$ >@@ -1116,7 +1113,7 @@ > // (this allows lazy page control creation) > if (currentPage.getControl() == null) { > final boolean[] failed = { false }; >- Platform.run(new ISafeRunnable() { >+ SafeRunnable.getRunner().run(new ISafeRunnable() { > public void handleException(Throwable e) { > failed[0] = true; > } >@@ -1136,7 +1133,7 @@ > // label can be wrapped. > final Point[] size = new Point[1]; > final Point failed = new Point(-1, -1); >- Platform.run(new ISafeRunnable() { >+ SafeRunnable.getRunner().run(new ISafeRunnable() { > public void handleException(Throwable e) { > size[0] = failed; > } >Index: src/org/eclipse/jface/preference/PreferenceStore.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceStore.java,v >retrieving revision 1.10 >diff -u -r1.10 PreferenceStore.java >--- src/org/eclipse/jface/preference/PreferenceStore.java 2 Oct 2004 02:14:46 -0000 1.10 >+++ src/org/eclipse/jface/preference/PreferenceStore.java 1 Jan 2005 15:33:58 -0000 >@@ -21,10 +21,12 @@ > import java.util.Enumeration; > import java.util.Properties; > >+import org.eclipse.jface.resource.JFaceResources; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.IPropertyChangeListener; > import org.eclipse.jface.util.ListenerList; > import org.eclipse.jface.util.PropertyChangeEvent; >+import org.eclipse.jface.util.SafeRunnable; > > /** > * A concrete preference store implementation based on an internal >@@ -129,18 +131,15 @@ > && (oldValue == null || !oldValue.equals(newValue))) { > final PropertyChangeEvent pe = new PropertyChangeEvent(this, name, > oldValue, newValue); >- // FIXME: need to do this without dependency on >- // org.eclipse.core.runtime >- // Platform.run(new >- // SafeRunnable(JFaceResources.getString("PreferenceStore.changeError")) >- // { //$NON-NLS-1$ >- // public void run() { >- for (int i = 0; i < finalListeners.length; ++i) { >- IPropertyChangeListener l = (IPropertyChangeListener) finalListeners[i]; >- l.propertyChange(pe); >- } >- // } >- // }); >+ >+ SafeRunnable.getRunner().run(new SafeRunnable(JFaceResources.getString("PreferenceStore.changeError")) { //$NON-NLS-1$ >+ public void run() { >+ for (int i = 0; i < finalListeners.length; ++i) { >+ IPropertyChangeListener l = (IPropertyChangeListener) finalListeners[i]; >+ l.propertyChange(pe); >+ } >+ } >+ }); > } > } > >Index: src/org/eclipse/jface/util/DelegatingDragAdapter.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/util/DelegatingDragAdapter.java,v >retrieving revision 1.4 >diff -u -r1.4 DelegatingDragAdapter.java >--- src/org/eclipse/jface/util/DelegatingDragAdapter.java 8 Jul 2004 20:07:09 -0000 1.4 >+++ src/org/eclipse/jface/util/DelegatingDragAdapter.java 1 Jan 2005 15:33:59 -0000 >@@ -14,7 +14,6 @@ > import java.util.Iterator; > import java.util.List; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.swt.dnd.DragSource; > import org.eclipse.swt.dnd.DragSourceEvent; > import org.eclipse.swt.dnd.DragSourceListener; >@@ -119,7 +118,7 @@ > public void dragFinished(final DragSourceEvent event) { > // if (Policy.DEBUG_DRAG_DROP) > // System.out.println("Drag Finished: " + toString()); //$NON-NLS-1$ >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > if (currentListener != null) { > // there is a listener that can handle the drop, delegate the event >@@ -151,7 +150,7 @@ > > updateCurrentListener(event); // find a listener that can provide the given data type > if (currentListener != null) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > currentListener.dragSetData(event); > } >@@ -180,7 +179,7 @@ > final TransferDragSourceListener listener = (TransferDragSourceListener) listeners > .get(i); > event.doit = true; // restore event.doit >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > listener.dragStart(event); > } >Index: src/org/eclipse/jface/util/DelegatingDropAdapter.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/util/DelegatingDropAdapter.java,v >retrieving revision 1.2 >diff -u -r1.2 DelegatingDropAdapter.java >--- src/org/eclipse/jface/util/DelegatingDropAdapter.java 8 Jul 2004 20:07:09 -0000 1.2 >+++ src/org/eclipse/jface/util/DelegatingDropAdapter.java 1 Jan 2005 15:33:59 -0000 >@@ -14,7 +14,6 @@ > import java.util.Iterator; > import java.util.List; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.swt.dnd.DND; > import org.eclipse.swt.dnd.DropTargetEvent; > import org.eclipse.swt.dnd.DropTargetListener; >@@ -164,7 +163,7 @@ > // operation change. otherwise the new listener would get a dragEnter > // followed by a dragOperationChanged with the exact same event. > if (newListener != null && newListener == oldListener) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > newListener.dragOperationChanged(event); > } >@@ -190,7 +189,7 @@ > // drag over. otherwise the new listener would get a dragEnter > // followed by a dragOver with the exact same event. > if (newListener != null && newListener == oldListener) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > newListener.dragOver(event); > } >@@ -210,7 +209,7 @@ > // System.out.println("Drop: " + toString()); //$NON-NLS-1$ > updateCurrentListener(event); > if (getCurrentListener() != null) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > getCurrentListener().drop(event); > } >@@ -229,7 +228,7 @@ > // if (Policy.DEBUG_DRAG_DROP) > // System.out.println("Drop Accept: " + toString()); //$NON-NLS-1$ > if (getCurrentListener() != null) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > getCurrentListener().dropAccept(event); > } >@@ -318,7 +317,7 @@ > if (currentListener == listener) > return false; > if (currentListener != null) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > currentListener.dragLeave(event); > } >@@ -328,7 +327,7 @@ > // if (Policy.DEBUG_DRAG_DROP) > // System.out.println("Current drop listener: " + listener); //$NON-NLS-1$ > if (currentListener != null) { >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() throws Exception { > currentListener.dragEnter(event); > } >Index: src/org/eclipse/jface/util/Policy.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/util/Policy.java,v >retrieving revision 1.6 >diff -u -r1.6 Policy.java >--- src/org/eclipse/jface/util/Policy.java 6 Oct 2004 13:46:25 -0000 1.6 >+++ src/org/eclipse/jface/util/Policy.java 1 Jan 2005 15:33:59 -0000 >@@ -10,11 +10,7 @@ > *******************************************************************************/ > package org.eclipse.jface.util; > >-import org.eclipse.core.runtime.ILog; >-import org.eclipse.core.runtime.ILogListener; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Platform; >-import org.osgi.framework.Bundle; > > /** > * The Policy class is a class to handle debug flags within the JFace plug-in. >@@ -33,7 +29,7 @@ > */ > public static final String JFACE = "org.eclipse.jface";//$NON-NLS-1$ > >- private static ILog log; >+ private static ILogger log; > > /** > * A flag to indicate whether unparented dialogs should >@@ -57,71 +53,27 @@ > */ > > public static boolean TRACE_TOOLBAR = DEFAULT; >- static { >- if (getDebugOption("/debug")) { //$NON-NLS-1$ >- DEBUG_DIALOG_NO_PARENT = getDebugOption("/debug/dialog/noparent"); //$NON-NLS-1$ >- TRACE_ACTIONS = getDebugOption("/trace/actions"); //$NON-NLS-1$ >- TRACE_TOOLBAR = getDebugOption("/trace/toolbarDisposal"); //$NON-NLS-1$ >- SHOW_PREFERENCES_NEWLOOK = getDebugOption("/newlook/preferences/showNewLook");//$NON-NLS-1$ >- } >- } >+ > > /** > * Get the dummy log to use if none has been set > * @return ILog > */ >- private static ILog getDummyLog() { >- return new ILog() { >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.core.runtime.ILog#addLogListener(org.eclipse.core.runtime.ILogListener) >- */ >- public void addLogListener(ILogListener listener) { >- // Do nothing as this is a dummy placeholder >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.core.runtime.ILog#getBundle() >- */ >- public Bundle getBundle() { >- //Do nothing as this is a dummy placeholder >- return null; >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.core.runtime.ILog#log(org.eclipse.core.runtime.IStatus) >- */ >+ private static ILogger getDummyLog() { >+ return new ILogger() { > public void log(IStatus status) { > System.err.println(status.getMessage()); > } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.core.runtime.ILog#removeLogListener(org.eclipse.core.runtime.ILogListener) >- */ >- public void removeLogListener(ILogListener listener) { >- //Do nothing as this is a dummy placeholder >- } > }; > } > >- private static boolean getDebugOption(String option) { >- if (Platform.isRunning()) >- return "true".equalsIgnoreCase(Platform.getDebugOption(JFACE + option)); //$NON-NLS-1$ >- return false; >- } >+ > > /** > * Set the log to be forwarding log. > * @param forwardingLog > */ >- public static void setLog(ILog forwardingLog) { >+ public static void setLog(ILogger forwardingLog) { > log = forwardingLog; > } > >@@ -129,7 +81,7 @@ > * Return the log the receiver is using. > * @return ILog > */ >- public static ILog getLog() { >+ public static ILogger getLog() { > if (log == null) > log = getDummyLog(); > return log; >Index: src/org/eclipse/jface/util/SafeRunnable.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/util/SafeRunnable.java,v >retrieving revision 1.9 >diff -u -r1.9 SafeRunnable.java >--- src/org/eclipse/jface/util/SafeRunnable.java 8 Jul 2004 20:07:09 -0000 1.9 >+++ src/org/eclipse/jface/util/SafeRunnable.java 1 Jan 2005 15:33:59 -0000 >@@ -25,6 +25,16 @@ > private String message; > > private static boolean ignoreErrors = false; >+ >+ private static ISafeRunnableRunner runner = new ISafeRunnableRunner(){ >+ public void run(ISafeRunnable code) { >+ try { >+ code.run(); >+ } catch (Throwable t){ >+ t.printStackTrace(); >+ code.handleException(t); >+ } >+ }}; > > /** > * Creates a new instance of SafeRunnable with a default error message. >@@ -78,4 +88,33 @@ > public static void setIgnoreErrors(boolean flag) { > ignoreErrors = flag; > } >+ >+ /** >+ * @return Returns the runner. >+ * >+ * @since 3.1 >+ */ >+ public static ISafeRunnableRunner getRunner() { >+ return runner; >+ } >+ >+ /** >+ * @param runner The runner to set. >+ * >+ * @since 3.1 >+ */ >+ public static void setRunner(ISafeRunnableRunner runner) { >+ SafeRunnable.runner = runner; >+ } >+ >+ >+ /** >+ * Runs SafeRunnable using the ISafeRunnableRunner registered statically. >+ * Equivalent to <code>SafeRunnable.getRunner().run(mySafeRunnable)</code> >+ * and when running within the Eclipse runtime equivalent to >+ * <code>Platform.run(mySafeRunnable)</code>. >+ */ >+ public void runSafely(){ >+ SafeRunnable.getRunner().run(this); >+ } > } >Index: src/org/eclipse/jface/viewers/AbstractTreeViewer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java,v >retrieving revision 1.48 >diff -u -r1.48 AbstractTreeViewer.java >--- src/org/eclipse/jface/viewers/AbstractTreeViewer.java 7 Dec 2004 04:04:37 -0000 1.48 >+++ src/org/eclipse/jface/viewers/AbstractTreeViewer.java 1 Jan 2005 15:34:01 -0000 >@@ -15,7 +15,6 @@ > import java.util.Enumeration; > import java.util.List; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.ListenerList; > import org.eclipse.jface.util.SafeRunnable; >@@ -487,7 +486,7 @@ > } > > // update icon and label >- Platform.run(new UpdateItemSafeRunnable(item, element)); >+ SafeRunnable.getRunner().run(new UpdateItemSafeRunnable(item, element)); > } > } > >@@ -539,7 +538,7 @@ > Object[] listeners = treeListeners.getListeners(); > for (int i = 0; i < listeners.length; ++i) { > final ITreeViewerListener l = (ITreeViewerListener) listeners[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.treeCollapsed(event); > } >@@ -559,7 +558,7 @@ > Object[] listeners = treeListeners.getListeners(); > for (int i = 0; i < listeners.length; ++i) { > final ITreeViewerListener l = (ITreeViewerListener) listeners[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.treeExpanded(event); > } >Index: src/org/eclipse/jface/viewers/CellEditor.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/CellEditor.java,v >retrieving revision 1.13 >diff -u -r1.13 CellEditor.java >--- src/org/eclipse/jface/viewers/CellEditor.java 8 Jul 2004 20:07:08 -0000 1.13 >+++ src/org/eclipse/jface/viewers/CellEditor.java 1 Jan 2005 15:34:02 -0000 >@@ -11,7 +11,6 @@ > > package org.eclipse.jface.viewers; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.IPropertyChangeListener; > import org.eclipse.jface.util.ListenerList; >@@ -300,7 +299,7 @@ > Object[] array = listeners.getListeners(); > for (int i = 0; i < array.length; i++) { > final ICellEditorListener l = (ICellEditorListener) array[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.applyEditorValue(); > } >@@ -318,7 +317,7 @@ > Object[] array = listeners.getListeners(); > for (int i = 0; i < array.length; i++) { > final ICellEditorListener l = (ICellEditorListener) array[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.cancelEditor(); > } >@@ -338,7 +337,7 @@ > Object[] array = listeners.getListeners(); > for (int i = 0; i < array.length; i++) { > final ICellEditorListener l = (ICellEditorListener) array[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.editorValueChanged(oldValidState, newValidState); > } >@@ -356,7 +355,7 @@ > Object[] array = propertyChangeListeners.getListeners(); > for (int i = 0; i < array.length; i++) { > final IPropertyChangeListener l = (IPropertyChangeListener) array[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.propertyChange(new PropertyChangeEvent(this, actionId, > null, null)); >Index: src/org/eclipse/jface/viewers/CheckboxTableViewer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTableViewer.java,v >retrieving revision 1.10 >diff -u -r1.10 CheckboxTableViewer.java >--- src/org/eclipse/jface/viewers/CheckboxTableViewer.java 8 Jul 2004 20:07:08 -0000 1.10 >+++ src/org/eclipse/jface/viewers/CheckboxTableViewer.java 1 Jan 2005 15:34:02 -0000 >@@ -13,7 +13,6 @@ > import java.util.ArrayList; > import java.util.List; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.ListenerList; > import org.eclipse.jface.util.SafeRunnable; >@@ -172,7 +171,7 @@ > Object[] array = checkStateListeners.getListeners(); > for (int i = 0; i < array.length; i++) { > final ICheckStateListener l = (ICheckStateListener) array[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.checkStateChanged(event); > } >Index: src/org/eclipse/jface/viewers/CheckboxTreeViewer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTreeViewer.java,v >retrieving revision 1.10 >diff -u -r1.10 CheckboxTreeViewer.java >--- src/org/eclipse/jface/viewers/CheckboxTreeViewer.java 8 Jul 2004 20:07:08 -0000 1.10 >+++ src/org/eclipse/jface/viewers/CheckboxTreeViewer.java 1 Jan 2005 15:34:03 -0000 >@@ -13,7 +13,6 @@ > import java.util.ArrayList; > import java.util.List; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.ListenerList; > import org.eclipse.jface.util.SafeRunnable; >@@ -129,7 +128,7 @@ > Object[] array = checkStateListeners.getListeners(); > for (int i = 0; i < array.length; i++) { > final ICheckStateListener l = (ICheckStateListener) array[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.checkStateChanged(event); > } >Index: src/org/eclipse/jface/viewers/LabelProvider.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/LabelProvider.java,v >retrieving revision 1.8 >diff -u -r1.8 LabelProvider.java >--- src/org/eclipse/jface/viewers/LabelProvider.java 8 Jul 2004 20:07:08 -0000 1.8 >+++ src/org/eclipse/jface/viewers/LabelProvider.java 1 Jan 2005 15:34:03 -0000 >@@ -10,7 +10,6 @@ > *******************************************************************************/ > package org.eclipse.jface.viewers; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.ListenerList; > import org.eclipse.jface.util.SafeRunnable; > import org.eclipse.swt.graphics.Image; >@@ -65,7 +64,7 @@ > Object[] listeners = this.listeners.getListeners(); > for (int i = 0; i < listeners.length; ++i) { > final ILabelProviderListener l = (ILabelProviderListener) listeners[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.labelProviderChanged(event); > } >Index: src/org/eclipse/jface/viewers/StructuredViewer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java,v >retrieving revision 1.33 >diff -u -r1.33 StructuredViewer.java >--- src/org/eclipse/jface/viewers/StructuredViewer.java 1 Dec 2004 15:07:58 -0000 1.33 >+++ src/org/eclipse/jface/viewers/StructuredViewer.java 1 Jan 2005 15:34:05 -0000 >@@ -14,7 +14,6 @@ > import java.util.Iterator; > import java.util.List; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.IOpenEventListener; > import org.eclipse.jface.util.ListenerList; >@@ -633,7 +632,7 @@ > Object[] listeners = doubleClickListeners.getListeners(); > for (int i = 0; i < listeners.length; ++i) { > final IDoubleClickListener l = (IDoubleClickListener) listeners[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.doubleClick(event); > } >@@ -654,7 +653,7 @@ > Object[] listeners = openListeners.getListeners(); > for (int i = 0; i < listeners.length; ++i) { > final IOpenListener l = (IOpenListener) listeners[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.open(event); > } >@@ -676,7 +675,7 @@ > Object[] listeners = postSelectionChangedListeners.getListeners(); > for (int i = 0; i < listeners.length; ++i) { > final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.selectionChanged(event); > } >@@ -1213,7 +1212,7 @@ > * @param element > */ > protected final void refreshItem(Widget widget, Object element) { >- Platform.run(new UpdateItemSafeRunnable(widget, element, true)); >+ SafeRunnable.getRunner().run(new UpdateItemSafeRunnable(widget, element, true)); > } > > /** >@@ -1643,7 +1642,7 @@ > * the element > */ > protected final void updateItem(Widget widget, Object element) { >- Platform.run(new UpdateItemSafeRunnable(widget, element, true)); >+ SafeRunnable.getRunner().run(new UpdateItemSafeRunnable(widget, element, true)); > } > > /** >Index: src/org/eclipse/jface/viewers/Viewer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/Viewer.java,v >retrieving revision 1.10 >diff -u -r1.10 Viewer.java >--- src/org/eclipse/jface/viewers/Viewer.java 8 Jul 2004 20:07:08 -0000 1.10 >+++ src/org/eclipse/jface/viewers/Viewer.java 1 Jan 2005 15:34:05 -0000 >@@ -10,7 +10,6 @@ > *******************************************************************************/ > package org.eclipse.jface.viewers; > >-import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.ListenerList; > import org.eclipse.jface.util.SafeRunnable; >@@ -158,7 +157,7 @@ > Object[] listeners = selectionChangedListeners.getListeners(); > for (int i = 0; i < listeners.length; ++i) { > final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i]; >- Platform.run(new SafeRunnable() { >+ SafeRunnable.getRunner().run(new SafeRunnable() { > public void run() { > l.selectionChanged(event); > } >Index: src/org/eclipse/jface/JFacePlugin.java >=================================================================== >RCS file: src/org/eclipse/jface/JFacePlugin.java >diff -N src/org/eclipse/jface/JFacePlugin.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/JFacePlugin.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,53 @@ >+package org.eclipse.jface; >+ >+import org.eclipse.core.runtime.ISafeRunnable; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.Plugin; >+import org.eclipse.jface.util.ILogger; >+import org.eclipse.jface.util.ISafeRunnableRunner; >+import org.eclipse.jface.util.Policy; >+import org.eclipse.jface.util.SafeRunnable; >+import org.osgi.framework.BundleContext; >+ >+/** >+ * JFace Plug-in responsible for wiring the Platform >+ * and JFace together. >+ * >+ * @author Chris Gross (schtoo@schtoo.com) >+ */ >+public class JFacePlugin extends Plugin { >+ >+ /** >+ * >+ */ >+ public JFacePlugin() { >+ super(); >+ } >+ >+ public void start(BundleContext context) throws Exception { >+ super.start(context); >+ >+ //Set the Platform to run all SafeRunnables >+ SafeRunnable.setRunner(new ISafeRunnableRunner(){ >+ public void run(ISafeRunnable code) { >+ Platform.run(code); >+ }}); >+ >+ //Log all errors to the main runtime log >+ Policy.setLog(new ILogger(){ >+ public void log(IStatus status) { >+ Platform.getLog(Platform.getBundle(Platform.PI_RUNTIME)).log(status); >+ }}); >+ >+ //Get all debug options from Platform >+ if ("true".equalsIgnoreCase(Platform.getDebugOption("/debug"))) { //$NON-NLS-1$ //$NON-NLS-2$ >+ Policy.DEBUG_DIALOG_NO_PARENT = "true".equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/debug/dialog/noparent")); //$NON-NLS-1$ //$NON-NLS-2$ >+ Policy.TRACE_ACTIONS = "true".equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/trace/actions")); //$NON-NLS-1$ //$NON-NLS-2$ >+ Policy.TRACE_TOOLBAR = "true".equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/trace/toolbarDisposal")); //$NON-NLS-1$ //$NON-NLS-2$ >+ Policy.SHOW_PREFERENCES_NEWLOOK = "true".equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/newlook/preferences/showNewLook"));//$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ >+ } >+ >+} >Index: src/org/eclipse/jface/util/ILogger.java >=================================================================== >RCS file: src/org/eclipse/jface/util/ILogger.java >diff -N src/org/eclipse/jface/util/ILogger.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/util/ILogger.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,19 @@ >+package org.eclipse.jface.util; >+ >+import org.eclipse.core.runtime.IStatus; >+ >+/** >+ * A mechanism to log errors throughout JFace. >+ * >+ * @author Chris Gross (schtoo@schtoo.com) >+ */ >+public interface ILogger { >+ >+ /** >+ * Logs the given status. >+ * >+ * @param status status to log >+ */ >+ public void log(IStatus status); >+ >+} >Index: src/org/eclipse/jface/util/ISafeRunnableRunner.java >=================================================================== >RCS file: src/org/eclipse/jface/util/ISafeRunnableRunner.java >diff -N src/org/eclipse/jface/util/ISafeRunnableRunner.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/util/ISafeRunnableRunner.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package org.eclipse.jface.util; >+ >+import org.eclipse.core.runtime.ISafeRunnable; >+import org.eclipse.core.runtime.Platform; >+ >+/** >+ * @author Chris Gross (schtoo@schtoo.com) >+ */ >+public interface ISafeRunnableRunner { >+ >+ /** >+ * Runs the runnable. All ISafeRunnableRunners must catch any exception >+ * thrown by the ISafeRunnable and pass the exception to >+ * ISafeRunnable.handleException(); >+ * >+ * @see Platform#run(ISafeRunnable) >+ */ >+ public abstract void run(ISafeRunnable code); >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49497
:
16877
| 16878 |
16879