The Content Manager manages the main window contents. You can add several contents to be displayed
in the main window. The user can switch between displayed contents.
To add a new content use the following:
ToolWindowManager toolWindowManager = new ...; ContentManager contentManager = toolWindowManager.getContentManager(); contentManager.addContent("Tools" // Content Key "Tools", // Content title null, // Content Item toolsContent, // Content component "ToolWindows" // Content tooltip text );
A content is a wrapper of a component decorated with some properties like a title, an icon, etc. The visualization of a content depends on specific platform implementation. A platform implementation can use a JTabbedPane or a JDesktopPane for example.
When you add a new content using the ContentManager you obtain an instance of Content interface.
This instance is used to modify content's properties.
To retrieve a content previously added use the following :
ToolWindowManager toolWindowManager = new ...; ContentManager contentManager = toolWindowManager.getContentManager(); Content content = contentManager.getContent("Tools");
A ContentManagerUI is an interface to modify the ui behaviours of a content manager. For example this is used to modify the way a content is shown.
This interface represents a ui that use a component that lets the user switch
between
a group of components by clicking on a tab with a given title and/or icon. The
position of each tab can be customized from the ui or by code.
To obtain and set a specific instance use the following (for example):
import org.noos.xing.mydoggy.plaf.ui.content; ... contentManager.setContentManagerUI(new MyDoggyMultiSplitContentManagerUI());
This interface represents a ui that use a component that lets the user switch
between
a group of components by clicking on a tab with a given title and/or icon (i.e.
JTabbedPane).
To obtain and set a specific instance use the following (for example):
import org.noos.xing.mydoggy.plaf.ui.content; ... contentManager.setContentManagerUI(new MyDoggyTabbedContentManagerUI());
This interface represents a ui that use a container to create a multiple-document
interface
or a virtual desktop.
To obtain and set a specific instance use the following (for example):
import org.noos.xing.mydoggy.plaf.ui.content; ... contentManager.setContentManagerUI(new MyDoggyDesktopContentManagerUI());
This interface is used to modify the ui behaviours of a single content. When you define a new ContentManagerUI you can also extend the ContentUI interface. In fact relative to TabbedContentManagerUI, DesktopContentManagerUI and MultiSplitContentManagerUI you can found TabbedContentUI, DesktopContentUI and MultiSplitContentUI interfaces. Using the default ContentUI interface you can manage transparent support and decide if a content is closeable and/or detachable using the ui.
If you want to implement your own
ContentManageUI,
your class must implement not only the
ContentManageUI
interface but also the
PlafContentManagerUI
interface in the
packageorg.noos.xing.mydoggy.plaf.ui.content.
This is to provide all the necessary methods to use the manager.