public interface SettingsProvider
SettingsUi
.
It will be display within the settings tree by getDescription()
.
Tree children are determined by getChildren()
. The most important functions are:
applySettings(MainWindow)
and getPanel(MainWindow)
.
Modifier and Type | Method and Description |
---|---|
void |
applySettings(MainWindow window)
The method is called if the settings should be applied to the
MainWindow . |
default boolean |
contains(java.lang.String substring)
Determines if the given search string matches some your settings.
|
default java.util.List<SettingsProvider> |
getChildren()
Tree children of your settings dialog.
|
java.lang.String |
getDescription()
A textual human readable description of the settings panel.
|
default javax.swing.Icon |
getIcon()
Deprecated.
unused currently
|
javax.swing.JComponent |
getPanel(MainWindow window)
Provides the visual component for the right side.
|
default int |
getPriorityOfSettings()
Determines the order in the
JTree of the settings. |
java.lang.String getDescription()
javax.swing.JComponent getPanel(MainWindow window)
This panel will be wrapped inside a JScrollPane
.
You are allowed to reuse the return component. But then you should update the components, e.g. text field, during handling of the call.
window
- non-null referencedefault java.util.List<SettingsProvider> getChildren()
You can use this method, if you need to split your settings into multiple panels.
The children are displayed as children within the JTree
.
void applySettings(MainWindow window) throws InvalidSettingsInputException
MainWindow
.
If the user clicks on apply or accept, the SettingsDialog
calls this method
for every registered SettingsProvider
.
You should read your values from the input components and update the settings within the main window.
If a field is not in the appropiate format, you should throw an InvalidSettingsInputException
with the reference to the panel and component.
InvalidSettingsInputException
- if an input component is not properly fill.
Prevent the settings dialog from closing.@Deprecated default javax.swing.Icon getIcon()
JTree
.default boolean contains(java.lang.String substring)
Implement this function for search support. The settings dialog ask every provider if a user given search request is "handled" by a settings provider.
substring
- a possible empty, non-null stringdefault int getPriorityOfSettings()
JTree
of the settings.Copyright © 2003-2019 The KeY-Project.