Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-ui-dev] Eclipse Commands Infrastructure

I'm hesitant to log it as a bug.  I really don't think it is per say.  They only negative effect at the moment is an error message logged stating the command has not been defined. This is due to our dynamic contribution of actions to menus instead of using plugin.xml.  Our 2.1 based code still works. Since we are going around the traditional way to add to menus I wouldn't expect 3.1 to support it 100% out of the box anyway.
 
Scott


From: platform-ui-dev-admin@xxxxxxxxxxx [mailto:platform-ui-dev-admin@xxxxxxxxxxx] On Behalf Of Michael Van Meekeren
Sent: Thursday, March 24, 2005 5:25 PM
To: platform-ui-dev@xxxxxxxxxxx
Subject: Re: [platform-ui-dev] Eclipse Commands Infrastructure


Scott,

Could you start by logging a bug against Platform UI.  Code that stopped working since 2.1 is always something we need to investigate.  

/michael


Scott Delap <SDelap@xxxxxxxxxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx

03/24/2005 04:50 PM

Please respond to
platform-ui-dev

To
platform-ui-dev@xxxxxxxxxxx
cc
Subject
[platform-ui-dev] Eclipse Commands Infrastructure





I've posted questions about commands on the org.eclipse.platform newsgroup twice with no response.  I thought I'd try this list as a result.

I'm in the middle of converting a Eclipse 2.x based application to Eclipse 3.1. We have a number of places where we are making dynamic contributions to menus programmatically instead of defining things in plugin.xml files.  I wasn't on the project when this was designed so don't ask me for the exact reasoning behind the code.  The best I've gotten when asked was that the functionality to determine contributions based on selected objects, etc was not enough in 2.1.  Anyway...It seems that the isVisible() method of ActionContributionItem has changed to:

return super.isVisible() && isCommandActive();

Our code doesn't take into account defining a Command object for each action. This causes and error to be logged the first time isVisible() is called. What is the proper way to define command for dynamically created actions? It seems when I attempt to lookup a command a CommandWrapper object is returned which does not have public access. Therefore I can't get access to the underlying Command object to define it. All other places that have such access seem to be related to creating commands based off of plugin.xml which isn't what I want.

Finally if anyone could point out any examples in other parts of Eclipse (the jdt possibly?) where actions are being dynamically created it would be appreciated.  I'd like to rewrite the mess I've inherited in a more correct manner.

Scott


Back to the top