Package com.iizigo
Class WorkspaceProperties
java.lang.Object
com.iizigo.WorkspaceProperties
The workspace properties is used to save/restore states and settings for dialog boxes, etc. These settings are stored in a property container. Each class wishing to save data provides its class or class name to gain access to a property container. In this container, any data may be saved/loaded.
- Author:
- Christopher Mindus
Field Summary
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
flush()
Flushes the preferences for the workspace to disk, e.g.static WorkspaceProperties
Gets the single instance of this class.static PropCnr
getPropertyContainer
(Class<?> clazz) Gets a property container for a class or class name.static void
registerDialogBounds
(Class<?> clazz, Shell shell) Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
registerDialogBounds
(String clazz, Shell shell) Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
restoreDialogBounds
(Class<?> clazz, Shell shell) Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
restoreDialogBounds
(String clazz, Shell shell) Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
saveDialogBounds
(Class<?> clazz, Shell shell) Saves the dialog bounds, or just the position if the dialog is not resizable.static void
saveDialogBounds
(String clazz, Shell shell) Saves the dialog bounds, or just the position if the dialog is not resizable.
Field Details
FILENAME
The file name for the state location file of the workspace properties.- See Also:
Method Details
getInstance
Gets the single instance of this class.- Returns:
- The singleton of the WorkspaceProperties instance.
flush
public static boolean flush()Flushes the preferences for the workspace to disk, e.g. at plug-in exit.- Returns:
- true for success, false for failure or that iiziGo is stopped.
getPropertyContainer
Gets a property container for a class or class name. The property container is created if it doesn't exist.- Parameters:
clazz
- The class.- Returns:
- A property container.
registerDialogBounds
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds. If no saved position/bounds is present, this method will center the dialog over its owner. Only the position is used and not the bounds if the dialog box is not resizable.This function registers a listener with the shell and saves the position when dialog box is closed.
- Parameters:
clazz
- The class of the dialog box.shell
- The dialog box shell.
registerDialogBounds
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds. If no saved position/bounds is present, this method will center the dialog over its owner. Only the position is used and not the bounds if the dialog box is not resizable.This function registers a listener with the shell and saves the position when dialog box is closed.
- Parameters:
clazz
- The class name of the dialog box.shell
- The dialog box shell.
restoreDialogBounds
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds. If no saved position/bounds is present, this method will center the dialog over its owner. Only the position is used and not the bounds if the dialog box is not resizable.- Parameters:
clazz
- The class of the dialog box.shell
- The dialog box shell.
restoreDialogBounds
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds. If no saved position/bounds is present, this method will center the dialog over its owner. Only the position is used and not the bounds if the dialog box is not resizable.- Parameters:
clazz
- The class name of the dialog box.shell
- The dialog box shell.
saveDialogBounds
Saves the dialog bounds, or just the position if the dialog is not resizable.- Parameters:
clazz
- The class of the dialog box.shell
- The dialog box shell.
saveDialogBounds
Saves the dialog bounds, or just the position if the dialog is not resizable.- Parameters:
clazz
- The class name of the dialog box.shell
- The dialog box shell.