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

## Class PatternComposite

- java.lang.Object
- - org.eclipse.viatra.query.tooling.ui.queryexplorer.content.patternsviewer.PatternComponent
  - - org.eclipse.viatra.query.tooling.ui.queryexplorer.content.patternsviewer.PatternComposite

-     public class PatternComposite
      extends PatternComponent

  This class represents a composite element inside a pattern hierarchy.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.List<PatternComponent>` | `children`

    - ### Fields inherited from class org.eclipse.viatra.query.tooling.ui.queryexplorer.content.patternsviewer.PatternComponent

      `parent, patternNameFragment, selected`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PatternComposite(java.lang.String patternNameFragment, PatternComposite parent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PatternComponent` | `addComponent(java.lang.String patternFragment)` Add a new component under the composite element based on the given pattern name fragment.
    `void` | `clear()`
    `boolean` | `equals(java.lang.Object obj)`
    `java.util.List<PatternComponent>` | `find(java.lang.String patternFragment)` Returns the list of pattern components downwards the tree for the given fully qualified pattern name.
    `java.util.List<PatternComponent>` | `getAllChildren()` Returns ALL children elements under the given composite.
    `java.util.List<PatternLeaf>` | `getAllLeaves()` Returns the list of (ALL) leaf objects under this composite.
    `java.util.List<PatternComponent>` | `getDirectChildren()` Returns the list of direct children elements under the composite.
    `java.util.List<PatternLeaf>` | `getDirectLeaves()` Returns the direct leaf children elements under this composite.
    `java.lang.String` | `getFullPatternNamePrefix()` Returns the prefix of the fully qualified pattern name for the given component.
    `PatternComposite` | `getRoot()` Returns the root above this composite element.
    `int` | `hashCode()`
    `protected java.util.Set<PatternComponent>` | `propagateSelectionStateDownwards()`
    `protected java.util.Set<PatternComponent>` | `propagateSelectionStateUpwards()`
    `void` | `purge()` Removes all composite elements which do not have a leaf component under it.
    `void` | `removeComponent(java.lang.String patternFragment)` This method removes the component matching the given pattern name fragment.
    `void` | `updateHasChildren()` Updates the checked and the "has children" states of this `PatternComponent` in the patterns viewer.

    - ### Methods inherited from class org.eclipse.viatra.query.tooling.ui.queryexplorer.content.patternsviewer.PatternComponent

      `getCheckedState, getParent, getPatternNameFragment, setCheckedState, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### children

          protected java.util.List<PatternComponent> children

  - ### Constructor Detail

    - #### PatternComposite

          public PatternComposite(java.lang.String patternNameFragment,
                                  PatternComposite parent)

  - ### Method Detail

    - #### clear

          public void clear()

    - #### find

          public java.util.List<PatternComponent> find(java.lang.String patternFragment)

      Returns the list of pattern components downwards the tree for the given fully qualified pattern name.
      Parameters:
        `patternFragment` - the fully qualified name of the pattern
      Returns:
        the list of components

    - #### getRoot

          public PatternComposite getRoot()

      Returns the root above this composite element. This will result either the Plug-in or the Runtime composite.
      Returns:
        the root composite

    - #### addComponent

          public PatternComponent addComponent(java.lang.String patternFragment)

      Add a new component under the composite element based on the given pattern name fragment.
      Parameters:
        `patternFragment` - the pattern name fragment

    - #### getAllLeaves

          public java.util.List<PatternLeaf> getAllLeaves()

      Returns the list of (ALL) leaf objects under this composite.
      Returns:
        the list of leaves

    - #### getDirectLeaves

          public java.util.List<PatternLeaf> getDirectLeaves()

      Returns the direct leaf children elements under this composite.
      Returns:
        the list of direct leaf elements

    - #### purge

          public void purge()

      Removes all composite elements which do not have a leaf component under it.

    - #### getAllChildren

          public java.util.List<PatternComponent> getAllChildren()

      Returns ALL children elements under the given composite.
      Returns:

    - #### propagateSelectionStateUpwards

          protected java.util.Set<PatternComponent> propagateSelectionStateUpwards()

      Overrides:
        `propagateSelectionStateUpwards` in class `PatternComponent`

    - #### propagateSelectionStateDownwards

          protected java.util.Set<PatternComponent> propagateSelectionStateDownwards()

      Overrides:
        `propagateSelectionStateDownwards` in class `PatternComponent`

    - #### removeComponent

          public void removeComponent(java.lang.String patternFragment)

      This method removes the component matching the given pattern name fragment.
      Parameters:
        `patternFragment` - the pattern name fragment

    - #### getDirectChildren

          public java.util.List<PatternComponent> getDirectChildren()

      Returns the list of direct children elements under the composite.
      Returns:
        the list of children elements

    - #### getFullPatternNamePrefix

          public java.lang.String getFullPatternNamePrefix()

      Description copied from class: `PatternComponent`
      Returns the prefix of the fully qualified pattern name for the given component.
      Specified by:
        `getFullPatternNamePrefix` in class `PatternComponent`
      Returns:
        the prefix of the pattern fqn

    - #### updateHasChildren

          public void updateHasChildren()

      Description copied from class: `PatternComponent`
      Updates the checked and the "has children" states of this `PatternComponent` in the patterns viewer.
      Specified by:
        `updateHasChildren` in class `PatternComponent`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`