001: /*******************************************************************************
002: * Copyright (c) 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: ******************************************************************************/package org.eclipse.ui.views.markers.internal;
011:
012: /**
013: * MarkerGroupingEntry is the configuration object for the markerGroupingEntry
014: * extension.
015: * @since 3.2
016: *
017: */
018: public class MarkerGroupingEntry {
019:
020: private MarkerGroup markerGroup;
021: private String label;
022: private String id;
023: private int sortPriority;
024:
025: /**
026: * Create a new instance of the receiver with name name and an id of
027: * identifier.
028: * @param name
029: * @param identifer
030: * @param priority
031: */
032: public MarkerGroupingEntry(String name, String identifer,
033: int priority) {
034: label = name;
035: id = identifer;
036: sortPriority = priority;
037: }
038:
039: /**
040: * Set the receiver as the default grouping entry for type markerType.
041: * @param markerType String
042: */
043: public void setAsDefault(String markerType) {
044: markerGroup.setAsDefault(markerType, this );
045:
046: }
047:
048: /**
049: * Map the attribute for the markerType to map to the receiver
050: * when it is equal to attributeValue.
051: * @param markerType
052: * @param attribute
053: * @param attributeValue
054: */
055: public void mapAttribute(String markerType, String attribute,
056: String attributeValue) {
057: markerGroup.mapAttribute(markerType, attribute, attributeValue,
058: this );
059:
060: }
061:
062: /**
063: * Return the id for the receiver.
064: * @return String
065: */
066: public String getId() {
067: return id;
068: }
069:
070: /**
071: * Set the group for the receiver.
072: * @param group
073: */
074: public void setGroupingEntry(MarkerGroup group) {
075: markerGroup = group;
076:
077: }
078:
079: /**
080: * Get the label of the receiver.
081: * @return String
082: */
083: public String getLabel() {
084: return label;
085: }
086:
087: /**
088: * Return the priority of the receiver.
089: * @return int
090: */
091: public int getPriority() {
092: return sortPriority;
093: }
094:
095: /**
096: * Return the marker group for the receiver.
097: * @return FieldMarkerGroup
098: */
099: public MarkerGroup getMarkerGroup() {
100: return markerGroup;
101: }
102:
103: }
|