org.eclipse.viatra.query.tooling.ui.queryexplorer.content.matcher

## Class BaseContent<ParentType>

- java.lang.Object
- - org.eclipse.viatra.query.tooling.ui.queryexplorer.content.matcher.BaseContent<ParentType>

- Type Parameters:
    `ParentType` - the type of the parent content element
  Direct Known Subclasses:
    CompositeContent, PatternMatchContent

      public abstract class BaseContent<ParentType>
      extends java.lang.Object

  Instances of this class represent contents of the tree viewer in the `QueryExplorer` on the various levels. This kind of content does not have children elements. The hierarchy of the contents is viewer root -> content root -> matchers -> matches.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ParentType` | `parent`
    `protected java.lang.String` | `text`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseContent(ParentType parent)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `dispose()` Disposes of this content.
    `ParentType` | `getParent()` Returns the parent content of this content.
    `java.lang.String` | `getText()` Returns the label that will be displayed in the `QueryExplorer` for this content.
    `void` | `setText(java.lang.String text)` Updates the label of the content and also refreshes the representation in the `QueryExplorer` for this content.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### parent

          protected ParentType parent

    - #### text

          protected java.lang.String text

  - ### Constructor Detail

    - #### BaseContent

          public BaseContent(ParentType parent)

  - ### Method Detail

    - #### setText

          public void setText(java.lang.String text)

      Updates the label of the content and also refreshes the representation in the `QueryExplorer` for this content.
      Parameters:
        `text` - the new label

    - #### getText

          public java.lang.String getText()

      Returns the label that will be displayed in the `QueryExplorer` for this content.
      Returns:
        the label of the content

    - #### dispose

          public abstract void dispose()

      Disposes of this content. It is the method's responsibility to call dispose on all child elements. Important: do NOT call dispose on the children observable collection as it will be invoked when the observable tree viewer processes the list diffs. This implementation should only release those resources (matchers / engines / etc) which are directly bound to this content.

    - #### getParent

          public ParentType getParent()

      Returns the parent content of this content.
      Returns:
        the parent content