Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Checked tool bar item appearance
Checked tool bar item appearance [message #327645] Mon, 28 April 2008 07:23 Go to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
I have an IAction added in a tool bar. It has an icon and its text isn't
shown.
Programmatically I call the setChecked(), but its visual appearance
doesn't change. I expect to appear sunken or something similar.

I'll try to change the icon when checked.

Is this normal?
Any workaround?

Thanks for any help.
David
Re: Checked tool bar item appearance [message #327651 is a reply to message #327645] Mon, 28 April 2008 08:01 Go to previous messageGo to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
I've studied a little the scroll lock action on the Console view as an
example.
I've observed this:

public class ScrollLockAction extends Action {
public ScrollLockAction(IConsoleView consoleView) {
super(ConsoleMessages.ScrollLockAction_0);
setToolTipText(ConsoleMessages.ScrollLockAction_1);
setHoverImageDescriptor(...);
setDisabledImageDescriptor(...);
setImageDescriptor(...);
boolean checked = fConsoleView.getScrollLock();
setChecked(checked);
}


It uses 3 different icons.
I've tried to set a different hover image, but it is used always instead
of the normal one.

David Perez wrote:

> I have an IAction added in a tool bar. It has an icon and its text isn't
> shown.
> Programmatically I call the setChecked(), but its visual appearance
> doesn't change. I expect to appear sunken or something similar.

> I'll try to change the icon when checked.

> Is this normal?
> Any workaround?
Re: Checked tool bar item appearance [message #327698 is a reply to message #327645] Tue, 29 April 2008 09:34 Go to previous message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Solved!

1) Use style IAction.AS_CHECK_BOX

2) In my code I did

void run() {
setChecked(!isChecked());
}

With the AS_CHECK_BOX style, I don't need to set the new check state.

David Perez wrote:

> I have an IAction added in a tool bar. It has an icon and its text isn't
> shown.
> Programmatically I call the setChecked(), but its visual appearance
> doesn't change. I expect to appear sunken or something similar.

> I'll try to change the icon when checked.

> Is this normal?
> Any workaround?

> Thanks for any help.
> David
Previous Topic:Eclipse 3.4 strange project naming upon import
Next Topic:Newbie help topic plugin question
Goto Forum:
  


Current Time: Wed Jul 17 17:48:20 GMT 2024

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

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

Back to the top