Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 30881 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyLifeCycle.java (-15 / +118 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 14-21 Link Here
14
import java.util.ArrayList;
14
import java.util.ArrayList;
15
import java.util.List;
15
import java.util.List;
16
16
17
import org.eclipse.swt.widgets.Display;
18
17
import org.eclipse.core.runtime.IProgressMonitor;
19
import org.eclipse.core.runtime.IProgressMonitor;
20
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.OperationCanceledException;
21
import org.eclipse.core.runtime.OperationCanceledException;
22
import org.eclipse.core.runtime.Status;
23
import org.eclipse.core.runtime.jobs.Job;
19
24
20
import org.eclipse.jface.operation.IRunnableContext;
25
import org.eclipse.jface.operation.IRunnableContext;
21
import org.eclipse.jface.operation.IRunnableWithProgress;
26
import org.eclipse.jface.operation.IRunnableWithProgress;
Lines 37-42 Link Here
37
import org.eclipse.jdt.core.JavaModelException;
42
import org.eclipse.jdt.core.JavaModelException;
38
43
39
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
44
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
45
import org.eclipse.jdt.internal.corext.util.Messages;
46
47
import org.eclipse.jdt.ui.JavaElementLabels;
40
48
41
import org.eclipse.jdt.internal.ui.JavaPlugin;
49
import org.eclipse.jdt.internal.ui.JavaPlugin;
42
50
Lines 52-59 Link Here
52
60
53
	private List fChangeListeners;
61
	private List fChangeListeners;
54
62
55
	public TypeHierarchyLifeCycle() {
63
	/**
64
	 * The type hierarchy view part.
65
	 *
66
	 * @since 3.6
67
	 */
68
	private TypeHierarchyViewPart fTypeHierarchyViewPart;
69
70
	/**
71
	 * The job that runs in the background to refresh the type hierarchy.
72
	 *
73
	 * @since 3.6
74
	 */
75
	private Job fRefreshHierarchyJob;
76
77
	/**
78
	 * Creates the type hierarchy life cycle.
79
	 *
80
	 * @param part the type hierarchy view part
81
	 * @since 3.6
82
	 */
83
	public TypeHierarchyLifeCycle(TypeHierarchyViewPart part) {
56
		this(false);
84
		this(false);
85
		fTypeHierarchyViewPart= part;
86
		fRefreshHierarchyJob= null;
57
	}
87
	}
58
88
59
	public TypeHierarchyLifeCycle(boolean isSuperTypesOnly) {
89
	public TypeHierarchyLifeCycle(boolean isSuperTypesOnly) {
Lines 98-103 Link Here
98
		}
128
		}
99
	}
129
	}
100
130
131
	/**
132
	 * Refreshes the type hierarchy for the java element if it exists.
133
	 *
134
	 * @param element the java element for which the type hierarchy is computed
135
	 * @param context the runnable context
136
	 * @throws InterruptedException thrown from the <code>OperationCanceledException</code> when the monitor is canceled
137
	 * @throws InvocationTargetException thrown from the <code>JavaModelException</code> if the java element does not exist or if an exception occurs while accessing its corresponding resource
138
	 */
101
	public void ensureRefreshedTypeHierarchy(final IJavaElement element, IRunnableContext context) throws InvocationTargetException, InterruptedException {
139
	public void ensureRefreshedTypeHierarchy(final IJavaElement element, IRunnableContext context) throws InvocationTargetException, InterruptedException {
102
		if (element == null || !element.exists()) {
140
		if (element == null || !element.exists()) {
103
			freeHierarchy();
141
			freeHierarchy();
Lines 106-126 Link Here
106
		boolean hierachyCreationNeeded= (fHierarchy == null || !element.equals(fInputElement));
144
		boolean hierachyCreationNeeded= (fHierarchy == null || !element.equals(fInputElement));
107
145
108
		if (hierachyCreationNeeded || fHierarchyRefreshNeeded) {
146
		if (hierachyCreationNeeded || fHierarchyRefreshNeeded) {
109
147
			if (fTypeHierarchyViewPart == null) {
110
			IRunnableWithProgress op= new IRunnableWithProgress() {
148
				IRunnableWithProgress op= new IRunnableWithProgress() {
111
				public void run(IProgressMonitor pm) throws InvocationTargetException, InterruptedException {
149
					public void run(IProgressMonitor pm) throws InvocationTargetException, InterruptedException {
112
					try {
150
						try {
113
						doHierarchyRefresh(element, pm);
151
							doHierarchyRefresh(element, pm);
114
					} catch (JavaModelException e) {
152
						} catch (JavaModelException e) {
115
						throw new InvocationTargetException(e);
153
							throw new InvocationTargetException(e);
116
					} catch (OperationCanceledException e) {
154
						} catch (OperationCanceledException e) {
117
						throw new InterruptedException();
155
							throw new InterruptedException();
156
						}
118
					}
157
					}
158
				};
159
				fHierarchyRefreshNeeded= true;
160
				context.run(true, true, op);
161
				fHierarchyRefreshNeeded= false;
162
			} else {
163
				synchronized (this) {
164
					final String label= Messages.format(TypeHierarchyMessages.TypeHierarchyLifeCycle_computeInput, JavaElementLabels.getElementLabel(element, JavaElementLabels.ALL_DEFAULT));
165
					fRefreshHierarchyJob= new Job(label) {
166
						/*
167
						 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
168
						 */
169
						public IStatus run(IProgressMonitor pm) {
170
							pm.beginTask(label, LONG);
171
							fTypeHierarchyViewPart.setCancelEnabled(true);
172
							try {
173
								doHierarchyRefreshBackground(element, pm);
174
							} catch (OperationCanceledException e) {
175
								fTypeHierarchyViewPart.setCanceledViewer();
176
								return Status.CANCEL_STATUS;
177
							} catch (JavaModelException e) {
178
								return e.getStatus();
179
							} finally {
180
								fTypeHierarchyViewPart.setCancelEnabled(false);
181
								fHierarchyRefreshNeeded= false;
182
								pm.done();
183
							}
184
							return Status.OK_STATUS;
185
						}
186
					};
187
					fRefreshHierarchyJob.schedule();
119
				}
188
				}
120
			};
189
			}
121
			fHierarchyRefreshNeeded= true;
190
		}
122
			context.run(true, true, op);
191
	}
123
			fHierarchyRefreshNeeded= false;
192
193
	/**
194
	 * Refreshes the hierarchy in the background and updates the hierarchy viewer asynchronously in the UI thread.
195
	 *
196
	 * @param element the java element on which the hierarchy is computed
197
	 * @param pm the progress monitor
198
	 * @throws JavaModelException if the java element does not exist or if an exception occurs while accessing its corresponding resource.
199
	 * @since 3.6
200
	 */
201
	protected synchronized void doHierarchyRefreshBackground(final IJavaElement element, final IProgressMonitor pm) throws JavaModelException {
202
		doHierarchyRefresh(element, pm);
203
		if (!pm.isCanceled()) {
204
			Display.getDefault().asyncExec(new Runnable() {
205
				/*
206
				 * @see java.lang.Runnable#run()
207
				 */
208
				public void run() {
209
					fTypeHierarchyViewPart.updateHierarchyViewer(true);
210
				}
211
			});
124
		}
212
		}
125
	}
213
	}
126
214
Lines 176-181 Link Here
176
			fInputElement= element;
264
			fInputElement= element;
177
		} else {
265
		} else {
178
			fHierarchy.refresh(pm);
266
			fHierarchy.refresh(pm);
267
			if (pm != null && pm.isCanceled())
268
				throw new OperationCanceledException();
179
		}
269
		}
180
		fHierarchy.addTypeHierarchyChangedListener(this);
270
		fHierarchy.addTypeHierarchyChangedListener(this);
181
		JavaCore.addElementChangedListener(this);
271
		JavaCore.addElementChangedListener(this);
Lines 274-278 Link Here
274
		}
364
		}
275
	}
365
	}
276
366
367
	/**
368
	 * Cancels the job that refreshes the type hierarchy.
369
	 *
370
	 * @since 3.6
371
	 */
372
	public void cancelRefreshJob() {
373
		if (fRefreshHierarchyJob != null) {
374
			fRefreshHierarchyJob.cancel();
375
			fRefreshHierarchyJob= null;
376
			fTypeHierarchyViewPart.setCanceledViewer();
377
		}
378
	}
379
277
380
278
}
381
}
(-)ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties (+3 lines)
Lines 9-14 Link Here
9
#     IBM Corporation - initial API and implementation
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
10
###############################################################################
11
11
12
CancelTypeHierarchyComputationAction_label=Cancel
13
CancelTypeHierarchyComputationAction_tooltip=Cancel Current Computation
12
EnableMemberFilterAction_label=Members in Hierarchy
14
EnableMemberFilterAction_label=Members in Hierarchy
13
EnableMemberFilterAction_tooltip=Lock View and Show Members in Hierarchy
15
EnableMemberFilterAction_tooltip=Lock View and Show Members in Hierarchy
14
EnableMemberFilterAction_description=Lock view and show members in hierarchy
16
EnableMemberFilterAction_description=Lock view and show members in hierarchy
Lines 62-67 Link Here
62
SortByDefiningTypeAction_label=Sort by the Defining Type
64
SortByDefiningTypeAction_label=Sort by the Defining Type
63
SortByDefiningTypeAction_tooltip=Sort Methods by the Defining Type
65
SortByDefiningTypeAction_tooltip=Sort Methods by the Defining Type
64
SortByDefiningTypeAction_description=Sort methods by the defining type
66
SortByDefiningTypeAction_description=Sort methods by the defining type
67
TypeHierarchyLifeCycle_computeInput=Computing type hierarchy of ''{0}''...
65
68
66
TypeHierarchyViewPart_error_title=Open Type Hierarchy
69
TypeHierarchyViewPart_error_title=Open Type Hierarchy
67
TypeHierarchyViewPart_createinput=Creating type hierarchy of ''{0}''...
70
TypeHierarchyViewPart_createinput=Creating type hierarchy of ''{0}''...
(-)ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyMessages.java (+3 lines)
Lines 20-25 Link Here
20
		// Do not instantiate
20
		// Do not instantiate
21
	}
21
	}
22
22
23
	public static String CancelTypeHierarchyComputationAction_label;
24
	public static String CancelTypeHierarchyComputationAction_tooltip;
23
	public static String EnableMemberFilterAction_label;
25
	public static String EnableMemberFilterAction_label;
24
	public static String EnableMemberFilterAction_tooltip;
26
	public static String EnableMemberFilterAction_tooltip;
25
	public static String EnableMemberFilterAction_description;
27
	public static String EnableMemberFilterAction_description;
Lines 72-77 Link Here
72
	public static String TypeHierarchyViewPart_ws_tooltip;
74
	public static String TypeHierarchyViewPart_ws_tooltip;
73
	public static String TypeHierarchyViewPart_restoreinput;
75
	public static String TypeHierarchyViewPart_restoreinput;
74
	public static String TypeHierarchyViewPart_layout_submenu;
76
	public static String TypeHierarchyViewPart_layout_submenu;
77
	public static String TypeHierarchyLifeCycle_computeInput;
75
	public static String ToggleViewAction_subtypes_label;
78
	public static String ToggleViewAction_subtypes_label;
76
	public static String ToggleViewAction_subtypes_tooltip;
79
	public static String ToggleViewAction_subtypes_tooltip;
77
	public static String ToggleViewAction_subtypes_description;
80
	public static String ToggleViewAction_subtypes_description;
(-)ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java (-18 / +73 lines)
Lines 241-248 Link Here
241
	private OpenAndLinkWithEditorHelper fTypeOpenAndLinkWithEditorHelper;
241
	private OpenAndLinkWithEditorHelper fTypeOpenAndLinkWithEditorHelper;
242
242
243
	private OpenAction fOpenAction;
243
	private OpenAction fOpenAction;
244
244
	/**
245
245
	 * Action to cancel the type hierarchy computation.
246
	 *
247
	 * @since 3.6
248
	 */
249
	private CancelTypeHierarchyComputationAction fCancelTypeHierarchyComputationAction;
246
	public TypeHierarchyViewPart() {
250
	public TypeHierarchyViewPart() {
247
		fSelectedType= null;
251
		fSelectedType= null;
248
		fInputElement= null;
252
		fInputElement= null;
Lines 251-257 Link Here
251
		fSelectInEditor= true;
255
		fSelectInEditor= true;
252
		fRestoreStateJob= null;
256
		fRestoreStateJob= null;
253
257
254
		fHierarchyLifeCycle= new TypeHierarchyLifeCycle();
258
		fHierarchyLifeCycle= new TypeHierarchyLifeCycle(this);
255
		fTypeHierarchyLifeCycleListener= new ITypeHierarchyLifeCycleListener() {
259
		fTypeHierarchyLifeCycleListener= new ITypeHierarchyLifeCycleListener() {
256
			public void typeHierarchyChanged(TypeHierarchyLifeCycle typeHierarchy, IType[] changedTypes) {
260
			public void typeHierarchyChanged(TypeHierarchyLifeCycle typeHierarchy, IType[] changedTypes) {
257
				doTypeHierarchyChanged(typeHierarchy, changedTypes);
261
				doTypeHierarchyChanged(typeHierarchy, changedTypes);
Lines 282-287 Link Here
282
		fHistoryDropDownAction= new HistoryDropDownAction(this);
286
		fHistoryDropDownAction= new HistoryDropDownAction(this);
283
		fHistoryDropDownAction.setEnabled(false);
287
		fHistoryDropDownAction.setEnabled(false);
284
288
289
		fCancelTypeHierarchyComputationAction= new CancelTypeHierarchyComputationAction(this);
290
		setCancelEnabled(false);
291
285
		fToggleOrientationActions= new ToggleOrientationAction[] {
292
		fToggleOrientationActions= new ToggleOrientationAction[] {
286
			new ToggleOrientationAction(this, VIEW_LAYOUT_VERTICAL),
293
			new ToggleOrientationAction(this, VIEW_LAYOUT_VERTICAL),
287
			new ToggleOrientationAction(this, VIEW_LAYOUT_HORIZONTAL),
294
			new ToggleOrientationAction(this, VIEW_LAYOUT_HORIZONTAL),
Lines 535-546 Link Here
535
				fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(inputElement, JavaPlugin.getActiveWorkbenchWindow());
542
				fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(inputElement, JavaPlugin.getActiveWorkbenchWindow());
536
				// fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(inputElement, getSite().getWorkbenchWindow());
543
				// fHierarchyLifeCycle.ensureRefreshedTypeHierarchy(inputElement, getSite().getWorkbenchWindow());
537
			} catch (InvocationTargetException e) {
544
			} catch (InvocationTargetException e) {
538
				ExceptionHandler.handle(e, getSite().getShell(), TypeHierarchyMessages.TypeHierarchyViewPart_exception_title, TypeHierarchyMessages.TypeHierarchyViewPart_exception_message);
545
				//Do nothing
539
				clearInput();
540
				return;
541
			} catch (InterruptedException e) {
546
			} catch (InterruptedException e) {
542
				fNoHierarchyShownLabel.setText(TypeHierarchyMessages.TypeHierarchyViewPart_empty);
547
				//Do nothing
543
				return;
544
			}
548
			}
545
549
546
			if (inputElement.getElementType() != IJavaElement.TYPE) {
550
			if (inputElement.getElementType() != IJavaElement.TYPE) {
Lines 561-566 Link Here
561
			updateToolTipAndDescription();
565
			updateToolTipAndDescription();
562
			showMembersInHierarchy(false);
566
			showMembersInHierarchy(false);
563
			fPagebook.showPage(fTypeMethodsSplitter);
567
			fPagebook.showPage(fTypeMethodsSplitter);
568
			setViewerVisibility(true);
564
			fSelectInEditor= true;
569
			fSelectInEditor= true;
565
		}
570
		}
566
	}
571
	}
Lines 1043-1048 Link Here
1043
			tbmanager.add(fViewActions[i]);
1048
			tbmanager.add(fViewActions[i]);
1044
		}
1049
		}
1045
		tbmanager.add(fHistoryDropDownAction);
1050
		tbmanager.add(fHistoryDropDownAction);
1051
		tbmanager.add(fCancelTypeHierarchyComputationAction);
1046
		tbmanager.update(false);
1052
		tbmanager.update(false);
1047
	}
1053
	}
1048
1054
Lines 1124-1130 Link Here
1124
	 * <code>updateHierarchyViewer<code> brings up the correct view and refreshes
1130
	 * <code>updateHierarchyViewer<code> brings up the correct view and refreshes
1125
	 * the current tree
1131
	 * the current tree
1126
	 */
1132
	 */
1127
	private void updateHierarchyViewer(final boolean doExpand) {
1133
	public void updateHierarchyViewer(final boolean doExpand) {
1128
		if (fInputElement == null) {
1134
		if (fInputElement == null) {
1129
			fNoHierarchyShownLabel.setText(TypeHierarchyMessages.TypeHierarchyViewPart_empty);
1135
			fNoHierarchyShownLabel.setText(TypeHierarchyMessages.TypeHierarchyViewPart_empty);
1130
			fPagebook.showPage(fNoHierarchyShownLabel);
1136
			fPagebook.showPage(fNoHierarchyShownLabel);
Lines 1561-1572 Link Here
1561
1567
1562
				fRestoreStateJob= new Job(label) {
1568
				fRestoreStateJob= new Job(label) {
1563
					protected IStatus run(IProgressMonitor monitor) {
1569
					protected IStatus run(IProgressMonitor monitor) {
1570
						fCancelTypeHierarchyComputationAction.setEnabled(true);
1564
						try {
1571
						try {
1565
							doRestoreInBackground(memento, hierarchyInput, monitor);
1572
							doRestoreInBackground(memento, hierarchyInput, monitor);
1566
						} catch (JavaModelException e) {
1573
						} catch (JavaModelException e) {
1567
							return e.getStatus();
1574
							return e.getStatus();
1568
						} catch (OperationCanceledException e) {
1575
						} catch (OperationCanceledException e) {
1576
							setCanceledViewer();
1569
							return Status.CANCEL_STATUS;
1577
							return Status.CANCEL_STATUS;
1578
						} finally {
1579
							fCancelTypeHierarchyComputationAction.setEnabled(false);
1570
						}
1580
						}
1571
						return Status.OK_STATUS;
1581
						return Status.OK_STATUS;
1572
					}
1582
					}
Lines 1579-1595 Link Here
1579
	private void doRestoreInBackground(final IMemento memento, final IJavaElement hierarchyInput, IProgressMonitor monitor) throws JavaModelException {
1589
	private void doRestoreInBackground(final IMemento memento, final IJavaElement hierarchyInput, IProgressMonitor monitor) throws JavaModelException {
1580
		fHierarchyLifeCycle.doHierarchyRefresh(hierarchyInput, monitor);
1590
		fHierarchyLifeCycle.doHierarchyRefresh(hierarchyInput, monitor);
1581
		final boolean doRestore= !monitor.isCanceled();
1591
		final boolean doRestore= !monitor.isCanceled();
1582
		Display.getDefault().asyncExec(new Runnable() {
1592
		if (doRestore) {
1583
			public void run() {
1593
			Display.getDefault().asyncExec(new Runnable() {
1584
				// running async: check first if view still exists
1594
				public void run() {
1585
				if (fPagebook != null && !fPagebook.isDisposed()) {
1595
					// running async: check first if view still exists
1586
					if (doRestore)
1596
					if (fPagebook != null && !fPagebook.isDisposed()) {
1587
						doRestoreState(memento, hierarchyInput);
1597
						doRestoreState(memento, hierarchyInput);
1588
					else
1598
					}
1589
						fNoHierarchyShownLabel.setText(TypeHierarchyMessages.TypeHierarchyViewPart_empty);
1590
				}
1599
				}
1591
			}
1600
			});
1592
		});
1601
		}
1593
	}
1602
	}
1594
1603
1595
1604
Lines 1731-1734 Link Here
1731
		fNeedRefresh= false;
1740
		fNeedRefresh= false;
1732
	}
1741
	}
1733
1742
1743
	/**
1744
	 * Sets the enablement state of the cancel button.
1745
	 *
1746
	 * @param enabled <code>true</code> if cancel should be enabled, <code>false</code> otherwise
1747
	 * @since 3.6
1748
	 */
1749
    void setCancelEnabled(boolean enabled) {
1750
        fCancelTypeHierarchyComputationAction.setEnabled(enabled);
1751
    }
1752
1753
	/**
1754
	 * Cancels the current computation of type hierarchy.
1755
	 *
1756
	 * @since 3.6
1757
	 */
1758
	public void cancelRestoreJob() {
1759
		if (fRestoreStateJob != null) {
1760
			fRestoreStateJob.cancel();
1761
			setCanceledViewer();
1762
		}
1763
	}
1764
1765
	/**
1766
	 * Sets the empty viewer after the canceled job in the display thread.
1767
	 *
1768
	 * @since 3.6
1769
	 */
1770
	public void setCanceledViewer() {
1771
		Display.getDefault().asyncExec(new Runnable() {
1772
			public void run() {
1773
				clearInput();
1774
			}
1775
		});
1776
	}
1777
1778
	/**
1779
	 * Returns the type hierarchy life cycle.
1780
	 *
1781
	 * @return the type hierarchy life cycle
1782
	 *
1783
	 * @since 3.6
1784
	 */
1785
	public TypeHierarchyLifeCycle getTypeHierarchyLifeCycle() {
1786
		return fHierarchyLifeCycle;
1787
1788
	}
1734
}
1789
}
(-)ui/org/eclipse/jdt/internal/ui/typehierarchy/CancelTypeHierarchyComputationAction.java (+54 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.jdt.internal.ui.typehierarchy;
13
14
import org.eclipse.jface.action.Action;
15
16
import org.eclipse.ui.PlatformUI;
17
18
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
19
import org.eclipse.jdt.internal.ui.JavaPluginImages;
20
21
/**
22
 * Action to cancel the current type hierarchy computation.
23
 *
24
 * @since 3.6
25
 *
26
 */
27
public class CancelTypeHierarchyComputationAction extends Action {
28
	/**
29
	 * The type hierarchy view part.
30
	 */
31
	private TypeHierarchyViewPart fTypeHierarchyViewPart;
32
33
	/**
34
	 * Creates the cancel action for type hierarchy computation.
35
	 *
36
	 * @param part the type hierarchy view part
37
	 */
38
	public CancelTypeHierarchyComputationAction(TypeHierarchyViewPart part) {
39
		super(TypeHierarchyMessages.CancelTypeHierarchyComputationAction_label);
40
		fTypeHierarchyViewPart= part;
41
		setToolTipText(TypeHierarchyMessages.CancelTypeHierarchyComputationAction_tooltip);
42
		JavaPluginImages.setLocalImageDescriptors(this, "ch_cancel.gif"); //$NON-NLS-1$
43
		PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.TYPE_HIERARCHY_CANCEL_COMPUTATION_ACTION);
44
	}
45
46
	/*
47
	 * @see org.eclipse.jface.action.Action#run()
48
	 */
49
	public void run() {
50
		setEnabled(false);
51
		fTypeHierarchyViewPart.getTypeHierarchyLifeCycle().cancelRefreshJob();
52
		fTypeHierarchyViewPart.cancelRestoreJob();
53
	}
54
}

Return to bug 30881