private void initPatternsViewerWithGeneratedPatterns() {
    for (IQuerySpecification<?> pattern :
        QueryExplorerPatternRegistry.getGeneratedQuerySpecifications()) {
      String patternFqn = pattern.getFullyQualifiedName();
      QueryExplorerPatternRegistry.getInstance().addGeneratedPattern(pattern);
      QueryExplorerPatternRegistry.getInstance().addActivePattern(pattern);
      patternsViewerInput.getGeneratedPatternsRoot().addComponent(patternFqn);
    }

    patternsTreeViewer.refresh();
    patternsViewerInput.getGeneratedPatternsRoot().updateSelection(patternsTreeViewer);
  }
  public void setPackagePresentation(String command, boolean update) {

    if (command.contains("flat")) {
      patternsTreeViewer.setContentProvider(flatCP);
      patternsTreeViewer.setLabelProvider(flatLP);
    } else {
      patternsTreeViewer.setContentProvider(hierarchicalCP);
      patternsTreeViewer.setLabelProvider(hierarchicalLP);
    }

    if (update) {
      patternsViewerInput.getGeneratedPatternsRoot().updateSelection(patternsTreeViewer);
      patternsViewerInput.getGenericPatternsRoot().updateSelection(patternsTreeViewer);
    }
  }