|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.skeleton.container.swing.SwingRepositoryUtil
SwingRepositoryUtil is a utility class to build repositories containing
items from the ElementPool, layout contexts or command items.
The necessary information (name, tooltip, icon, category, size,
background gradient) is loaded from an AttributeList
that is usually stored in an XML file.
The items are then added to SlidePanels and for each
nested category in the given AttributeList another
SlidePanel will be created.
| Method Summary | |
static void |
buildRepository(ApplicationFrame appFrame,
DragContext dragContext,
javax.swing.JPanel slideRepository,
AttributeList repository,
ActionRepositoryItem.ClickActionProvider clickActionProvider)
Builds a repository into a given SlidePanel. |
static void |
buildRepository(ApplicationFrame appFrame,
DragContext dragContext,
SlidePanel slideRepository,
java.io.File file,
ActionRepositoryItem.ClickActionProvider clickActionProvider)
Builds a repository into a given SlidePanel. |
static void |
buildRepository(ApplicationFrame appFrame,
DragContext dragContext,
SlidePanel slideRepository,
java.lang.String filepath,
java.lang.Class refClass,
ActionRepositoryItem.ClickActionProvider clickActionProvider)
Builds a repository into a given SlidePanel. |
static javax.swing.Action |
getCloseAction(javax.swing.JComponent slideComponent,
SlidePanel parent)
Creates the close action that removes a SlidePanel from the repository |
static AttributableOnSet |
getSlidesVisibilityAttributableOnSet(ApplicationFrame appFrame)
Returns an AttributableOnSet that contains all slidepanels
of the application in an hierarchical structure. |
static void |
restoreCollapsedContainersFromPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
Restores the state of collapsed repository slides from a string in the preferences containing their paths. |
static void |
restoreHiddenContainersFromPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
Restores the state of hidden repository slides from a string in the preferences containing their paths. |
static void |
storeCollapsedContainersToPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
Stores a string to the preferences containing the paths to all collapsed repository slides, so their state can be restored later. |
static void |
storeHiddenContainersToPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
Stores a string to the preferences containing the paths to all hidden repository slides, so their state can be restored later. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void buildRepository(ApplicationFrame appFrame,
DragContext dragContext,
SlidePanel slideRepository,
java.lang.String filepath,
java.lang.Class refClass,
ActionRepositoryItem.ClickActionProvider clickActionProvider)
throws XMLParseException,
ReadException
SlidePanel.
appFrame - The ApplicationFrame of the
application used to retrieve the
CommandRegistry and the
UIManagerdragContext - The drag context used to install drag and
drop in items representing insertable
elementsslideRepository - The root slide to build the repository intofilepath - The relative path to the file containing
the repository datarefClass - The reference class for filepathclickActionProvider - The ActionRepositoryItem.ClickActionProvider
to define the behaviour when the user clicks
on the repository items, may be null
ReadException - if reading the file failed
XMLParseException - if the file contains invalid XML data
public static void buildRepository(ApplicationFrame appFrame,
DragContext dragContext,
SlidePanel slideRepository,
java.io.File file,
ActionRepositoryItem.ClickActionProvider clickActionProvider)
throws XMLParseException,
ReadException
SlidePanel.
appFrame - The ApplicationFrame of the
application used to retrieve the
CommandRegistry and the
UIManagerdragContext - The drag context used to install drag and
drop in items representing insertable
elementsslideRepository - The root slide to build the repository intofile - The File to read the data to
build the repository fromclickActionProvider - The ActionRepositoryItem.ClickActionProvider
to define the behaviour when the user clicks
on the repository items, may be null
ReadException - if reading the file failed
XMLParseException - if the file contains invalid XML data
public static void buildRepository(ApplicationFrame appFrame,
DragContext dragContext,
javax.swing.JPanel slideRepository,
AttributeList repository,
ActionRepositoryItem.ClickActionProvider clickActionProvider)
SlidePanel.
appFrame - The ApplicationFrame of the
application used to retrieve the
CommandRegistry and the
UIManagerdragContext - The drag context used to install drag and
drop in items representing insertable
elementsslideRepository - The root slide to build the repository intorepository - The AttributeList containing
the data to build the repository fromclickActionProvider - The ActionRepositoryItem.ClickActionProvider
to define the behaviour when the user clicks
on the repository items, may be null
public static final javax.swing.Action getCloseAction(javax.swing.JComponent slideComponent,
SlidePanel parent)
slideComponent - The slide component of the slide to removeparent - The parent slide to remove the component from
public static final void storeCollapsedContainersToPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
appFrame - The application frame used to retrieve all
"containers" representing SlidePanelsprefs - The preferences to store the state inkey - The key to store the state under
public static final void restoreCollapsedContainersFromPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
appFrame - The application frame used to retrieve all
"containers" representing SlidePanelsprefs - The preferences to get the state fromkey - The key to retrieve the state
public static final void storeHiddenContainersToPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
appFrame - The application frame used to retrieve all
"containers" representing SlidePanelsprefs - The preferences to store the state inkey - The key to store the state under
public static final void restoreHiddenContainersFromPreferences(SwingApplicationFrame appFrame,
Preferences prefs,
java.lang.String key)
appFrame - The application frame used to retrieve all
"containers" representing SlidePanelsprefs - The preferences to get the state fromkey - The key to retrieve the statepublic static final AttributableOnSet getSlidesVisibilityAttributableOnSet(ApplicationFrame appFrame)
AttributableOnSet that contains all slidepanels
of the application in an hierarchical structure. On the top level all
containers (AttributeEditorContainer, NavigatorContainer, etc. and
custom containers) are listed and below there are the slides of the
containers.
Each attribute representing a slide has a Boolean as value, so the user
can use a checkbox to edit the value.
This AttributableOnSet is used to toggle the hidden or collapsed state
of slides.
appFrame - The application frame used to retrieve all
containers of the application gui
AttributableOnSet that can be used
to edit the visibility
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||