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 16520 Details for
Bug 80702
[Contributions] Support notion of default handler on RetargetAction
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]
Patch to RetargetAction.java
retarget.txt (text/plain), 1.93 KB, created by
John Arthorne
on 2004-12-10 12:16:21 EST
(
hide
)
Description:
Patch to RetargetAction.java
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2004-12-10 12:16:21 EST
Size:
1.93 KB
patch
obsolete
>Index: RetargetAction.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/RetargetAction.java,v >retrieving revision 1.14 >diff -u -r1.14 RetargetAction.java >--- RetargetAction.java 20 Aug 2004 16:02:35 -0000 1.14 >+++ RetargetAction.java 10 Dec 2004 17:12:59 -0000 >@@ -54,6 +54,8 @@ > private boolean enableAccelerator = true; > > private IAction handler; >+ >+ private IAction defaultHandler; > > private IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() { > public void propertyChange(PropertyChangeEvent event) { >@@ -230,8 +232,11 @@ > * Sets the action handler. > */ > protected void setActionHandler(IAction newHandler) { >- // Optimize. >- if (newHandler == handler) >+ if (newHandler == null) >+ newHandler = defaultHandler; >+ // Optimize for the same handler >+ // Don't optimize for default handler because it may need enablement update >+ if (newHandler == handler && newHandler != defaultHandler) > return; > > // Clear old action. >@@ -273,6 +278,20 @@ > handler.setChecked(checked); > } > >+ /** >+ * Sets the default handler for this retarget action. If a default >+ * handler is supplied, it will be used whenever the part-specified >+ * handler is <code>null</code> >+ * @param action The default handler, or <code>null</code> to remove >+ * the default handler >+ * @since 3.1 >+ */ >+ public void setDefaultHandler(IAction action) { >+ this.defaultHandler = action; >+ //update the handler if we don't have one >+ if (handler == null) >+ setActionHandler(action); >+ } > /** > * The <code>RetargetAction</code> implementation of this method declared on > * <code>IAction</code> stores the help listener in a local field. The
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 80702
: 16520