Class SnapUtils

    • Constructor Summary

      Constructors 
      Constructor Description
      SnapUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.openide.filesystems.FileObject addAction​(Action action)
      Adds an action into the folder Menu/Tools of the SNAP Desktop / NetBeans file system.
      static org.openide.filesystems.FileObject addAction​(Action action, String path)
      Adds an action into the folder given by path of the SNAP Desktop / NetBeans file system.
      static org.openide.filesystems.FileObject addAction​(Action action, String path, Integer position)
      Adds an action into the folder given by path of the SNAP Desktop / NetBeans file system at the given position.
      static org.openide.filesystems.FileObject addActionReference​(org.openide.filesystems.FileObject instanceFile, String path, Integer position)
      Adds an action references into the folder given by path of the SNAP Desktop / NetBeans file system at the given position.
      static void openWindow​(org.openide.windows.TopComponent window)
      Opens a new window in SNAP Desktop in the "explorer" location.
      static void openWindow​(org.openide.windows.TopComponent window, boolean requestActive)
      Opens a new window in SNAP Desktop in the "explorer" location.
      static void openWindow​(org.openide.windows.TopComponent window, String location)
      Opens a new window in SNAP Desktop at the given location.
      static void openWindow​(org.openide.windows.TopComponent window, String location, boolean requestActive)
      Opens a new window in SNAP Desktop.
      static boolean removeAction​(org.openide.filesystems.FileObject actionFile)  
      static boolean removeActionReference​(org.openide.filesystems.FileObject actionReferenceFile)  
    • Constructor Detail

      • SnapUtils

        public SnapUtils()
    • Method Detail

      • addAction

        public static org.openide.filesystems.FileObject addAction​(Action action)
        Adds an action into the folder Menu/Tools of the SNAP Desktop / NetBeans file system.
        Parameters:
        action - The action.
        Returns:
        The file object representing the action.
      • addAction

        public static org.openide.filesystems.FileObject addAction​(Action action,
                                                                   String path)
        Adds an action into the folder given by path of the SNAP Desktop / NetBeans file system.
        Parameters:
        action - The action.
        path - The folder path.
        Returns:
        The file object representing the action.
      • addAction

        public static org.openide.filesystems.FileObject addAction​(Action action,
                                                                   String path,
                                                                   Integer position)
        Adds an action into the folder given by path of the SNAP Desktop / NetBeans file system at the given position.
        Parameters:
        action - The action.
        path - The folder path.
        position - The position within the folder. May be null.
        Returns:
        The file object representing the action.
      • addActionReference

        public static org.openide.filesystems.FileObject addActionReference​(org.openide.filesystems.FileObject instanceFile,
                                                                            String path,
                                                                            Integer position)
        Adds an action references into the folder given by path of the SNAP Desktop / NetBeans file system at the given position. The following are standard folders in SNAP Desktop/NetBeans where actions and action references may be placed to become visible:
        1. Menu/* - the main menu
        2. Toolbars/* - the main tool bar
        Parameters:
        instanceFile - The file object representing an action instance.
        path - The folder path.
        position - The position within the folder. May be null.
        Returns:
        The file object representing the action reference.
      • removeAction

        public static boolean removeAction​(org.openide.filesystems.FileObject actionFile)
      • removeActionReference

        public static boolean removeActionReference​(org.openide.filesystems.FileObject actionReferenceFile)
      • openWindow

        public static void openWindow​(org.openide.windows.TopComponent window)
        Opens a new window in SNAP Desktop in the "explorer" location.
        Parameters:
        window - The window which must must be an instance of TopComponent.
        See Also:
        openWindow(TopComponent, String, boolean)
      • openWindow

        public static void openWindow​(org.openide.windows.TopComponent window,
                                      boolean requestActive)
        Opens a new window in SNAP Desktop in the "explorer" location.
        Parameters:
        window - The window which must must be an instance of TopComponent.
        requestActive - true if a request will be made to activate the window after opening it.
        See Also:
        openWindow(TopComponent, String, boolean)
      • openWindow

        public static void openWindow​(org.openide.windows.TopComponent window,
                                      String location)
        Opens a new window in SNAP Desktop at the given location.
        Parameters:
        window - The window which must must be an instance of TopComponent.
        location - The location where the window should appear when it is first opened.
        See Also:
        openWindow(TopComponent, String, boolean)
      • openWindow

        public static void openWindow​(org.openide.windows.TopComponent window,
                                      String location,
                                      boolean requestActive)
        Opens a new window in SNAP Desktop.
        Parameters:
        window - The window which must must be an instance of TopComponent.
        location - The location where the window should appear when it is first opened. Possible docking areas are "explorer" (upper left), "navigator" (lower left), "properties" (upper right), "output" (bottom). You may choose "floating" to not dock the window at all. Note that this mode requires explicitly setting the window's position and size.
        requestActive - true if a request will be made to activate the window after opening it.