KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > model > provisional > TreeModelViewer


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.ui.viewers.model.provisional;
12
13 import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.ui.IMemento;
16
17 /**
18  * A tree viewer for a model.
19  * <p>
20  * Clients may instantiate this class. Clients may not subclass this class.
21  * </p>
22  * @since 3.3
23  */

24 public class TreeModelViewer extends InternalTreeModelViewer {
25
26     /**
27      * Constructs a new viewer.
28      *
29      * @param parent parent widget
30      * @param style viewer style bits
31      * @param context presentation context
32      */

33     public TreeModelViewer(Composite parent, int style, IPresentationContext context) {
34         super(parent, style, context);
35     }
36     
37     /**
38      * Returns this viewer's presentation context.
39      *
40      * @return presentation context
41      */

42     public IPresentationContext getPresentationContext() {
43         return super.getPresentationContext();
44     }
45
46     /**
47      * Registers the given listener for model delta notification.
48      *
49      * @param listener model delta listener
50      */

51     public void addModelChangedListener(IModelChangedListener listener) {
52         super.addModelChangedListener(listener);
53     }
54     
55     /**
56      * Unregisters the given listener from model delta notification.
57      *
58      * @param listener model delta listener
59      */

60     public void removeModelChangedListener(IModelChangedListener listener) {
61         super.removeModelChangedListener(listener);
62     }
63     
64     /**
65      * Registers the specified listener for view update notifications.
66      *
67      * @param listener listener
68      */

69     public void addViewerUpdateListener(IViewerUpdateListener listener) {
70         super.addViewerUpdateListener(listener);
71     }
72     
73     /**
74      * Removes the specified listener from update notifications.
75      *
76      * @param listener listener
77      */

78     public void removeViewerUpdateListener(IViewerUpdateListener listener) {
79         super.removeViewerUpdateListener(listener);
80     }
81         
82     /**
83      * Returns whether columns can be toggled on/off for this viewer's current
84      * input element.
85      *
86      * @return whether columns can be toggled on/off
87      */

88     public boolean canToggleColumns() {
89         return super.canToggleColumns();
90     }
91     
92     /**
93      * Returns the current column presentation for this viewer, or <code>null</code>
94      * if none.
95      *
96      * @return column presentation or <code>null</code>
97      */

98     public IColumnPresentation getColumnPresentation() {
99         return super.getColumnPresentation();
100     }
101     
102     /**
103      * Returns identifiers of the visible columns in this viewer, or <code>null</code>
104      * if there are currently no columns.
105      *
106      * @return visible columns identifiers or <code>null</code>
107      */

108     public String JavaDoc[] getVisibleColumns() {
109         return super.getVisibleColumns();
110     }
111     
112     /**
113      * Initializes viewer state from the memento
114      *
115      * @param memento
116      */

117     public void initState(IMemento memento) {
118         super.initState(memento);
119     }
120     
121     /**
122      * Save viewer state into the given memento.
123      *
124      * @param memento
125      */

126     public void saveState(IMemento memento) {
127         super.saveState(memento);
128     }
129     
130     /**
131      * Returns whether columns are being displayed currently.
132      *
133      * @return
134      */

135     public boolean isShowColumns() {
136         return super.isShowColumns();
137     }
138     
139     /**
140      * Resets any persisted column size for the given columns
141      *
142      * @param columnIds array of column identifiers
143      */

144     public void resetColumnSizes(String JavaDoc[] columnIds) {
145         super.resetColumnSizes(columnIds);
146     }
147     
148     /**
149      * Toggles columns on/off for the current column presentation, if any.
150      *
151      * @param show whether to show columns if the current input supports
152      * columns
153      */

154     public void setShowColumns(boolean show) {
155         super.setShowColumns(show);
156     }
157     
158     /**
159      * Sets the visible columns for this viewer. Id's correspond to
160      * column identifiers from a column presentation. Use <code>null</code>
161      * or an empty collection to display default columns for the current
162      * column presentation. Only effects the current column presentation.
163      *
164      * @param ids column identifiers or <code>null</code>
165      */

166     public void setVisibleColumns(String JavaDoc[] ids) {
167         super.setVisibleColumns(ids);
168     }
169 }
170
Popular Tags