Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » How to enable/disable Action Button
How to enable/disable Action Button [message #1021483] Wed, 20 March 2013 07:43 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
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 18:21 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
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 11:00 Go to previous message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
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: Tue Mar 19 08:57:16 GMT 2024

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

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

Back to the top