Package adams.gui.goe

Class AbstractGenericObjectEditorHandler

    • Field Detail

      • m_Cache

        protected static Hashtable<Class,​Class> m_Cache
        the cache for object class / handler relation.
      • m_Handlers

        protected static String[] m_Handlers
        the handlers (classnames) currently available.
      • m_HandlerClasses

        protected static Class[] m_HandlerClasses
        the handlers (classes) currently available.
    • Constructor Detail

      • AbstractGenericObjectEditorHandler

        public AbstractGenericObjectEditorHandler()
    • Method Detail

      • setClassType

        public abstract boolean setClassType​(PropertyEditor editor,
                                             Class cls)
        Sets the class type to use.
        Parameters:
        editor - the editor to update
        cls - the class to set
        Returns:
        true if successfully set
      • getClassType

        public abstract Class getClassType​(PropertyEditor editor)
        Returns the class type currently in use.
        Parameters:
        editor - the editor to query
        Returns:
        the class type
      • setCanChangeClassInDialog

        public abstract boolean setCanChangeClassInDialog​(PropertyEditor editor,
                                                          boolean canChange)
        Sets whether the class can be changed in the dialog.
        Parameters:
        editor - the editor to update
        canChange - if true the class can be changed in the dialog
        Returns:
        true if successfully set
      • getCanChangeClassInDialog

        public abstract boolean getCanChangeClassInDialog​(PropertyEditor editor)
        Returns whether the class can be changed in the dialog.
        Parameters:
        editor - the editor to query
        Returns:
        true if the class can be changed in the dialog
      • setValue

        public abstract boolean setValue​(PropertyEditor editor,
                                         Object value)
        Sets the editor value.
        Parameters:
        editor - the editor to update
        value - the object to set
        Returns:
        true if successfully set
      • getValue

        public abstract Object getValue​(PropertyEditor editor)
        Returns the value currently being edited.
        Parameters:
        editor - the editor to query
        Returns:
        the current editor value
      • handles

        public boolean handles​(Object obj)
        Checks whether the given objects can be processed.
        Parameters:
        obj - the object to inspect
        Returns:
        true if the handler can process the object
      • handles

        public abstract boolean handles​(Class cls)
        Checks whether the given class can be processed.
        Parameters:
        cls - the class to inspect
        Returns:
        true if the handler can process the class
      • hasCustomPanel

        public abstract boolean hasCustomPanel​(PropertyEditor editor)
        Checks whether the editor supplies its own panel.
        Parameters:
        editor - the editor to check
        Returns:
        true if the editor provides a panel
      • getCustomPanel

        public abstract JPanel getCustomPanel​(PropertyEditor editor)
        Returns the custom panel of the editor.
        Parameters:
        editor - the editor to obtain the panel from
        Returns:
        the custom panel, null if none available
      • initHandlers

        protected static void initHandlers()
        Initializes the handlers.
      • getHandler

        public static AbstractGenericObjectEditorHandler getHandler​(Object obj)
        Returns a handler for the specified object.
        Parameters:
        obj - the object to get a commandline handler for
        Returns:
        the handler
      • getHandler

        public static AbstractGenericObjectEditorHandler getHandler​(Class cls)
        Returns a handler for the specified class.
        Parameters:
        cls - the class to get a commandline handler for
        Returns:
        the handler
      • getHandlers

        public static String[] getHandlers()
        Returns a list with classnames of handlers.
        Returns:
        the handler classnames