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 | private Control buildUI(Composite parent) { Composite composite = new Composite(parent,SWT.NULL); RowLayout rowLayout = new RowLayout(); rowLayout.type = SWT.VERTICAL; rowLayout.wrap = false; composite.setLayout(rowLayout); hasNature = new Button(composite,SWT.CHECK); hasNature.setText(Resources.getString("eclipse.hasnature")); hasNature.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { group.setEnabled(hasNature.getSelection()); } public void widgetSelected(SelectionEvent e) { group.setEnabled(hasNature.getSelection()); } }); group = new Group(composite,SWT.NONE); group.setText(Resources.getString("eclipse.properties")); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; group.setLayout(gridLayout); Label label = new Label(group,SWT.RIGHT); label.setText(Resources.getString("eclipse.src")); srcText = new Text(group,SWT.SINGLE); GridData gridData = new GridData(); gridData.widthHint = 150; srcText.setLayoutData(gridData); label = new Label(group,SWT.RIGHT); label.setText(Resources.getString("eclipse.rules")); rulesText = new Text(group,SWT.LEFT); gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; rulesText.setLayoutData(gridData); label = new Label(group,SWT.RIGHT); label.setText(Resources.getString("eclipse.publish")); publishText = new Text(group,SWT.LEFT); gridData = new GridData(); publishText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); isBuild = new Button(group,SWT.CHECK); isBuild.setText(Resources.getString("eclipse.build")); gridData = new GridData(); gridData.horizontalSpan = 2; isBuild.setLayoutData(gridData); return composite; } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |