1 2 3 4 | public void createPartControl(Composite parent) { ExampleEditLayout _layout = new ExampleEditLayout(parent,SWT.NONE,FieldMode.Read,new ExampleViewContentProvider()); } |
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 | public void createControls(int style) { GridData gridData; Text textFld, subjectFld; Control toLabel, ccLabel, bccLabel; Control fromDateTime; Control control; Button durationText; Button submit; GridLayout layout = new GridLayout(2, false); layout.marginWidth = 0; layout.marginHeight = 4; setLayout(layout); //Label gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); gridData.horizontalIndent = 10; LabelFactory.create(this, Messages.getString("ExampleEditLayout.Title"), gridData); //$NON-NLS-1$ gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); gridData.horizontalIndent = 40; LabelFactory.create(this, "", gridData); //Text gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); gridData.horizontalIndent = 10; control = LabelFactory.create(this, Messages.getString("ExampleEditLayout.Email"), gridData); //$NON-NLS-1$ gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER); gridData.horizontalIndent = 10; control = TextFactory.create(this, SWT.BORDER | SWT.V_SCROLL | SWT.WRAP, gridData, FieldMode.Edit); //$NON-NLS-1$ addField(new TextField(control, ExampleViewContentProvider.FIRST_INDEX)); //Combo gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); gridData.horizontalIndent = 10; LabelFactory.create(this, Messages.getString("ExampleEditLayout.Group"), gridData); //$NON-NLS-1$ gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER); gridData.horizontalIndent = 40; control = ComboFactory.create(this, FieldMode.Edit, false, gridData); //$NON-NLS-1$ addField(new ComboField(control, ExampleViewContentProvider.SECOND_INDEX)); ...} |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |