KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > progress > SubTaskInfo


1 /*******************************************************************************
2  * Copyright (c) 2003, 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.ui.internal.progress;
12
13 /**
14  * SubTaskInfo is the class that displays a subtask in the
15  * tree.
16  */

17 class SubTaskInfo extends JobTreeElement {
18
19     protected String JavaDoc taskName;
20
21     JobInfo jobInfo;
22
23     /**
24      * Create a new instance of the receiver.
25      * @param parentJob
26      * @param name
27      */

28     SubTaskInfo(JobInfo parentJob, String JavaDoc name) {
29         taskName = name;
30         jobInfo = parentJob;
31     }
32
33     /* (non-Javadoc)
34      * @see org.eclipse.ui.internal.progress.JobTreeElement#getChildren()
35      */

36     Object JavaDoc[] getChildren() {
37         return ProgressManagerUtil.EMPTY_OBJECT_ARRAY;
38     }
39
40     /* (non-Javadoc)
41      * @see org.eclipse.ui.internal.progress.JobTreeElement#getDisplayString()
42      */

43     String JavaDoc getDisplayString() {
44         if (taskName == null) {
45             return ProgressMessages.SubTaskInfo_UndefinedTaskName;
46         }
47         return taskName;
48     }
49
50     /* (non-Javadoc)
51      * @see org.eclipse.ui.internal.progress.JobTreeElement#hasChildren()
52      */

53     boolean hasChildren() {
54         return false;
55     }
56
57     /**
58      * Set the taskName of the receiver.
59      * @param taskName
60      */

61     void setTaskName(String JavaDoc name) {
62         this.taskName = name;
63     }
64
65     /**
66      * Returns the taskName of the receiver.
67      */

68     String JavaDoc getTaskName() {
69         return taskName;
70     }
71
72     /* (non-Javadoc)
73      * @see org.eclipse.ui.internal.progress.JobTreeElement#getParent()
74      */

75     Object JavaDoc getParent() {
76         return jobInfo;
77     }
78
79     /* (non-Javadoc)
80      * @see org.eclipse.ui.internal.progress.JobTreeElement#isJobInfo()
81      */

82     boolean isJobInfo() {
83         return false;
84     }
85
86     /* (non-Javadoc)
87      * @see org.eclipse.ui.internal.progress.JobTreeElement#isActive()
88      */

89     boolean isActive() {
90         return jobInfo.isActive();
91     }
92 }
93
Popular Tags