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: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.views.markers.internal;
11:
12: import org.eclipse.core.resources.IMarker;
13:
14: /**
15: * Represents a marker visible in the Tasks view. Additional members should be added
16: * to this class if new fields are added to the Tasks view. Such members should be
17: * initialized in the constructor, and accessed via get methods rather than accessing
18: * the IMarker instance directly. This is necessary to support sorting in a reasonable
19: * time bound.
20: */
21: public class TaskMarker extends ConcreteMarker {
22:
23: private int priority;
24:
25: private int done;
26:
27: /**
28: * @param toCopy
29: */
30: public TaskMarker(IMarker toCopy) {
31: super (toCopy);
32: }
33:
34: public void refresh() {
35: super .refresh();
36: priority = getMarker().getAttribute(IMarker.PRIORITY,
37: IMarker.PRIORITY_NORMAL);
38: done = -1;
39: if (getMarker().getAttribute(IMarker.USER_EDITABLE, true)) {
40: done = 0;
41: if (getMarker().getAttribute(IMarker.DONE, false)) {
42: done = 1;
43: }
44: }
45: }
46:
47: public int getPriority() {
48: return priority;
49: }
50:
51: public int getDone() {
52: return done;
53: }
54: }
|