01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
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: * MyGWT - derived implementation
10: *******************************************************************************/package net.mygwt.ui.client.viewer;
11:
12: /**
13: * Defines common methods for tree based viewers.
14: *
15: * @see TreeViewer
16: * @see TreeTableViewer
17: */
18: public interface ITreeViewer {
19:
20: /**
21: * Adds the given child element to this viewer as a child of the given parent
22: * element.
23: *
24: * @param parent the parent element
25: * @param child the child element
26: */
27: public void add(Object parent, Object child);
28:
29: /**
30: * Inserts the given element as a new child element of the given parent
31: * element at the given position.
32: *
33: * @param parent the parent element
34: * @param child the child element
35: * @param position the insert position
36: */
37: public void insert(Object parent, Object child, int position);
38:
39: /**
40: * Refreshes this viewer completely with information freshly obtained from
41: * this viewer's model.
42: */
43: public void refresh();
44:
45: /**
46: * Removes the given element from the viewer.
47: *
48: * @param element the element to be removed
49: */
50: public void remove(Object element);
51:
52: /**
53: * Refreshes labels with information from the viewer's label provider.
54: */
55: public void update();
56:
57: /**
58: * Refreshes labels with information from the viewer's label provider.
59: *
60: * @param elem the element to be updated
61: */
62: public void update(Object elem);
63: }
|