Package com.iizigo
Class WorkspaceProperties
- java.lang.Object
- com.iizigo.WorkspaceProperties
public class WorkspaceProperties extends java.lang.Object
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
Fields Modifier and Type Field Description static java.lang.String
FILENAME
The file name for the state location file of the workspace properties.
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
flush()
Flushes the preferences for the workspace to disk, e.g.static WorkspaceProperties
getInstance()
Gets the single instance of this class.static PropCnr
getPropertyContainer(java.lang.Class<?> clazz)
Gets a property container for a class or class name.static void
registerDialogBounds(java.lang.Class<?> clazz, org.eclipse.swt.widgets.Shell shell)
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
registerDialogBounds(java.lang.String clazz, org.eclipse.swt.widgets.Shell shell)
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
restoreDialogBounds(java.lang.Class<?> clazz, org.eclipse.swt.widgets.Shell shell)
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
restoreDialogBounds(java.lang.String clazz, org.eclipse.swt.widgets.Shell shell)
Places the not yet visible dialog box according to a previous position saved using saveDialogBounds.static void
saveDialogBounds(java.lang.Class<?> clazz, org.eclipse.swt.widgets.Shell shell)
Saves the dialog bounds, or just the position if the dialog is not resizable.static void
saveDialogBounds(java.lang.String clazz, org.eclipse.swt.widgets.Shell shell)
Saves the dialog bounds, or just the position if the dialog is not resizable.
Field Detail
FILENAME
public static final java.lang.String FILENAME
The file name for the state location file of the workspace properties.- See Also:
- Constant Field Values
Method Detail
getInstance
public static WorkspaceProperties 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
public static PropCnr getPropertyContainer(java.lang.Class<?> clazz)
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
public static void registerDialogBounds(java.lang.Class<?> clazz, org.eclipse.swt.widgets.Shell shell)
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
public static void registerDialogBounds(java.lang.String clazz, org.eclipse.swt.widgets.Shell shell)
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
public static void restoreDialogBounds(java.lang.Class<?> clazz, org.eclipse.swt.widgets.Shell shell)
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
public static void restoreDialogBounds(java.lang.String clazz, org.eclipse.swt.widgets.Shell shell)
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
public static void saveDialogBounds(java.lang.Class<?> clazz, org.eclipse.swt.widgets.Shell shell)
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
public static void saveDialogBounds(java.lang.String clazz, org.eclipse.swt.widgets.Shell shell)
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.