Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to access toolbar button
How to access toolbar button [message #331803] Tue, 23 September 2008 08:31 Go to next message
sana is currently offline sanaFriend
Messages: 17
Registered: July 2009
Junior Member
Hi,

How can i change the state of the button (in toolbar and menubar
respectively) using selectionChanged(IAction..,ISelection) Method..or any
other way?All buttons should be enabled in the start. The "save" button
should get disabled on clicking "perform" and should be enabled again on
clicking "reset" button.
The plugin.xml looks like follows:

<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="JSDiag Action Set"
visible="true"
id="JSDiagnosis.actionSet">
<menu
label="JSDiagnosis"
id="jsdiagMenu">
<separator
name="jsdiagGroup">
</separator>
</menu>
<action
tooltip="Save task"
label="Save"
icon="icons/save.gif"
class="jsdiagnosis.actions.SaveAction"
toolbarPath="ToolGroup"
menubarPath="jsdiagMenu/MenuGroup"
id="jsdiagnosis.actions.SaveAction">
</action>
<action
tooltip="Perform task"
label="Perform"
icon="icons/perform.gif"
class="jsdiagnosis.actions.PerformAction"
toolbarPath="ToolGroup"
menubarPath="jsdiagMenu/MenuGroup"
id="jsdiagnosis.actions.PerformAction">
</action>
<action
tooltip="Reset"
label="Reset"
icon="icons/reset.gif"
class="jsdiagnosis.actions.ResetAction"
toolbarPath="ToolGroup"
menubarPath="jsdiagMenu/MenuGroup"
id="jsdiagnosis.actions.ResetAction">
</action>

</actionSet>
</extension>



thanks,
sana.
Re: How to access toolbar button [message #331812 is a reply to message #331803] Tue, 23 September 2008 12:45 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

When your selectionChanged(*) method is called, you can call
action.setEnabled(true/false)

If you have 3 buttons that are supposed to work together, you'll need to
have them communicate through your application/plugin model somewhere.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Custom plugin will not install
Next Topic:File hiding in perspectives
Goto Forum:
  


Current Time: Thu Jul 18 03:19:47 GMT 2024

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

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

Back to the top