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:
15: /**
16: * MarkerPathField is the field for the paths column.
17: *
18: * @since 3.4
19: *
20: */
21: public class MarkerPathField extends MarkerField {
22:
23: /*
24: * (non-Javadoc)
25: *
26: * @see org.eclipse.ui.internal.provisional.views.markers.IMarkerField#compare(org.eclipse.ui.internal.provisional.views.markers.MarkerItem,
27: * org.eclipse.ui.internal.provisional.views.markers.MarkerItem)
28: */
29: public int compare(MarkerItem item1, MarkerItem item2) {
30: if (!(item1.isConcrete() && item2.isConcrete()))
31: return 0;
32:
33: return item1.getPath().compareTo(item2.getPath());
34: }
35:
36: /*
37: * (non-Javadoc)
38: *
39: * @see org.eclipse.ui.internal.provisional.views.markers.IMarkerField#getColumnWeight()
40: */
41: public float getColumnWeight() {
42: return 2;
43: }
44:
45: /*
46: * (non-Javadoc)
47: *
48: * @see org.eclipse.ui.internal.provisional.views.markers.IMarkerField#getValue(org.eclipse.ui.internal.provisional.views.markers.MarkerItem)
49: */
50: public String getValue(MarkerItem item) {
51: return item.getPath();
52: }
53:
54: }
|