Class JavaElementLinkAdapter

  • All Implemented Interfaces:
    ILinkCapable, org.eclipse.core.runtime.IAdaptable

    public class JavaElementLinkAdapter
    extends java.lang.Object
    implements ILinkCapable
    Class used to create an ILinkCapable instance of a Java class.
    Author:
    Christopher Mindus
    • Constructor Detail

      • JavaElementLinkAdapter

        public JavaElementLinkAdapter​(org.eclipse.jdt.core.IMethod method)
        The constructor.
        Parameters:
        method - The method.
      • JavaElementLinkAdapter

        public JavaElementLinkAdapter​(org.eclipse.jdt.core.IType type)
        The constructor.
        Parameters:
        type - The type.
      • JavaElementLinkAdapter

        public JavaElementLinkAdapter​(org.eclipse.jdt.core.IJavaElement element)
        The constructor.
        Parameters:
        element - The Java element.
    • Method Detail

      • isLinkCapable

        public org.eclipse.core.runtime.IStatus isLinkCapable​(LinkData data)
        Returns if this property container could potentially be link capable.

        This call is done many times during drag-drop and must be very fast and not cause too much garbage collection.

        Specified by:
        isLinkCapable in interface ILinkCapable
        Parameters:
        data - The link data.
        Returns:
        The status of capability of the operation.
      • getDragDropText

        public java.lang.String getDragDropText()
        Gets the link text to display when drag-dropping into JavaScript Panel Editor.
        Specified by:
        getDragDropText in interface ILinkCapable
        Returns:
        The drag-drop text to use, or null if the method ILinkCapable.getDragDropHTML() is used instead.
      • getLinkOperations

        public java.util.Collection<ILinkOperation> getLinkOperations​(LinkData data)
        Called when the drag-drop is to be performed (link or paste-link menu item). The link-capable instance fills in only what it handles.
        Specified by:
        getLinkOperations in interface ILinkCapable
        Parameters:
        data - The link data.
        Returns:
        The list of operations required.
      • getAdapter

        public <T> T getAdapter​(java.lang.Class<T> adapter)
        Adapter.
        Specified by:
        getAdapter in interface org.eclipse.core.runtime.IAdaptable