private void addXslGroup(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(Messages.CoProc2LaunchConfigurationMainTab_StylesheetGroupName); GridLayout layout = new GridLayout(); layout.numColumns = 3; group.setLayout(layout); GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; group.setLayoutData(gd); Label label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_FileField + ':'); xslFileText = new Text(group, SWT.BORDER); gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.grabExcessHorizontalSpace = true; xslFileText.setLayoutData(gd); xslFileText.addModifyListener(modifyListener); browseXslButton = new Button(group, SWT.PUSH); browseXslButton.setText(Messages.CoProc2LaunchConfigurationMainTab_BrowseButton); browseXslButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { String[] extensions = new String[] {"*.xsl", "*.xslt"}; // $NON-NLS-1$ //$NON-NLS-2$ String fileName = browseForSourceFile(extensions); if (fileName != null) { xslFileText.setText(fileName); } } }); }
/** This method initializes keyWordGroup. */ private void createKeyWordGroup() { GridData keyWordTextGridData = new GridData(); keyWordTextGridData.grabExcessHorizontalSpace = true; keyWordTextGridData.verticalAlignment = GridData.CENTER; keyWordTextGridData.horizontalAlignment = GridData.FILL; GridData keyWordDescriptionLabelGridData = new GridData(); keyWordDescriptionLabelGridData.horizontalAlignment = GridData.FILL; keyWordDescriptionLabelGridData.grabExcessHorizontalSpace = false; keyWordDescriptionLabelGridData.grabExcessVerticalSpace = true; keyWordDescriptionLabelGridData.verticalAlignment = GridData.CENTER; GridLayout keyWordGroupGridLayout = new GridLayout(); keyWordGroupGridLayout.numColumns = 2; GridData keyWordGroupGridData = new GridData(); keyWordGroupGridData.horizontalAlignment = GridData.FILL; keyWordGroupGridData.grabExcessHorizontalSpace = true; keyWordGroupGridData.grabExcessVerticalSpace = true; keyWordGroupGridData.verticalAlignment = GridData.FILL; keyWordGroup = new Composite(substititionGroup, SWT.NONE); keyWordGroup.setLayoutData(keyWordGroupGridData); keyWordGroup.setLayout(keyWordGroupGridLayout); // keyWordGroup.setText(Messages.AdfgvxWizardPage_keyword); keyWordDescriptionLabel = new Label(keyWordGroup, SWT.NONE); keyWordDescriptionLabel.setText(Messages.AdfgvxWizardPage_enterkeyword); keyWordDescriptionLabel.setLayoutData(keyWordDescriptionLabelGridData); keyWordText = new Text(keyWordGroup, SWT.BORDER); keyWordText.setLayoutData(keyWordTextGridData); keyWordText.setToolTipText(Messages.AdfgvxWizardPage_substitutionHint); }
protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; composite.setLayout(gridLayout); Work work = (Work) getValue(); Label nameLabel = new Label(composite, SWT.NONE); nameLabel.setText("Name: "); Text nameText = new Text(composite, SWT.NONE); nameText.setEditable(false); GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.FILL; nameText.setLayoutData(gridData); String name = work.getName(); nameText.setText(name == null ? "" : name); Set<ParameterDefinition> parameters = workDefinition.getParameters(); for (ParameterDefinition param : parameters) { Label label = new Label(composite, SWT.NONE); label.setText(param.getName() + ": "); Text text = new Text(composite, SWT.NONE); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.FILL; text.setLayoutData(gridData); texts.put(param.getName(), text); Object value = work.getParameter(param.getName()); text.setText(value == null ? "" : value.toString()); } return composite; }
/** * Creates composite for project name. * * @param container */ private void createProjNameComposite(Composite container) { Composite containerProjName = new Composite(container, SWT.NONE); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; GridData gridData = new GridData(); gridData.horizontalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; containerProjName.setLayout(gridLayout); containerProjName.setLayoutData(gridData); Label lblProjName = new Label(containerProjName, SWT.LEFT); lblProjName.setText(Messages.wizPageProjName); textProjName = new Text(containerProjName, SWT.SINGLE | SWT.BORDER); gridData = new GridData(); gridData.widthHint = 330; gridData.horizontalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; textProjName.setLayoutData(gridData); textProjName.addModifyListener( new ModifyListener() { @Override public void modifyText(ModifyEvent event) { handleModifyText(event); } }); }
@Override protected void createButtonsForButtonBar(Composite parent) { configureButtonCompositeLayout(parent); GridData layoutData = new GridData(390, 130); layoutData.horizontalAlignment = SWT.CENTER; layoutData.verticalAlignment = SWT.TOP; layoutData.grabExcessHorizontalSpace = true; parent.setLayoutData(layoutData); layoutData = new GridData(); layoutData.widthHint = 70; layoutData.horizontalAlignment = SWT.RIGHT; layoutData.grabExcessHorizontalSpace = true; Button cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", false); cancelButton.setLayoutData(layoutData); layoutData = new GridData(); layoutData.widthHint = 70; layoutData.horizontalAlignment = SWT.LEFT; layoutData.grabExcessHorizontalSpace = true; okButton = createButton(parent, IDialogConstants.OK_ID, "&Login", true); okButton.setLayoutData(layoutData); setupDataBinding(); }
private Control createAdvancedConnectionPage(Composite parent) { Composite fieldComposite = new Composite(parent, SWT.BORDER); fieldComposite.setLayout(new GridLayout(2, false)); GridData data = new GridData(GridData.FILL_BOTH); // 0 - name Label nameLabel = new Label(fieldComposite, SWT.CENTER); nameLabel.setText(Messages.DefaultConnectionWizardPage_Name); advancedNameText = new Text(fieldComposite, SWT.BORDER); advancedNameText.setText(getNextName()); data = new GridData(GridData.FILL_HORIZONTAL); data.grabExcessHorizontalSpace = true; advancedNameText.setLayoutData(data); // 1 host label Label label = new Label(fieldComposite, SWT.CENTER); label.setText(Messages.DefaultConnectionWizardPage_JMX_URL); // 2 URL text entry urlText = new Text(fieldComposite, SWT.BORDER); urlText.setText("service:jmx:rmi:"); // $NON-NLS-1$ data = new GridData(GridData.FILL_HORIZONTAL); data.grabExcessHorizontalSpace = true; urlText.setLayoutData(data); // 3 user name label label = new Label(fieldComposite, SWT.CENTER); label.setText(Messages.DefaultConnectionWizardPage_Username); // 4 user name text entry advancedUserNameText = new Text(fieldComposite, SWT.BORDER); advancedUserNameText.setText(_BLANK_); data = new GridData(GridData.FILL_HORIZONTAL); data.grabExcessHorizontalSpace = true; advancedUserNameText.setLayoutData(data); // 5 password label label = new Label(fieldComposite, SWT.CENTER); label.setText(Messages.DefaultConnectionWizardPage_Password); // 6 user name text entry advancedPasswordText = new Text(fieldComposite, SWT.BORDER | SWT.PASSWORD); advancedPasswordText.setText(_BLANK_); data = new GridData(GridData.FILL_HORIZONTAL); data.grabExcessHorizontalSpace = true; advancedPasswordText.setLayoutData(data); if (initialConnection == null) { urlText.setText("service:jmx:rmi:"); // $NON-NLS-1$ advancedUserNameText.setText(_BLANK_); advancedPasswordText.setText(_BLANK_); } else { urlText.setText(initialConnection.getDescriptor().getURL()); userNameText.setText(initialConnection.getDescriptor().getUserName()); passwordText.setText(initialConnection.getDescriptor().getPassword()); } return fieldComposite; }
/** This method initializes parametersGroup */ private void createParametersGroup(Composite parent) { GridData gridData7 = new GridData(); gridData7.grabExcessHorizontalSpace = true; gridData7.verticalAlignment = GridData.FILL; gridData7.grabExcessVerticalSpace = true; gridData7.horizontalAlignment = GridData.FILL; GridData gridData6 = new GridData(); gridData6.horizontalAlignment = GridData.FILL; gridData6.grabExcessHorizontalSpace = true; gridData6.grabExcessVerticalSpace = true; gridData6.verticalAlignment = GridData.FILL; // GridData gridData8 = new GridData(); // gridData8.horizontalAlignment = GridData.FILL; // gridData8.grabExcessHorizontalSpace = true; // gridData8.grabExcessVerticalSpace = true; // gridData8.verticalAlignment = GridData.FILL; GridData gridData5 = new GridData(); gridData5.horizontalAlignment = GridData.FILL; gridData5.grabExcessHorizontalSpace = true; parametersGroup = new Group(parent, SWT.NONE); parametersGroup.setLayout(new GridLayout()); parametersGroup.setLayoutData(gridData5); parametersGroup.setText(Messages.AlgorithmIntroductionPage_1); defaultRadioButton = new Button(parametersGroup, SWT.RADIO); defaultRadioButton.setText(Messages.AlgorithmIntroductionPage_2); defaultRadioButton.setLayoutData(gridData6); // if (paramGenExists) { // generateRadioButton = new Button(parametersGroup, SWT.RADIO); // generateRadioButton.setText("Generate parameters"); // generateRadioButton.setLayoutData(gridData8); // } customRadioButton = new Button(parametersGroup, SWT.RADIO); customRadioButton.setText(Messages.AlgorithmIntroductionPage_3); customRadioButton.setLayoutData(gridData7); }
/** * 创建文件类型列表 * * @param title * @param composite * @return ; */ private ComboViewer createConvertControl(String title, Composite composite) { Label positiveConvertLabel = new Label(composite, SWT.NONE); GridData positiveConvertLabelData = new GridData(); positiveConvertLabelData.horizontalSpan = 2; positiveConvertLabelData.horizontalAlignment = SWT.CENTER; positiveConvertLabelData.grabExcessHorizontalSpace = true; positiveConvertLabel.setLayoutData(positiveConvertLabelData); positiveConvertLabel.setText(title); Label suportFormat = new Label(composite, SWT.NONE); suportFormat.setText("Suport Format"); ComboViewer supportList = new ComboViewer(composite, SWT.READ_ONLY); GridData gridData = new GridData(); gridData.horizontalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; supportList.getCombo().setLayoutData(gridData); supportList.addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection.isEmpty()) { okButton.setEnabled(false); } else { okButton.setEnabled(true); } } }); return supportList; }
/** * This method initializes hyperLinkShell. * * @wbp.parser.entryPoint */ protected void createHyperLinkShell() { GridData gridData9 = new GridData(); gridData9.grabExcessHorizontalSpace = true; gridData9.verticalAlignment = GridData.FILL; gridData9.horizontalSpan = 2; gridData9.horizontalAlignment = GridData.FILL; GridData gridData8 = new GridData(); gridData8.horizontalAlignment = GridData.FILL; gridData8.grabExcessHorizontalSpace = true; gridData8.horizontalSpan = 2; gridData8.verticalAlignment = GridData.FILL; GridLayout gridLayout2 = new GridLayout(); gridLayout2.numColumns = 14; gridLayout2.makeColumnsEqualWidth = true; // this line has to be commented in order to open with VISUAL EDITOR hyperLinkShell = new Shell(PlatformUI.getWorkbench().getDisplay().getActiveShell()); // hyperLinkShell = new Shell(); hyperLinkShell.setText(Messages.AbstractHyperLinkManagerShell_HyperLink); hyperLinkShell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); createCTabFolder(); hyperLinkShell.setLayout(gridLayout2); hyperLinkShell.setSize(new Point(687, 308)); OkButton = new Button(hyperLinkShell, SWT.NONE); OkButton.setText(Messages.AbstractHyperLinkManagerShell_OK); OkButton.setLayoutData(gridData9); cancelButton = new Button(hyperLinkShell, SWT.NONE); cancelButton.setText(Messages.AbstractHyperLinkManagerShell_Cancel); cancelButton.setLayoutData(gridData8); }
@Override public void createPartControl(Composite parent) { { GridLayout parentLayout = new GridLayout(); parentLayout.makeColumnsEqualWidth = true; parent.setLayout(parentLayout); parent.setSize(557, 321); { composite1 = new Composite(parent, SWT.NONE); GridLayout composite1Layout = new GridLayout(); composite1Layout.makeColumnsEqualWidth = true; GridData composite1LData = new GridData(); composite1LData.grabExcessHorizontalSpace = true; composite1LData.horizontalAlignment = GridData.FILL; composite1LData.verticalAlignment = GridData.FILL; composite1.setLayoutData(composite1LData); composite1.setLayout(composite1Layout); { statusLbl = new Label(composite1, SWT.NONE); GridData statusLblLData = new GridData(); statusLblLData.grabExcessHorizontalSpace = true; statusLblLData.horizontalAlignment = GridData.FILL; statusLbl.setLayoutData(statusLblLData); statusLbl.setText("sdfsdfsdf"); } } { group1 = new Group(parent, SWT.NONE); GridLayout group1Layout = new GridLayout(); group1Layout.makeColumnsEqualWidth = true; group1.setLayout(group1Layout); GridData group1LData = new GridData(); group1LData.verticalAlignment = GridData.FILL; group1LData.horizontalAlignment = GridData.FILL; group1LData.grabExcessHorizontalSpace = true; group1LData.grabExcessVerticalSpace = true; group1.setLayoutData(group1LData); group1.setText("Notes"); { notesTxt = new Text(group1, SWT.MULTI | SWT.WRAP | SWT.BORDER); GridData text1LData = new GridData(); text1LData.grabExcessHorizontalSpace = true; text1LData.horizontalAlignment = GridData.FILL; text1LData.verticalAlignment = GridData.FILL; text1LData.grabExcessVerticalSpace = true; notesTxt.setLayoutData(text1LData); } } { archiveBtn = new Button(parent, SWT.PUSH | SWT.CENTER); GridData button1LData = new GridData(); button1LData.horizontalAlignment = GridData.FILL; button1LData.grabExcessHorizontalSpace = true; archiveBtn.setLayoutData(button1LData); archiveBtn.setText("Archive"); } } new KController(this); }
/** This method initializes transpositionGroup */ private void createTranspositionGroup(Composite parent) { GridData transpositionKeyTextGridData = new GridData(); transpositionKeyTextGridData.horizontalAlignment = GridData.FILL; transpositionKeyTextGridData.grabExcessHorizontalSpace = true; transpositionKeyTextGridData.verticalAlignment = GridData.CENTER; GridData transpositionDescriptionLabelGridData = new GridData(); transpositionDescriptionLabelGridData.grabExcessHorizontalSpace = false; transpositionDescriptionLabelGridData.horizontalAlignment = GridData.BEGINNING; transpositionDescriptionLabelGridData.verticalAlignment = GridData.CENTER; transpositionDescriptionLabelGridData.grabExcessVerticalSpace = true; GridLayout transpositionGroupGridLayout = new GridLayout(); transpositionGroupGridLayout.numColumns = 2; GridData transpositionGroupGridData = new GridData(); transpositionGroupGridData.grabExcessHorizontalSpace = true; transpositionGroupGridData.horizontalAlignment = GridData.FILL; transpositionGroupGridData.verticalAlignment = GridData.FILL; transpositionGroupGridData.grabExcessVerticalSpace = true; transpositionGroup = new Group(parent, SWT.NONE); transpositionGroup.setLayoutData(transpositionGroupGridData); transpositionGroup.setLayout(transpositionGroupGridLayout); transpositionGroup.setText(Messages.AdfgvxWizardPage_step2); transpositionDescriptionLabel = new Label(transpositionGroup, SWT.NONE); transpositionDescriptionLabel.setText(Messages.AdfgvxWizardPage_enterTranspKey); transpositionDescriptionLabel.setLayoutData(transpositionDescriptionLabelGridData); transpositionKeyText = new Text(transpositionGroup, SWT.BORDER); transpositionKeyText.setLayoutData(transpositionKeyTextGridData); transpositionKeyText.setToolTipText(Messages.AdfgvxWizardPage_transpositionHint); }
private void initGUI() { radioGroup = new Listener() { @Override public void handleEvent(Event event) { Button b = (Button) event.widget; if (b.getSelection() == false) { b.setSelection(true); } else { if (event.widget == btnColumnar) { btnRowwise.setSelection(!btnColumnar.getSelection()); } else { btnColumnar.setSelection(!btnRowwise.getSelection()); } input.synchronizeWithUserSide(); } } }; try { GridLayout thisLayout = new GridLayout(); thisLayout.marginWidth = 0; thisLayout.marginHeight = 0; thisLayout.numColumns = 2; thisLayout.horizontalSpacing = 0; thisLayout.makeColumnsEqualWidth = true; this.setLayout(thisLayout); { btnColumnar = new Button(this, SWT.TOGGLE | SWT.FLAT | SWT.CENTER); GridData btnColumnarLData = new GridData(); btnColumnarLData.grabExcessHorizontalSpace = true; btnColumnarLData.horizontalAlignment = GridData.FILL; btnColumnarLData.verticalAlignment = GridData.FILL; btnColumnarLData.heightHint = HEIGHT_NORMAL; if (flat) btnColumnarLData.heightHint = HEIGHT_FLAT; btnColumnar.setLayoutData(btnColumnarLData); btnColumnar.setText(Messages.ReadDirectionChooser_0); btnColumnar.addListener(SWT.Selection, radioGroup); } { btnRowwise = new Button(this, SWT.TOGGLE | SWT.FLAT | SWT.CENTER); GridData btnRowwiseLData = new GridData(); btnRowwiseLData.grabExcessHorizontalSpace = true; btnRowwiseLData.horizontalAlignment = GridData.FILL; btnRowwiseLData.verticalAlignment = GridData.FILL; btnRowwiseLData.heightHint = HEIGHT_NORMAL; if (flat) btnRowwiseLData.heightHint = HEIGHT_FLAT; btnRowwise.setLayoutData(btnRowwiseLData); btnRowwise.setText(Messages.ReadDirectionChooser_1); btnRowwise.addListener(SWT.Selection, radioGroup); } this.layout(); } catch (Exception e) { LogUtil.logError(e); } initInput(); }
private void createDestinationGroup(Composite parent) { GridData gd; Font font = parent.getFont(); // destination specification group Composite destinationSelectionGroup = new Composite(parent, SWT.NONE); destinationSelectionGroup.setLayout(new GridLayout(2, false)); destinationSelectionGroup.setLayoutData( new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); destinationSelectionGroup.setFont(font); Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE); destinationLabel.setText(Messages.TeamProjectIndexExportWizardPage_destinationLabel); destinationLabel.setFont(font); destinationLabel.setLayoutData(gd = new GridData()); gd.horizontalSpan = 2; // destination name entry field fDestinationField = new Text(destinationSelectionGroup, SWT.BORDER); fDestinationField.addListener(SWT.Modify, this); fDestinationField.addListener(SWT.Selection, this); fDestinationField.setFont(font); fDestinationField.setLayoutData(gd = new GridData()); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = GridData.FILL; gd.widthHint = SIZING_TEXT_FIELD_WIDTH; Button button = createButton( destinationSelectionGroup, IDialogConstants.CLIENT_ID, Messages.TeamProjectIndexExportWizardPage_variableButton, false); SelectionAdapter listener = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { onInsertVariable(); } }; button.addSelectionListener(listener); // resource snapshot destination group Composite resourceSnapshotDestinationGroup = new Composite(parent, SWT.NONE); resourceSnapshotDestinationGroup.setLayout(new GridLayout(1, false)); resourceSnapshotDestinationGroup.setLayoutData( new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); resourceSnapshotDestinationGroup.setFont(font); fResourceSnapshotButton = new Button(resourceSnapshotDestinationGroup, SWT.CHECK); fResourceSnapshotButton.setText( Messages.TeamProjectIndexExportWizardPage_resourceSnapshotButton); fResourceSnapshotButton.setFont(font); fResourceSnapshotButton.setLayoutData(gd = new GridData()); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = GridData.FILL; }
private Control createDialogAreaContentsForLoad(Composite p_composite) { messageLabel = new Label(p_composite, SWT.NULL); messageLabel.setText( Messages.getString("dialogs.OrganizeTestTextDialog.messageLabel.text1")); // $NON-NLS-1$ GridData gd = new GridData(GridData.VERTICAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; gd.widthHint = 400; messageLabel.setLayoutData(gd); Label nameLabel = new Label(p_composite, SWT.NULL); nameLabel.setText( Messages.getString("dialogs.OrganizeTestTextDialog.nameLabel.text2")); // $NON-NLS-1$ gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); gd.grabExcessHorizontalSpace = false; nameLabel.setLayoutData(gd); nameList = new List(p_composite, SWT.V_SCROLL); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.heightHint = 100; nameList.setLayoutData(gd); nameList.setItems(QuickRExPlugin.getDefault().getTestTextNames()); nameList.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent e) { if (nameList.getSelection() != null && nameList.getSelection().length > 0) { testTextField.setText( QuickRExPlugin.getDefault() .getTestTextByName(nameList.getSelection()[0]) .getText()); selectedPath = null; } } public void widgetDefaultSelected(SelectionEvent e) {} }); Label textLabel = new Label(p_composite, SWT.NULL); textLabel.setText( Messages.getString("dialogs.OrganizeTestTextDialog.textLabel.text2")); // $NON-NLS-1$ gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); gd.grabExcessHorizontalSpace = false; textLabel.setLayoutData(gd); testTextField = new Text( p_composite, SWT.READ_ONLY | SWT.LEAD | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.RESIZE); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = true; gd.heightHint = 250; gd.widthHint = 400; testTextField.setLayoutData(gd); testTextField.setBackground(new Color(getShell().getDisplay(), new RGB(255, 255, 255))); return p_composite; }
private void buildAddRemoveButtons(Composite parent, final TableViewer tableViewer) { Composite buttonComposite = new Composite(parent, SWT.NULL); GridLayout buttonLayout = new GridLayout(1, false); buttonComposite.setLayout(buttonLayout); GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.verticalAlignment = GridData.BEGINNING; buttonComposite.setLayoutData(gridData); // Add buttons Button addButton = new Button(buttonComposite, SWT.PUSH); addButton.setText(JptDbwsEclipseLinkUiMessages.JDBC_DRIVER_WIZARD_PAGE__ADD_BUTTON); gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; addButton.setLayoutData(gridData); addButton.addSelectionListener( new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) {} public void widgetSelected(SelectionEvent e) { ArrayList<String> jarFiles = promptJarFiles(); for (String jarFile : jarFiles) { addJarFile(jarFile); } tableViewer.refresh(); } }); // Remove buttons Button removeButton = new Button(buttonComposite, SWT.PUSH); removeButton.setText(JptDbwsEclipseLinkUiMessages.JDBC_DRIVER_WIZARD_PAGE__REMOVE_BUTTON); gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; removeButton.setLayoutData(gridData); removeButton.addSelectionListener( new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) {} public void widgetSelected(SelectionEvent e) { StructuredSelection selection = (StructuredSelection) tableViewer.getSelection(); if (selection.isEmpty()) { return; } String jarFile = (String) selection.getFirstElement(); removeJarFile(jarFile); tableViewer.refresh(); } }); addButton.setFocus(); }
public OrCondition( final FilterAdvancedComposite filterAdvancedComposite, final CTabFolder tabFolder) { // fields this.filterAdvancedComposite = filterAdvancedComposite; this.tabItem = new CTabItem(tabFolder, SWT.NULL); this.tabItem.setText(Messages.a_condition); this.tabContent = new Composite(tabFolder, SWT.NONE); this.tabItem.setControl(this.tabContent); // widgets this.addAssertionComposite = new AddAssertionComposite(this, this.tabContent); this.assertionScrolledComposite = new ScrolledComposite(this.tabContent, SWT.V_SCROLL | SWT.NONE); this.assertionComposite = new Composite(this.assertionScrolledComposite, SWT.NONE); this.assertionScrolledComposite.setContent(this.assertionComposite); // layout final GridLayout layout = new GridLayout(); layout.marginLeft = 6; layout.marginRight = 6; layout.marginTop = 6; layout.marginBottom = 6; layout.verticalSpacing = 12; this.tabContent.setLayout(layout); final GridData addAssertionCompositeLayoutData = new GridData(); addAssertionCompositeLayoutData.grabExcessHorizontalSpace = true; addAssertionCompositeLayoutData.horizontalAlignment = GridData.FILL; this.addAssertionComposite.setLayoutData(addAssertionCompositeLayoutData); final GridData assertionCompositeLayoutData = new GridData(); assertionCompositeLayoutData.grabExcessHorizontalSpace = true; assertionCompositeLayoutData.horizontalAlignment = GridData.FILL; assertionCompositeLayoutData.grabExcessVerticalSpace = true; assertionCompositeLayoutData.verticalAlignment = GridData.FILL; this.assertionScrolledComposite.setLayoutData(assertionCompositeLayoutData); this.assertionScrolledComposite.setExpandHorizontal(true); final RowLayout innerlayout = new RowLayout(SWT.VERTICAL); innerlayout.wrap = false; this.assertionComposite.setLayout(innerlayout); this.assertionComposite.addListener( SWT.Resize, new Listener() { public void handleEvent(final org.eclipse.swt.widgets.Event event) { final Point s = OrCondition.this.assertionComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT); OrCondition.this.assertionComposite.setSize(s.x, s.y); refreshGUI(); } }); }
protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(2, false); container.setLayout(gridLayout); GridData gridData = new GridData(); gridData.widthHint = 200; container.setLayoutData(gridData); Label lblName = new Label(container, SWT.LEFT); gridData = new GridData(); gridData.horizontalIndent = 10; lblName.setLayoutData(gridData); lblName.setText(Messages.adRolName); txtName = new Text(container, SWT.SINGLE | SWT.BORDER); gridData = new GridData(); gridData.horizontalAlignment = GridData.END; gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 75; txtName.setLayoutData(gridData); createEndptTypeComponent(container); createPublicPortComponent(container); Label lblPrivatePort = new Label(container, SWT.LEFT); gridData = new GridData(); gridData.horizontalIndent = 10; lblPrivatePort.setLayoutData(gridData); lblPrivatePort.setText(Messages.adRolPrivatePort); txtPrivatePort = new Text(container, SWT.SINGLE | SWT.BORDER); gridData = new GridData(); gridData.horizontalAlignment = GridData.END; gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 75; txtPrivatePort.setLayoutData(gridData); if (isEditEndpt) { txtName.setText(waEndpt.getName()); txtPrivatePort.setText(waEndpt.getPrivatePort()); txtPublicPort.setText(waEndpt.getPort()); comboType.setText(waEndpt.getEndPointType().toString()); if (comboType.getText().equalsIgnoreCase(WindowsAzureEndpointType.Internal.toString())) { txtPublicPort.setEnabled(false); lblPublicPort.setEnabled(false); txtPublicPort.setText(""); } } return super.createContents(parent); }
private void addXmlGroup(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(Messages.CoProc2LaunchConfigurationMainTab_InputXmlGroupName); GridLayout layout = new GridLayout(); layout.numColumns = 3; group.setLayout(layout); GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; group.setLayoutData(gd); setXmlInputNull = new Button(group, SWT.CHECK); setXmlInputNull.setText(Messages.CoProc2LaunchConfigurationMainTab_SetInputToNullCheckbox); setXmlInputNull.setToolTipText( Messages.CoProc2LaunchConfigurationMainTab_SetInputToNullTooltip); gd = new GridData(); gd.horizontalSpan = 3; setXmlInputNull.setLayoutData(gd); setXmlInputNull.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { xmlFileText.setEnabled(!setXmlInputNull.getSelection()); browseXmlButton.setEnabled(!setXmlInputNull.getSelection()); setDirty(true); updateLaunchConfigurationDialog(); } }); Label label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_FileField + ':'); xmlFileText = new Text(group, SWT.BORDER); gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; xmlFileText.setLayoutData(gd); xmlFileText.addModifyListener(modifyListener); browseXmlButton = new Button(group, SWT.PUSH); browseXmlButton.setText(Messages.CoProc2LaunchConfigurationMainTab_BrowseButton); browseXmlButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { String[] extensions = new String[] {"*.xml"}; // $NON-NLS-1$ String fileName = browseForSourceFile(extensions); if (fileName != null) { xmlFileText.setText(fileName); } } }); }
private void addUrlGroup(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(Messages.CoProc2LaunchConfigurationMainTab_ConnectionGroupName); GridLayout layout = new GridLayout(); layout.numColumns = 4; group.setLayout(layout); GridData gd = new GridData(); gd.horizontalAlignment = SWT.FILL; group.setLayoutData(gd); Label label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_HostField + ':'); coprocHostText = new Text(group, SWT.BORDER); gd = new GridData(); gd.horizontalSpan = 3; gd.horizontalAlignment = SWT.FILL; gd.grabExcessHorizontalSpace = true; coprocHostText.setLayoutData(gd); coprocHostText.addModifyListener(modifyListener); label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_PortField + ':'); coprocPortText = new Text(group, SWT.BORDER); gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.widthHint = 40; coprocPortText.setLayoutData(gd); coprocPortText.addModifyListener(modifyListener); testUrl = new Button(group, SWT.PUSH); testUrl.setText(Messages.CoProc2LaunchConfigurationMainTab_TestConnectionButton); testUrl.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { statusLabel.setText(Messages.CoProc2LaunchConfigurationMainTab_TestingConnectionStatus); AsyncConnectionTest test = new AsyncConnectionTest( coprocHostText.getText(), coprocPortText.getText(), statusLabel); new Thread(test).start(); } }); statusLabel = new Label(group, SWT.NONE); gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; statusLabel.setLayoutData(gd); statusLabel.setText(Messages.CoProc2LaunchConfigurationMainTab_ConnectionNotTested); }
/** @param parent The parent <code>Composite</code> */ private void createCleanTestResults(Composite parent) { m_cleanTestresults = new Button(parent, SWT.CHECK); m_cleanTestresults.setText(Messages.TestResultViewPreferencePageCleanResults); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = 1; gridData.grabExcessHorizontalSpace = false; m_cleanTestresults.setLayoutData(gridData); int testResultCleanupInterval = getProject().getTestResultCleanupInterval(); m_cleanTestresults.setSelection(testResultCleanupInterval != IProjectPO.NO_CLEANUP); m_cleanTestresults.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent e) { enableCleanResultDaysTextfield(); checkCompleteness(); } public void widgetDefaultSelected(SelectionEvent e) { // nothing here } }); m_cleanResultDays = new CheckedIntText(parent, SWT.BORDER, false, 1, Integer.MAX_VALUE); gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gridData.horizontalSpan = 1; gridData.grabExcessHorizontalSpace = false; gridData.widthHint = 80; m_cleanResultDays.setLayoutData(gridData); if (testResultCleanupInterval > 0) { m_cleanResultDays.setText(String.valueOf(testResultCleanupInterval)); } m_cleanResultDays.addKeyListener( new KeyListener() { public void keyPressed(KeyEvent e) { // nothing } public void keyReleased(KeyEvent e) { checkCompleteness(); } }); Label label = new Label(parent, SWT.NONE); label.setText(Messages.TestResultViewPreferencePageCleanDaysLabel); gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gridData.horizontalSpan = 1; gridData.grabExcessHorizontalSpace = false; label.setLayoutData(gridData); enableCleanResultDaysTextfield(); ControlDecorator.decorateInfo( label, "TestResultViewPreferencePage.cleanResultsInfo", false); // $NON-NLS-1$ }
private void createContents(final Shell shell) { GridLayout gridLayout1 = new GridLayout(); GridData gridData2 = new GridData(GridData.FILL_HORIZONTAL); GridData gridData3 = new GridData(GridData.FILL_HORIZONTAL); GridData gridData4 = new GridData(GridData.FILL_HORIZONTAL); GridData gridData5 = new GridData(GridData.FILL_HORIZONTAL); GridData gridData6 = new GridData(GridData.FILL_HORIZONTAL); GridData gridData7 = new GridData(GridData.FILL_HORIZONTAL); GridData gridData8 = new GridData(GridData.FILL_HORIZONTAL); GridData gridData9 = new GridData(GridData.FILL_HORIZONTAL); header = new Label(shell, SWT.NONE); textArea = new Text(shell, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL); Display disp = shell.getDisplay(); textArea.setBackground(disp.getSystemColor(SWT.COLOR_WHITE)); trailer = new Label(shell, SWT.NONE); button = createButton(shell, IMQSCScriptsConstants.RUN_SCRIPT_RUN_BUTTON, "Run", false); button1 = createButton(shell, IMQSCScriptsConstants.RUN_SCRIPT_SKIP_BUTTON, "Skip", false); button2 = createButton(shell, IMQSCScriptsConstants.RUN_SCRIPT_RUNALL_BUTTON, "Run All", false); button3 = createButton(shell, IMQSCScriptsConstants.RUN_SCRIPT_SKIPALL_BUTTON, "Skip All", false); button4 = createButton(shell, IMQSCScriptsConstants.RUN_SCRIPT_ABORT_BUTTON, "Abort", false); shell.setLayout(gridLayout1); header.setLayoutData(gridData2); trailer.setLayoutData(gridData4); gridLayout1.numColumns = 5; gridData2.horizontalSpan = 5; gridData3.horizontalSpan = 5; gridData3.verticalSpan = 25; textArea.setLayoutData(gridData3); gridData4.horizontalSpan = 5; gridData5.grabExcessHorizontalSpace = true; button.setLayoutData(gridData5); gridData6.grabExcessHorizontalSpace = true; button1.setLayoutData(gridData6); gridData7.grabExcessHorizontalSpace = true; button2.setLayoutData(gridData7); gridData8.grabExcessHorizontalSpace = true; button3.setLayoutData(gridData8); gridData9.grabExcessHorizontalSpace = true; button4.setLayoutData(gridData9); shell.setSize(new org.eclipse.swt.graphics.Point(350, 225)); shell.setText("Invalid MQSC Command Found"); header.setText("The following command appears to be invalid MQSC."); textArea.setText(fText); trailer.setText( "Do you want to Run this command, Skip it, Run All invalid commands, or Skip All invalid commands?"); shell.pack(); }
/** * Sets up the assertion preservation part of the UI. * * @param composite on which to install the UI. * @param cfg to be used. * @pre composite != null and cfg != null */ private void setupAssertionUI(final Composite composite, final SlicerConfiguration cfg) { final Group _assertionGroup = new Group(composite, SWT.NONE); final GridData _gridData1 = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false); _gridData1.horizontalSpan = 3; _gridData1.grabExcessHorizontalSpace = true; _assertionGroup.setLayoutData(_gridData1); final GridLayout _gl1 = new GridLayout(3, false); _assertionGroup.setLayout(_gl1); _assertionGroup.setText("Preservation of assertions in the system"); final Button _assertionPreservingSliceButton = new Button(_assertionGroup, SWT.CHECK); _assertionPreservingSliceButton.setText("Preserve assertions"); _assertionPreservingSliceButton.setEnabled(true); final GridData _gd2 = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false); _gd2.horizontalSpan = 1; _assertionPreservingSliceButton.setLayoutData(_gd2); final Button _applclasses = new Button(_assertionGroup, SWT.CHECK); _applclasses.setText("Preserve assertions in application classes only"); _applclasses.addSelectionListener( new BooleanPropertySelectionListener( SlicerConfiguration.ASSERTIONS_IN_APPLICATION_CLASSES_ONLY, _applclasses, cfg)); _applclasses.setSelection(cfg.areAssertionsOnlyInAppClassesConsidered()); final GridData _gd3 = new GridData(SWT.END, SWT.BEGINNING, false, false); _gd3.horizontalSpan = 2; _gd3.grabExcessHorizontalSpace = true; _applclasses.setLayoutData(_gd3); final SelectionListener _sl1 = new BooleanPropertySelectionListener( SlicerConfiguration.SLICE_TO_PRESERVE_ASSERTIONS, _assertionPreservingSliceButton, cfg) { @Override public void widgetSelected(@SuppressWarnings("unused") final SelectionEvent evt) { final boolean _value = button.getSelection(); containingConfiguration.setProperty(id, Boolean.valueOf(_value)); _applclasses.setEnabled(_value); } }; _assertionPreservingSliceButton.addSelectionListener(_sl1); _assertionPreservingSliceButton.setSelection(cfg.getSliceToPreserveAssertions()); _assertionPreservingSliceButton.notifyListeners(SWT.Selection, null); }
private void createButtonBarComposite(Composite parent) { Composite buttonBarComposite = new Composite(parent, SWT.NONE); GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.CENTER; buttonBarComposite.setLayoutData(gridData); RowLayout rowLayout = new RowLayout(); rowLayout.pack = false; buttonBarComposite.setLayout(rowLayout); Button okButton = new Button(buttonBarComposite, SWT.PUSH); okButton.setText("OK"); okButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { okPressed(); } }); this.shell.setDefaultButton(okButton); Button cancelButton = new Button(buttonBarComposite, SWT.PUSH); cancelButton.setText("Cancel"); cancelButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { cancelPressed(); } }); }
public FilterAdvancedComposite( final FilterChangedListener filterChangedListener, final Composite parent, final int style) { // fields super(parent, style); // widgets this.tabFolder = new CTabFolder(this, SWT.TOP | SWT.BORDER | SWT.CLOSE); this.addOrConditionButton = creteAddOrConditionButton(); addOrCondition(); // layout final GridLayout layout = new GridLayout(1, true); layout.marginLeft = 6; layout.marginRight = 6; layout.marginTop = 6; layout.marginBottom = 6; layout.verticalSpacing = 12; this.setLayout(layout); final GridData tabFolderLayoutData = new GridData(); tabFolderLayoutData.horizontalAlignment = GridData.FILL; tabFolderLayoutData.grabExcessHorizontalSpace = true; tabFolderLayoutData.verticalAlignment = GridData.FILL; tabFolderLayoutData.grabExcessVerticalSpace = true; this.tabFolder.setLayoutData(tabFolderLayoutData); this.tabFolder.setBackgroundMode(SWT.INHERIT_FORCE); final GridData addOrConditionButtonLayoutdata = new GridData(); addOrConditionButtonLayoutdata.horizontalAlignment = GridData.END; this.addOrConditionButton.setLayoutData(addOrConditionButtonLayoutdata); }
public void createControl(Composite parent) { final Composite container = new Composite(parent, SWT.NULL); final GridLayout layout = new GridLayout(); container.setLayout(layout); layout.numColumns = 3; layout.verticalSpacing = 9; final Label label = new Label(container, SWT.NULL); label.setText("&Target model:"); uriText = new Text(container, SWT.BORDER | SWT.SINGLE); final GridData gd = new GridData(GridData.FILL_HORIZONTAL); uriText.setLayoutData(gd); // uriText.setEditable(false); uriText.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); final Button button = new Button(container, SWT.PUSH); button.setText("B&rowse..."); button.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleBrowse(); } }); final GridData gd1 = new GridData(GridData.FILL_HORIZONTAL); gd1.horizontalSpan = 3; final Label infoLabel = new Label(container, SWT.NULL); infoLabel.setLayoutData(gd1); infoLabel.setText("Contents of the selected resource:"); final GridData gd2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL); gd2.horizontalSpan = 3; gd2.grabExcessHorizontalSpace = true; gd2.grabExcessVerticalSpace = true; viewer = new TreeViewer(container, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); viewer.getTree().setLayoutData(gd2); viewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); viewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); viewer.addSelectionChangedListener(this); final GridData gd3 = new GridData(GridData.FILL_HORIZONTAL); gd3.horizontalSpan = 3; final Label hintLabel = new Label(container, SWT.WRAP); hintLabel.setLayoutData(gd3); hintLabel.setText( "Hint: You may also select a sub-model that contains ALL RELEVANT ELEMENTS for " + MPatchConstants.MPATCH_SHORT_NAME + " application (improves performance)."); initialize(); dialogChanged(); setControl(container); }
private void addSeparator(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; separator.setLayoutData(gridData); }
public ParamBoolean(Composite parent, int style, String key, String label, boolean labelFirst) { super(parent, style); this.key = key; this.label = label; this.setLayout(new GridLayout(2, false)); if (labelFirst) { labelItem = new Label(this, SWT.NONE); labelItem.setText(label); check = new Button(this, SWT.CHECK); check.addSelectionListener(new SelectionCheck()); } else { check = new Button(this, SWT.CHECK); check.addSelectionListener(new SelectionCheck()); labelItem = new Label(this, SWT.NONE); labelItem.setText(label); } GridData gdata = new GridData(); // gdata.minimumWidth=20; gdata.grabExcessHorizontalSpace = false; // text.setLayoutData(gdata); }
private void createUriPanel(final Composite parent) { if (configuredRemotes != null) { uriButton = new Button(parent, SWT.RADIO); uriButton.setText(UIText.RepositorySelectionPage_uriChoice + ":"); // $NON-NLS-1$ uriButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { // occurs either on selection or unselection event updateRemoteAndURIPanels(); checkPage(); } }); } uriPanel = new Composite(parent, SWT.NULL); uriPanel.setLayout(new GridLayout()); final GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; uriPanel.setLayoutData(gd); createLocationGroup(uriPanel); createConnectionGroup(uriPanel); authGroup = createAuthenticationGroup(uriPanel); }
/** * Initialize the toolbar with icons and selection listeners in the appropriate part of the window */ public void initToolbar() { Device dev = shell.getDisplay(); try { exitImg = new Image(dev, "img/exit.png"); // openImg = new Image(dev, "img/open.png"); playImg = new Image(dev, "img/play.png"); // pauseImg = new Image(dev, "img/pause.png"); } catch (Exception e) { System.out.println("Cannot load images"); System.out.println(e.getMessage()); System.exit(1); } ToolBar toolBar = new ToolBar(shell, SWT.BORDER); GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; toolBar.setLayoutData(gridData); ToolItem exit = new ToolItem(toolBar, SWT.PUSH); exit.setImage(exitImg); // ToolItem open = new ToolItem(toolBar, SWT.PUSH); // exit.setImage(openImg); ToolItem play = new ToolItem(toolBar, SWT.PUSH); play.setImage(playImg); // ToolItem pause = new ToolItem(toolBar, SWT.PUSH); // pause.setImage(pauseImg); toolBar.pack(); exit.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { System.exit(0); } }); // open.addSelectionListener(new SelectionAdapter() { // @Override // public void widgetSelected(SelectionEvent e) { // FileDialog dialog = new FileDialog(shell, SWT.NULL); // String path = dialog.open(); // } // }); play.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { controller.RunAnimation(); } }); }
@Override protected void createCustomContents(Composite parent) { GridData gd; Group group = WidgetFactory.createSimpleGroup( parent, UTIL.getString("Common.Properties.Label")); // $NON-NLS-1$; scrolled = new Composite(group, SWT.NONE); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; scrolled.setLayout(gridLayout); urlLabel = new Label(scrolled, SWT.NONE); urlLabel.setText(UTIL.getString("Common.URL.Label")); // $NON-NLS-1$ urlLabel.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$ gd = new GridData(); gd.verticalAlignment = GridData.BEGINNING; urlLabel.setLayoutData(gd); urlText = new Text(scrolled, SWT.SINGLE | SWT.BORDER); urlText.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$ gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.verticalAlignment = GridData.BEGINNING; gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 1; urlText.setLayoutData(gd); initControls(); addlisteners(); }