Skip to main content



      Home
Home » Eclipse Projects » GEF » View & Toolbar
View & Toolbar [message #61338] Mon, 03 February 2003 04:55 Go to next message
Eclipse UserFriend
Originally posted by: jan.odvarko.schemantix.com

Hi All,
I have created a custom view (derived fromViewPart class),
which uses action toolbar (I am using IToolBarManager). Further
I have added some actions into to toolbar (simply by add
method) and it works well.
The question is, how can I visually check the button within
that toolbar in order to indicate, that the action is active? Just
to note that the action stands as a switch (on, off).
I have called the setChecked(true) method on the action object,
however the button is still not checked. Should I refresh or
somehow update the toolbar buttons?

thanks

cheers

Honza
Re: View & Toolbar [message #61362 is a reply to message #61338] Mon, 03 February 2003 05:16 Go to previous messageGo to next message
Eclipse UserFriend
I would just make 2 Icons (for on and off) and call setImageDescriptor() /
setHoverImageDescriptor everytime the button changes state. That is no
problem if the state change is triggered from the run-method of your action.
If not, you need some way to obtain a reference to your action to be able to
tell your button to change state.

"Jan Odv
Re: View & Toolbar [message #61410 is a reply to message #61338] Mon, 03 February 2003 08:35 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

setChecked should be sufficient. Make call this method before adding the
action to the toolbarmanager.

Notice that by setting the checked state you are changing the result of
getStyle(), which is used when creating the ToolItem.

"Jan Odv
Previous Topic:Layout in Circuit Figure
Next Topic:draw2d.text strange behaviour
Goto Forum:
  


Current Time: Wed May 07 18:03:04 EDT 2025

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

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

Back to the top