Package adams.gui.goe

Class AbstractPropertyEditorSupport

    • Field Detail

      • CANCEL_OPTION

        public static final int CANCEL_OPTION
        the user canceled the dialog.
        See Also:
        Constant Field Values
      • APPROVE_OPTION

        public static final int APPROVE_OPTION
        the user approved the dialog.
        See Also:
        Constant Field Values
      • m_CustomEditor

        protected JComponent m_CustomEditor
        the custom editor.
      • m_WindowAdapter

        protected WindowAdapter m_WindowAdapter
        the window adapter for de-registering the DB change listener.
      • m_ChosenOption

        protected int m_ChosenOption
        the option that the user chose.
    • Constructor Detail

      • AbstractPropertyEditorSupport

        protected AbstractPropertyEditorSupport()
        Initializes the editor.
    • Method Detail

      • initialize

        protected void initialize()
        For initializing members.

        Default implementation does nothing.
      • setValue

        public void setValue​(Object value)
        Set (or change) the object that is to be edited.
        Specified by:
        setValue in interface PropertyEditor
        Overrides:
        setValue in class PropertyEditorSupport
        Parameters:
        value - The new target object to be edited. Note that this object should not be modified by the PropertyEditor, rather the PropertyEditor should create a new object to hold any modified value.
      • createWindowAdapter

        protected WindowAdapter createWindowAdapter()
        Creates the window adapater to attach.
        Returns:
        the WindowAdapter to use
      • addWindowAdapter

        protected void addWindowAdapter()
        Adds a window listener to the dialog.
        See Also:
        initForDisplay()
      • cleanUp

        protected void cleanUp()
        Cleans up when the dialog is closed.

        Default implementation does nothing.
      • closeDialog

        protected void closeDialog​(int option)
        Closes the dialog.
        Parameters:
        option - the chosen option
        See Also:
        getChosenOption()
      • getParentDialog

        protected Dialog getParentDialog()
        Returns the parent dialog if possible.
        Returns:
        the parent dialog, null if not available
      • getParentFrame

        protected Frame getParentFrame()
        Returns the parent frame if possible.
        Returns:
        the parent frame, null if not available
      • createCustomEditor

        protected abstract JComponent createCustomEditor()
        Creates the custom editor.
        Returns:
        the editor
      • initForDisplay

        protected void initForDisplay()
        Initializes the display of the value.
      • getChosenOption

        public int getChosenOption()
        Returns the option that the user chose.
        Returns:
        the option
        See Also:
        APPROVE_OPTION, CANCEL_OPTION
      • createPopup

        protected BasePopupMenu createPopup()
        Creates a popup menu.
        Returns:
        the popup menu, null if not supported
      • createTipText

        public String createTipText​(String help)
        Creates a tip text from the given help string.
        Parameters:
        help - the help string, can be null
        Returns:
        the generated tip text string
      • getHelpURL

        public String getHelpURL()
        Returns a URL with additional information.

        If current value is an instance of HelpProvider, then its URL is returned, otherwise null.
        Specified by:
        getHelpURL in interface HelpProvider
        Returns:
        the URL, null if not available
      • getHelpDescription

        public String getHelpDescription()
        Returns a long help description, e.g., used in tiptexts.

        If current value is an instance of HelpProvider, then its description is returned, otherwise the value's tip text.
        Specified by:
        getHelpDescription in interface HelpProvider
        Returns:
        the help text, null if not available
      • getHelpTitle

        public String getHelpTitle()
        Returns a short title for the help, e.g., used for buttons.

        If current value is an instance of HelpProvider, then its title is returned, otherwise null.
        Specified by:
        getHelpTitle in interface HelpProvider
        Returns:
        the short title, null if not available
      • getHelpIcon

        public String getHelpIcon()
        Returns the name of a help icon, e.g., used for buttons.

        If current value is an instance of HelpProvider, then its icon is returned, otherwise null.
        Specified by:
        getHelpIcon in interface HelpProvider
        Returns:
        the icon name, null if not available