Class ResourceExplorer

Object
Widget
ResourceExplorer
All Implemented Interfaces:
Localized

public class ResourceExplorer extends Widget
A panel showing a tree of resources together with their metadata and data views.
Since:
1.1

Defined in the sis-javafx module

  • Property Details

  • Field Details

  • Constructor Details

    • ResourceExplorer

      public ResourceExplorer()
      Creates a new panel for exploring resources.
  • Method Details

    • getView

      public final Region getView()
      Returns the region containing the resource tree, metadata panel and any other control managed by this Resource­Explorer. The subclass is implementation dependent and may change in any future version.
      Specified by:
      get­View in class Widget
      Returns:
      the region to show.
    • getOnResourceLoaded

      public EventHandler<ResourceEvent> getOnResourceLoaded()
      Returns the function to be called after a resource has been loaded from a file or URL. This is an accessor for the Resource­Tree​.on­Resource­Loaded property value.
      Returns:
      current function to be called after a resource has been loaded, or null if none.
    • setOnResourceLoaded

      public void setOnResourceLoaded(EventHandler<ResourceEvent> handler)
      Specifies a function to be called after a resource has been loaded from a file or URL. This is a setter for the Resource­Tree​.on­Resource­Loaded property value. If this method is never invoked, then the default value is null.
      Parameters:
      handler - new function to be called after a resource has been loaded, or null if none.
    • getOnResourceClosed

      public EventHandler<ResourceEvent> getOnResourceClosed()
      Returns the function to be called when a resource is closed. This is an accessor for the Resource­Tree​.on­Resource­Closed property value.
      Returns:
      current function to be called when a resource is closed, or null if none.
      Since:
      1.2
    • setOnResourceClosed

      public void setOnResourceClosed(EventHandler<ResourceEvent> handler)
      Specifies a function to be called when a resource is closed. This is a setter for the Resource­Tree​.on­Resource­Closed property value. If this method is never invoked, then the default value is null.
      Parameters:
      handler - new function to be called when a resource is closed, or null if none.
      Since:
      1.2
    • loadResources

      public void loadResources(Collection<?> files)
      Loads all given sources in background threads and add them to the resource tree. The given collection typically contains files to load, but may also contain Resource instances to add directly. This method forwards the files to Resource­Tree​.load­Resource(Object), which will allocate a background thread for each resource to load.
      Parameters:
      files - the source of the resource to load. They are usually File or Path instances.
      See Also:
    • removeAndClose

      public void removeAndClose(Resource resource)
      Removes the given resource from the tree and eventually closes it. If the given resource is not in this tree explorer or can not be removed, then this method does nothing.
      Parameters:
      resource - the resource to remove, or null.
      See Also:
    • getSelectedResource

      public final Resource getSelectedResource()
      Returns the currently selected resource.
      Returns:
      the currently selected resource, or null if none.
    • selectedResourceProperty

      public final ReadOnlyProperty<Resource> selectedResourceProperty()
      Returns the property for currently selected resource.
      Returns:
      property for currently selected resource.
    • getLocale

      public final Locale getLocale()
      Returns the locale for controls and messages.
      Specified by:
      get­Locale in interface Localized
      Overrides:
      get­Locale in class Widget
      Returns:
      the locale for controls in this widget.
    • createNewWindowMenu

      public final MenuItem createNewWindowMenu()
      Creates a menu item for creating new windows for the currently selected resource. The new menu item is initially disabled. Its will become enabled automatically when a resource is selected.

      Note: current implementation keeps a strong reference to created menu. Use this method only for menus that are expected to exist for application lifetime.

      Returns:
      a "new window" menu item.
      See Also:
    • setWindowsItems

      public void setWindowsItems(ObservableList<MenuItem> items)
      Sets the list where to add or remove the name of data windows. New data windows are created when user selects a menu item given by create­New­Window­Menu(). Window­Manager will automatically add or remove elements in the given list. The position of the new menu item will be just before the last Separator­Menu­Item instance. If no Separator­Menu­Item is found, then one will be inserted at the beginning of the given list when needed.
      Parameters:
      items - the list where to add and remove the name of windows.
      See Also: