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 59171 Details for
Bug 172573
Retargettable all references and all instances action
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]
Proposed Fix
172573RetargettableHeapWalking (text/plain), 6.74 KB, created by
Curtis Windatt
on 2007-02-16 12:33:20 EST
(
hide
)
Description:
Proposed Fix
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2007-02-16 12:33:20 EST
Size:
6.74 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.debug.ui >Index: ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java,v >retrieving revision 1.4 >diff -u -r1.4 AllReferencesActionDelegate.java >--- ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java 14 Aug 2006 20:35:15 -0000 1.4 >+++ ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllReferencesActionDelegate.java 16 Feb 2007 17:24:17 -0000 >@@ -21,9 +21,12 @@ > import org.eclipse.jface.viewers.IStructuredSelection; > > /** >- * Action to browse all references to selected object. >+ * Action to browse all references to selected object. This action is retargettable, to do so, >+ * implement <code>IAllReferencesAction</code> and contribute the implementation as an adapter >+ * of the objects you want the custom action available for. > * > * @since 3.3 >+ * @see IAllReferencesAction > */ > public class AllReferencesActionDelegate extends ObjectActionDelegate { > >@@ -33,6 +36,16 @@ > public void run(IAction action) { > IStructuredSelection currentSelection = getCurrentSelection(); > IJavaVariable var = (IJavaVariable) currentSelection.getFirstElement(); >+ >+ // See if there is adapter that can handle this action >+ IAllReferencesAction altAction = (IAllReferencesAction)var.getAdapter(IAllReferencesAction.class); >+ if (altAction != null){ >+ altAction.setActivePart(action, getPart()); >+ altAction.selectionChanged(action, currentSelection); >+ altAction.run(action); >+ return; >+ } >+ > ReferencesPopupDialog popup; > try { > popup = new ReferencesPopupDialog(getWorkbenchWindow().getShell(), (IDebugView) getPart().getAdapter(IDebugView.class), (IJavaObject) var.getValue()); >Index: ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java,v >retrieving revision 1.6 >diff -u -r1.6 AllInstancesActionDelegate.java >--- ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java 15 Feb 2007 13:53:38 -0000 1.6 >+++ ui/org/eclipse/jdt/internal/debug/ui/heapwalking/AllInstancesActionDelegate.java 16 Feb 2007 17:24:17 -0000 >@@ -41,9 +41,12 @@ > > /** > * Class to provide new function of viewing all live objects of the selected type in the current VM >- * Feature of 1.6 VMs >+ * Feature of 1.6 VMs. This action is retargettable, to do so, implement <code>IAllInstancesAction</code> >+ * and contribute the implementation as an adapter of the objects you want the custom action available >+ * for. > * > * @since 3.3 >+ * @see IAllReferencesAction > */ > public class AllInstancesActionDelegate extends ObjectActionDelegate implements IEditorActionDelegate { > >@@ -55,6 +58,18 @@ > public void run(IAction action) { > IStructuredSelection currentSelection = getCurrentSelection(); > Object object = currentSelection.getFirstElement(); >+ >+ // See if there is an adapter that can handle this action >+ if (object instanceof IAdaptable){ >+ IAllInstancesAction altAction = (IAllInstancesAction)((IAdaptable)object).getAdapter(IAllInstancesAction.class); >+ if (altAction != null){ >+ altAction.setActivePart(action, getPart()); >+ altAction.selectionChanged(action, currentSelection); >+ altAction.run(action); >+ return; >+ } >+ } >+ > IJavaType type = null; > Point anchor = null; > try { >Index: ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllReferencesAction.java >=================================================================== >RCS file: ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllReferencesAction.java >diff -N ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllReferencesAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllReferencesAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,27 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.internal.debug.ui.heapwalking; >+ >+import org.eclipse.ui.IObjectActionDelegate; >+ >+/** >+ * This interface allows the all references action to be retargettable. >+ * >+ * To use, create a class that implements this interface, then register it >+ * as an adapter for the kinds of objects this class should override the >+ * default all references action. >+ * >+ * @since 3.3 >+ * @see AllReferencesActionDelegate >+ */ >+public interface IAllReferencesAction extends IObjectActionDelegate{ >+ >+} >Index: ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllInstancesAction.java >=================================================================== >RCS file: ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllInstancesAction.java >diff -N ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllInstancesAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/internal/debug/ui/heapwalking/IAllInstancesAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,27 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.internal.debug.ui.heapwalking; >+ >+import org.eclipse.ui.IObjectActionDelegate; >+ >+/** >+ * This interface allows the all instances action to be retargettable. >+ * >+ * To use, create a class that implements this interface, then register it >+ * as an adapter for the kinds of objects this class should override the >+ * default all instances action. >+ * >+ * @since 3.3 >+ * @see AllInstancesActionDelegate >+ */ >+public interface IAllInstancesAction extends IObjectActionDelegate { >+ >+}
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 172573
: 59171