01: /*
02: * Created on May 30, 2004
03: */
04: package net.charabia.jsmoothgen.application.swtgui;
05:
06: import net.charabia.jsmoothgen.application.swtgui.resources.JSmoothResources;
07:
08: import org.eclipse.swt.SWT;
09: import org.eclipse.swt.layout.GridData;
10: import org.eclipse.swt.layout.GridLayout;
11: import org.eclipse.swt.widgets.Composite;
12: import org.eclipse.swt.widgets.Control;
13: import org.eclipse.swt.widgets.Display;
14: import org.eclipse.swt.widgets.Label;
15: import org.eclipse.ui.forms.HyperlinkGroup;
16: import org.eclipse.ui.forms.widgets.Form;
17: import org.eclipse.ui.forms.widgets.FormText;
18: import org.eclipse.ui.forms.widgets.FormToolkit;
19: import org.eclipse.ui.forms.widgets.TableWrapData;
20: import org.eclipse.ui.forms.widgets.TableWrapLayout;
21:
22: /**
23: * @author Dumon
24: */
25: public class WelcomePage extends JSmoothPage {
26:
27: public WelcomePage(JSmoothApplication js) {
28: super (js);
29: }
30:
31: public Control createPageArea(Composite parent) {
32: Display display = parent.getDisplay();
33:
34: Composite top = new Composite(parent, SWT.NONE);
35: GridLayout layout = new GridLayout();
36: layout.marginHeight = 0;
37: layout.marginWidth = 0;
38: top.setLayout(layout);
39:
40: FormToolkit kit = new FormToolkit(parent.getDisplay());
41: Form form = kit.createForm(top);
42: GridData grid = new GridData(GridData.FILL_BOTH);
43: grid.widthHint = 400;
44: form.setLayoutData(grid);
45: form.setText("Welcome to JSmooth !");
46: TableWrapLayout wraplayout = new TableWrapLayout();
47: form.getBody().setLayout(wraplayout);
48: HyperlinkGroup hypergroup = kit.getHyperlinkGroup();
49: hypergroup.setActiveForeground(display
50: .getSystemColor(SWT.COLOR_BLUE));
51: hypergroup
52: .setForeground(display.getSystemColor(SWT.COLOR_BLUE));
53: hypergroup
54: .setHyperlinkUnderlineMode(HyperlinkGroup.UNDERLINE_HOVER);
55:
56: Label label = kit.createSeparator(form.getBody(),
57: SWT.HORIZONTAL);
58: TableWrapData wrapgrid = new TableWrapData(
59: TableWrapData.FILL_GRAB);
60: label.setLayoutData(wrapgrid);
61:
62: FormText text = kit.createFormText(form.getBody(), true);
63: wrapgrid = new TableWrapData(TableWrapData.FILL);
64: text.setLayoutData(wrapgrid);
65: text.setText(JSmoothResources.TEXT_HELP_WELCOME, true, false);
66:
67: return top;
68: }
69:
70: public boolean apply() {
71: return false;
72: }
73:
74: protected void configureResources() {
75: setImage(JSmoothResources.IMG_SWITCHER_WELCOME);
76: setToolTip("Welcome");
77: }
78:
79: public void load() {
80: // Do nothing.
81: }
82:
83: }
|