/* * (non-Javadoc) * * @see * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets * .Composite) */ @Override protected Control createDialogArea(Composite parent) { getShell().setText("Select the views to filter"); // create a checked treeviewer Composite composite = new Composite(parent, 0); GridData data = new GridData(GridData.FILL_HORIZONTAL, GridData.FILL_VERTICAL, true, true); data.widthHint = 600; data.heightHint = 400; composite.setLayoutData(data); composite.setLayout(new GridLayout()); treeViewer = new TreeViewer(composite, SWT.CHECK | SWT.BORDER); treeViewer.setLabelProvider(new BaseViewInfoLabelProvider()); treeViewer.setContentProvider(new BaseViewInfoContentProvider()); treeViewer.setInput(getViewInfo()); treeViewer .getTree() .addSelectionListener( new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { // should not be called } public void widgetSelected(SelectionEvent e) { treeItemSelected(e); } }); data = new GridData(GridData.FILL_HORIZONTAL, GridData.FILL_VERTICAL, true, true); data.widthHint = 600; data.heightHint = 400; treeViewer.getTree().setLayoutData(data); getTreeViewer().expandAll(); populateTree(); return composite; }
public void createButtonPanel(Shell dialog) { Composite buttonPanel = new Composite(dialog, SWT.NONE); GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false); buttonPanel.setLayoutData(gridData); buttonPanel.setLayout(new GridLayout(4, false)); String buttonAlign = System.getProperty("org.pentaho.di.buttonPosition", "right") .toLowerCase(); //$NON-NLS-1$ //$NON-NLS-2$ if (!"left".equals(buttonAlign)) { // $NON-NLS-1$ Label emptyLabel = new Label(buttonPanel, SWT.NONE); gridData = new GridData(SWT.FILL, SWT.FILL, true, false); emptyLabel.setLayoutData(gridData); } okButton = new Button(buttonPanel, SWT.PUSH); okButton.setText(Messages.getString("VfsFileChooserDialog.ok")); // $NON-NLS-1$ gridData = new GridData(SWT.FILL, SWT.FILL, false, false); gridData.widthHint = 90; okButton.setLayoutData(gridData); okButton.addSelectionListener(this); cancelButton = new Button(buttonPanel, SWT.PUSH); cancelButton.setText(Messages.getString("VfsFileChooserDialog.cancel")); // $NON-NLS-1$ cancelButton.addSelectionListener(this); gridData = new GridData(SWT.FILL, SWT.FILL, false, false); gridData.widthHint = 90; cancelButton.setLayoutData(gridData); if ("center".equals(buttonAlign)) { // $NON-NLS-1$ Label emptyLabel = new Label(buttonPanel, SWT.NONE); gridData = new GridData(SWT.FILL, SWT.FILL, true, false); emptyLabel.setLayoutData(gridData); } }
/** * Fills this field editor's basic controls into the given parent. * * <p>The string field implementation of this <code>FieldEditor</code> framework method * contributes the text field. Subclasses may override but must call <code>super.doFillIntoGrid * </code>. */ protected void doFillIntoGrid(Composite parent, int numColumns) { getLabelControl(parent); textField = getTextControl(parent); GridData gd = new GridData(); gd.horizontalSpan = numColumns - 1; if (widthInChars != UNLIMITED) { GC gc = new GC(textField); try { Point extent = gc.textExtent("X"); // $NON-NLS-1$ gd.widthHint = widthInChars * extent.x; } finally { gc.dispose(); } } else { // System.out.println("fill"); gd.horizontalAlignment = GridData.FILL_BOTH; gd.verticalSpan = 4; gd.horizontalSpan = 1; gd.grabExcessVerticalSpace = true; gd.widthHint = 400; gd.heightHint = 60; // gd.grabExcessHorizontalSpace = true; } textField.setLayoutData(gd); }
private void addGeneratorSection(Composite parent) { String generator = config.getGenerator(); agxInfoLabel = new Label(parent, SWT.NONE); agxInfoLabel.setText(agx.getInfo(generator)); Composite composite = createColComposite(parent); GridData labelGd = new GridData(); labelGd.widthHint = convertWidthInCharsToPixels(LABEL_FIELD_WIDTH); Label generatorLabel = new Label(composite, SWT.NONE); generatorLabel.setLayoutData(labelGd); generatorLabel.setText(GENERATOR_TITLE); GridData textGd = new GridData(); textGd.widthHint = convertWidthInCharsToPixels(TEXT_FIELD_WIDTH); generatorText = new Text(composite, SWT.SINGLE | SWT.BORDER); generatorText.setLayoutData(textGd); generatorText.setText(generator); Button button = new Button(composite, SWT.PUSH); button.setText("browse"); addGeneratorListener(button); }
@Override public void createControl(Composite parent) { GridData gd_txt = new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1); gd_txt.widthHint = 200; GridData gd_desc = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 4); gd_desc.widthHint = 375; Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); lblmsg = new Label(composite, SWT.NONE); lblmsg.setText(""); Button btnchk = new Button(composite, SWT.CHECK); btnchk.setText("Open this case for investigation"); btnchk.addSelectionListener( new SelectionListener() { @Override public void widgetSelected(SelectionEvent arg0) { if (((Button) arg0.widget).getSelection()) { OpenCase(); } } @Override public void widgetDefaultSelected(SelectionEvent arg0) {} }); setControl(composite); }
@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(); }
@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); }
private void createButtons(Composite parent) { // Create and configure the "Add" button Button add = new Button(parent, SWT.PUSH | SWT.CENTER); add.setText("Add"); GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gridData.widthHint = 80; add.setLayoutData(gridData); add.addSelectionListener( new SelectionAdapter() { // Add a URIMap to the URIMapList and refresh the view public void widgetSelected(SelectionEvent e) { mapList.addMap(); } }); // Create and configure the "Delete" button Button delete = new Button(parent, SWT.PUSH | SWT.CENTER); delete.setText("Delete"); gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gridData.widthHint = 80; delete.setLayoutData(gridData); delete.addSelectionListener( new SelectionAdapter() { // Remove the selection and refresh the view public void widgetSelected(SelectionEvent e) { URIMap map = (URIMap) ((IStructuredSelection) tableViewer.getSelection()).getFirstElement(); if (map != null) { mapList.removeMap(map); } } }); }
/** {@inheritDoc} */ @Override protected void createFieldEditors() { disableResolvers = new BooleanFieldEditor( EMFCompareUIPreferences.DISABLE_RESOLVERS_PREFERENCE, EMFCompareIDEUIMessages.getString( "ModelResolutionPreferencesPage.disableResolvers"), //$NON-NLS-1$ getFieldEditorParent()); addField(disableResolvers); useThreads = new BooleanFieldEditor( EMFCompareUIPreferences.DISABLE_THREADING_PREFERENCE, EMFCompareIDEUIMessages.getString( "ModelResolutionPreferencesPage.disableThreading"), //$NON-NLS-1$ getFieldEditorParent()); addField(useThreads); final Composite resolutionScopeComposite = new Composite(getFieldEditorParent(), SWT.BORDER); resolutionScopeComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); resolutionScopeComposite.setLayout(new GridLayout(2, false)); resolutionScopeMainDescription = new Label(resolutionScopeComposite, SWT.WRAP); resolutionScopeMainDescription.setText( EMFCompareIDEUIMessages.getString( "ModelResolutionPreferencesPage.resolutionScope.description")); //$NON-NLS-1$ final GridData layoutData = new GridData(GridData.FILL_HORIZONTAL); layoutData.widthHint = 400; layoutData.horizontalSpan = 2; resolutionScopeMainDescription.setLayoutData(layoutData); // Use a composite for the combo editor field alone, to prevent it from grabbing all horizontal // space. resolutionScopeComboComposite = new Composite(resolutionScopeComposite, SWT.NONE); resolutionScopeComboComposite.setLayout(new GridLayout(2, false)); resolutionScope = new ComboFieldEditor( EMFCompareUIPreferences.RESOLUTION_SCOPE_PREFERENCE, EMFCompareIDEUIMessages.getString( "ModelResolutionPreferencesPage.resolutionScope"), //$NON-NLS-1$ scopeNamesAndValues, resolutionScopeComboComposite); addField(resolutionScope); resolutionScopeComboComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); resolutionScopeDescriptionComposite = new Composite(resolutionScopeComposite, SWT.BORDER); resolutionScopeDescriptionComposite.setLayout(new GridLayout(1, true)); GridData descriptionData = new GridData(SWT.FILL, SWT.FILL, true, false); descriptionData.widthHint = 200; resolutionScopeDescriptionComposite.setLayoutData(descriptionData); resolutionScopeDescriptionLabel = new Label(resolutionScopeDescriptionComposite, SWT.WRAP); GridData labelData = new GridData(SWT.FILL, SWT.FILL, true, true); resolutionScopeDescriptionLabel.setLayoutData(labelData); updateFieldEnablement( getPreferenceStore().getBoolean(EMFCompareUIPreferences.DISABLE_RESOLVERS_PREFERENCE)); updateScopeDescription( getPreferenceStore().getString(EMFCompareUIPreferences.RESOLUTION_SCOPE_PREFERENCE)); }
@Override protected Control createContents(final Composite parent) { noDefaultAndApplyButton(); final Composite panel = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(); layout.numColumns = 2; panel.setLayout(layout); final Label img = new Label(panel, SWT.NONE); img.setLayoutData(new GridData(79, SWT.DEFAULT)); img.setImage( ResourceManager.getPluginImage(ErlideUIPlugin.PLUGIN_ID, "icons/full/obj16/erlang058.gif")); final Group composite = new Group(panel, SWT.NONE); final GridData gd_composite = new GridData(SWT.FILL, SWT.CENTER, false, false); gd_composite.widthHint = 356; composite.setLayoutData(gd_composite); composite.setLayout(new GridLayout()); final Label text = new Label(composite, SWT.NONE); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); text.setToolTipText("Vlad Dumitrescu, Jakob Cederlund and others"); text.setText(PreferenceMessages.ErlangPreferencePage_2); final Label textv = new Label(composite, SWT.NONE); textv.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); final String version = ErlangPlugin.getDefault().getCore().getFeatureVersion(); textv.setText(" version " + version); final Link erlideorgLink = new Link(composite, SWT.NONE); erlideorgLink.setText(PreferenceMessages.ErlangPreferencePage_3); final Link updateLink = new Link(composite, SWT.NONE); updateLink.setText(PreferenceMessages.ErlangPreferencePage_4); new Label(panel, SWT.NONE); final Button reportButton = new Button(panel, SWT.NONE); reportButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn( getShell(), "org.erlide.ui.reporting", null, null); } }); reportButton.setText("Report problems"); new Label(panel, SWT.NONE); txtLocalErlangNodes = new Text(panel, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI); txtLocalErlangNodes.setText( "This machine supports local Erlang nodes with only short names \nbecause of its hostname configuration. \n\nTo enable long names locally, make sure that the machine \nhas a proper FQDN on the network. "); final GridData gd_txtLocalErlangNodes = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_txtLocalErlangNodes.widthHint = 339; gd_txtLocalErlangNodes.heightHint = 87; txtLocalErlangNodes.setLayoutData(gd_txtLocalErlangNodes); txtLocalErlangNodes.setVisible(false); return panel; }
protected Control createContents(Composite ancestor) { initializeDialogUnits(ancestor); noDefaultAndApplyButton(); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginHeight = 0; layout.marginWidth = 0; ancestor.setLayout(layout); Label l = new Label(ancestor, SWT.WRAP); l.setFont(ancestor.getFont()); l.setText( "Add, remove or edit jBPM Runtime definitions. " + "By default, the checked jBPM Runtime is added to the build " + "path of newly created jBPM projects."); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 1; gd.widthHint = 300; l.setLayoutData(gd); l = new Label(ancestor, SWT.NONE); gd = new GridData(GridData.FILL_HORIZONTAL); gd.heightHint = 1; l.setLayoutData(gd); jBPMRuntimesBlock = new JBPMRuntimesBlock(); jBPMRuntimesBlock.createControl(ancestor); JBPMRuntime[] runtimes = JBPMRuntimeManager.getJBPMRuntimes(); jBPMRuntimesBlock.setJBPMRuntimes(runtimes); for (JBPMRuntime runtime : runtimes) { if (runtime.isDefault()) { jBPMRuntimesBlock.setDefaultJBPMRuntime(runtime); break; } } if (jBPMRuntimesBlock.getDefaultJBPMRuntime() == null) { setErrorMessage("Select a default jBPM Runtime"); } Control control = jBPMRuntimesBlock.getControl(); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 1; data.widthHint = 450; control.setLayoutData(data); jBPMRuntimesBlock.addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { JBPMRuntime runtime = jBPMRuntimesBlock.getDefaultJBPMRuntime(); if (runtime == null) { setErrorMessage("Select a default jBPM Runtime"); } else { setErrorMessage(null); } } }); applyDialogFont(ancestor); return ancestor; }
private void createWizardNoticeScreen(final Shell dialogShell) { dialogShell.setLayout(new GridLayout(1, false)); Label lblNewLabel = new Label(dialogShell, SWT.NONE); lblNewLabel.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 12, SWT.NORMAL)); lblNewLabel.setForeground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_WHITE)); lblNewLabel.setText("TwoCents Cadastro"); Label lblNewLabel_4 = new Label(dialogShell, SWT.NONE); lblNewLabel_4.setFont( org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 10, SWT.NORMAL)); lblNewLabel_4.setForeground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_WHITE)); lblNewLabel_4.setText("Informa\u00E7\u00F5es sobre usu\u00E1rio :"); Group group = new Group(dialogShell, SWT.NONE); group.setForeground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_WHITE)); group.setLayout(new GridLayout(2, false)); group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); Label nomeLbl = new Label(group, SWT.NONE); nomeLbl.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 12, SWT.NORMAL)); nomeLbl.setForeground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_WHITE)); nomeLbl.setText("Nome :"); nomeTxt = new Text(group, SWT.BORDER); GridData gd_nomeTxt = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_nomeTxt.widthHint = 244; nomeTxt.setLayoutData(gd_nomeTxt); Label lblEmail = new Label(group, SWT.NONE); lblEmail.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 12, SWT.NORMAL)); lblEmail.setText("E-mail :"); lblEmail.setForeground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_WHITE)); emailTxt = new Text(group, SWT.BORDER); GridData gd_emailTxt = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_emailTxt.widthHint = 236; emailTxt.setLayoutData(gd_emailTxt); Label lblLogin = new Label(group, SWT.NONE); lblLogin.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 12, SWT.NORMAL)); lblLogin.setText("Login :"******"Segoe UI", 12, SWT.NORMAL)); lblSenha.setText("Senha :"); lblSenha.setForeground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_WHITE)); passwd = new Text(group, SWT.BORDER | SWT.PASSWORD); passwd.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); }
@Override public void createPartControl(Composite parent) { parent.setLayout(new GridLayout(3, false)); new Label(parent, SWT.NONE); Label lblNewLabel = new Label(parent, SWT.NONE); GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_lblNewLabel.widthHint = 301; lblNewLabel.setLayoutData(gd_lblNewLabel); lblNewLabel.setText("Seach Books"); new Label(parent, SWT.NONE); new Label(parent, SWT.NONE); findByTitle = new Text(parent, SWT.BORDER); GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1); gd_text.widthHint = 335; findByTitle.setLayoutData(gd_text); findByTitle.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); prefix = findByTitle.getText(); createViewer(parent, prefix); { Button btnAddBook = new Button(parent, SWT.LEFT); btnAddBook.addSelectionListener(actionAddBook(parent)); btnAddBook.setText("Add Book"); } new Label(parent, SWT.LEFT); { Button btnRemoveBook = new Button(parent, SWT.NONE); btnRemoveBook.addSelectionListener(actionDelate()); btnRemoveBook.setText("Delete book"); } new Label(parent, SWT.NONE); Menu menu = new Menu(parent); parent.setMenu(menu); MenuItem mntmAddBook = new MenuItem(menu, SWT.NONE); mntmAddBook.setText("Add Book"); mntmAddBook.addSelectionListener(actionAddBook(parent)); filter = new BookTitleFilter(findByTitle.getText()); tableBooks.addFilter(filter); findByTitle.addKeyListener( new KeyAdapter() { public void keyReleased(KeyEvent ke) { prefix = findByTitle.getText(); filter.setPrefix(prefix); tableBooks.refresh(); } }); }
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 initialize() { String filename = StringUtils.defaultString(level.getName()); GridData gridDataLabel = new GridData(); gridDataLabel.widthHint = 100; gridDataLabel.verticalAlignment = GridData.CENTER; gridDataLabel.horizontalAlignment = GridData.END; GridData gridDataText = new GridData(); gridDataText.heightHint = -1; gridDataText.widthHint = 150; GridLayout gridLayoutMy = new GridLayout(); gridLayoutMy.numColumns = 2; gridLayoutMy.marginWidth = 25; gridLayoutMy.verticalSpacing = 5; gridLayoutMy.horizontalSpacing = 20; gridLayoutMy.marginHeight = 25; gridLayoutMy.makeColumnsEqualWidth = false; GridData gridDataMy = new GridData(); gridDataMy.grabExcessHorizontalSpace = true; gridDataMy.verticalAlignment = GridData.CENTER; gridDataMy.horizontalSpan = 1; gridDataMy.horizontalAlignment = GridData.FILL; this.setLayoutData(gridDataMy); this.setLayout(gridLayoutMy); Label labelTitle = new Label(this, SWT.RIGHT); labelTitle.setText( "* ".concat(LabelHolder.get("dialog.pojo.level.fields.title"))); // $NON-NLS-1$ labelTitle.setLayoutData(gridDataLabel); textTitle = new Text(this, SWT.BORDER); textTitle.setTextLimit(256); textTitle.setLayoutData(gridDataText); textTitle.setText(StringUtils.defaultString(level.getTitle())); Label labelName = new Label(this, SWT.RIGHT); labelName.setText( "* ".concat(LabelHolder.get("dialog.pojo.level.fields.name"))); // $NON-NLS-1$ labelName.setLayoutData(gridDataLabel); textName = new Text(this, SWT.BORDER); textName.setTextLimit(256); textName.setLayoutData(gridDataText); textName.setText(filename); textName.addVerifyListener(new FileNameVerifier()); textName.addModifyListener(new ModifyListenerClearErrorMessages(dialogCreator)); Collection<String> forbiddenNames = new ArrayList<String>(); Collection<Level> sisters = level.getParent().getSublevels(); if (CollectionUtils.isNotEmpty(sisters)) for (Level otherLevel : sisters) forbiddenNames.add(otherLevel.getName()); if (StringUtils.isNotBlank(filename)) forbiddenNames.remove(filename); if (level.getId() == APoormansObject .UNSET_VALUE) // suggestion of the file name should work just with new objects textTitle.addModifyListener( new FilenameSuggestorListener(dialogCreator, textName, forbiddenNames)); }
/* (non-Javadoc) * Method declared on Dialog. */ @Override protected Control createDialogArea(Composite parent) { Font font = parent.getFont(); // create composite Composite composite = (Composite) super.createDialogArea(parent); // create message if (message != null) { Label label = new Label(composite, SWT.WRAP); label.setText(message); GridData data = new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); label.setFont(font); } combo = new Combo(composite, SWT.READ_ONLY | SWT.BORDER); combo.add(Boolean.TRUE.toString()); combo.add(Boolean.FALSE.toString()); GridData gridData = new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); gridData.heightHint = 12; gridData.widthHint = 30; combo.setLayoutData(gridData); combo.setFont(font); combo.addSelectionListener( new SelectionAdapter() { /* * (non-Javadoc) * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { if (okButton.isEnabled()) { return; } okButton.setEnabled(true); } }); return composite; }
private void addFileNameControls(Composite group) { // grid layout with 2 columns // Line with label, combo and button Label label = new Label(group, SWT.LEAD); label.setText(SearchMessages.SearchPage_fileNamePatterns_text); label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); label.setFont(group.getFont()); fExtensions = new Combo(group, SWT.SINGLE | SWT.BORDER); fExtensions.addModifyListener( new ModifyListener() { @Override public void modifyText(ModifyEvent e) { updateOKStatus(); } }); GridData data = new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1); data.widthHint = convertWidthInCharsToPixels(50); fExtensions.setLayoutData(data); fExtensions.setFont(group.getFont()); Button button = new Button(group, SWT.PUSH); button.setText(SearchMessages.SearchPage_browse); GridData gridData = new GridData(SWT.BEGINNING, SWT.CENTER, false, false, 1, 1); gridData.widthHint = SWTUtil.getButtonWidthHint(button); button.setLayoutData(gridData); button.setFont(group.getFont()); fFileTypeEditor = new FileTypeEditor(fExtensions, button); // Text line which explains the special characters Label description = new Label(group, SWT.LEAD); description.setText(SearchMessages.SearchPage_fileNamePatterns_hint); description.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); description.setFont(group.getFont()); fSearchDerivedCheckbox = new Button(group, SWT.CHECK); fSearchDerivedCheckbox.setText(SearchMessages.TextSearchPage_searchDerived_label); fSearchDerivedCheckbox.setSelection(fSearchDerived); fSearchDerivedCheckbox.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fSearchDerived = fSearchDerivedCheckbox.getSelection(); writeConfiguration(); } }); fSearchDerivedCheckbox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); fSearchDerivedCheckbox.setFont(group.getFont()); }
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 createDefinitionParametersButton(Composite comp, final TableViewer parView) { Composite composite = new Composite(comp, SWT.NONE); GridData gd = new GridData(); gd.horizontalSpan = 2; gd.horizontalAlignment = SWT.CENTER; composite.setLayout(new GridLayout(2, false)); composite.setLayoutData(gd); final Button addButton = new Button(composite, SWT.NONE); addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION)); addButton.setToolTipText( DefaultMessagesImpl.getString("PatternMasterDetailsPage.add")); // $NON-NLS-1$ GridData labelGd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER); labelGd.horizontalAlignment = SWT.RIGHT; labelGd.widthHint = 65; addButton.setLayoutData(labelGd); addButton.addListener( SWT.MouseDown, new Listener() { public void handleEvent(Event event) { JavaUDIIndicatorParameter newItem = DomainHelper.createJavaUDIIndicatorParameter( "key", "value"); // $NON-NLS-1$ //$NON-NLS-2$ content.add(newItem); viewer.refresh(); checkFieldsValue(); } }); final Button romveButton = new Button(composite, SWT.NONE); romveButton.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION)); romveButton.setToolTipText( DefaultMessagesImpl.getString("PatternMasterDetailsPage.del")); // $NON-NLS-1$ GridData reGd = new GridData(); reGd.horizontalAlignment = SWT.LEFT; reGd.widthHint = 65; romveButton.setLayoutData(reGd); romveButton.addListener( SWT.MouseDown, new Listener() { public void handleEvent(Event event) { IStructuredSelection selection = (IStructuredSelection) parView.getSelection(); Object o = selection.getFirstElement(); if (o instanceof JavaUDIIndicatorParameter) { content.remove(o); viewer.refresh(content); checkFieldsValue(); } } }); }
/** * @inheritDoc このクラスではパネルを正方形に使います。 * @see IgoOutlinePanel#setSizeHint(Point) */ public void setSizeHint(Point boardSize) { ArgumentChecker.throwIfNull(boardSize); GridData gridData; gridData = (GridData) frame_.getLayoutData(); gridData.widthHint = boardSize.x; int margin = ((GridLayout) frame_.getLayout()).marginWidth; gridData = (GridData) boardControl_.getLayoutData(); gridData.widthHint = boardSize.x - frame_.getBorderWidth() * 2 - margin * 2; gridData.heightHint = boardSize.y - frame_.getBorderWidth() * 2 - margin * 2; gridData = (GridData) annotationLabel_.getLayoutData(); gridData.widthHint = boardSize.x - frame_.getBorderWidth() * 2 - margin * 2; }
private void updateRangeMatchingArrangement() { if (btnSetEndMarker.getSelection()) { containingEndText.setVisible(true); gd_endText.widthHint = 393; lblContainingText.setText(Messages.ConsoleConfigDialog_StartExpession); lblContainingEndText.setText(Messages.ConsoleConfigDialog_EndExpression); } else { containingEndText.setVisible(false); gd_endText.widthHint = 0; updateLblText(); lblContainingEndText.setText(""); // $NON-NLS-1$ } lblContainingEndText.pack(); composite.layout(); }
void createRTFTransfer(Composite copyParent, Composite pasteParent) { // RTF Transfer Label l = new Label(copyParent, SWT.NONE); l.setText("RTFTransfer:"); // $NON-NLS-1$ copyRtfText = new Text(copyParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); copyRtfText.setText("some\nrtf\ntext"); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.heightHint = data.widthHint = SIZE; copyRtfText.setLayoutData(data); Button b = new Button(copyParent, SWT.PUSH); b.setText("Copy"); b.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { String data = copyRtfText.getText(); if (data.length() > 0) { status.setText(""); data = "{\\rtf1{\\colortbl;\\red255\\green0\\blue0;}\\uc1\\b\\i " + data + "}"; clipboard.setContents( new Object[] {data}, new Transfer[] {RTFTransfer.getInstance()}); } else { status.setText("nothing to copy"); } } }); l = new Label(pasteParent, SWT.NONE); l.setText("RTFTransfer:"); // $NON-NLS-1$ pasteRtfText = new Text(pasteParent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); data = new GridData(GridData.FILL_HORIZONTAL); data.heightHint = data.widthHint = SIZE; pasteRtfText.setLayoutData(data); b = new Button(pasteParent, SWT.PUSH); b.setText("Paste"); b.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { String data = (String) clipboard.getContents(RTFTransfer.getInstance()); if (data != null && data.length() > 0) { status.setText(""); pasteRtfText.setText("start paste>" + data + "<end paste"); } else { status.setText("nothing to paste"); } } }); }
/** Creates a new DoubleField. */ public DoubleField(Composite parent, int style, IPrintPreferences prefs, int index) { super(parent, style); _preferences = prefs; _index = index; FillLayout fill = new FillLayout(); setLayout(fill); _text = new Text(this, SWT.SINGLE | SWT.BORDER); updateControl(); _text.addModifyListener(this); _text.addMouseListener( new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { _text.selectAll(); } @Override public void mouseUp(MouseEvent e) { // _text.selectAll(); } }); GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gridData.widthHint = 50; // setLayoutData(gridData); }
/** * Creates the project location specification controls. * * @param projectGroup the parent composite */ private void createUserSpecifiedProjectLocationGroup(Composite projectGroup) { Font dialogFont = projectGroup.getFont(); // project location entry field this.locationPathField = new Text(projectGroup, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = SIZING_TEXT_FIELD_WIDTH; this.locationPathField.setLayoutData(data); this.locationPathField.setFont(dialogFont); // browse button this.browseButton = new Button(projectGroup, SWT.PUSH); this.browseButton.setText(DataTransferMessages.DataTransfer_browse); this.browseButton.setFont(dialogFont); setButtonLayoutData(this.browseButton); this.browseButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { handleLocationBrowseButtonPressed(); } }); locationPathField.addListener(SWT.Modify, locationModifyListener); }
/** * Creates the project name specification controls. * * @param parent the parent composite */ private final void createProjectNameGroup(Composite parent) { Font dialogFont = parent.getFont(); // project specification group Composite projectGroup = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; projectGroup.setFont(dialogFont); projectGroup.setLayout(layout); projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // new project label Label projectLabel = new Label(projectGroup, SWT.NONE); projectLabel.setText(DataTransferMessages.WizardExternalProjectImportPage_nameLabel); projectLabel.setFont(dialogFont); // new project name entry field projectNameField = new Text(projectGroup, SWT.BORDER | SWT.READ_ONLY); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = SIZING_TEXT_FIELD_WIDTH; projectNameField.setLayoutData(data); projectNameField.setFont(dialogFont); projectNameField.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); }
private Composite addOrderEntryChoices(Composite buttonComposite) { Label enterLabel = new Label(buttonComposite, SWT.NONE); enterLabel.setText(CodeInsertionDialog.insertionPoint); if (!enableInsertPosition) enterLabel.setEnabled(false); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); enterLabel.setLayoutData(gd); final Combo enterCombo = new Combo(buttonComposite, SWT.READ_ONLY); enterCombo.setVisibleItemCount(COMBO_VISIBLE_ITEM_COUNT); if (!enableInsertPosition) enterCombo.setEnabled(false); enterCombo.setItems(fLabels.toArray(new String[fLabels.size()])); enterCombo.select(currentPositionIndex); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = convertWidthInCharsToPixels(60); enterCombo.setLayoutData(gd); enterCombo.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { int index = enterCombo.getSelectionIndex(); setInsertPosition(index); System.out.println(getElementPosition().toString()); } }); return buttonComposite; }
private void createFileContentsGroup(Composite parent) { Group theGroup = WidgetFactory.createGroup( parent, getString("fileContentsGroup"), SWT.NONE, 1, 4); // $NON-NLS-1$ GridData groupGD = new GridData(GridData.FILL_BOTH); groupGD.heightHint = GROUP_HEIGHT_190; groupGD.widthHint = 400; theGroup.setLayoutData(groupGD); this.fileContentsViewer = new ListViewer(theGroup, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 4; this.fileContentsViewer.getControl().setFont(JFaceResources.getTextFont()); this.fileContentsViewer.getControl().setLayoutData(data); if (this.dataFileInfo != null) { for (String row : this.dataFileInfo.getCachedFirstLines()) { if (row != null) { this.fileContentsViewer.add(row); } } } // Add a Context Menu final MenuManager columnMenuManager = new MenuManager(); this.fileContentsViewer.getControl().setMenu(columnMenuManager.createContextMenu(parent)); }
protected void createTextboxArea(final Shell parent) { fAddText = new Text(parent, SWT.BORDER | SWT.SINGLE); GridData gdText = new GridData(GridData.FILL_HORIZONTAL); gdText.widthHint = 400; fAddText.setLayoutData(gdText); }
private Text newText(Composite parent) { Text t = new Text(parent, SWT.BORDER); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.widthHint = SIZING_TEXT_FIELD_WIDTH; t.setLayoutData(gd); return t; }
/* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); Label label = new Label(composite, SWT.WRAP); label.setText(MessagesForDetailPane.PaneMaxLengthDialog_MaxCharactersToDisplay); GridData data = new GridData( GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); label.setLayoutData(data); label.setFont(parent.getFont()); fTextWidget = new Text(composite, SWT.SINGLE | SWT.BORDER); fTextWidget.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); fTextWidget.setText(fValue); fTextWidget.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { validateInput(); fValue = fTextWidget.getText(); } }); fErrorTextWidget = new Text(composite, SWT.READ_ONLY); fErrorTextWidget.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); fErrorTextWidget.setBackground( fErrorTextWidget.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); setErrorMessage(fErrorMessage); applyDialogFont(composite); return composite; }