KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > LabelResult


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;
12
13 import org.eclipse.jface.viewers.TreePath;
14 import org.eclipse.swt.graphics.Image;
15
16
17 /**
18  * @since 3.2
19  *
20  */

21 class LabelResult extends LabelRequestMonitor implements ILabelResult {
22
23     public LabelResult(ModelNode node, AsynchronousModel model) {
24         super(node, model);
25     }
26     
27     protected synchronized void scheduleViewerUpdate(long ms) {
28         notifyAll();
29     }
30     
31     public synchronized boolean isDone() {
32         return super.isDone();
33     }
34     
35     /* (non-Javadoc)
36      * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getElement()
37      */

38     public Object JavaDoc getElement() {
39         return getNode().getElement();
40     }
41
42     /* (non-Javadoc)
43      * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getImages()
44      */

45     public Image[] getImages() {
46         return getModel().getViewer().getImages(getImageDescriptors());
47     }
48
49     /* (non-Javadoc)
50      * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getLabels()
51      */

52     public String JavaDoc[] getLabels() {
53         return super.getLabels();
54     }
55
56     /* (non-Javadoc)
57      * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getTreePath()
58      */

59     public TreePath getTreePath() {
60         return getNode().getTreePath();
61     }
62
63     /* (non-Javadoc)
64      * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getDepth()
65      */

66     public int getDepth() {
67         int level = 0;
68         ModelNode node = getNode().getParentNode();
69         while (node != null) {
70             node = node.getParentNode();
71             level++;
72         }
73         return level;
74     }
75
76     
77 }
78
Popular Tags