Package adams.gui.goe

Class GenericObjectEditorPopupMenu

    • Constructor Detail

      • GenericObjectEditorPopupMenu

        public GenericObjectEditorPopupMenu​(PropertyEditor editor,
                                            JComponent comp)
        Initializes the menu.
        Parameters:
        editor - the editor this menu belongs to
        comp - the component to use as parent
    • Method Detail

      • initialize

        protected void initialize​(PropertyEditor editor,
                                  JComponent comp)
        Initializes the menu.
        Parameters:
        editor - the editor this menu belongs to
        comp - the component to use as parent
      • initializeCustomizers

        protected void initializeCustomizers()
        Initializes the menu customizers if necessary.
      • applyCustomizers

        protected void applyCustomizers​(PropertyEditor editor,
                                        JComponent comp)
        Applies the customizers.
      • getMenuItemText

        protected String getMenuItemText​(boolean customStringRepresentation)
        Returnsa the text to use in menu items and error messages.
        Parameters:
        customStringRepresentation - whether editor/element editor supports custom string representation
        Returns:
        the text
      • updateEditor

        protected boolean updateEditor​(PropertyEditor editor,
                                       JComponent comp,
                                       boolean canChangeClass,
                                       boolean customStringRepresentation,
                                       String str)
        Updates the editor using the string.
        Parameters:
        editor - the editor to update
        canChangeClass - whether the user can change the class
        customStringRepresentation - whether editor/element editor supports custom string representation
        str - the string to use
      • getCanChangeClassInDialog

        protected boolean getCanChangeClassInDialog​(PropertyEditor editor)
        Returns whether the class can be changed in the editor.
        Parameters:
        editor - the editor to check
        Returns:
        true if the class can be changed
      • getClassType

        protected Class getClassType​(PropertyEditor editor)
        Returns the class type handled in the editor.
        Parameters:
        editor - the editor to use
        Returns:
        the class
      • addChangeListener

        public void addChangeListener​(ChangeListener l)
        Adds the listener to the internal list of listeners that get notified when the user changes the setup.
        Parameters:
        l - the listener to add
      • removeChangeListener

        public void removeChangeListener​(ChangeListener l)
        Removes the listener from the internal list of listeners that get notified when the user changes the setup.
        Parameters:
        l - the listener to remove
      • notifyChangeListeners

        protected void notifyChangeListeners()
        Notifies all change listeners that the user modified the setup.