I am trying to do the following:
- Create a button in the toolbar (Already done as a 'handled tool item')
- Click on the button and have the button look like it's pressed in (I read something about using IAction.AS_CHECK_BOX, but I can't find any clear RCP 4 examples on how to do this). When the button is pressed in a certain action can be performed (For the sake of this example let's call it "Action A")
- Click on the button again and have the button look like it's no longer pressed in. When the button is no longer pressed in a different action can be performed ("For the sake of this example let's call it "Action B")
A more concrete example would be a text editor program. Let's say the toolbar has a 'Bold' button. The user presses the 'Bold' button and the button icon now looks like it has been pressed in. At this point, everything the user types into the text area will be in bold. The user then presses the 'Bold' button again and the button no longer looks like it is pressed in. At this point, everything the user types into the text area is in regular font.
I have tried searching around but cannot find any examples that clearly show how to do it. Any help would be appreciated!