Initialize
[sdk/ide/product.git] / org.eclipse.jst.pagedesigner / src / org / eclipse / jst / pagedesigner / css2 / provider / ICSSWidgetProvider.java
1 /*******************************************************************************\r
2  * Copyright (c) 2006 Sybase, Inc. and others.\r
3  *\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     Sybase, Inc. - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.eclipse.jst.pagedesigner.css2.provider;\r
13 \r
14 import org.eclipse.draw2d.Graphics;\r
15 import org.eclipse.draw2d.geometry.Rectangle;\r
16 import org.eclipse.jst.pagedesigner.css2.ICSSStyle;\r
17 \r
18 /**\r
19  * @author mengbo\r
20  */\r
21 public interface ICSSWidgetProvider {\r
22         /**\r
23          * can be null\r
24          * \r
25          * @return the style\r
26          */\r
27         public ICSSStyle getCSSStyle();\r
28 \r
29         /**\r
30          * @return true if is handling border\r
31          */\r
32         public boolean isHandlingBorder();\r
33 \r
34         /**\r
35          * whether the parameter and return value includes border depends on the\r
36          * isHandlingBorder\r
37          * \r
38          * @param width\r
39          *            -1 means no suggested value\r
40          * @param height\r
41          *            -1 means no suggested value\r
42          * @return the dimension info\r
43          */\r
44         public DimensionInfo getPreferredDimension(int width, int height);\r
45 \r
46         /**\r
47          * if isHandlingBorder return false, then "rect" will be the rect without\r
48          * border, and this method should not paint border.\r
49          * \r
50          * If isHandlingBorder returns true, then "rect" include border, and this\r
51          * method should also paint its own border.\r
52          * @param g \r
53          * @param rect\r
54          */\r
55         public void paintFigure(Graphics g, Rectangle rect);\r
56 \r
57         /**\r
58          * @return true if is inline\r
59          */\r
60         public boolean isInline();\r
61 }\r