Package org.omegat.gui.preferences
Interface IPreferencesController
-
- All Known Implementing Classes:
AppearanceController,AutoCompleterController,AutotextAutoCompleterOptionsController,BasePreferencesController,CharTableAutoCompleterOptionsController,CustomColorSelectionController,DictionaryPreferencesController,EditingBehaviorController,ExternalFinderPreferencesController,FiltersCustomizerController,FontSelectionController,GeneralOptionsController,GlossaryAutoCompleterOptionsController,GlossaryPreferencesController,HistoryAutoCompleterOptionsController,LanguageToolConfigurationController,MachineTranslationPreferencesController,PluginsPreferencesController,RepositoriesCredentialsController,SaveOptionsController,SecureStoreController,SegmentationCustomizerController,SpellcheckerConfigurationController,TagProcessingOptionsController,TeamOptionsController,TMMatchesPreferencesController,UserPassController,VersionCheckPreferencesController,ViewOptionsController
public interface IPreferencesControllerAn interface implemented by views shown in the Preferences window. SeeBasePreferencesControllerfor a base implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIPreferencesController.FurtherActionListenerAn interface used by observers interested in knowing when a preference has been altered that requires the application to be restarted or the project to be reloaded.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddFurtherActionListener(IPreferencesController.FurtherActionListener listener)Add a listenerjava.awt.ComponentgetGui()Get the GUI (the "view") controlled by this controller.default java.lang.Class<? extends IPreferencesController>getParentViewClass()Get the parent view in the view tree.booleanisReloadRequired()Returns whether a preference has been altered such as to require the project to be reloaded.booleanisRestartRequired()Returns whether a preference has been altered such as to require the application to be restarted.voidpersist()Commit changes.voidremoveFurtherActionListener(IPreferencesController.FurtherActionListener listener)Remove a listenervoidrestoreDefaults()Restore preferences controlled by this view to their default state.java.lang.StringtoString()Implementors should override this to return the name of the view as shown in the view tree.voidundoChanges()Restore preferences controlled by this view to their current persisted state.default booleanvalidate()Validate the current preferences.
-
-
-
Method Detail
-
addFurtherActionListener
void addFurtherActionListener(IPreferencesController.FurtherActionListener listener)
Add a listener
-
removeFurtherActionListener
void removeFurtherActionListener(IPreferencesController.FurtherActionListener listener)
Remove a listener
-
isRestartRequired
boolean isRestartRequired()
Returns whether a preference has been altered such as to require the application to be restarted.
-
isReloadRequired
boolean isReloadRequired()
Returns whether a preference has been altered such as to require the project to be reloaded.
-
toString
java.lang.String toString()
Implementors should override this to return the name of the view as shown in the view tree.- Overrides:
toStringin classjava.lang.Object
-
getGui
java.awt.Component getGui()
Get the GUI (the "view") controlled by this controller. This should not be a window (e.g. JDialog, JFrame) but rather a component embeddable in a window (e.g. JPanel).
-
getParentViewClass
default java.lang.Class<? extends IPreferencesController> getParentViewClass()
Get the parent view in the view tree. Implementors should override this to return the class of the desired parent; by default this is the Plugins view.
-
persist
void persist()
Commit changes.
-
validate
default boolean validate()
Validate the current preferences. Implementors should override to implement validation logic as necessary.When validation fails, implementors should not raise dialogs; instead they should offer feedback within the view GUI.
- Returns:
- True if the settings are valid and OK to be persisted; false if not
-
undoChanges
void undoChanges()
Restore preferences controlled by this view to their current persisted state.
-
restoreDefaults
void restoreDefaults()
Restore preferences controlled by this view to their default state.
-
-