ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simeon H.K. Fitch" <>
Subject RE: toolbar toggle actions
Date Wed, 07 Mar 2001 13:59:22 GMT
> I was hoping to make a contribution to Antidote.

My sincerest apologies for not getting back to you sooner (I marked your
email for followup but kept putting it off). Regardless, I would love to
have anything you have to offer.

> I found this item in the TODO file:
> Add support to ActionManager to handle toggle actions
> in tool bar. Also need a better way of detecting the
> selected state of the action button.

The toggle bit is already implemented (but not being used right now), at
least from the standpoint of allowing a toggle button/check box be
generated via an action specification in the properties file. However....

> The rest of this message details how I would make the
> change. If this feature is not needed, do you have a
> suggestion for an item which is needed (and please
> ignore the rest of the message).
> Here is an overview of how I would make the change:
> * Modify AntAction to recognize the following items
> from the file:
> initalToggleValue
> toggleOn
> toggleDownOn
> toggleUpOn
> And add accessor methods to AntAction which would be
> simmular to the getDisableOnEvents method.

> * Modify the EventToActionMapper so applyEvent will
> process the toggle events in a manner that is similar
> to the way it processes the enable events.
> When a toggle event occurs, a property will be set on
> the action as follows:
>   action.putValue(AccessibleState.CHECKED.toString(),
>     new Boolean(state));
> * Modify ActionManager to include a nested class which
> will implement PropertyChangeListener.  This class
> would hook the action to the buttons.  When the
> CHECKED property of the action changed, the button
> would be updated.
> * Add a button model that will allow the toolbar
> buttons to appear pressed when the action is in a
> CHECKED state.

What you have proposed here is much more sophisticated than what is there
now. I have absolutely *no* experience with the accessibility API, but I
assume what you are referring to above is just to use the property names
that have already been defined within Swing via the AccessibleState class.
This begs the question as to whether there are further opportunities in
the action handling code for better Swing conformity.

After I wrote the first Action handling code in Antidote, I ran into the
Action framework that is used in NetBeans, which is quite sophisticated
and well done. So I very much recognize room for improvements in what is
currently implemented.

So, in summary, have at it!

Again, sorry for the neglect.


Simeon H.K. Fitch
Mustard Seed Software

View raw message