/** Create contents of the shell. */ protected void createContents() { setText(Messages.getString("ShowAlphaContentWindow.1")); // $NON-NLS-1$ setSize(325, 130); setLayout(new GridLayout()); { composite = new Composite(this, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); composite.setLayout(new GridLayout(1, false)); { lblCharactersInThe = new Label(composite, SWT.WRAP); GridData layoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); layoutData.widthHint = 130; lblCharactersInThe.setLayoutData(layoutData); if (alpha instanceof BlockAlphabet) { lblCharactersInThe.setText( String.format( Messages.getString("ShowAlphaContentWindow.0"), ((BlockAlphabet) alpha).getBlockName())); // $NON-NLS-1$ } else { lblCharactersInThe.setText(Messages.getString("ShowAlphaContentWindow.2")); // $NON-NLS-1$ } } { text = new Text(composite, SWT.BORDER | SWT.MULTI); text.setEditable(false); text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); text.setText(AbstractAlphabet.alphabetContentAsString(alpha.getCharacterSet())); } } }
private void createFilePreviewOptionsGroup(Composite parent) { Group theGroup = WidgetFactory.createGroup( parent, getString("filePreviewOptionsGroup"), SWT.NONE, 1, 5); // $NON-NLS-1$ theGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label numberLinesInFileLabel = new Label(theGroup, SWT.NONE); numberLinesInFileLabel.setText(getString("numberOfLinesLabel")); // $NON-NLS-1$ numberLinesInFileText = WidgetFactory.createTextField(theGroup, SWT.NONE); numberLinesInFileText.setEditable(false); numberLinesInFileText.setBackground( Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); GridData gd = new GridData(); gd.minimumWidth = 50; Label spacer = new Label(theGroup, SWT.NONE); spacer.setText(" "); // $NON-NLS-1$ Label prefixLabel = new Label(theGroup, SWT.NONE); prefixLabel.setText(getString("numberOfPreviewLines")); // $NON-NLS-1$ prefixLabel.setLayoutData(new GridData()); // new GridData(GridData.FILL_HORIZONTAL)); this.numberPreviewLinesText = WidgetFactory.createTextField(theGroup, SWT.NONE); gd = new GridData(); gd.minimumWidth = 50; this.numberPreviewLinesText.setLayoutData(gd); this.numberPreviewLinesText.addModifyListener( new ModifyListener() { @Override public void modifyText(final ModifyEvent event) { if (!synchronizing) { if (!numberPreviewLinesText.getText().isEmpty()) { try { int nLines = Integer.parseInt(numberPreviewLinesText.getText()); if (nLines == 0) { setErrorMessage(getString("numberOfLinesCannotBeNullOrZero")); // $NON-NLS-1$ return; } if (nLines != dataFileInfo.getNumberOfCachedFileLines()) { dataFileInfo.setNumberOfCachedFileLines(nLines); handleInfoChanged(true); } setErrorMessage(null); } catch (NumberFormatException ex) { setErrorMessage( getString( "numberOfLinesMustBeInteger", numberPreviewLinesText.getText())); // $NON-NLS-1$ return; } } else { setErrorMessage(getString("numberOfLinesCannotBeNullOrZero")); // $NON-NLS-1$ return; } } } }); }
@Override public void reset() { if (labelSelected != null) { toolbar.setRedraw(false); labelSelected.setText(""); // $NON-NLS-1$ labelSelected.pack(); layout(); toolbar.setRedraw(true); } if (labelApplied != null) { toolbar.setRedraw(false); labelApplied.setText(""); // $NON-NLS-1$ labelApplied.pack(); layout(); toolbar.setRedraw(true); } if (labelTransformations != null) { toolbar.setRedraw(false); labelTransformations.setText(""); // $NON-NLS-1$ labelTransformations.pack(); layout(); toolbar.setRedraw(true); } if (labelAttribute != null) { toolbar.setRedraw(false); labelAttribute.setText(""); // $NON-NLS-1$ labelAttribute.pack(); layout(); toolbar.setRedraw(true); } }
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); }
/* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) */ @Override protected Control createContents(Composite parent) { Composite content = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(2, false); gridLayout.marginWidth = gridLayout.marginHeight = 0; content.setLayout(gridLayout); initializeDialogUnits(content); Label label = new Label(content, SWT.NONE); label.setText("Name:"); name = new Text(content, SWT.BORDER); name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); label = new Label(content, SWT.NONE); label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); label = new Label(content, SWT.NONE); label.setText("Target repository:"); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); repository = new ComboViewer(content, SWT.READ_ONLY); repository.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); repository.setLabelProvider(new LabelProvider()); repository.setContentProvider(new ArrayContentProvider()); repository.setSorter(new ViewerSorter()); repository.setInput(getRepositoryService().getRepositories()); repository.setSelection(new StructuredSelection(getRepositoryService().getRepository("local"))); performDefaults(); name.addModifyListener(modifyListener); return content; }
private void createFilterTextfield(Composite filterComp) { Label label = new Label(filterComp, SWT.NONE); label.setText(Messages.MultiselectWidget_1); label = new Label(filterComp, SWT.NONE); label.setText(""); // $NON-NLS-1$ filter = new Text(filterComp, SWT.BORDER); GridData gridData = new GridData(SWT.FILL, SWT.NONE, true, false); filter.setLayoutData(gridData); filter.addKeyListener( new KeyListener() { @Override public void keyReleased(KeyEvent e) { filterString = filter.getText(); if (filterString != null) { filterString = filterString.trim(); if (filterString.isEmpty()) { filterString = null; } } removeCheckboxes(); addCheckboxes(); } @Override public void keyPressed(KeyEvent e) {} }); }
public QualifiedNameComponent( Composite parent, int style, final IQualifiedNameUpdating refactoring, IDialogSettings settings) { super(parent, style); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; layout.numColumns = 2; setLayout(layout); Label label = new Label(this, SWT.NONE); label.setText(RefactoringMessages.QualifiedNameComponent_patterns_label); fPatterns = new Text(this, SWT.BORDER); fPatterns.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); label = new Label(this, SWT.NONE); label.setText(RefactoringMessages.QualifiedNameComponent_patterns_description); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; label.setLayoutData(gd); String text = refactoring.getFilePatterns(); if (text == null) text = settings.get(PATTERNS); if (text != null) { fPatterns.setText(text); refactoring.setFilePatterns(text); } fPatterns.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { refactoring.setFilePatterns(fPatterns.getText()); } }); }
public void createCombos(Composite parent) { parent.setLayout( GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).spacing(64, 10).create()); GridData comboGridData = new GridData(); comboGridData.widthHint = 100; Label label = new Label(parent, SWT.None); label.setText("Complex"); complexCombo = new Combo(parent, SWT.READ_ONLY); complexCombo.add("true"); complexCombo.add("false"); complexCombo.setToolTipText( "Flag to indicate data is complex. If true, data values assumed to be alternating real and complex float values."); complexCombo.setLayoutData(comboGridData); label = new Label(parent, SWT.None); label.setText("Loop"); loopCombo = new Combo(parent, SWT.READ_ONLY); loopCombo.add("true"); loopCombo.add("false"); // loopCombo.setEnabled(false); loopCombo.setToolTipText( "Do we continue to replay and loop over the input file when we are done or not"); loopCombo.setLayoutData(comboGridData); }
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; }
/** * Create contents of the dialog. * * @param parent */ @Override protected Control createDialogArea(Composite parent) { setMessage(title); setTitle("Tadpole Message"); Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayout(new GridLayout(2, false)); container.setLayoutData(new GridData(GridData.FILL_BOTH)); lblDate = new Label(container, SWT.NONE); lblDate.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblDate.setText("Date"); text = new Text(container, SWT.BORDER); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); text.setText(head); lblMessage = new Label(container, SWT.NONE); lblMessage.setText("Message"); new Label(container, SWT.NONE); textMessage = new Text( container, SWT.BORDER | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI); textMessage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); textMessage.setText(message); return area; }
/* * (non-Jsdoc) * @see com.ebmwebsourcing.petals.common.croquis.internal.provisional.ICroquisExtension * #createControl(org.eclipse.swt.widgets.Composite, com.ebmwebsourcing.petals.common.croquis.internal.provisional.CroquisNewWizardPage) */ public void createControl(Composite parent, final CroquisNewWizardPage page) { Label l = new Label(parent, SWT.NONE); l.setText("File Name:"); l.setToolTipText("The name of the file to create"); Text text = new Text(parent, SWT.BORDER); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); text.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { EipCroquis.this.fileName = ((Text) e.widget).getText().trim(); validate(page); } }); l = new Label(parent, SWT.NONE); l.setText("Chain Name:"); l.setToolTipText("The name of the EIP chain to create"); text = new Text(parent, SWT.BORDER); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); text.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { EipCroquis.this.chainName = ((Text) e.widget).getText().trim(); validate(page); } }); }
/* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ protected void okPressed() { okPressed = true; if (type == TYPE_SAVE) { if (nameText.getText() == null || nameText.getText().trim().length() == 0) { messageLabel.setText( Messages.getString("dialogs.OrganizeTestTextDialog.messageLabel.text7")); // $NON-NLS-1$ messageLabel.redraw(); return; } else { this.nameToSave = nameText.getText(); } } else if (type == TYPE_LOAD) { if (this.selectedPath != null) { try { this.selectedText = getFileContents(this.selectedPath); } catch (Exception e) { messageLabel.setText(e.getMessage()); messageLabel.redraw(); return; } } else if (nameList.getSelection() == null || nameList.getSelection().length == 0) { messageLabel.setText( Messages.getString("dialogs.OrganizeTestTextDialog.messageLabel.text8")); // $NON-NLS-1$ messageLabel.redraw(); return; } else { this.selectedText = QuickRExPlugin.getDefault().getTestTextByName(nameList.getSelection()[0]); } } this.close(); }
@Override protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(2, false)); Label lblNewLabel = new Label(container, SWT.NONE); lblNewLabel.setText(Messages.DefaultPreferencePage_2); textSessionTime = new Text(container, SWT.BORDER); textSessionTime.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); Label lblExportDilimit = new Label(container, SWT.NONE); lblExportDilimit.setText(Messages.GeneralPreferencePage_lblExportDilimit_text); textExportDelimit = new Text(container, SWT.BORDER); textExportDelimit.setText(Messages.GeneralPreferencePage_text_text); textExportDelimit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); Label lblHomePage = new Label(container, SWT.NONE); lblHomePage.setText(Messages.GeneralPreferencePage_lblHomePage_text); textHomePage = new Text(container, SWT.BORDER); textHomePage.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); new Label(container, SWT.NONE); btnCheckButtonHomepage = new Button(container, SWT.CHECK); btnCheckButtonHomepage.setText(Messages.GeneralPreferencePage_btnCheckButton_text); btnCheckButtonHomepage.setSelection(true); initDefaultValue(); return container; }
protected void buttonPressed(int buttonId) { if (buttonId == RESET_ID) { usernameField.setText(""); // $NON-NLS-1$ passwordField.setText(""); // $NON-NLS-1$ } else { if (buttonId == Window.OK) { if (!workspaceCombo.getEnabled()) { portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace); return; } if (workspaceCombo.getSelectionIndex() == -1) { portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace); return; } try { String success = uploadPPK( url, uname, pwd, workspaceCombo.getItem(workspaceCombo.getSelectionIndex()), ppk); if (success.indexOf(Messages.TAUPortalUploadDialog_Error) >= 0) { portalStatus.setText(success); return; } } catch (Exception e) { e.printStackTrace(); portalStatus.setText(Messages.TAUPortalUploadDialog_UploadError); return; } } super.buttonPressed(buttonId); } }
/** * Creates and returns the contents of the upper part of the dialog (above the button bar). * * <p>Subclasses should override. * * @param ancestor the parent composite to contain the dialog area * @return the dialog area control */ protected Control createDialogArea(Composite ancestor) { Composite composite = (Composite) super.createDialogArea(ancestor); Label comment = new Label(composite, SWT.NONE); comment.setText(XMLCompareMessages.XMLCompareEditCopyIdMapDialog_comment); GridData data = new GridData(); data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.BEGINNING; comment.setLayoutData(data); Composite inner = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; inner.setLayout(layout); inner.setLayoutData(new GridData(GridData.FILL_BOTH)); Label label = new Label(inner, SWT.NULL); label.setText(XMLCompareMessages.XMLCompareEditCopyIdMapDialog_label); label.setLayoutData(new GridData()); fIdMapText = new Text(inner, SWT.BORDER); fIdMapText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fIdMapText.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { doValidation(); } }); fIdMapText.setFocus(); return composite; }
protected void setStatus(IStatus status) { if (status == null || status.isOK()) { errorLabel.setText(""); errorImage.setImage(null); } else { errorLabel.setText(status.getMessage()); errorLabel.setToolTipText(status.getMessage()); Image toUse = null; switch (status.getSeverity()) { case IStatus.WARNING: toUse = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK); break; case IStatus.ERROR: toUse = PlatformUI.getWorkbench() .getSharedImages() .getImage(ISharedImages.IMG_OBJS_ERROR_TSK); break; case IStatus.INFO: toUse = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK); break; } errorImage.setImage(toUse); errorImage.setVisible(true); } }
/** Creates the widgets in the "child" group. */ void createChildWidgets() { /* Add common controls */ super.createChildWidgets(); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = 3; Label lblAverage = new Label(childGroup, SWT.NONE); lblAverage.setText("Average"); lblAverage.setLayoutData(gridData); avgText = new Text(childGroup, SWT.BORDER); avgText.setEditable(false); avgText.setLayoutData(gridData); Label lblVariant = new Label(childGroup, SWT.NONE); lblVariant.setText("Variant"); lblVariant.setLayoutData(gridData); variantText = new Text(childGroup, SWT.BORDER); variantText.setEditable(false); variantText.setLayoutData(gridData); Label lblMax = new Label(childGroup, SWT.NONE); lblMax.setText("Max"); lblMax.setLayoutData(gridData); maxText = new Text(childGroup, SWT.BORDER); maxText.setEditable(false); maxText.setLayoutData(gridData); Label lblMin = new Label(childGroup, SWT.NONE); lblMin.setText("Min"); lblMin.setLayoutData(gridData); minText = new Text(childGroup, SWT.BORDER); minText.setEditable(false); minText.setLayoutData(gridData); }
@Override protected void createDestinationGroup(Composite parent) { UIPlugin plugin = UIPlugin.getInstance(); Group destinationGroup = new Group(parent, SWT.NONE); GridLayout layout = new GridLayout(); destinationGroup.setLayout(layout); destinationGroup.setLayoutData( new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); destinationGroup.setText(plugin.getString("_UI_Forge_Credentials_label")); destinationGroup.setFont(parent.getFont()); Font font = destinationGroup.getFont(); Label loginLabel = new Label(destinationGroup, SWT.NONE); loginLabel.setText(plugin.getString("_UI_Login_label")); loginLabel.setFont(font); loginField = new Text(destinationGroup, SWT.BORDER | SWT.READ_ONLY); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = SIZING_TEXT_FIELD_WIDTH; loginField.setLayoutData(data); loginField.setFont(font); Label passwordLabel = new Label(destinationGroup, SWT.NONE); passwordLabel.setText(plugin.getString("_UI_Password_label")); passwordLabel.setFont(font); passwordField = new Text(destinationGroup, SWT.BORDER | SWT.PASSWORD); data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = SIZING_TEXT_FIELD_WIDTH; passwordField.setLayoutData(data); passwordField.setFont(font); passwordField.addListener(SWT.Modify, this); }
/** * Creates and returns the content of the information area. * * @param composite The parent composite to contain the information area */ private Composite createInfoArea(Composite composite) { Group group = new Group(composite, SWT.CENTER); group.setText("Info"); GridLayout layout = new GridLayout(2, false); group.setLayout(layout); Label dateLabel = new Label(group, SWT.LEFT); dateLabel.setText("Date"); GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); dateLabel.setLayoutData(gd); dateText = new Text(group, SWT.SINGLE | SWT.BORDER); final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); final TimeZone local = TimeZone.getDefault(); sdf.setTimeZone(local); // new Date() gets current date/elapsedTime final String dateString = sdf.format(new Date()); dateText.setText(dateString); gd = new GridData(SWT.FILL, SWT.CENTER, true, false); dateText.setLayoutData(gd); Label authorLabel = new Label(group, SWT.LEFT); authorLabel.setText("Author"); gd = new GridData(SWT.FILL, SWT.CENTER, true, false); authorLabel.setLayoutData(gd); authorText = new Text(group, SWT.SINGLE | SWT.BORDER); // should look in preferences... authorText.setText( Activator.getDefault() .getPreferenceStore() .getString(ProfileDefinitionPreferenceConstants.PREF_AUTHOR_NAME)); gd = new GridData(SWT.FILL, SWT.CENTER, true, false); authorText.setLayoutData(gd); return group; }
protected Control createDialogArea(Composite parent) { Composite dialogArea1 = (Composite) super.createDialogArea(parent); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(dialogArea1, XMLCommonUIContextIds.XCUI_PROCESSING_DIALOG); Composite composite = new Composite(dialogArea1, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginWidth = 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.widthHint = 250; Label targetLabel = new Label(composite, SWT.NONE); targetLabel.setText(XMLUIMessages._UI_LABEL_TARGET_COLON); targetField = new Text(composite, SWT.SINGLE | SWT.BORDER); targetField.setLayoutData(gd); targetField.setText(getDisplayValue(target)); Label dataLabel = new Label(composite, SWT.NONE); dataLabel.setText(XMLUIMessages._UI_LABEL_DATA_COLON); dataField = new Text(composite, SWT.SINGLE | SWT.BORDER); dataField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dataField.setText(getDisplayValue(data)); return dialogArea1; }
/** Updates {@link #labelAppVersion} with current verson information */ private void updateLabelAppVersion() { if (Version.isUpdateAvailable() == null) { if (ConfigurationFactory.getConfigurationFactory().getConfiguration().checkForUpdates()) { labelAppVersion.setToolTipText("Could not get version information."); } } else { if (Version.isUpdateAvailable()) { labelAppVersion.setForeground(SharedStyle.COLOR_RED); labelAppVersion.setText(Version.VERSION_NUMBER + " (Update Available!)"); labelAppVersion.setToolTipText("Click to go to update " + "download page"); labelAppVersion.setCursor(SharedStyle.CURSOR_HAND); labelAppVersion.addMouseListener( new MouseAdapter() { @Override public void mouseUp(final MouseEvent event) { Program.launch(Version.DOWNLOAD_URL); shell.dispose(); } }); } else { labelAppVersion.setText(Version.VERSION_NUMBER); labelAppVersion.setToolTipText("Latest available version!"); labelAppVersion.setForeground(SharedStyle.COLOR_GREEN); } } }
// Checked:030806 private void createSettingControls() { GridLayout gridLayout1; Composite composite = new Composite(_shell, SWT.NULL); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); gridLayout1 = new GridLayout(); gridLayout1.numColumns = 2; composite.setLayout(gridLayout1); // information Label infoLabel = new Label(composite, SWT.NONE); infoLabel.setText(IDialogConstants.OPENFILE_INFO); GridData gridData = new GridData(); gridData.horizontalSpan = 2; infoLabel.setLayoutData(gridData); // URL label Label label1 = new Label(composite, SWT.NONE); label1.setText("URL: "); // Create the TextBox _urlText = new Text(composite, SWT.SINGLE | SWT.BORDER); _urlText.setText(""); gridData = new GridData(); gridData.widthHint = 300; _urlText.setLayoutData(gridData); }
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); }
@PostConstruct public void postConstruct(Composite parent) { Label label = new Label(parent, SWT.None); label.setText("Hallo Bernd"); Label label1 = new Label(parent, SWT.None); label1.setText("Hallo Orhan"); }
/** * 创建文件类型列表 * * @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; }
private void refresh(boolean fromText) { String loc = comboDataBase.getText(); int index = -1; for (int i = 0; i < recent.size(); ++i) if (recent.get(i).getValue1().equals(loc)) { index = i; break; } int lang; if (index >= 0 && fromText) { lang = recent.get(index).getValue2(); comboLanguage.select(lang); } else { lang = comboLanguage.getSelectionIndex(); if (lang < 0) return; } text.setText(_text[lang]); labelDataBase.setText(_database[lang]); buttonBrowse.setText(_browse[lang]); labelLanguage.setText(_language[lang]); buttonOk.setText(_ok[lang]); buttonCancel.setText(_cancel[lang]); getDialogPanel().layout(true, true); resize(); }
/** * Creates and returns the contents of the upper part of this dialog (above the button bar). * * @param parent the parent composite to contain the dialog area * @return the dialog area control */ protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); final GridLayout gridLayout = new GridLayout(); final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true); gridLayout.numColumns = 2; container.setLayout(gridLayout); container.setLayoutData(gridData); final Label dialogLabel = new Label(container, SWT.NONE); dialogLabel.setLayoutData( new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1)); dialogLabel.setText( "Please, enter the required information: "); // ************************************************************* // Macro Questions for (int i = 0; i < questions.length; i++) { final Label macroQuestionLabel = new Label(container, SWT.RESIZE | SWT.NONE); macroQuestionLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false)); macroQuestionLabel.setText(questions[i]); Text fieldText = new Text(container, SWT.BORDER); macroQuestionField[i] = fieldText; macroQuestionField[i].setLayoutData( new GridData(GridData.FILL, GridData.CENTER, true, false)); } // ************************************************************** // Setup listeners for the fields setupListeners(); return container; }
@PostConstruct public void postConstruct(Composite parent, ITodoService iTodoService) { GridLayout gridLayout = new GridLayout(2, false); parent.setLayout(gridLayout); Label lblSummary = new Label(parent, SWT.NONE); lblSummary.setText("Summary"); txtSummary = new Text(parent, SWT.BORDER); txtSummary.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); Label lblDescription = new Label(parent, SWT.NONE); lblDescription.setText("Description"); txtDescription = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); txtDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); Label lblDueDate = new Label(parent, SWT.NONE); lblDueDate.setText("Due Date"); dateTime = new DateTime(parent, SWT.BORDER); dateTime.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); Label lblDone = new Label(parent, SWT.NONE); lblDone.setText("Done"); Button btnDone = new Button(parent, SWT.CHECK); btnDone.setText("Done"); // updateUI(todo); }
/** @see IDialogPage#createControl(Composite) */ public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); container.setLayout(layout); layout.numColumns = 2; layout.verticalSpacing = 9; Label lblprojectName = new Label(container, SWT.NULL); lblprojectName.setText("&Project name:"); projectName = new Text(container, SWT.BORDER | SWT.SINGLE); projectName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); projectName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); projectName.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); Label lblExamples = new Label(container, SWT.NULL); lblExamples.setText("&Create example data"); examples = new Button(container, SWT.CHECK); examples.setSelection(false); dialogChanged(); setControl(container); }
@Override protected Control createDialogArea(Composite parent) { getShell().setText("Sign Log Entries"); Composite container = (Composite) super.createDialogArea(parent); GridLayout gridLayout = (GridLayout) container.getLayout(); gridLayout.marginWidth = 2; gridLayout.marginHeight = 2; errorBar = new ErrorBar(container, SWT.NONE); errorBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); container.setLayout(new GridLayout(2, false)); lblUsername = new Label(container, SWT.NONE); lblUsername.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblUsername.setText("User Name:"); username = new Text(container, SWT.BORDER); username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); lblPassword = new Label(container, SWT.NONE); lblPassword.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblPassword.setText("Password:"); password = new Text(container, SWT.BORDER | SWT.PASSWORD); password.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); return container; }