Hello,
I’m new to DockingFrames, so please bear with me a little -_-
I have DefaultSingleCDockables inside a StackDockStation, and I want to use Actions to obtain some sort of toolbar for every dockable.
I went through section 6 Actions in common.pdf, and was able to use CActions like CButton, CMenu, etc. by adding them to my dockables directly using:
dockable.addAction(action); //where action is an instance of CAction
First question: is it correct to add my actions one-by-one to my dockable (of type DefaultSingleCDockable)? I’m asking because after going through section 4 Actions in core.pdf, and in particular ActionsExample.java under tutorial.core.guide, it seems Actions are handled quite differently in the core library. The example says that “We cannot add actions directly to a Dockable, we add a group of actions. […]”, and introduces DefaultDockActionSource, where actions are grouped and then the whole group of actions is passed to the Dockable through:
dockable.setActionOffers(actions);
So is there the concept of “ActionSource” for CActions in the common library? Or is it ok to add actions one-by-one as I mentioned? Honestly, I was a bit confused to find two “Actions” implemntations in core and common, that’s because I’m new to the framework, as I already mentioned. So could you also briefly explain how does one decide what “Actions” implementation to choose? I mean DockActions from core, or CActions from common? Does it simply depend on the type of Dockable I’m using? I mean are DockActions compatible with Dockable types in core, and are CActions compatible with Dockable types in common (like DefaultSingleCDockable)?
You might conclude from my question that I didn’t really understand what the two libraries core and common are in the first place, or how are they divided. Well, I read in common.pdf that “Common provides advanced functionalities that are built on top of Core[…]” but now that I read a bit about Actions, I started to feel that some features like Actions have two independent implementations in the two libraries. I mean CActions are not (meaning do not extend or so) DockActions. So how should I relate the two implementations? Or maybe I shouldn’t?
Second question: Since I have a StackDockStation with possibly many DefaultSingleCDockables, some of the actions are common to all dockables in the station and hence must appear on all dockables. Again, would it be correct here to add the actions on every dockable separately, or is there a better practice to handle actions common among many dockables? Again, my question is inspired from section 4.2.2 Group actions in core.pdf; is there a similar concept in the common library?
Thanks a lot
Shant