private Button createButton(Composite parent, FormToolkit toolkit, String label) { Button button = toolkit.createButton(parent, label, SWT.CHECK); GridData gd = new GridData(); gd.horizontalSpan = F_NUM_COLUMNS; button.setLayoutData(gd); return button; }
protected Button[] createTrueFalseButtons(Composite parent, FormToolkit toolkit, int colSpan) { Composite comp = toolkit.createComposite(parent, SWT.NONE); GridLayout gl = new GridLayout(2, false); gl.marginHeight = gl.marginWidth = 0; comp.setLayout(gl); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = colSpan; gd.horizontalIndent = FormLayoutFactory.CONTROL_HORIZONTAL_INDENT; comp.setLayoutData(gd); Button tButton = toolkit.createButton(comp, BOOLS[0], SWT.RADIO); Button fButton = toolkit.createButton(comp, BOOLS[1], SWT.RADIO); gd = new GridData(); gd.horizontalIndent = 20; fButton.setLayoutData(gd); return new Button[] {tButton, fButton}; }
private void createLaunchersOption(Composite client, FormToolkit toolkit) { fLaunchersButton = toolkit.createButton(client, PDEUIMessages.ProductInfoSection_launchers, SWT.CHECK); GridData data = new GridData(); data.horizontalSpan = 2; fLaunchersButton.setLayoutData(data); fLaunchersButton.setEnabled(isEditable()); fLaunchersButton.addSelectionListener(widgetSelectedAdapter(e -> getProduct().setIncludeLaunchers(fLaunchersButton.getSelection()))); }
private void createPatchButton(FormToolkit toolkit, Composite container) { fPatchCheckBox = toolkit.createButton(container, PDEUIMessages.FeatureDetailsSection_patch, SWT.CHECK); fPatchCheckBox.addSelectionListener(widgetSelectedAdapter(e -> { try { applyIsPatch(fPatchCheckBox.getSelection()); } catch (CoreException ce) { PDEPlugin.logException(ce); } })); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; fPatchCheckBox.setLayoutData(gd); fPatchCheckBox.setEnabled(isEditable()); }
private void createReexportButton(FormToolkit toolkit, Composite container) { fReexportButton = toolkit.createButton(container, PDEUIMessages.ManifestEditor_MatchSection_reexport, SWT.CHECK); fReexportButton.addSelectionListener(widgetSelectedAdapter(e -> { if (!fBlockChanges && fCurrentImport instanceof IPluginImport) { try { IPluginImport iimport = (IPluginImport) fCurrentImport; iimport.setReexported(fReexportButton.getSelection()); } catch (CoreException ex) { PDEPlugin.logException(ex); } } })); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; fReexportButton.setLayoutData(gd); }
/** * New radio button. * * @param parent the parent * @param label the label * @param toolTip the tool tip * @param selected the selected * @return the button */ // ************************************************** public Button newRadioButton(Composite parent, String label, String toolTip, boolean selected) { Button button = toolkit.createButton(parent, label, SWT.RADIO); button.setToolTipText(toolTip); button.setSelection(selected); button.addListener(SWT.Selection, this); return button; }
private void createOptionalButton(FormToolkit toolkit, Composite container) { fOptionalButton = toolkit.createButton(container, PDEUIMessages.ManifestEditor_MatchSection_optional, SWT.CHECK); fOptionalButton.addSelectionListener(widgetSelectedAdapter(e -> { if (fBlockChanges) return; if (!fBlockChanges && fCurrentImport instanceof IPluginImport) { try { IPluginImport iimport = (IPluginImport) fCurrentImport; iimport.setOptional(fOptionalButton.getSelection()); } catch (CoreException ex) { PDEPlugin.logException(ex); } } })); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; fOptionalButton.setLayoutData(gd); }
protected void createSingleton(Composite parent, FormToolkit toolkit, IActionBars actionBars, String label) { fSingleton = toolkit.createButton(parent, label, SWT.CHECK); TableWrapData td = new TableWrapData(); td.colspan = 3; fSingleton.setLayoutData(td); fSingleton.setEnabled(isEditable()); fSingleton.addSelectionListener(widgetSelectedAdapter(e -> { IManifestHeader header = getSingletonHeader(); if (header instanceof BundleSymbolicNameHeader) ((BundleSymbolicNameHeader) header).setSingleton(fSingleton.getSelection()); })); }
@Override public void create(Composite parent, boolean enabled) { checkbox = fBlock.getToolkit().createButton(parent, getLabel(), SWT.CHECK); TableWrapData td = new TableWrapData(); td.colspan = 2; checkbox.setLayoutData(td); checkbox.setEnabled(enabled); createCommentDecorator(checkbox, enabled); }
public void createStandardCheckbox ( final Composite parent, final String attributeName, final String label, final IObservableMap data, final Object valueType ) { final Button button = this.toolkit.createButton ( parent, label, SWT.CHECK ); { final GridData gd = new GridData ( GridData.FILL_HORIZONTAL ); gd.horizontalSpan = 3; button.setLayoutData ( gd ); final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType ); this.dbc.bindValue ( WidgetProperties.selection ().observe ( button ), value ); } }
public void createStandardCheckbox ( final Composite parent, final String attributeName, final String label, final IObservableMap data, final Object valueType ) { final Button button = this.toolkit.createButton ( parent, label, SWT.CHECK ); { final GridData gd = new GridData ( GridData.FILL_HORIZONTAL ); gd.horizontalSpan = 3; button.setLayoutData ( gd ); final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType ); this.dbc.bindValue ( WidgetProperties.selection ().observe ( button ), value ); } }
/** * New check box. * * @param parent the parent * @param label the label * @param tip the tip * @return the button */ public Button newCheckBox(Composite parent, String label, String tip) { Button button = toolkit.createButton(parent, label, SWT.CHECK); button.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL)); button.pack(); button.setToolTipText(tip); button.addListener(SWT.Selection, this); return button; }
protected Button createButton(Composite parent, String label, int index, FormToolkit toolkit) { Button button; if (toolkit != null) button = toolkit.createButton(parent, label, SWT.PUSH); else { button = new Button(parent, SWT.PUSH); button.setText(label); } GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); button.setLayoutData(gd); button.setData(Integer.valueOf(index)); // Set the default button size button.setFont(JFaceResources.getDialogFont()); PixelConverter converter = new PixelConverter(button); int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); gd.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); return button; }
private Group createGroup(Composite parent) { fRadioButton = fToolkit.createButton(parent, "", SWT.RADIO); //$NON-NLS-1$ fRadioButton.addSelectionListener(widgetSelectedAdapter(e -> enable(fRadioButton.getSelection()))); fGroup = new Group(parent, SWT.NONE); GridData gd = new GridData(GridData.FILL_HORIZONTAL); fGroup.setLayoutData(gd); fGroup.setLayout(new GridLayout()); fGroup.setText(getName()); createGroupContents(fGroup); fToolkit.adapt(fGroup, false, false); return fGroup; }
@Override public void createContents(Composite parent, FormToolkit toolkit, int span) { super.createContents(parent, toolkit, span); if (part.isEditable()) { Button button = toolkit.createButton(parent, PDEUIMessages.ReferenceAttributeRow_browse, SWT.PUSH); button.addSelectionListener(widgetSelectedAdapter(e -> { if (!isReferenceModel()) browse(); })); //button.setEnabled(part.isEditable()); } }
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); new Label(composite, SWT.WRAP).setText(""); //$NON-NLS-1$ String sAddToFlowPrompt = Messages .getString("MultiResourceSelectionDialogWithFlowOption.addSelectedAEsToEndOfFlow"); //$NON-NLS-1$ FormToolkit factory = new FormToolkit(TAEConfiguratorPlugin.getDefault().getFormColors( parent.getDisplay())); autoAddToFlowButton = factory.createButton(composite, sAddToFlowPrompt, SWT.CHECK); m_bAutoAddToFlow = "false".equals(CDEpropertyPage.getAddToFlow(editor.getProject())) ? false : true; autoAddToFlowButton.setSelection(m_bAutoAddToFlow); autoAddToFlowButton.setBackground(null); return composite; }
private void createLazyStart(Composite parent, FormToolkit toolkit, IActionBars actionBars) { fLazyStart = toolkit.createButton(parent, PDEUIMessages.PluginGeneralInfoSection_lazyStart, SWT.CHECK); TableWrapData td = new TableWrapData(); td.colspan = 3; fLazyStart.setLayoutData(td); fLazyStart.setEnabled(isEditable()); fLazyStart.addSelectionListener(widgetSelectedAdapter(e -> { LazyStartHeader[] headers = getLazyStartHeaders(); // must block the refresh otherwise we have problems with multiple activation headers. fBlockListener = true; for (LazyStartHeader header : headers) header.setLazyStart(fLazyStart.getSelection()); if (headers.length == 0) getBundle().setHeader(getLazyStartHeaderName(), getLazyStateHeaderValue(fLazyStart.getSelection())); fBlockListener = false; })); }
private void createMoreButton() { moreButton = getManagedForm().getToolkit().createButton(container, "More...", //$NON-NLS-1$ SWT.PUSH); moreButton.addSelectionListener(widgetSelectedAdapter(e -> BusyIndicator.showWhile(getSection().getDisplay(), () -> getPage().getEditor().setActivePage(morePageId)))); moreButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); }
private void createPreviewLabelComp(Composite parent) { Composite preLabelComp = fCCP.createComposite(parent, GridData.FILL_HORIZONTAL, 3, false, 0); fToolkit.createLabel(preLabelComp, PDEUIMessages.CommandDetails_preview, SWT.NONE).setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fSurroundCopyText = fToolkit.createButton(preLabelComp, PDEUIMessages.CommandDetails_includeMarkup, SWT.CHECK); fSurroundCopyText.setToolTipText(PDEUIMessages.CommandDetails_markupTooltip); fSurroundCopyText.addSelectionListener(widgetSelectedAdapter(e -> updatePreviewText())); fFilterCombo = new Combo(preLabelComp, SWT.READ_ONLY | SWT.DROP_DOWN); CommandCopyFilter[] filters = CommandCopyFilter.getFilters(); for (CommandCopyFilter filter : filters) fFilterCombo.add(filter.getLabelText()); fFilterCombo.select(CommandCopyFilter.indexOf(CommandCopyFilter.NONE)); fFilterCombo.addSelectionListener(widgetSelectedAdapter(e -> updatePreviewText())); fToolkit.adapt(fFilterCombo, true, true); fComPrev = fToolkit.createText(parent, "", SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.WRAP); //$NON-NLS-1$ GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.heightHint = 60; fComPrev.setLayoutData(gd); fComPrev.setEditable(false); }
private void createProductEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { Label label = toolkit.createLabel(client, PDEUIMessages.ProductInfoSection_product); label.setToolTipText(PDEUIMessages.ProductInfoSection_productTooltip); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); fProductCombo = new ExtensionIdComboPart(); fProductCombo.createControl(client, toolkit, SWT.READ_ONLY); fProductCombo.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fProductCombo.setItems(TargetPlatform.getProducts()); fProductCombo.add(""); //$NON-NLS-1$ fProductCombo.addSelectionListener(widgetSelectedAdapter(e -> getProduct().setProductId(fProductCombo.getSelection()))); Button button = toolkit.createButton(client, PDEUIMessages.ProductInfoSection_new, SWT.PUSH); button.setEnabled(isEditable()); button.addSelectionListener(widgetSelectedAdapter(e -> handleNewDefinition())); fProductCombo.getControl().setEnabled(isEditable()); }