KickJava   Java API By Example, From Geeks To Geeks.

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


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
12 package org.eclipse.ui.views.markers.internal;
13
14
15 /**
16  * MarkerGroupingEntry is the configuration object for the markerGroupingEntry
17  * extension.
18  * @since 3.2
19  *
20  */

21 public class MarkerGroupingEntry {
22
23     private FieldMarkerGroup markerGroup;
24     private String JavaDoc label;
25     private String JavaDoc id;
26     private int sortPriority;
27
28     
29     /**
30      * Create a new instance of the receiver with name name and an id of
31      * identifier.
32      * @param name
33      * @param identifer
34      * @param priority
35      */

36     public MarkerGroupingEntry(String JavaDoc name, String JavaDoc identifer, int priority) {
37         label = name;
38         id = identifer;
39         sortPriority = priority;
40     }
41
42     /**
43      * Set the receiver as the default grouping entry for type markerType.
44      * @param markerType String
45      */

46     public void setAsDefault(String JavaDoc markerType) {
47         markerGroup.setAsDefault(markerType,this);
48         
49     }
50
51     /**
52      * Map the attribute for the markerType to map to the receiver
53      * when it is equal to attributeValue.
54      * @param markerType
55      * @param attribute
56      * @param attributeValue
57      */

58     public void mapAttribute(String JavaDoc markerType, String JavaDoc attribute, String JavaDoc attributeValue) {
59         markerGroup.mapAttribute(markerType,attribute,attributeValue,this);
60         
61     }
62
63     /**
64      * Return the id for the receiver.
65      * @return String
66      */

67     public String JavaDoc getId() {
68         return id;
69     }
70
71     /**
72      * Set the group for the receiver.
73      * @param group
74      */

75     public void setGroupingEntry(FieldMarkerGroup group) {
76         markerGroup = group;
77         
78     }
79
80     /**
81      * Get the label of the receiver.
82      * @return String
83      */

84     public String JavaDoc getLabel() {
85         return label;
86     }
87
88     /**
89      * Return the priority of the receiver.
90      * @return int
91      */

92     public int getPriority() {
93         return sortPriority;
94     }
95
96     /**
97      * Return the marker group for the receiver.
98      * @return FieldMarkerGroup
99      */

100     public FieldMarkerGroup getMarkerGroup() {
101         return markerGroup;
102     }
103
104 }
105
Popular Tags