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: * MyGWT - derived implementation
11: *******************************************************************************/package net.mygwt.ui.client.viewer;
12:
13: /**
14: * Provides the text and/or icon style for the label of a given element.
15: *
16: * <p>
17: * This code is based on JFace API from the Eclipse Project.
18: * </p>
19: */
20: public abstract class LabelProvider implements IBaseLabelProvider {
21:
22: /**
23: * Returns the text for the label of the given element.
24: *
25: * @param element the element for which to provide the label text
26: * @return the text string used to label the element, or <code>null</code>
27: * if there is no text label for the given object
28: */
29: public abstract String getText(Object element);
30:
31: /**
32: * Returns a list of CSS styles to be applied to the element's value.
33: *
34: * @param element the element for which to provide the styles
35: * @return the styles
36: */
37: public String getTextStyle(Object element) {
38: return null;
39: }
40:
41: /**
42: * Returns the icon style for the label of the given element. The style chould
43: * be a css class name with a background image specified.
44: *
45: * @param element the element for which to provide the label text
46: * @return the css class name
47: */
48: public String getIconStyle(Object element) {
49: return null;
50: }
51:
52: }
|