KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > viewers > IDecoration


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.viewers;
12
13 import org.eclipse.jface.resource.ImageDescriptor;
14 import org.eclipse.swt.graphics.Color;
15 import org.eclipse.swt.graphics.Font;
16
17 /**
18  * Defines the result of decorating an element.
19  *
20  * This interface is not meant to be implemented and will be provided to
21  * instances of <code>ILightweightLabelDecorator</code>.
22  */

23 public interface IDecoration{
24
25     /**
26      * Constants for placement of image decorations.
27      */

28     public static final int TOP_LEFT = 0;
29
30     /**
31      * Constant for the top right quadrant.
32      */

33     public static final int TOP_RIGHT = 1;
34
35     /**
36      * Constant for the bottom left quadrant.
37      */

38     public static final int BOTTOM_LEFT = 2;
39
40     /**
41      * Constant for the bottom right quadrant.
42      */

43     public static final int BOTTOM_RIGHT = 3;
44
45     /**
46      * Constant for the underlay.
47      */

48     public static final int UNDERLAY = 4;
49
50     /**
51      * Adds a prefix to the element's label.
52      *
53      * @param prefix
54      * the prefix
55      */

56     public void addPrefix(String JavaDoc prefix);
57
58     /**
59      * Adds a suffix to the element's label.
60      *
61      * @param suffix
62      * the suffix
63      */

64     public void addSuffix(String JavaDoc suffix);
65
66     /**
67      * Adds an overlay to the element's image.
68      *
69      * @param overlay
70      * the overlay image descriptor
71      */

72     public void addOverlay(ImageDescriptor overlay);
73
74     /**
75      * Adds an overlay to the element's image.
76      *
77      * @param overlay
78      * the overlay image descriptor
79      * @param quadrant
80      * The constant for the quadrant to draw the image on.
81      */

82     public void addOverlay(ImageDescriptor overlay, int quadrant);
83     
84     /**
85      * Set the foreground color for this decoration.
86      * @param color the color to be set for the foreground
87      *
88      * @since 3.1
89      */

90     public void setForegroundColor(Color color);
91     
92     /**
93      * Set the background color for this decoration.
94      * @param color the color to be set for the background
95      *
96      * @since 3.1
97      */

98     public void setBackgroundColor(Color color);
99     
100     /**
101      * Set the font for this decoration.
102      * @param font the font to use in this decoration
103      *
104      * @since 3.1
105      */

106     public void setFont(Font font);
107
108     /**
109      * Return the decoration context in which this decoration
110      * will be applied.
111      * @return the decoration context
112      *
113      * @since 3.2
114      */

115     public IDecorationContext getDecorationContext();
116 }
117
Popular Tags