01: /*******************************************************************************
02: * Copyright (c) 2007 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.internal.provisional.views.markers;
11:
12: import org.eclipse.ui.internal.provisional.views.markers.api.MarkerField;
13: import org.eclipse.ui.internal.provisional.views.markers.api.MarkerItem;
14: import org.eclipse.ui.internal.provisional.views.markers.api.MarkerSupportConstants;
15: import org.eclipse.ui.views.markers.MarkerViewUtil;
16:
17: /**
18: * MarkerResourceField is the field that specifies the resource column.
19: *
20: * @since 3.4
21: *
22: */
23: public class MarkerResourceField extends MarkerField {
24:
25: /*
26: * (non-Javadoc)
27: *
28: * @see org.eclipse.ui.provisional.views.markers.IMarkerField#getValue(org.eclipse.ui.provisional.views.markers.MarkerItem)
29: */
30: public String getValue(MarkerItem item) {
31: if (item.isConcrete()) {
32: return item.getAttributeValue(
33: MarkerViewUtil.NAME_ATTRIBUTE, item
34: .getConcreteRepresentative().getMarker()
35: .getResource().getName());
36: }
37: return MarkerSupportConstants.EMPTY_STRING;
38: }
39: }
|