Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » actionSetPartAssociations wont work to hide action set
actionSetPartAssociations wont work to hide action set [message #441491] Tue, 03 January 2006 18:25 Go to next message
Eclipse UserFriend
Originally posted by: michael.lipton.gmail.com

Hello,
I have done extensive research on the use of actionSets and actionSetPartAssociations and think that I am using the extension points properly, but it doesn't seem to be working.
I would like my "print" and "send to personal window" options only to be visible when the CreateNewContactView or SearchContactViews are active.
Does anyone see anything wrong with this?
is there anything i'm missing?
anything else that could be wrong???

thanks in advance for your help.
mike

---------------------------------

Here is a clip from my plugin.xml
<extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            description="actions associated with contact entries"
            id="contactEntryActionSet"
            label="contact entry action set"
            visible="true">
         <action
               class="PrintAction"
               id="contactEntry.print"
               label="Print"
               menubarPath="file/additions"
               style="push"
               />
         <action
               class="AddToPersonalWindowAction"
               id="contactEntry.sendToPW"
               label="Send to Personal Window"
               menubarPath="file/additions"
               style="push"/>
      </actionSet>
</extension>
   <extension
         point="org.eclipse.ui.actionSetPartAssociations">
      <actionSetPartAssociation targetID="contactEntryActionSet">
         <part id="CreateNewContactView"/>
         <part id="SearchView"/>
      </actionSetPartAssociation>
   </extension>



--
View in EZ forum: http://www.eclipsezone.com/eclipse/forums/m91978790.html
Re: actionSetPartAssociations wont work to hide action set [message #441499 is a reply to message #441491] Tue, 03 January 2006 19:21 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Michael Lipton wrote:
> Hello,
> I have done extensive research on the use of actionSets and actionSetPartAssociations and think that I am using the extension points properly, but it doesn't seem to be working.
> I would like my "print" and "send to personal window" options only to be visible when the CreateNewContactView or SearchContactViews are active.
> Does anyone see anything wrong with this?

In your <actionSet/> you set visible="true" ... that means always
visible. Other than that it seems OK.

Later,
PW


Re: actionSetPartAssociations wont work to hide action set [message #441500 is a reply to message #441499] Tue, 03 January 2006 19:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.lipton.gmail.com

> In your <actionSet/> you set visible="true" ... that
> means always
> visible. Other than that it seems OK.
>
> Later,
> PW

thanks for the response.
When I set visible=true, both menu options are always there.
When I omit a value for visible, both options are still always there.
When I set visible=false, neither menu option is ever there.

Which is ideal? omitting it altogether?
why are they still always visible?

thanks


--
View in EZ forum: http://www.eclipsezone.com/eclipse/forums/m91978796.html
Re: actionSetPartAssociations wont work to hide action set [message #441501 is a reply to message #441500] Tue, 03 January 2006 20:23 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Michael Lipton wrote:
> thanks for the response.
> When I set visible=true, both menu options are always there.
> When I omit a value for visible, both options are still always there.
> When I set visible=false, neither menu option is ever there.
>
> Which is ideal? omitting it altogether?
> why are they still always visible?
>

There's an example close to the end of the plugin.xml in
org.eclipse.ui.tests, at least that's where the actionSetPartAssociation
is defined.

It looked just like yours. An extension with an id, a targetID in the
sub element, and a part with an id.

The only difference I could see was the action set in the targetID had
visible="false".

Maybe the missing id for your extension matters. Check out the
definitions in org.eclipse.ui.tests/plugin.xml

Later,
PW


Re: actionSetPartAssociations wont work to hide action set [message #441504 is a reply to message #441501] Tue, 03 January 2006 21:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.lipton.gmail.com

> There's an example close to the end of the plugin.xml
> in
> org.eclipse.ui.tests, at least that's where the
> actionSetPartAssociation
> is defined.
>
> It looked just like yours. An extension with an id,
> a targetID in the
> sub element, and a part with an id.
>
> The only difference I could see was the action set in
> the targetID had
> visible="false".
>
> Maybe the missing id for your extension matters.
> Check out the
> efinitions in org.eclipse.ui.tests/plugin.xml
>
> Later,
> PW


well, this is strange... setting visible false does the trick now... not sure why it didnt work before, i must have messed something up
thanks a lot for your help.


--
View in EZ forum: http://www.eclipsezone.com/eclipse/forums/m91978800.html
Re: actionSetPartAssociations wont work to hide action set [message #461998 is a reply to message #441499] Sat, 20 January 2007 22:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: akbdas.gmail.com

hi,

I have a problem with actionSets in RCP for enabling/disabling menu items and toolbars items.
In my current application, after a user login bases some parameters i need to disable/enable menu & toolbar items.
Menu & toolbar items created using action sets.

I hope u will in a position solve me problem


Thanks in advance
Das
Re: actionSetPartAssociations wont work to hide action set [message #462022 is a reply to message #461998] Sun, 21 January 2007 16:05 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

for flat out enabling/disabling of actionSets programmatically, you can
use IWorkbenchPage#showActionSet(*) and IWorkbenchPage#hideActionSet(*).

Make your action sets visible=false by default ... then they will only
show up if you enable them specifically.

Later,
PW


Re: actionSetPartAssociations wont work to hide action set [message #462116 is a reply to message #461998] Tue, 23 January 2007 10:05 Go to previous messageGo to next message
Ali Alauoubiy is currently offline Ali AlauoubiyFriend
Messages: 20
Registered: July 2009
Junior Member
In Your action class there is method called SelectionChanged (IAction action, ISelection incoming) which you need to override..

example:
public void selectionChanged(IAction action, ISelection incoming) {

action. setId(ID);

if (incoming instanceof IStructuredSelection) {
action.setEnabled(false);


selection = (IStructuredSelection) incoming;

action.setEnabled(selection.size() == 1
&& selection.getFirstElement() instanceof Book);
} else {
// Other selections, for example containing text or of other kinds.
action.setEnabled(false);
}
}

hope that helps...
Re: actionSetPartAssociations wont work to hide action set [message #462117 is a reply to message #462116] Tue, 23 January 2007 10:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: akbdas.gmail.com

Hi,
I have small query, is selectionChanged will be call be called when action is selected.
but i want to disable at the time of initialization / any other time. but on its action.

more specfically, when successful login i need to disable few items based on who (userid) logs-in.

Thanks in advance.
Re: actionSetPartAssociations wont work to hide action set [message #462119 is a reply to message #462022] Tue, 23 January 2007 10:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: akbdas.gmail.com

Hi,
I have tried but its not working....
But when i tried for to hide entire action set its working but not for indiviual menu items.

If its possible to hide indivuals menu items, will pls. send a the sample / portion of code and plugin.xml

thanks
Re: actionSetPartAssociations wont work to hide action set [message #462212 is a reply to message #462119] Wed, 24 January 2007 19:19 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

No, it's per action set in 3.2

PW


Previous Topic:Eclipse Skin
Next Topic:PATH Environment Variable Needed
Goto Forum:
  


Current Time: Wed Jan 15 12:03:08 GMT 2025

Powered by FUDForum. Page generated in 0.03690 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top