Mercurial > projects > dwt-addons
annotate dwtx/jface/viewers/IDecoration.d @ 90:7ffeace6c47f
Update 3.4M7 to 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 06 Jul 2008 23:30:07 +0200 |
parents | 46a6e0e6ccd4 |
children |
rev | line source |
---|---|
10 | 1 /******************************************************************************* |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
10 | 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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.viewers.IDecoration; | |
14 | |
15 import dwtx.jface.viewers.IDecorationContext; | |
16 | |
17 import dwt.graphics.Color; | |
18 import dwt.graphics.Font; | |
19 import dwtx.jface.resource.ImageDescriptor; | |
20 | |
21 import dwt.dwthelper.utils; | |
22 | |
23 /** | |
24 * Defines the result of decorating an element. | |
25 * | |
26 * This interface is not meant to be implemented and will be provided to | |
27 * instances of <code>ILightweightLabelDecorator</code>. | |
90 | 28 * @noimplement This interface is not intended to be implemented by clients. |
10 | 29 */ |
30 public interface IDecoration{ | |
31 | |
32 /** | |
33 * Constants for placement of image decorations. | |
34 */ | |
35 public static const int TOP_LEFT = 0; | |
36 | |
37 /** | |
38 * Constant for the top right quadrant. | |
39 */ | |
40 public static const int TOP_RIGHT = 1; | |
41 | |
42 /** | |
43 * Constant for the bottom left quadrant. | |
44 */ | |
45 public static const int BOTTOM_LEFT = 2; | |
46 | |
47 /** | |
48 * Constant for the bottom right quadrant. | |
49 */ | |
50 public static const int BOTTOM_RIGHT = 3; | |
51 | |
52 /** | |
53 * Constant for the underlay. | |
54 */ | |
55 public static const int UNDERLAY = 4; | |
56 | |
57 /** | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
58 * Constant for replacing the original image. Note that for this to have an |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
59 * effect on the resulting decorated image, {@link #ENABLE_REPLACE} has to |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
60 * be set to {@link Boolean#TRUE} in the {@link IDecorationContext} (opt-in |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
61 * model). If replacement behavior is enabled, the resulting decorated image |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
62 * will be constructed by first painting the underlay, then the replacement |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
63 * image, and then the regular quadrant images. |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
64 * |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
65 * @since 3.4 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
66 */ |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
67 public static final int REPLACE = 5; |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
68 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
69 /** |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
70 * Constant that is used as the property key on an |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
71 * {@link IDecorationContext}. To enable image replacement, set to |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
72 * {@link Boolean#TRUE}. |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
73 * |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
74 * @since 3.4 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
75 * @see IDecorationContext |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
76 */ |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
77 public static final String ENABLE_REPLACE = "dwtx.jface.viewers.IDecoration.disableReplace"; //$NON-NLS-1$ |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
78 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
79 /** |
10 | 80 * Adds a prefix to the element's label. |
81 * | |
82 * @param prefix | |
83 * the prefix | |
84 */ | |
85 public void addPrefix(String prefix); | |
86 | |
87 /** | |
88 * Adds a suffix to the element's label. | |
89 * | |
90 * @param suffix | |
91 * the suffix | |
92 */ | |
93 public void addSuffix(String suffix); | |
94 | |
95 /** | |
96 * Adds an overlay to the element's image. | |
97 * | |
98 * @param overlay | |
99 * the overlay image descriptor | |
100 */ | |
101 public void addOverlay(ImageDescriptor overlay); | |
102 | |
103 /** | |
104 * Adds an overlay to the element's image. | |
105 * | |
106 * @param overlay | |
107 * the overlay image descriptor | |
108 * @param quadrant | |
109 * The constant for the quadrant to draw the image on. | |
110 */ | |
111 public void addOverlay(ImageDescriptor overlay, int quadrant); | |
112 | |
113 /** | |
114 * Set the foreground color for this decoration. | |
115 * @param color the color to be set for the foreground | |
116 * | |
117 * @since 3.1 | |
118 */ | |
119 public void setForegroundColor(Color color); | |
120 | |
121 /** | |
122 * Set the background color for this decoration. | |
123 * @param color the color to be set for the background | |
124 * | |
125 * @since 3.1 | |
126 */ | |
127 public void setBackgroundColor(Color color); | |
128 | |
129 /** | |
130 * Set the font for this decoration. | |
131 * @param font the font to use in this decoration | |
132 * | |
133 * @since 3.1 | |
134 */ | |
135 public void setFont(Font font); | |
136 | |
137 /** | |
138 * Return the decoration context in which this decoration | |
139 * will be applied. | |
140 * @return the decoration context | |
141 * | |
142 * @since 3.2 | |
143 */ | |
144 public IDecorationContext getDecorationContext(); | |
145 } |