Class DialogSettingsBasedHistory


  • public class DialogSettingsBasedHistory
    extends Object
    History of String entries, based on IDialogSettings.

    History may be used to store and load String elements (or some elements encoded to String) in dialog settings. History size is 10 by default, but may be configured.

    See Also:
    IDialogSettings
    • Constructor Detail

      • DialogSettingsBasedHistory

        public DialogSettingsBasedHistory​(org.eclipse.jface.dialogs.IDialogSettings dialogSettings)
        Parameters:
        dialogSettings - the dialog settings to use for entry save and load, cannot be null
    • Method Detail

      • setHistorySize

        public void setHistorySize​(int historySize)
        Set maximum history size. Default value is 10.
        Parameters:
        historySize - the maximum history size, must be positive
      • addHistoryEntry

        public void addHistoryEntry​(String entry)
        Add new String entry to the history. History will be saved in dialog settings. If history size reached its maximum, least recent entry will be removed.
        Parameters:
        entry - a new String entry to add to history, cannot be null
      • saveHistory

        public void saveHistory​(List<String> history)
        Save entire history list to the dialog settings.
        Parameters:
        history - the history list to save, cannot be null
      • loadHistory

        public List<String> loadHistory()
        Load and return condition history from the dialog settings.
        Returns:
        the condition history, cannot be null