Class GenericHyperlink<P extends org.eclipse.emf.ecore.EObject>

  • Type Parameters:
    P - the type of the "project", the top-most semantic language unit
    All Implemented Interfaces:
    org.eclipse.jface.text.hyperlink.IHyperlink

    public class GenericHyperlink<P extends org.eclipse.emf.ecore.EObject>
    extends org.eclipse.xtext.ui.editor.hyperlinking.AbstractHyperlink
    This class realizes a custom hyperlink that is created for any IVML-element in an IVML-file if the user selects such an element either via pressing the "F3"-key or by clicking on that element while pressing the "CTRL"-key.
    Author:
    kroeher
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private IHyperlinkFactory<P> factory  
      private org.eclipse.xtext.nodemodel.ILeafNode hyperlinkLeafNode
      Stores the element for which this hyperlink is created.
      private P leafNodeProject
      Stores the IVML-project in which the node of this hyperlink is located in.
    • Constructor Summary

      Constructors 
      Constructor Description
      GenericHyperlink​(org.eclipse.xtext.nodemodel.ILeafNode parseTreeElement, P project, IHyperlinkFactory<P> factory)
      Creates an instance of this GenericHyperlink for the given ILeafNode which enables the jump to the element's declaration the node represents.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void open()
      Opens an IVML-editor for showing the declaration of the IVML-element this hyperlink was created for.
      • Methods inherited from class org.eclipse.xtext.ui.editor.hyperlinking.AbstractHyperlink

        getHyperlinkRegion, getHyperlinkText, getTypeLabel, setHyperlinkRegion, setHyperlinkRegion, setHyperlinkText, setTypeLabel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • hyperlinkLeafNode

        private org.eclipse.xtext.nodemodel.ILeafNode hyperlinkLeafNode
        Stores the element for which this hyperlink is created.
      • leafNodeProject

        private P extends org.eclipse.emf.ecore.EObject leafNodeProject
        Stores the IVML-project in which the node of this hyperlink is located in.
    • Constructor Detail

      • GenericHyperlink

        public GenericHyperlink​(org.eclipse.xtext.nodemodel.ILeafNode parseTreeElement,
                                P project,
                                IHyperlinkFactory<P> factory)
        Creates an instance of this GenericHyperlink for the given ILeafNode which enables the jump to the element's declaration the node represents. This is a user visible feature as this hyperlink is shown when the user holds CTRL and points to an element in an IVML-editor.
        Parameters:
        parseTreeElement - the ILeafNode of the parsed resource for which this hyperlink should be created
        project - the Project the given node is located in
        factory - the creating factory
    • Method Detail

      • open

        public void open()
        Opens an IVML-editor for showing the declaration of the IVML-element this hyperlink was created for.