My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package org.javabuilders.swt;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;

import org.eclipse.swt.widgets.Widget;
import org.javabuilders.BuildException;
import org.javabuilders.BuildResult;
import org.javabuilders.Builder;

public class SWTBuilder {

public static final String MARGIN_BOTTOM = "marginBottom";
public static final String MARGIN_HEIGHT = "marginHeight";
public static final String MARGIN_WIDTH = "marginWidth";
public static final String MARGIN_TOP = "marginTop";
public static final String MARGIN_LEFT = "marginLeft";
public static final String MARGIN_RIGHT = "marginRight";
public static final String SPACING = "spacing";
public static final String STYLE = "style";
public static final String TEXT = "text";

public static final String ON_SELECTION = "onSelection";

public static final String PARENT = "parent";

private static final SWTBuilderConfig config = new SWTBuilderConfig();

/**
* @return SWT builder config
*/
public static SWTBuilderConfig getConfig() {return config;}

/**
* Main SWT building method
* @param caller
* @param bundles
* @return
* @throws IOException
* @throws BuildException
*/
public static BuildResult build(Object caller, ResourceBundle...bundles) throws BuildException {
return Builder.build(getConfig(),caller, bundles);
}

/**
* Main SWT building method
* @param caller
* @param bundles
* @param Explicit parent (if required)
* @return
* @throws IOException
* @throws BuildException
*/
public static BuildResult build(Widget parent, Object caller, ResourceBundle...bundles) throws BuildException {
Map<String,Widget> map = new HashMap<String, Widget>();
map.put(SWTBuilder.PARENT, parent);
return Builder.build(getConfig(),caller, map, bundles);
}
}
Show details Hide details

Change log

r784 by jacek99 on Dec 16, 2008   Diff
Swing: further fixes to Actions,
SWT: ability to pass a specific parent to
object for creation, further fixes
Go to: 
Project members, sign in to write a code review

Older revisions

r762 by jacek99 on Dec 01, 2008   Diff
Iniital import
All revisions of this file

File info

Size: 1898 bytes, 62 lines

File properties

svn:executable
*
Hosted by Google Code