KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > markers > internal > TaskMarker


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.views.markers.internal;
12
13 import org.eclipse.core.resources.IMarker;
14
15 /**
16  * Represents a marker visible in the Tasks view. Additional members should be added
17  * to this class if new fields are added to the Tasks view. Such members should be
18  * initialized in the constructor, and accessed via get methods rather than accessing
19  * the IMarker instance directly. This is necessary to support sorting in a reasonable
20  * time bound.
21  */

22 public class TaskMarker extends ConcreteMarker {
23
24     private int priority;
25
26     private int done;
27
28     /**
29      * @param toCopy
30      */

31     public TaskMarker(IMarker toCopy) {
32         super(toCopy);
33     }
34
35     public void refresh() {
36         super.refresh();
37         priority = getMarker().getAttribute(IMarker.PRIORITY,
38                 IMarker.PRIORITY_NORMAL);
39         done = -1;
40         if (getMarker().getAttribute(IMarker.USER_EDITABLE, true)) {
41             done = 0;
42             if (getMarker().getAttribute(IMarker.DONE, false)) {
43                 done = 1;
44             }
45         }
46     }
47
48     public int getPriority() {
49         return priority;
50     }
51
52     public int getDone() {
53         return done;
54     }
55 }
56
Popular Tags