Menu

[r3155]: / trunk / ch.sahits.codegen.java.gui / fragments / SWTGUI.java  Maximize  Restore  History

Download this file

584 lines (565 with data), 23.1 kB

  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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
import java.util.Iterator;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
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.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import ch.sahits.codegen.java.gui.util.EGUIGroup;
import ch.sahits.codegen.java.gui.util.SWTGUIHelper;
import ch.sahits.model.gui.IForm;
import ch.sahits.model.gui.IFormButton;
import ch.sahits.model.gui.IFormCheckbox;
import ch.sahits.model.gui.IFormCombo;
import ch.sahits.model.gui.IFormElement;
import ch.sahits.model.gui.IFormFileUpload;
import ch.sahits.model.gui.IFormGroup;
import ch.sahits.model.gui.IFormImageButton;
import ch.sahits.model.gui.IFormInput;
import ch.sahits.model.gui.IFormLabel;
import ch.sahits.model.gui.IFormList;
import ch.sahits.model.gui.IFormPasswordInput;
import ch.sahits.model.gui.IFormRadioButton;
import ch.sahits.model.gui.IFormResetButton;
import ch.sahits.model.gui.IFormSubmitButton;
import ch.sahits.model.internal.java.gui.Form;
public class SWTGUI {
private Display display = new Display();
private Shell shell = new Shell(display);
public SWTGUI(){
createControl(getShell());
}
/**
* Retrive the shell of this GUI element
* @return shell
*/
private Shell getShell(){
return shell;
}
/**
* Set the control up with the layout and the input fields
*/
private void createControl(Composite composite) {
Composite container = new Composite(composite, SWT.NULL);
container.setFont(composite.getFont());
GridLayout layout = new GridLayout();
container.setLayout(layout);
int nColumns = 2;
layout.numColumns = nColumns;
layout.verticalSpacing = 9;
IForm form = new Form();
SWTGUIHelper guiHelper = new SWTGUIHelper(form);
for (Iterator<IFormElement> iterator = form.elements().iterator(); iterator.hasNext();) {
IFormElement elem = (IFormElement) iterator.next();
if (elem instanceof IFormGroup){
IFormGroup group = (IFormGroup)elem;
if (guiHelper.isFormGroup(group)){
// process the different elements
EGUIGroup g = guiHelper.getGroupType(group);
switch (g){
case BUTTON:
case SUBMIT_BUTTON:{
IFormButton btn = (IFormButton) group.elements().get(1);
String name = guiHelper.toName(btn);
createButton(container, null, btn.getDefaultValue(), btn.getTooltip(), btn.isVisible(), btn.isEnabled());
break;
}
case CHECK_BOX:{
IFormGroup grp = (IFormGroup)group.elements().get(1);
IFormLabel lbl = (IFormLabel) group.elements().get(0);
String name1 = guiHelper.toName(lbl);
List<IFormElement> ch = grp.elements();
String[] name2 = new String[ch.size()];
for (int i = 0; i < name2.length; i++) {
name2[i]=guiHelper.toName(ch.get(i));
}
String[] tooltip = new String[ch.size()];
for (int i = 0; i < tooltip.length; i++) {
tooltip[i]=ch.get(i).getTooltip();
}
boolean[] visible = new boolean[ch.size()];
for (int i = 0; i < visible.length; i++) {
visible[i]=((IFormCheckbox)ch.get(i)).isVisible();
}
boolean[] editable = new boolean[ch.size()];
for (int i = 0; i < editable.length; i++) {
editable[i]=((IFormCheckbox)ch.get(i)).isEnabled();
}
boolean[] selected = new boolean[ch.size()];
for (int i = 0; i < selected.length; i++) {
selected[i]=((IFormCheckbox)ch.get(i)).isChecked();
}
createCheckBoxes(container, null, null, lbl.getText(), tooltip, visible, editable, selected);
break;
}
case COMBO:{
IFormLabel lbl = (IFormLabel) group.elements().get(0);
IFormCombo combo =(IFormCombo)group.elements().get(1);
String name1 = guiHelper.toName(lbl);
String name2 = guiHelper.toName(combo);
createCombo(container, null, null, lbl.getText(), lbl.isVisible(), combo.isVisible(), combo.isEnabled(), combo.getTooltip(), combo.getSelectedIndex(), combo.elements());
break;
}
case FILE_BROWSE:{
IFormLabel lbl = (IFormLabel) group.elements().get(0);
IFormFileUpload txt =(IFormFileUpload)group.elements().get(1);
String name1 = guiHelper.toName(lbl);
String name2 = guiHelper.toName(txt);
String name3 = guiHelper.getBrowseButtonName(txt);
createFileBrowse(container, null, null, null, lbl.getText(), lbl.isVisible(), txt.isVisible(), txt.isEnabled(), txt.getTooltip(), txt.getDefaultValue(), txt.getButtonText(), txt.acceptedTypes().toArray(new String[txt.acceptedTypes().size()]));
break;
}
case IMAGE_BUTTON:{
IFormImageButton btn = (IFormImageButton) group.elements().get(1);
String name = guiHelper.toName(btn);
createImageButton(container, null, btn.getImageSrc(), btn.getTooltip(), btn.isVisible(), btn.isEnabled());
break;
}
case INPUT:{
IFormLabel lbl = (IFormLabel) group.elements().get(0);
IFormInput txt =(IFormInput)group.elements().get(1);
String name1 = guiHelper.toName(lbl);
String name2 = guiHelper.toName(txt);
createInput(container, null, null, lbl.getText(), lbl.isVisible(), txt.isVisible(), txt.isEnabled(), txt.getTooltip(), txt.getDefaultValue());
break;
}
case LIST:{
IFormLabel lbl = (IFormLabel) group.elements().get(0);
IFormList list =(IFormList)group.elements().get(1);
String name1 = guiHelper.toName(lbl);
String name2 = guiHelper.toName(list);
createList(container, null, null, lbl.getText(), lbl.isVisible(), list.isVisible(), list.isEnabled(), list.getTooltip(), list.elements(), list.isMultiselect());
break;
}
case PASSWORD:{
IFormLabel lbl = (IFormLabel) group.elements().get(0);
IFormPasswordInput txt =(IFormPasswordInput)group.elements().get(1);
String name1 = guiHelper.toName(lbl);
String name2 = guiHelper.toName(txt);
createPassword(container, null, null, lbl.getText(), lbl.isVisible(), txt.isVisible(), txt.isEnabled(), txt.getTooltip(), txt.getDefaultValue());
break;
}
case RADIO_BUTTON:{
IFormGroup grp = (IFormGroup)group.elements().get(1);
IFormLabel lbl = (IFormLabel) group.elements().get(0);
String name1 = guiHelper.toName(lbl);
List<IFormElement> ch = grp.elements();
String[] name2 = new String[ch.size()];
for (int i = 0; i < name2.length; i++) {
name2[i]=guiHelper.toName(ch.get(i));
}
String[] tooltip = new String[ch.size()];
for (int i = 0; i < tooltip.length; i++) {
tooltip[i]=ch.get(i).getTooltip();
}
boolean[] visible = new boolean[ch.size()];
for (int i = 0; i < visible.length; i++) {
visible[i]=((IFormRadioButton)ch.get(i)).isVisible();
}
boolean[] editable = new boolean[ch.size()];
for (int i = 0; i < editable.length; i++) {
editable[i]=((IFormRadioButton)ch.get(i)).isEnabled();
}
boolean[] selected = new boolean[ch.size()];
for (int i = 0; i < selected.length; i++) {
selected[i]=((IFormRadioButton)ch.get(i)).isChecked();
}
String[] text = new String[ch.size()];
for (int i = 0; i < selected.length; i++) {
text[i]=((IFormRadioButton)ch.get(i)).getDefaultValue();
}
createRadioButtons(container, null, null, lbl.getText(), text, tooltip, visible, editable, selected);
break;
}
case RESET_BUTTON:{
IFormResetButton btn = (IFormResetButton) group.elements().get(1);
String name = guiHelper.toName(btn);
createResetButton(container, null, btn.getDefaultValue(), btn.getTooltip(), btn.isVisible(), btn.isEnabled());
break;
}
case TEXT:{
IFormLabel lbl = (IFormLabel) group.elements().get(0);
IFormInput txt =(IFormInput)group.elements().get(1);
String name1 = guiHelper.toName(lbl);
String name2 = guiHelper.toName(txt);
createTextArea(container, null, null, lbl.getText(), lbl.isVisible(), txt.isVisible(), txt.isEnabled(), txt.getTooltip(), txt.getDefaultValue());
break;
}
}
} // Is not a form group
} // the base element was not of type IFormGroup
}
}
/**
* Create a text input field with preceeding label
* @param parent container
* @param lbl Label field
* @param txt Text input field
* @param labelText text of the label
* @param lblVisibility is the label visible
* @param inputVisibility is the input field visible
* @param inputEditable ist the input field enabled and editibla
* @param inputTooltip tooltip of the input field may be null
* @param inputText text of the input field may be null
*/
private void createInput(Composite parent,Label lbl, Text txt,String labelText, boolean lblVisibility, boolean inputVisibility,boolean inputEditable,String inputTooltip,String inputText){
lbl = new Label(parent,SWT.NULL);
lbl.setText(labelText);
lbl.setVisible(lblVisibility);
txt = new Text(parent,SWT.BORDER | SWT.SINGLE);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
txt.setLayoutData(gd);
if (inputTooltip!=null)
txt.setToolTipText(inputTooltip);
txt.setVisible(inputVisibility);
txt.setEnabled(inputEditable);
txt.setEditable(inputEditable);
if (inputText!=null)
txt.setText(inputText);
}
/**
* Create a text input field with preceeding label
* @param parent container
* @param lbl Label field
* @param txt Text input field
* @param labelText text of the label
* @param lblVisibility is the label visible
* @param inputVisibility is the input field visible
* @param inputEditable ist the input field enabled and editibla
* @param inputTooltip tooltip of the input field may be null
* @param inputText text of the input field may be null
*/
private void createPassword(Composite parent,Label lbl, Text txt,String labelText, boolean lblVisibility, boolean inputVisibility,boolean inputEditable,String inputTooltip,String inputText){
lbl = new Label(parent,SWT.NULL);
lbl.setText(labelText);
lbl.setVisible(lblVisibility);
txt = new Text(parent,SWT.BORDER | SWT.PASSWORD);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
txt.setLayoutData(gd);
if (inputTooltip!=null)
txt.setToolTipText(inputTooltip);
txt.setVisible(inputVisibility);
txt.setEnabled(inputEditable);
txt.setEditable(inputEditable);
if (inputText!=null)
txt.setText(inputText);
}
/**
* Create a button
* @param parent container
* @param btn Button
* @param btnText button text
* @param tooltip button tooltip
* @param visible is the button visible
* @param editable is the button cklickable
*/
private void createButton(Composite parent,Button btn,String btnText,String tooltip,boolean visible,boolean editable) {
btn = new Button(parent,SWT.PUSH);
btn.setText(btnText);
btn.setToolTipText(tooltip);
btn.setEnabled(editable);
btn.setVisible(visible);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// TODO: implement the SelectionEvent
}
});
}
/**
* Create a reset buttonbutton
* @param parent container
* @param btn Button
* @param btnText button text
* @param tooltip button tooltip
* @param visible is the button visible
* @param editable is the button cklickable
*/
private void createResetButton(Composite parent,Button btn,String btnText,String tooltip,boolean visible,boolean editable) {
btn = new Button(parent,SWT.PUSH);
btn.setText(btnText);
btn.setToolTipText(tooltip);
btn.setEnabled(editable);
btn.setVisible(visible);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// set the default data
}
});
}
/**
* Create a button
* @param parent container
* @param btn Button
* @param imageSrc button image
* @param tooltip button tooltip
* @param visible is the button visible
* @param editable is the button cklickable
*/
private void createImageButton(Composite parent,Button btn,String imageSrc,String tooltip,boolean visible,boolean editable) {
btn = new Button(parent,SWT.PUSH);
Image image = new Image(parent.getDisplay(),imageSrc);
btn.setImage(image);
btn.setToolTipText(tooltip);
btn.setEnabled(editable);
btn.setVisible(visible);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// TODO: implement the SelectionEvent
}
});
}
/**
* Create checkboxes
* @param parent container
* @param lbl Label field
* @param btn Array of Button fields
* @param lblText Label text
* @param text Array of texts of the buttons
* @param tooltip Array of tooltips of the buttons
* @param visible Array of the buttons visibility
* @param editable Array of the buttons editability
* @param selected Array of the buttons selectedness
*/
private void createCheckBoxes(Composite parent,Label lbl,Button[] btn,String lblText, String[] tooltip, boolean[] visible, boolean[] editable,boolean[] selected) {
Composite cont = new Composite(parent,SWT.NULL);
FillLayout fl = new FillLayout(SWT.HORIZONTAL);
cont.setLayout(fl);
lbl = new Label(parent,SWT.NULL);
lbl.setText(lblText);
lbl.setVisible(visible[0]);
for (int i = 0; i < selected.length; i++) {
createCheckbox(cont,btn[i],tooltip[i],visible[i],editable[i],selected[i]);
}
}
/**
* Create a checkbox
* @param parent container
* @param btn Button field
* @param tooltip of the button
* @param visible is the button visible
* @param editable is the button editable
* @param selected is the button selected
*/
private void createCheckbox(Composite parent,Button btn, String tooltip, boolean visible, boolean editable,boolean selected){
btn = new Button(parent,SWT.CHECK);
btn.setToolTipText(tooltip);
btn.setVisible(visible);
btn.setEnabled(editable);
btn.setSelection(selected);
btn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// TODO Implement SelectionEvent
}
});
}
/**
* Create radio Buttons
* @param parent container
* @param lbl Label field
* @param btn Array of Button fields
* @param lblText label text
* @param text Array of texts of the buttons
* @param tooltip Array of tooltips of the buttons
* @param visible Array of the buttons visibility
* @param editable Array of the buttons editability
* @param selected Array of the buttons selectedness
*/
private void createRadioButtons(Composite parent,Label lbl, Button[] btn,String lblText,String[] text, String[] tooltip, boolean[] visible, boolean[] editable,boolean[] selected) {
Composite cont = new Composite(parent,SWT.NULL);
FillLayout fl = new FillLayout(SWT.HORIZONTAL);
cont.setLayout(fl);
lbl = new Label(parent,SWT.NULL);
lbl.setText(lblText);
lbl.setVisible(visible[0]);
for (int i = 0; i < selected.length; i++) {
createRadioButton(cont,btn[i],text[i],tooltip[i],visible[i],editable[i],selected[i]);
}
}
/**
* Create a radio Button
* @param parent container
* @param btn Button field
* @param text Text of the button
* @param tooltip of the button
* @param visible is the button visible
* @param editable is the button editable
* @param selected is the button selected
*/
private void createRadioButton(Composite parent,Button btn,String text, String tooltip, boolean visible, boolean editable,boolean selected){
btn = new Button(parent,SWT.RADIO);
btn.setText(text);
btn.setToolTipText(tooltip);
btn.setVisible(visible);
btn.setEnabled(editable);
btn.setSelection(selected);
btn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// TODO Implement SelectionEvent
}
});
}
/**
* Create a text input field with preceeding label
* @param parent container
* @param lbl Label field
* @param list Combo field
* @param labelText text of the label
* @param lblVisibility is the label visible
* @param inputVisibility is the input field visible
* @param inputEditable ist the input field enabled and editibla
* @param tooltip tooltip of the input field may be null
* @param defaultSelection index of the default selection
* @param elements List of all elements
*/
private void createCombo(Composite parent,Label lbl, Combo combo,String labelText, boolean lblVisibility, boolean inputVisibility,boolean inputEditable,String tooltip, int defaultSelection,List<String> elements) {
lbl = new Label(parent,SWT.NULL);
lbl.setText(labelText);
lbl.setVisible(lblVisibility);
combo = new Combo(parent,SWT.DROP_DOWN);
combo.setVisible(inputVisibility);
combo.setEnabled(inputEditable);
combo.setToolTipText(tooltip);
for (Iterator<String> iterator = elements.iterator(); iterator.hasNext();) {
String type = (String) iterator.next();
combo.add(type);
}
combo.select(defaultSelection);
combo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// TODO: implement SelectionEvent
}
});
}
/**
* Create a text input field with preceeding label
* @param parent container
* @param lbl Label field
* @param list txt Input field
* @param btn Browse button
* @param labelText text of the label
* @param lblVisibility is the label visible
* @param inputVisibility is the input field visible
* @param inputEditable ist the input field enabled and editibla
* @param inputTooltip tooltip of the input field may be null
* @param inputText text of the input field may be null
*/
private void createFileBrowse(Composite parent,Label lbl,final Text txt, Button btn,String labelText, boolean lblVisibility, boolean inputVisibility,boolean inputEditable,String inputTooltip,String inputText,String btnText,final String[] fileTypes){
lbl = new Label(parent,SWT.NULL);
lbl.setText(labelText);
lbl.setVisible(lblVisibility);
Composite cont = new Composite(parent,SWT.NULL);
FillLayout fl = new FillLayout(SWT.HORIZONTAL);
cont.setLayout(fl);
txt.setParent(cont);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
txt.setLayoutData(gd);
if (inputTooltip!=null)
txt.setToolTipText(inputTooltip);
txt.setVisible(inputVisibility);
txt.setEnabled(inputEditable);
txt.setEditable(inputEditable);
if (inputText!=null)
txt.setText(inputText);
btn = new Button(cont,SWT.PUSH);
btn.setText(btnText);
btn.setToolTipText(inputTooltip);
btn.setEnabled(inputEditable);
btn.setVisible(inputVisibility);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String selection = handleBroseFileSystem(fileTypes);
if (selection!=null){
txt.setText(selection);
}
}
});
}
/**
* Browse for the jet file
* @param filter Array of filters in the form of *.jpg
* @return selected file or null
*/
private String handleBroseFileSystem(String[] filter){
FileDialog dialog = new FileDialog(getShell(),SWT.OPEN);
dialog.setText("Browse file");
dialog.setFilterExtensions(filter);
dialog.setFilterNames(filter);
return dialog.open();
}
/**
* Create a text input field with preceeding label
* @param parent container
* @param lbl Label field
* @param list List field
* @param labelText text of the label
* @param lblVisibility is the label visible
* @param inputVisibility is the input field visible
* @param inputEditable ist the input field enabled and editibla
* @param tooltip tooltip of the input field may be null
* @param elements List of all elements
* @param multiselect selection of several elements allowed
*/
private void createList(Composite parent,Label lbl, org.eclipse.swt.widgets.List list,String labelText, boolean lblVisibility, boolean inputVisibility,boolean inputEditable,String tooltip,List<String> elements,boolean multiselect) {
lbl = new Label(parent,SWT.NULL);
lbl.setText(labelText);
lbl.setVisible(lblVisibility);
if (multiselect){
list = new org.eclipse.swt.widgets.List(parent,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
} else {
list = new org.eclipse.swt.widgets.List(parent,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
}
list.setVisible(inputVisibility);
list.setEnabled(inputEditable);
list.setToolTipText(tooltip);
for (Iterator<String> iterator = elements.iterator(); iterator.hasNext();) {
String type = (String) iterator.next();
list.add(type);
}
list.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// TODO: implement SelectionEvent
}
});
}
/**
* Create a text input field with preceeding label
* @param parent container
* @param lbl Label field
* @param txt Text input field
* @param labelText text of the label
* @param lblVisibility is the label visible
* @param inputVisibility is the input field visible
* @param inputEditable ist the input field enabled and editibla
* @param inputTooltip tooltip of the input field may be null
* @param inputText text of the input field may be null
*/
private void createTextArea(Composite parent,Label lbl, Text txt,String labelText, boolean lblVisibility, boolean inputVisibility,boolean inputEditable,String inputTooltip,String inputText){
lbl = new Label(parent,SWT.NULL);
lbl.setText(labelText);
lbl.setVisible(lblVisibility);
txt = new Text(parent,SWT.BORDER | SWT.WRAP| SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
txt.setLayoutData(gd);
if (inputTooltip!=null)
txt.setToolTipText(inputTooltip);
txt.setVisible(inputVisibility);
txt.setEnabled(inputEditable);
txt.setEditable(inputEditable);
if (inputText!=null)
txt.setText(inputText);
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.