Package com.google.devtools.depan.filters

Examples of com.google.devtools.depan.filters.PathMatcherTerm


    PathExpression pathExpressionModel = new PathExpression();
    RelationshipSetAdapter setAdapterFromPicker =
        new RelationshipSetAdapter(setName, getRelationShips(),
            SourcePluginRegistry.getRelations());
    pathExpressionModel.addPathMatcher(
        new PathMatcherTerm(setAdapterFromPicker, isRecursive, false));
    pathMatcherModel = pathExpressionModel;
  }
View Full Code Here


  // TODO(leeca): rename PathMatcher class to NodeSelector
  @Override
  public PathMatcher getNodeSelector() {
    PathExpression result = new PathExpression();
    for (int i = 0; i < pathMatchers.getTable().getItemCount(); i++) {
      PathMatcherTerm matchers =
          (PathMatcherTerm) pathMatchers.getElementAt(i);
      result.addPathMatcher(matchers);
    }
    return result;
  }
View Full Code Here

   *
   * @param direction SWT.UP or SWT.DOWN to represent up and down respectively.
   * @return True iff move is successful.
   */
  private boolean moveSelection(int direction) {
    PathMatcherTerm term = getSelection();

    int initialPosition = getElementIndex(term);
    if (initialPosition < 0) {
      return false;
    }
View Full Code Here

    RelationshipSetAdapter setAdapterFromPicker =
        new RelationshipSetAdapter(setName, finder,
            SourcePluginRegistry.getRelations());
    boolean isRecursive = recursive.getSelection();
    boolean isCumulative = cumulative.getSelection();
    PathMatcherTerm termToAppend =
        new PathMatcherTerm(setAdapterFromPicker, isRecursive, isCumulative);
    pathMatchers.add(termToAppend);
    Table matcherTable = pathMatchers.getTable();
    matcherTable.setSelection(matcherTable.getItemCount() - 1);
  }
View Full Code Here

   */
  public void createPathMatcherModel() {
    pathExpression = new PathExpression();
    PathExpression pathExpressionRef = (PathExpression) pathExpression;
    for (int i = 0; i < pathMatchers.getTable().getItemCount(); i++) {
      PathMatcherTerm matchers =
          (PathMatcherTerm) pathMatchers.getElementAt(i);
      pathExpressionRef.addPathMatcher(matchers);
    }
  }
View Full Code Here

     * @return Returns null for all cases.
     */
    @Override
    public Image getColumnImage(Object element, int columnIndex) {
      if (element instanceof PathMatcherTerm) {
        PathMatcherTerm tableEntry = ((PathMatcherTerm) element);
        switch (columnIndex) {
        case 0:
          return null;
        case 1:
          return Resources.getOnOff(tableEntry.isRecursive());
        case 2:
          return Resources.getOnOff(tableEntry.isCumulative());
        default:
          break;
        }
      }
      return null;
View Full Code Here

     * @return Text that is associated with this element for the given index.
     */
    @Override
    public String getColumnText(Object element, int columnIndex) {
      if (element instanceof PathMatcherTerm) {
        PathMatcherTerm item = (PathMatcherTerm) element;
        switch (columnIndex) {
        case 0:
          // return the displayName of the path matcher term, trim just in case
          return item.getDisplayName().trim();
        case 1:
          if (item.isRecursive()) {
            return RECURSIVE_LABEL;
          }
          return NON_RECURSIVE_LABEL;
        case 2:
          if (item.isCumulative()) {
            return CUMULATIVE_LABEL;
          }
          return NON_CUMULATIVE_LABEL;
        default:
          break;
View Full Code Here

     * @return the property value
     */
    @Override
    public Object getValue(Object element, String property) {
      if (element instanceof PathMatcherTerm) {
        PathMatcherTerm relation = ((PathMatcherTerm) element);
        if (property.equals(COL_RECURSIVE)) {
          return relation.isRecursive();
        } else if (property.equals(COL_CUMULATIVE)) {
          return relation.isCumulative();
        }
      }
      return null;
    }
View Full Code Here

      if (!(o instanceof PathMatcherTerm)) {
        return;
      }

      PathMatcherTerm relation = ((PathMatcherTerm) o);

      if (property.equals(COL_RECURSIVE)) {
        relation.setRecursive((Boolean) value);
      } else if (property.equals(COL_CUMULATIVE)) {
        relation.setCumulative((Boolean) value);
      }

      // update the column / line we just modified
      fireSelectionChange(o, new String[] {property});
    }
View Full Code Here

TOP

Related Classes of com.google.devtools.depan.filters.PathMatcherTerm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.