public class DefaultSettingsProvider extends java.lang.Object implements SettingsProvider
Constructor and Description |
---|
DefaultSettingsProvider() |
DefaultSettingsProvider(java.lang.String desc,
javax.swing.JComponent pane) |
Modifier and Type | Method and Description |
---|---|
void |
applySettings(MainWindow window)
The method is called if the settings should be applied to the
MainWindow . |
boolean |
contains(java.lang.String substring)
Determines if the given search string matches some your settings.
|
java.util.List<SettingsProvider> |
getChildren()
Tree children of your settings dialog.
|
java.lang.String |
getDescription()
A textual human readable description of the settings panel.
|
javax.swing.Icon |
getIcon()
An icon for this settings for the
JTree . |
javax.swing.JComponent |
getPanel(MainWindow window)
Provides the visual component for the right side.
|
int |
getPriorityOfSettings()
Determines the order in the
JTree of the settings. |
void |
setChildren(java.util.List<SettingsProvider> children) |
void |
setDescription(java.lang.String description) |
void |
setIcon(javax.swing.Icon icon) |
void |
setPanel(javax.swing.JComponent panel) |
void |
setPriority(int priority) |
public DefaultSettingsProvider()
public DefaultSettingsProvider(java.lang.String desc, javax.swing.JComponent pane)
public java.lang.String getDescription()
SettingsProvider
getDescription
in interface SettingsProvider
public void setDescription(java.lang.String description)
public javax.swing.JComponent getPanel(MainWindow window)
SettingsProvider
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.
getPanel
in interface SettingsProvider
window
- non-null referencepublic java.util.List<SettingsProvider> getChildren()
SettingsProvider
You can use this method, if you need to split your settings into multiple panels.
The children are displayed as children within the JTree
.
getChildren
in interface SettingsProvider
public void setChildren(java.util.List<SettingsProvider> children)
public void applySettings(MainWindow window) throws InvalidSettingsInputException
SettingsProvider
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.
applySettings
in interface SettingsProvider
InvalidSettingsInputException
- if an input component is not properly fill.
Prevent the settings dialog from closing.public javax.swing.Icon getIcon()
SettingsProvider
JTree
.getIcon
in interface SettingsProvider
public void setIcon(javax.swing.Icon icon)
public boolean contains(java.lang.String substring)
SettingsProvider
Implement this function for search support. The settings dialog ask every provider if a user given search request is "handled" by a settings provider.
contains
in interface SettingsProvider
substring
- a possible empty, non-null stringpublic int getPriorityOfSettings()
SettingsProvider
JTree
of the settings.getPriorityOfSettings
in interface SettingsProvider
public void setPanel(javax.swing.JComponent panel)
public void setPriority(int priority)
Copyright © 2003-2019 The KeY-Project.