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 172573
Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java (-1 / +14 lines)
Lines 21-29 Link Here
21
import org.eclipse.jface.viewers.IStructuredSelection;
21
import org.eclipse.jface.viewers.IStructuredSelection;
22
22
23
/**
23
/**
24
 * Action to browse all references to selected object.
24
 * Action to browse all references to selected object. This action is retargettable, to do so, 
25
 * implement <code>IAllReferencesAction</code> and contribute the implementation as an adapter 
26
 * of the objects you want the custom action available for.
25
 * 
27
 * 
26
 * @since 3.3
28
 * @since 3.3
29
 * @see IAllReferencesAction
27
 */
30
 */
28
public class AllReferencesActionDelegate extends ObjectActionDelegate {
31
public class AllReferencesActionDelegate extends ObjectActionDelegate {
29
32
Lines 33-38 Link Here
33
	public void run(IAction action) {
36
	public void run(IAction action) {
34
		IStructuredSelection currentSelection = getCurrentSelection();
37
		IStructuredSelection currentSelection = getCurrentSelection();
35
		IJavaVariable var = (IJavaVariable) currentSelection.getFirstElement();
38
		IJavaVariable var = (IJavaVariable) currentSelection.getFirstElement();
39
		
40
		// See if there is adapter that can handle this action
41
		IAllReferencesAction altAction = (IAllReferencesAction)var.getAdapter(IAllReferencesAction.class);
42
		if (altAction != null){
43
			altAction.setActivePart(action, getPart());
44
			altAction.selectionChanged(action, currentSelection);
45
			altAction.run(action);
46
			return;
47
		}
48
		
36
		ReferencesPopupDialog popup;
49
		ReferencesPopupDialog popup;
37
		try {
50
		try {
38
			popup = new ReferencesPopupDialog(getWorkbenchWindow().getShell(), (IDebugView) getPart().getAdapter(IDebugView.class), (IJavaObject) var.getValue());
51
			popup = new ReferencesPopupDialog(getWorkbenchWindow().getShell(), (IDebugView) getPart().getAdapter(IDebugView.class), (IJavaObject) var.getValue());
(-)ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java (-1 / +16 lines)
Lines 41-49 Link Here
41
41
42
/**
42
/**
43
 * Class to provide new function of viewing all live objects of the selected type in the current VM
43
 * Class to provide new function of viewing all live objects of the selected type in the current VM
44
 * Feature of 1.6 VMs
44
 * Feature of 1.6 VMs.  This action is retargettable, to do so, implement <code>IAllInstancesAction</code>
45
 * and contribute the implementation as an adapter of the objects you want the custom action available
46
 * for.
45
 * 
47
 * 
46
 * @since 3.3
48
 * @since 3.3
49
 * @see IAllReferencesAction
47
 */
50
 */
48
public class AllInstancesActionDelegate extends ObjectActionDelegate implements IEditorActionDelegate {
51
public class AllInstancesActionDelegate extends ObjectActionDelegate implements IEditorActionDelegate {
49
52
Lines 55-60 Link Here
55
	public void run(IAction action) {
58
	public void run(IAction action) {
56
		IStructuredSelection currentSelection = getCurrentSelection();
59
		IStructuredSelection currentSelection = getCurrentSelection();
57
		Object object = currentSelection.getFirstElement();
60
		Object object = currentSelection.getFirstElement();
61
		
62
		// See if there is an adapter that can handle this action
63
		if (object instanceof IAdaptable){
64
			IAllInstancesAction altAction = (IAllInstancesAction)((IAdaptable)object).getAdapter(IAllInstancesAction.class);
65
			if (altAction != null){
66
				altAction.setActivePart(action, getPart());
67
				altAction.selectionChanged(action, currentSelection);
68
				altAction.run(action);
69
				return;
70
			}
71
		}
72
				
58
		IJavaType type = null;
73
		IJavaType type = null;
59
		Point anchor = null;
74
		Point anchor = null;
60
		try {
75
		try {
(-)ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllReferencesAction.java (+27 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 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
package org.eclipse.jdt.internal.debug.ui.heapwalking;
12
13
import org.eclipse.ui.IObjectActionDelegate;
14
15
/**
16
 * This interface allows the all references action to be retargettable.
17
 * 
18
 * To use, create a class that implements this interface, then register it
19
 * as an adapter for the kinds of objects this class should override the
20
 * default all references action.
21
 * 
22
 * @since 3.3
23
 * @see AllReferencesActionDelegate
24
 */
25
public interface IAllReferencesAction extends IObjectActionDelegate{
26
	
27
}
(-)ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllInstancesAction.java (+27 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 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
package org.eclipse.jdt.internal.debug.ui.heapwalking;
12
13
import org.eclipse.ui.IObjectActionDelegate;
14
15
/**
16
 * This interface allows the all instances action to be retargettable.
17
 * 
18
 * To use, create a class that implements this interface, then register it
19
 * as an adapter for the kinds of objects this class should override the
20
 * default all instances action.
21
 * 
22
 * @since 3.3
23
 * @see AllInstancesActionDelegate
24
 */
25
public interface IAllInstancesAction extends IObjectActionDelegate {
26
	
27
}

Return to bug 172573