01: /*******************************************************************************
02: * Copyright (c) 2007 MyGWT.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Darrell Meyer <darrell@mygwt.net> - initial API and implementation
10: *******************************************************************************/package net.mygwt.ui.client.viewer;
11:
12: import net.mygwt.ui.client.widget.tree.Tree;
13:
14: /**
15: * A <code>ViewerFilterTextBox</code> for trees.
16: */
17: public class TreeViewerFilterTextBox extends ViewerFilterTextBox {
18:
19: Tree tree;
20:
21: public void bind(TreeViewer viewer) {
22: super .bind(viewer);
23: this .tree = viewer.getTree();
24: }
25:
26: protected void onChange() {
27: super .onChange();
28: if (!getText().equals("")) {
29: tree.expandAll();
30: } else {
31: tree.collapseAll();
32: }
33: }
34:
35: }
|