-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathff
249 lines (230 loc) · 8.89 KB
/
ff
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
package mail;
import javax.swing.event.HyperlinkEvent;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import org.eclipse.ui.part.ViewPart;
public class View extends ViewPart {
public static final String ID = "mail.view";
Form form;
Composite parent;
/**
* The text control that's displaying the content of the email message.
*/
private Text messageText;
Composite sectionClient;
FormToolkit toolkit;
protected Control createContents2(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setBackground(SWTResourceManager.getColor(SWT.COLOR_RED));
container.setLayout(new FillLayout(SWT.VERTICAL));
{
Group grpTt = new Group(container, SWT.NONE);
grpTt.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
grpTt.setText("tt1");
grpTt.setLayout(new GridLayout(2, false));
{
Label label = new Label(grpTt, SWT.NONE);
label.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
label.setText("New Label");
text = new Text(grpTt, SWT.BORDER);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
}
}
{
Group grpTt_1 = new Group(container, SWT.NONE);
grpTt_1.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
grpTt_1.setText("tt2");
}
return container;
}
public void show(Composite parent)
{
parent.setLayout(new FillLayout(SWT.VERTICAL));
Group titleGroup = new Group(parent,SWT.NONE);
titleGroup.setText("title");
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 10;
GridLayout layout = new GridLayout();
titleGroup.setLayout(layout);
titleGroup.setLayoutData(gd);
Text name = new Text(titleGroup, SWT.MULTI | SWT.WRAP);
name.setText("function name");
name.setLayoutData(new GridData(GridData.FILL_BOTH));
Label label = new Label(titleGroup, SWT.NONE);
label.setText("a lebl");
label.setLayoutData(new GridData(GridData.FILL_BOTH));
Group titleGroup2 = new Group(parent,SWT.NONE);
titleGroup2.setText("title2");
GridData gd2 = new GridData(GridData.FILL_BOTH);
gd2.heightHint = 10;
GridLayout layout2 = new GridLayout();
titleGroup2.setLayout(layout2);
titleGroup2.setLayoutData(gd2);
Text name2 = new Text(titleGroup2, SWT.MULTI | SWT.WRAP);
name2.setText("function name2");
name2.setLayoutData(new GridData(GridData.FILL_BOTH));
}
public void createPartControl(Composite parent) {
show(parent);
// Composite top = new Composite(parent, SWT.NONE);
// GridLayout layout = new GridLayout();
// layout.marginHeight = 0;
// layout.marginWidth = 0;
// top.setLayout(layout);
//
// Composite banner2 = new Composite(top, SWT.NONE);
// //banner2.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
// banner2.setLayoutData(new GridData(GridData.FILL_BOTH));
// layout = new GridLayout();
// layout.marginHeight = 0;
// layout.marginWidth = 0;
// layout.numColumns = 2;
// banner2.setLayout(layout);
// Label label = new Label(banner2, SWT.SEPARATOR | SWT.HORIZONTAL);
// label.setLayoutData(new GridData(GridData.FILL_BOTH) );
//
// // top banner
// Composite banner = new Composite(top, SWT.NONE);
// banner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
// layout = new GridLayout();
// layout.marginHeight = 5;
// layout.marginWidth = 5;
// layout.numColumns = 2;
// banner.setLayout(layout);
//
// // setup bold font
// Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
//
// Label l = new Label(banner, SWT.NONE);
// l.setText("Subject:");
// l.setFont(boldFont);
// l.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
//
// l = new Label(banner, SWT.WRAP);
// l.setText("This is a message about the cool Eclipse RCP!");
// l.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false));
//
// l = new Label(banner, SWT.NONE);
// l.setText("From:");
// l.setFont(boldFont);
// l.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
//
// final Link link = new Link(banner, SWT.NONE);
// link.setText("<a>nicole@mail.org</a>");
// link.addSelectionListener(new SelectionAdapter() {
// public void widgetSelected(SelectionEvent e) {
// MessageDialog.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now.");
// }
// });
// link.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false));
//
// l = new Label(banner, SWT.NONE);
// l.setText("Date:");
// l.setFont(boldFont);
// l.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
//
// l = new Label(banner, SWT.WRAP);
// l.setText("10:34 am");
// l.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false));
//
//
//
//
// // message contents
// messageText = new Text(top, SWT.MULTI | SWT.WRAP);
// messageText.setText("This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"+
// "- add a top-level menu and toolbar with actions\n"+
// "- add keybindings to actions\n" +
// "- create views that can't be closed and\n"+
// " multiple instances of the same view\n"+
// "- perspectives with placeholders for new views\n"+
// "- use the default about dialog\n"+
// "- create a product definition\n");
// messageText.setLayoutData(new GridData(GridData.FILL_BOTH));
// this.parent = parent;
// toolkit = new FormToolkit(parent.getDisplay());
// form = toolkit.createForm(parent);
// form.setText("Hello, Eclipse Forms");
//
// TableWrapLayout layout = new TableWrapLayout();
// form.getBody().setLayout(layout);
// Hyperlink link = toolkit.createHyperlink(form.getBody(),"Click here.", SWT.WRAP);
// link.addHyperlinkListener(new HyperlinkAdapter() {
// public void linkActivated(HyperlinkEvent e) {
// System.out.println("Link activated!");
// }
// });
// link.setText("This is an example of a form that is much longer and will need to wrap.");
// layout.numColumns = 2;
// TableWrapData td = new TableWrapData();
// td.colspan = 2;
// link.setLayoutData(td);
//
//
// Section section = toolkit.createSection(form.getBody(),
// Section.DESCRIPTION|Section.TITLE_BAR|
// Section.TWISTIE|Section.EXPANDED);
// td = new TableWrapData(TableWrapData.FILL);
// td.colspan = 2;
// section.setLayoutData(td);
// section.addExpansionListener(new ExpansionAdapter() {
// public void expansionStateChanged(ExpansionEvent e) {
// form.layout();
// }
// });
// section.setText("Section title");
// section.setDescription("This is the description that goes "+
// "below the title");
// sectionClient = toolkit.createComposite(section);
// sectionClient.setLayout(new GridLayout());
// Text tt = toolkit.createText(sectionClient, "", SWT.WRAP |SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
// String text = "this is aaa test text.\n"
// + "this is aaa test text.this is aaa test text.this is aaa test text.this is aaa test text.\n"
// + "this is aaa test text.\n"
// + "this is aaa test text.\n";
// tt.setText(text);
// tt.setBackground(Display.getCurrent().getSystemColor (SWT.COLOR_YELLOW));
//
// tt.setForeground(Display.getCurrent().getSystemColor (SWT.COLOR_BLUE));
//
// section.setClient(sectionClient);
}
public void setFocus() {
//messageText.setFocus();
}
public void updateContent()
{
//form.setText("Hello, Eclipse Forms2");
//Button button = toolkit.createButton(sectionClient, "Radio 3", SWT.RADIO);
// form.dispose();
//
// form = toolkit.createForm(parent);
// form.setText("Hello, Eclipse Forms33");
// parent.layout();
//form = toolkit.createForm(parent);
}
}