Class AbstractObjectContentHandler

    • Constructor Detail

      • AbstractObjectContentHandler

        public AbstractObjectContentHandler()
    • Method Detail

      • reusePreview

        public PreviewPanel reusePreview​(Object obj,
                                         PreviewPanel lastPreview)
        Reuses the last preview, if possible.
        Default implementation just creates a new preview.
        Specified by:
        reusePreview in interface ObjectContentHandler
        Parameters:
        obj - the object to create the view for
        Returns:
        the preview
      • canHandle

        public boolean canHandle​(Object obj)
        Checks whether the object is handled by this content handler.
        Specified by:
        canHandle in interface ObjectContentHandler
        Parameters:
        obj - the object to check
        Returns:
        true if handled
      • checkObject

        protected String checkObject​(Object obj)
        Hook method for checks before generating the preview.
        Parameters:
        obj - the object to check
        Returns:
        null if checks passed, otherwise error message
      • getObjectHandlers

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

        public static boolean hasObjectHandler​(Object obj)
        Checks whether the specified object can be managed.
        Parameters:
        obj - the object to check
        Returns:
        true if the object represents a managed object
      • hasObjectHandler

        public static boolean hasObjectHandler​(Class cls)
        Checks whether the specified class can be managed.
        Parameters:
        cls - the object to check
        Returns:
        true if the object represents a managed object
      • getObjectHandlersFor

        public static List<Class<? extends ObjectContentHandler>> getObjectHandlersFor​(Object obj)
        Returns the handlers registered for the object.
        Parameters:
        obj - the object to get the handlers for
        Returns:
        the handlers, null if none available
      • getObjectHandlersFor

        public static List<Class<? extends ObjectContentHandler>> getObjectHandlersFor​(Class cls)
        Returns the handlers registered for the class.
        Parameters:
        cls - the class to get the handlers for
        Returns:
        the handlers, null if none available