コード例 #1
0
    @Override
    public void handleValueChange(ValueChangeEvent event) {
      Object value = event.getObservableValue().getValue();

      tableViewerUtil.clearTableViewerColumns(detailsTableViewer);
      clearTableViewer();

      if (value instanceof PatternMatcherContent) {
        PatternMatcherContent observableMatcher = (PatternMatcherContent) value;
        if (observableMatcher.getMatcher() != null) {
          tableViewerUtil.prepareFor(observableMatcher, detailsTableViewer);
          String patternFqn =
              observableMatcher.getMatcher().getSpecification().getFullyQualifiedName();
          IQuerySpecification<?> pattern =
              QueryExplorerPatternRegistry.getInstance().getPatternByFqn(patternFqn);
          List<PatternComponent> components = null;
          if (QueryExplorerPatternRegistry.getInstance().isGenerated(pattern)) {
            components = patternsViewerInput.getGeneratedPatternsRoot().find(patternFqn);
            components.add(0, patternsViewerInput.getGeneratedPatternsRoot());
          } else {
            components = patternsViewerInput.getGenericPatternsRoot().find(patternFqn);
            components.add(0, patternsViewerInput.getGenericPatternsRoot());
          }

          if (components != null) {
            patternsTreeViewer.setSelection(new TreeSelection(new TreePath(components.toArray())));
          }
        } else {
          clearTableViewer();
        }
      } else if (value instanceof PatternMatchContent) {
        PatternMatchContent match = (PatternMatchContent) value;
        tableViewerUtil.prepareFor(match, detailsTableViewer);
      }
    }
コード例 #2
0
 public void handleValueChange(ValueChangeEvent event) {
   this.value = event.getObservableValue().getValue();
 }