I have a toolbar that I use to switch over perspectives. Each button in my toolbar opens a different perspective. I want to emphasize the user feeling what is opened at the time and I want to work my buttons as toggles with states "DOWN" and "UP". The code I use to add new BaseActions to the toolbar:
ToolBarManager toolBarManager = new ToolBarManager();
coolBar.add(toolBarManager);
toolBarManager.add(ordersDownload);
and part of the code of my BaseAction which changes button behaviour to toggle:
public class BaseAction implements IAction {
@Override
public int getStyle() {
return SWT.TOGGLE;
}
Inside IAction there is a method boolean isChecked
but it doesnt work at all as always when I click on the toolbar button its state is inverted (DOWN -> UP, UP -> DOWN). I dont want to have more than one Button (Toggle) at the same time with state DOWN so I want to somehow call state UP for all buttons and leave only one with state DOWN.