Package com.iizigo

Class 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 TypeFieldDescription
      static java.lang.StringFILENAME
      The file name for the state location file of the workspace properties.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static booleanflush()
      Flushes the preferences for the workspace to disk, e.g.
      static WorkspacePropertiesgetInstance()
      Gets the single instance of this class.
      static PropCnrgetPropertyContainer​(java.lang.Class<?> clazz)
      Gets a property container for a class or class name.
      static voidregisterDialogBounds​(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 voidregisterDialogBounds​(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 voidrestoreDialogBounds​(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 voidrestoreDialogBounds​(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 voidsaveDialogBounds​(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 voidsaveDialogBounds​(java.lang.String clazz, org.eclipse.swt.widgets.Shell shell)
      Saves the dialog bounds, or just the position if the dialog is not resizable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.