Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » How to enable/disable Action Button
How to enable/disable Action Button [message #1021483] Wed, 20 March 2013 03:43 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEE
Messages: 56
Registered: September 2012
Member
Hello Again Smile

I have the following property:

<property-editor>
	<label>Default value</label>
	<property>DefaultValue</property>
	<related-content>
		<actuator>
			<action-id>org.trial.mxmleditor.FixDefaultValue</action-id>
			<show-image>true</show-image>
			<action>
				<id>org.trial.mxmleditor.FixDefaultValue</id>
				<label>Fix Default Value</label>
			</action>
			<action-handler>
				<action>org.trial.mxmleditor.FixDefaultValue</action>
				<impl>FixDefaultValueActionHandler</impl>
			</action-handler>
			<style>Sapphire.Actuator.Button</style>
			<span>false</span>
			<show-label>true</show-label>
		</actuator>
	</related-content>
	<related-content-width>20</related-content-width>
</property-editor>


As you can see, I put a button next to the property, for the user to run an action that tries to fix the value entered.

Anyway, I don't want the Button to be always active, yet I want it to be active ONLY when the value entered is incorrect.

Is that possible?
Re: How to enable/disable Action Button [message #1021817 is a reply to message #1021483] Wed, 20 March 2013 14:21 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 923
Registered: July 2009
Senior Member
To control action enablement, you need to call setEnabled( ? ) in your action handler implementation. Typically, you call this from a listener that you attach in action handler's init. Don't forget to detach the listener in action handler's dispose.

- Konstantin
Re: How to enable/disable Action Button [message #1023486 is a reply to message #1021817] Sun, 24 March 2013 07:00 Go to previous message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEE
Messages: 56
Registered: September 2012
Member
Yes, exactly like: "samples\calendar\ui\ShowContactDetailsActionHandler.java"

Thank you very much Smile
Previous Topic:Working with Java Types
Next Topic:Recursive Node Factory
Goto Forum:
  


Current Time: Sun Apr 20 12:30:52 EDT 2014

Powered by FUDForum. Page generated in 0.01703 seconds