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.swt.graphics.Image;
13:
14: /**
15: * IField is the definition of fields for marker views.
16: *
17: */
18: public interface IField {
19:
20: /**
21: * @return String the description of the field.
22: */
23: String getDescription();
24:
25: /**
26: * @return the image associated with the description of the field or <code>null<code>.
27: */
28: Image getDescriptionImage();
29:
30: /**
31: * @return The text to be displayed in the column header for this field.
32: */
33: String getColumnHeaderText();
34:
35: /**
36: * @return The image to be displayed in the column header for this field or <code>null<code>.
37: */
38: Image getColumnHeaderImage();
39:
40: /**
41: * @param obj
42: * @return The String value of the object for this particular field to be displayed to the user.
43: */
44: String getValue(Object obj);
45:
46: /**
47: * @param obj
48: * @return The image value of the object for this particular field to be displayed to the user
49: * or <code>null<code>.
50: */
51: Image getImage(Object obj);
52:
53: /**
54: * @param obj1
55: * @param obj2
56: * @return Either:
57: * <li>a negative number if the value of obj1 is less than the value of obj2 for this field.
58: * <li><code>0</code> if the value of obj1 and the value of obj2 are equal for this field.
59: * <li>a positive number if the value of obj1 is greater than the value of obj2 for this field.
60: */
61: int compare(Object obj1, Object obj2);
62:
63: /**
64: * Get the default direction for the receiver. Return either
65: * {@link TableComparator#ASCENDING } or {@link TableComparator#DESCENDING }
66: * @return int
67: */
68: int getDefaultDirection();
69:
70: /**
71: * Get the preferred width of the receiver.
72: * @return int
73: */
74: int getPreferredWidth();
75:
76: /**
77: * Return whether not the receiver is showing.
78: * @return boolean
79: */
80: boolean isShowing();
81:
82: /**
83: * Set whether or not the receiver is showing.
84: * @param showing
85: */
86: void setShowing(boolean showing);
87:
88: }
|