Package org.apache.sis.gui.dataset
Class ResourceExplorer
- All Implemented Interfaces:
Localized
A panel showing a tree of resources together with their metadata and data views.
- Since:
- 1.1
Defined in the sis-javafx module
-
Property Summary
PropertiesTypePropertyDescriptionfinal ReadOnlyProperty<Resource>Returns the property for currently selected resource. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ReadOnlyBooleanPropertyA property telling whether at least one data window created by this class is still visible. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal MenuItemCreates a menu item for creating new windows for the currently selected resource.final LocaleReturns the locale for controls and messages.EventHandler<ResourceEvent>Returns the function to be called when a resource is closed.EventHandler<ResourceEvent>Returns the function to be called after a resource has been loaded from a file or URL.final ResourceReturns the currently selected resource.final RegiongetView()Returns the region containing the resource tree, metadata panel and any other control managed by thisResourceExplorer.voidloadResources(Collection<?> files) Loads all given sources in background threads and add them to the resource tree.voidremoveAndClose(Resource resource) Removes the given resource from the tree and eventually closes it.final ReadOnlyProperty<Resource>Returns the property for currently selected resource.voidsetOnResourceClosed(EventHandler<ResourceEvent> handler) Specifies a function to be called when a resource is closed.voidsetOnResourceLoaded(EventHandler<ResourceEvent> handler) Specifies a function to be called after a resource has been loaded from a file or URL.voidsetWindowsItems(ObservableList<MenuItem> items) Sets the list where to add or remove the name of data windows.
-
Property Details
-
selectedResource
Returns the property for currently selected resource.- See Also:
-
-
Field Details
-
hasWindowsProperty
public final ReadOnlyBooleanProperty hasWindowsPropertyA property telling whether at least one data window created by this class is still visible.
-
-
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 thisResourceExplorer. The subclass is implementation dependent and may change in any future version. -
getOnResourceLoaded
Returns the function to be called after a resource has been loaded from a file or URL. This is an accessor for theResourceTree.onResourceLoadedproperty value.- Returns:
- current function to be called after a resource has been loaded, or
nullif none.
-
setOnResourceLoaded
Specifies a function to be called after a resource has been loaded from a file or URL. This is a setter for theResourceTree.onResourceLoadedproperty value. If this method is never invoked, then the default value isnull.- Parameters:
handler- new function to be called after a resource has been loaded, ornullif none.
-
getOnResourceClosed
Returns the function to be called when a resource is closed. This is an accessor for theResourceTree.onResourceClosedproperty value.- Returns:
- current function to be called when a resource is closed, or
nullif none. - Since:
- 1.2
-
setOnResourceClosed
Specifies a function to be called when a resource is closed. This is a setter for theResourceTree.onResourceClosedproperty value. If this method is never invoked, then the default value isnull.- Parameters:
handler- new function to be called when a resource is closed, ornullif none.- Since:
- 1.2
-
loadResources
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 containResourceinstances to add directly. This method forwards the files toResourceTree.loadResource(Object), which will allocate a background thread for each resource to load. -
removeAndClose
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, ornull.- See Also:
-
getSelectedResource
Returns the currently selected resource.- Returns:
- the currently selected resource, or
nullif none.
-
selectedResourceProperty
Returns the property for currently selected resource.- Returns:
- property for currently selected resource.
-
getLocale
Returns the locale for controls and messages.- Specified by:
getLocalein interfaceLocalized- Overrides:
getLocalein classWidget- 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 bycreateNewWindowMenu().WindowManagerwill automatically add or remove elements in the given list. The position of the new menu item will be just before the lastSeparatorMenuIteminstance. If noSeparatorMenuItemis 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:
-