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

## Class PatternComponent

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

- Direct Known Subclasses:
    PatternComposite, PatternLeaf

      public abstract class PatternComponent
      extends java.lang.Object

  A component inside the pattern hierarchy.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected PatternComposite` | `parent`
    `protected java.lang.String` | `patternNameFragment`
    `protected boolean` | `selected`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PatternComponent()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getCheckedState()`
    `abstract java.lang.String` | `getFullPatternNamePrefix()` Returns the prefix of the fully qualified pattern name for the given component.
    `PatternComposite` | `getParent()` Returns the parent element of the component.
    `java.lang.String` | `getPatternNameFragment()` Returns the fragment inside the fully qualified pattern name for the given component.
    `protected java.util.Set<PatternComponent>` | `propagateSelectionStateDownwards()`
    `protected java.util.Set<PatternComponent>` | `propagateSelectionStateUpwards()`
    `java.util.Collection<PatternComponent>` | `setCheckedState(boolean checked)`
    `java.lang.String` | `toString()`
    `abstract void` | `updateHasChildren()` Updates the checked and the "has children" states of this `PatternComponent` in the patterns viewer.

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

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

- - ### Field Detail

    - #### patternNameFragment

          protected java.lang.String patternNameFragment

    - #### selected

          protected boolean selected

    - #### parent

          protected PatternComposite parent

  - ### Constructor Detail

    - #### PatternComponent

          public PatternComponent()

  - ### Method Detail

    - #### getParent

          public PatternComposite getParent()

      Returns the parent element of the component. The root component will should return null.
      Returns:
        the parent of the component

    - #### getCheckedState

          public boolean getCheckedState()

    - #### updateHasChildren

          public abstract void updateHasChildren()

      Updates the checked and the "has children" states of this `PatternComponent` in the patterns viewer.

    - #### setCheckedState

          public java.util.Collection<PatternComponent> setCheckedState(boolean checked)

    - #### propagateSelectionStateUpwards

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

    - #### propagateSelectionStateDownwards

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

    - #### getFullPatternNamePrefix

          public abstract java.lang.String getFullPatternNamePrefix()

      Returns the prefix of the fully qualified pattern name for the given component.
      Returns:
        the prefix of the pattern fqn

    - #### getPatternNameFragment

          public java.lang.String getPatternNameFragment()

      Returns the fragment inside the fully qualified pattern name for the given component.
      Returns:
        the pattern fqn fragment

    - #### toString

          public java.lang.String toString()

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