public interface UserInterface extends RichPlugin, Disposable
UIs discoverable at runtime must implement this interface and be annotated
with @Plugin
with attribute Plugin.type()
=
UserInterface
.class. While it possible to create a UI merely by
implementing this interface, it is encouraged to instead extend
AbstractUserInterface
, for convenience.
Modifier and Type | Method and Description |
---|---|
default File |
chooseFile(File file,
String style)
Prompts the user to choose a file.
|
default File |
chooseFile(String title,
File file,
String style)
Prompts the user to choose a file.
|
default File[] |
chooseFiles(File parent,
File[] files,
FileFilter filter,
String style)
Prompts the user to choose a list of files.
|
default List<File> |
chooseFiles(File parent,
List<File> fileList,
FileFilter filter,
String style)
Prompts the user to choose a list of files.
|
DisplayWindow |
createDisplayWindow(Display<?> display)
Creates a new display window housing the given display, or null if not
applicable.
|
DialogPrompt |
dialogPrompt(String message,
String title,
DialogPrompt.MessageType messageType,
DialogPrompt.OptionType optionType)
Creates a dialog prompter.
|
default ApplicationFrame |
getApplicationFrame()
Gets the main SciJava application frame, or null if not applicable.
|
default ConsolePane<?> |
getConsolePane()
Gets the main SciJava console pane, or null if not applicable.
|
default Desktop |
getDesktop()
Gets the desktop, for use with multi-document interfaces (MDI), or null if
not applicable.
|
default StatusBar |
getStatusBar()
Gets the main SciJava status bar, or null if not applicable.
|
default SystemClipboard |
getSystemClipboard()
Gets the system clipboard associated with this UI, or null if not
applicable.
|
default ToolBar |
getToolBar()
Gets the main SciJava toolbar, or null if not applicable.
|
boolean |
isVisible()
Whether this UI is visible onscreen.
|
boolean |
requiresEDT()
Returns true if this UI requires the EDT.
|
void |
restoreLocation()
Restores the application frame's current location.
|
void |
saveLocation()
Persists the application frame's current location.
|
void |
show()
Shows the UI.
|
void |
show(Display<?> display)
Shows the display onscreen using an appropriate UI widget.
|
default void |
show(Object o)
Shows the object onscreen using an appropriate UI widget.
|
void |
show(String name,
Object o)
Shows the object onscreen using an appropriate UI widget.
|
void |
showContextMenu(String menuRoot,
Display<?> display,
int x,
int y)
Displays a popup context menu for the given display at the specified
position.
|
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
void show()
Note that the actual UI components are created lazily when this method is called, rather then upon the UI's initial construction.
boolean isVisible()
default void show(Object o)
void show(String name, Object o)
name
- The name to use when displaying the object.o
- The object to be displayed.void show(Display<?> display)
default Desktop getDesktop()
default ApplicationFrame getApplicationFrame()
default ToolBar getToolBar()
default StatusBar getStatusBar()
default ConsolePane<?> getConsolePane()
default SystemClipboard getSystemClipboard()
DisplayWindow createDisplayWindow(Display<?> display)
DialogPrompt dialogPrompt(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
message
- The message in the dialog itself.title
- The title of the dialog.messageType
- The type of message. This typically is rendered as an
icon next to the message. For example,
DialogPrompt.MessageType.WARNING_MESSAGE
typically appears
as an exclamation point.optionType
- The choices available when dismissing the dialog. These
choices are typically rendered as buttons for the user to click.default File chooseFile(File file, String style)
file
- The initial value displayed in the file chooser prompt.style
- The style of chooser to use:
File
chosen by the user, or null if prompt is not
availabledefault File chooseFile(String title, File file, String style)
title
- Title to use in the file chooser dialog.file
- The initial value displayed in the file chooser prompt.style
- The style of chooser to use:
File
chosen by the user, or null if prompt is not
availabledefault File[] chooseFiles(File parent, File[] files, FileFilter filter, String style)
parent
- Parent folder for file selectionfiles
- The initial value displayed in the file chooser prompt.filter
- A filter allowing to restrict file choice.style
- File selection style (files, directories, or both) and optional filtersFile
s chosen by the user, or null if the
user cancels the prompt.default List<File> chooseFiles(File parent, List<File> fileList, FileFilter filter, String style)
parent
- Parent folder for file selectionfileList
- The initial value displayed in the file chooser prompt.filter
- A filter allowing to restrict file choice.style
- File selection style (files, directories, or both) and optional filtersFile
s chosen by the user, or null if the
user cancels the prompt.void showContextMenu(String menuRoot, Display<?> display, int x, int y)
void saveLocation()
void restoreLocation()
boolean requiresEDT()
Copyright © 2015–2022 SciJava. All rights reserved.