ActionManager and Actions with state
I have a question about how to use ActionManager. I have a JXPanel with a JXEditor and a toolbar created via code like this:
<br /> ActionManager manager = ActionManager.getInstance();<br /> manager.addAction(ActionFactory.createTargetableAction("font-bold", "font-bold"));<br /> List l = Arrays.asList("font-bold");<br /> _editorToolbarPanel.add(manager.getFactory().createToolBar(l));<br />
which did result in a somewhat functional "font-bold" button on a toolbar. When I select text and click on it, the text gets the bold attribute. Great. But the button state doesn't track of the attributes of the text under my cursor.
The toolbar's bold button state is never shown depressed. I do see code in JXEditorPane.CaretHandler which looks like it should be setting it, but I don't see the results.
Obviously, I'm missing something important. Is there something else I'm supposed to do?