Package com.iizigo

Class WorkspaceProperties

java.lang.Object
com.iizigo.WorkspaceProperties

public class WorkspaceProperties extends 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 final String
    The file name for the state location file of the workspace properties.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Flushes the preferences for the workspace to disk, e.g.
    Gets the single instance of this class.
    static PropCnr
    Gets a property container for a class or class name.
    static void
    registerDialogBounds(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(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(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(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(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(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 Details

    • FILENAME

      public static final String FILENAME
      The file name for the state location file of the workspace properties.
      See Also:
  • Method Details

    • 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(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(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(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(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(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(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(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.