Any reason that the classes CAction and CDecorateableAction are abstract? I created a SimpleButtonAction and I want to add it to a DefaultCDockable. So I need to create an anonymous CAction to add it?
Also how can I use RenameAction from CControl . I’m not sure how to get a handle to the DockController.
There is a class CButton (extends CAction) which makes the same job that “SimpleButtonAction” does. You’ll have to subclass CButton and override its method “action” to use it.
To use the RenameAction create a new CAction like this one:
public CRenameAction(){
super( new RenameAction.RenameDefaultDockable() );
}
}```
If you really need access to the DockControl: call "ccontrol.intern().getController()"
The nice thing about SimpleButtonAction is that I can get a handle to the Dockable when the action is triggered. I was just curious about why CAction was abstract because once it has a DockAction it is ‘complete’ (nothing to add in the subclass). But maybe you wanted to encourage the use of CButton.
For future reference here is my rename action. I had to pass the controller into the constructor.
private static class CRenameAction extends CAction {
public CRenameAction(CControl control) {
super(new RenameAction.RenameDefaultDockable(control.intern().getController()));
}
}