org.eclipse.viatra.query.tooling.ui.queryexplorer.util

## Class DisplayUtil

- java.lang.Object
- - org.eclipse.viatra.query.tooling.ui.queryexplorer.util.DisplayUtil

-     public class DisplayUtil
      extends java.lang.Object

  The util contains several useful methods for the query displaying operations.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ORDERBY_ANNOTATION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DisplayUtil()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addOrderByPatternWarning(java.lang.String patternFqn, java.lang.String message)` Creates a marker with a warning for the given pattern.
    `PatternModel` | `extractPatternModelFromResource(org.eclipse.emf.ecore.resource.Resource resource)`
    `static org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider` | `getAdapterFactoryLabelProvider(org.eclipse.emf.common.util.URI uri)` Returns the `AdapterFactoryLabelProvider` instance for the given uri.
    `static java.lang.String` | `getMessage(IPatternMatch match)` Get the value of the PatternUI annotation's message attribute for the pattern which name is patternName.
    `static java.lang.String` | `getMessage(ViatraQueryMatcher<? extends IPatternMatch> matcher, int matchesSize, java.lang.String patternFqn)` Returns a text message for a generated, not filtered matcher about the current match size.
    `static java.lang.String` | `getMessage(ViatraQueryMatcher<? extends IPatternMatch> matcher, int matchesSize, java.lang.String patternFqn, boolean isGenerated, boolean isFiltered, java.lang.String exceptionMessage, IQueryBackendFactory backend)` Returns a text message about the matches size for the given matcher.
    `static java.lang.String` | `getMessage(ViatraQueryMatcher<? extends IPatternMatch> matcher, int matchesSize, java.lang.String patternFqn, IQueryBackendFactory backend)` Returns a text message for a generated, not filtered matcher about the current match size.
    `static java.lang.String` | `getQueryBackendName(IQueryBackendFactory backend)`
    `PatternModel` | `parseEPM(org.eclipse.core.resources.IFile file)` Parses the given .vql file into a `PatternModel`.
    `static void` | `removeOrderByPatternWarning(java.lang.String patternFqn)` Removes the marker for the given pattern if it is present.

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

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

- - ### Field Detail

    - #### ORDERBY_ANNOTATION

          public static final java.lang.String ORDERBY_ANNOTATION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DisplayUtil

          public DisplayUtil()

  - ### Method Detail

    - #### addOrderByPatternWarning

          public static void addOrderByPatternWarning(java.lang.String patternFqn,
                                                      java.lang.String message)

      Creates a marker with a warning for the given pattern. The marker's message will be set to the given message parameter.
      Parameters:
        `patternFqn` - the fully qualified name of the pattern
        `message` - the warning message for the marker

    - #### removeOrderByPatternWarning

          public static void removeOrderByPatternWarning(java.lang.String patternFqn)

      Removes the marker for the given pattern if it is present.
      Parameters:
        `patternFqn` - the fully qualified name of the pattern

    - #### getAdapterFactoryLabelProvider

          public static org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider getAdapterFactoryLabelProvider(org.eclipse.emf.common.util.URI uri)

      Returns the `AdapterFactoryLabelProvider` instance for the given uri.
      Parameters:
        `uri` - the uri
      Returns:
        the `AdapterFactoryLabelProvider` instance

    - #### getMessage

          public static java.lang.String getMessage(ViatraQueryMatcher<? extends IPatternMatch> matcher,
                                                    int matchesSize,
                                                    java.lang.String patternFqn)

      Returns a text message for a generated, not filtered matcher about the current match size.
      Parameters:
        `matcher` -
        `matchesSize` -
        `patternFqn` -
      Returns:

    - #### getMessage

          public static java.lang.String getMessage(ViatraQueryMatcher<? extends IPatternMatch> matcher,
                                                    int matchesSize,
                                                    java.lang.String patternFqn,
                                                    IQueryBackendFactory backend)

      Returns a text message for a generated, not filtered matcher about the current match size.
      Parameters:
        `matcher` -
        `matchesSize` -
        `patternFqn` -
        `backend` -
      Returns:

    - #### getMessage

          public static java.lang.String getMessage(ViatraQueryMatcher<? extends IPatternMatch> matcher,
                                                    int matchesSize,
                                                    java.lang.String patternFqn,
                                                    boolean isGenerated,
                                                    boolean isFiltered,
                                                    java.lang.String exceptionMessage,
                                                    IQueryBackendFactory backend)

      Returns a text message about the matches size for the given matcher.
      Parameters:
        `matcher` - the `ViatraQueryMatcher` instance
        `matchesSize` - the size of the matchset
        `patternFqn` - the pattern fqn
        `isGenerated` - true, if the matcher is generated, false if generic
        `isFiltered` - true, if the matcher is filtered, false otherwise
      Returns:
        the label associated to the matcher

    - #### getQueryBackendName

          public static java.lang.String getQueryBackendName(IQueryBackendFactory backend)

      Parameters:
        `backend` -
      Returns:
        a user-readable name for the given `IQueryBackend` implementation.

    - #### getMessage

          public static java.lang.String getMessage(IPatternMatch match)

      Get the value of the PatternUI annotation's message attribute for the pattern which name is patternName.
      Parameters:
        `patternName` - the name of the pattern
      Returns:
        the content of the message attribute

    - #### extractPatternModelFromResource

          public PatternModel extractPatternModelFromResource(org.eclipse.emf.ecore.resource.Resource resource)

    - #### parseEPM

          public PatternModel parseEPM(org.eclipse.core.resources.IFile file)

      Parses the given .vql file into a `PatternModel`.
      Parameters:
        `file` - the .vql file instance
      Returns:
        the parsed pattern model or null in case of error