org.noos.xing.mydoggy
Interface ContentManager

All Superinterfaces:
DockableManager<Content>, Observable

public interface ContentManager
extends DockableManager<Content>, Observable

This manager manages the main window. You can add several contents to be displayed in the main window. The user can switch between displayed contents. Contents are added to the ContentManager by using the addContent method.

Since:
1.0.0
Author:
Angelo De Caro (angelo.decaro@gmail.com)
See Also:
Content

Method Summary
 Content addContent(Dockable dockable)
          Adds a dockable.
 Content addContent(String id, String title, Icon icon, Component component)
          Adds a component represented by a unique identifier id with a title and/or icon, either of which can be null.
 Content addContent(String id, String title, Icon icon, Component component, String tip)
          Adds a component represented by a unique identifier id with a title and/or icon, either of which can be null.
 Content addContent(String id, String title, Icon icon, Component component, String tip, Object... constraints)
          Adds a component represented by a unique identifier id with a title and/or icon, either of which can be null.
 void addContentManagerListener(ContentManagerListener listener)
          Registers listener so that it will receive events when contents are registered or removed..
 Content getContent(int index)
          Returns the content at the specified position in this manager.
 Content getContent(Object key)
          Returns the content to which this manager maps the specified key (the key could be the id or an alias).
 Content getContentByComponent(Component component)
          Returns the content that wraps the passed component
 int getContentCount()
          Returns the number of contents in this manager.
 ContentManagerListener[] getContentManagerListeners()
          Returns an array of all the content manager listeners registered on this manager.
 ContentManagerUI getContentManagerUI()
          Returns the content manager ui.
 Content[] getContents()
          Returns an array containing all of the contents in this manager in proper sequence.
 Content getNextContent()
          Returns in order the next enabled content related to the selected content, or null if no contents are registered or no content is enabled.
 JPopupMenu getPopupMenu()
          Returns the default popup menu for the contents.
 Content getPreviousContent()
          Returns in order the previous enabled content related to the selected content, or null if no contents are registered or no content is enabled.
 Content getSelectedContent()
          Returns the selected content, or null if the selection is empty.
 ToolWindowManager getToolWindowManager()
          Returns the related tool window manager.
 boolean isEnabled()
          Returns if the content manager is enabled.
 void removeAllContents()
          Removes all of the contents from this manager.
 boolean removeContent(Content content)
          Removes the content content.
 boolean removeContent(int index)
          Removes the content at the specified position in this manager
 void removeContentManagerListener(ContentManagerListener listener)
          Unregisters listener so that it will no longer receive events.
 void setContentManagerUI(ContentManagerUI contentManagerUI)
          Sets the content manager ui to contentManagerUI.
 void setEnabled(boolean enabled)
          Enables or disables the content manager.
 void setPopupMenu(JPopupMenu popupMenu)
          Sets the default popup menu for the contents.
 
Methods inherited from interface org.noos.xing.mydoggy.DockableManager
addAlias, addDockableManagerListener, getAliases, getDockableById, getDockableManagerListeners, getDockables, removeAlias, removeDockableManagerListener
 
Methods inherited from interface org.noos.xing.mydoggy.Observable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 

Method Detail

getToolWindowManager

ToolWindowManager getToolWindowManager()
Returns the related tool window manager.

Returns:
the related tool window manager.
Since:
1.5.0

setContentManagerUI

void setContentManagerUI(ContentManagerUI contentManagerUI)
Sets the content manager ui to contentManagerUI.

Parameters:
contentManagerUI - the content manager ui.
Since:
1.1.0
See Also:
getContentManagerUI(), ContentManagerUI

getContentManagerUI

ContentManagerUI getContentManagerUI()
Returns the content manager ui.

Returns:
the content manager ui.
Since:
1.1.0
See Also:
ContentManagerUI

getContentCount

int getContentCount()
Returns the number of contents in this manager.

Returns:
the number of contents.
Since:
1.0.0

addContent

Content addContent(String id,
                   String title,
                   Icon icon,
                   Component component)
Adds a component represented by a unique identifier id with a title and/or icon, either of which can be null.

Parameters:
id - the content id. It must be unique.
title - the title to be displayed in this content
icon - the icon to be displayed in this content
component - the component to be displayed when this content is selected. @return the a Content object rapresents the content added. @see #removeContent(Content)
Returns:
a Content instance that rapresents the component
Since:
1.0.0
See Also:
Content

addContent

Content addContent(String id,
                   String title,
                   Icon icon,
                   Component component,
                   String tip)
Adds a component represented by a unique identifier id with a title and/or icon, either of which can be null.

Parameters:
id - the content id. It must be unique.
title - the title to be displayed in this content
icon - the icon to be displayed in this content
component - the component to be displayed when this content is selected.
tip - the tool tip text @return the a Content object rapresents the content added. @see #removeContent(Content)
Returns:
a Content instance that rapresents the component
Since:
1.0.0

addContent

Content addContent(String id,
                   String title,
                   Icon icon,
                   Component component,
                   String tip,
                   Object... constraints)
Adds a component represented by a unique identifier id with a title and/or icon, either of which can be null.

Parameters:
id - the content id. It must be unique.
title - the title to be displayed in this content
icon - the icon to be displayed in this content
component - the component to be displayed when this content is selected.
tip - the tool tip text @return the a Content object rapresents the content added. @see #removeContent(Content)
constraints - a constraints used by the underlining ContentManagerUI. For example a location for the DesktopContentManagerUI.
Returns:
a Content instance that rapresents the component
Since:
1.4.0

addContent

Content addContent(Dockable dockable)
Adds a dockable. A content is created to accommodate the dockable.

Parameters:
dockable - the dockable to be accommodated.
Returns:
a Content instance that represents the accommodated dockable.
Since:
1.4.0

removeContent

boolean removeContent(Content content)
Removes the content content.

Parameters:
content - content to be removed from this manager, if present.
Returns:
true if this manager contained the specified element.
Since:
1.0.0
See Also:
addContent(String, String,javax.swing.Icon,java.awt.Component), addContent(String, String,javax.swing.Icon,java.awt.Component, String)

removeContent

boolean removeContent(int index)
Removes the content at the specified position in this manager

Parameters:
index - the index of the element to removed.
Returns:
true if this manager contained the specified element.
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getContentCount()).
Since:
1.0.0

removeAllContents

void removeAllContents()
Removes all of the contents from this manager.

Since:
1.1.0

getContent

Content getContent(int index)
Returns the content at the specified position in this manager.

Parameters:
index - index of content to return.
Returns:
the content at the specified position in this manager.
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getContentCount()).
Since:
1.0.0

getContents

Content[] getContents()
Returns an array containing all of the contents in this manager in proper sequence.

Returns:
an array containing all of the contents in this list in proper sequence.
Since:
1.0.0
See Also:
getContent(int)

getContent

Content getContent(Object key)
Returns the content to which this manager maps the specified key (the key could be the id or an alias). Returns null if the manager contains no mapping for this key.

Parameters:
key - key whose associated content is to be returned.
Returns:
the content to which this manager maps the specified key
Throws:
NullPointerException - if the key is null.
Since:
1.0.0

getContentByComponent

Content getContentByComponent(Component component)
Returns the content that wraps the passed component

Parameters:
component - the component wrapped by a content.
Returns:
the content that wraps the passed component
Since:
1.2.0

getSelectedContent

Content getSelectedContent()
Returns the selected content, or null if the selection is empty.

Returns:
the selected content.
Since:
1.2.0

getNextContent

Content getNextContent()
Returns in order the next enabled content related to the selected content, or null if no contents are registered or no content is enabled.

Returns:
the next enabled content related to the selected content.
Since:
1.3.1

getPreviousContent

Content getPreviousContent()
Returns in order the previous enabled content related to the selected content, or null if no contents are registered or no content is enabled.

Returns:
the previous enabled content related to the selected content.
Since:
1.3.1

setPopupMenu

void setPopupMenu(JPopupMenu popupMenu)
Sets the default popup menu for the contents. If a content has no specific popup menu then the content manager will show popupMenu.

Parameters:
popupMenu - the default popup menu for the contents.
Since:
1.0.0

getPopupMenu

JPopupMenu getPopupMenu()
Returns the default popup menu for the contents.

Returns:
the default PopupMenu for the contents.
Since:
1.0.0
See Also:
setPopupMenu(javax.swing.JPopupMenu)

setEnabled

void setEnabled(boolean enabled)
Enables or disables the content manager. If the content manager is disable the whole space will be available for toolwindows.

Parameters:
enabled - true to enable the content manager, false otherwise.
Since:
1.4.2

isEnabled

boolean isEnabled()
Returns if the content manager is enabled.

Returns:
true if the content manager is enabled, false otherwise.

addContentManagerListener

void addContentManagerListener(ContentManagerListener listener)
Registers listener so that it will receive events when contents are registered or removed.. If listener listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the ContentManagerListener to register.
Since:
1.0.0
See Also:
ContentManagerListener

removeContentManagerListener

void removeContentManagerListener(ContentManagerListener listener)
Unregisters listener so that it will no longer receive events. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this group. If listener listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the ContentManagerListener to be removed
Since:
1.0.0
See Also:
addContentManagerListener(ContentManagerListener)

getContentManagerListeners

ContentManagerListener[] getContentManagerListeners()
Returns an array of all the content manager listeners registered on this manager.

Returns:
all of the group's ContentManagerListeners or an empty array if no tool window manager listeners are currently registered.
Since:
1.0.0
See Also:
addContentManagerListener(ContentManagerListener), removeContentManagerListener(ContentManagerListener)


Copyright © 2012. All Rights Reserved.