@Override protected Control createExtendedContentArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); fShowLatestVersionOnlyButton = new Button(composite, SWT.CHECK); fShowLatestVersionOnlyButton.setSelection(true); fShowLatestVersionOnlyButton.setText(PDEUIMessages.FilteredIUSelectionDialog_showLatestVersionOnly); fShowLatestVersionOnlyButton.addSelectionListener(widgetSelectedAdapter(e -> { fShowLatestVersionOnly = fShowLatestVersionOnlyButton.getSelection(); applyFilter(); })); return composite; }
@Override protected Control createDialogArea(Composite parent) { Composite comp = (Composite) super.createDialogArea(parent); final Button button = new Button(comp, SWT.CHECK); button.setText(PDEUIMessages.LibrarySection_addDialogButton); button.setSelection(updateClasspath[0]); button.addSelectionListener(widgetSelectedAdapter(e -> updateClasspath[0] = button.getSelection())); applyDialogFont(button); return comp; } };
@Override public void initialize() { update(); checkbox.addSelectionListener(widgetSelectedAdapter(e -> { int value = checkbox.getSelection() ? 1 : 0; valueModified(Integer.valueOf(value)); })); int value = checkbox.getSelection() ? 1 : 0; valueModified(Integer.valueOf(value)); } }
private void createRenameProject(Composite composite) { fRenameProject = new Button(composite, SWT.CHECK); fRenameProject.setText(PDEUIMessages.RenamePluginWizardPage_renameProject); fRenameProject.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false, 2, 1)); fRenameProject.addSelectionListener(widgetSelectedAdapter(e -> ((RefactoringPluginInfo) fInfo).setRenameProject(fRenameProject.getSelection()))); boolean checked = getRefactoringSettings().getBoolean(RENAME_PROJECT); fRenameProject.setSelection(checked); ((RefactoringPluginInfo) fInfo).setRenameProject(checked); }
/** * Creates the "Other" group. */ @Override void createOtherGroup () { super.createOtherGroup (); /* Create display controls specific to this example */ comboChildButton = new Button (otherGroup, SWT.CHECK); comboChildButton.setText (ControlExample.getResourceString("Combo_child")); /* Add the listeners */ comboChildButton.addSelectionListener (widgetSelectedAdapter(event -> recreateExampleWidgets ())); }
/** * Creates the "Other" group. */ @Override void createOtherGroup () { super.createOtherGroup (); /* Create display controls specific to this example */ titleButton = new Button (otherGroup, SWT.CHECK); titleButton.setText (ControlExample.getResourceString("Title_Text")); /* Add the listeners */ titleButton.addSelectionListener (widgetSelectedAdapter(event -> setTitleText ())); }
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 createImpButtons(Composite container) { Composite buttonContainer = SWTFactory.createComposite(container, 1, 1, GridData.FILL_VERTICAL, 0, 0); fAddButton = SWTFactory.createPushButton(buttonContainer, PDEUIMessages.SourceBlock_add, null); fAddButton.addSelectionListener(widgetSelectedAdapter(e -> handleAdd())); fRemoveButton = SWTFactory.createPushButton(buttonContainer, PDEUIMessages.SourceBlock_remove, null); fRemoveButton.addSelectionListener(widgetSelectedAdapter(e -> handleRemove())); fRemoveAllButton = SWTFactory.createPushButton(buttonContainer, PDEUIMessages.TargetImplicitPluginsTab_removeAll3, null); fRemoveAllButton.addSelectionListener(widgetSelectedAdapter(e -> handleRemoveAll())); updateImpButtons(); }
@Override protected void hookListeners() { super.hookListeners(); fDirectoryButton.addSelectionListener(widgetSelectedAdapter(e -> { ((FeatureExportWizardPage) fPage).adjustJNLPTabVisibility(); fPage.pageChanged(); })); }
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()); })); }
private void createVerticalButton(Composite parent) { fPromoteIncludedButton= new Button(parent, SWT.PUSH); fPromoteIncludedButton.setImage(JavaPlugin.getImageDescriptorRegistry().get(JavaPluginImages.DESC_BUTTON_MOVE_UP)); fPromoteIncludedButton.setToolTipText(NewWizardMessages.ModuleDialog_addToExplicitlyIncluded_tooltip); fPromoteIncludedButton.addSelectionListener(widgetSelectedAdapter(e -> moveModuleEntry(IDX_IMPLICITLY_INCLUDED, IDX_INCLUDED))); GridData gd= new GridData(); gd.horizontalAlignment= SWT.CENTER; fPromoteIncludedButton.setLayoutData(gd); }
/** * Create the UI elements for this block * @param parent parent composite */ public void createControl(Composite parent) { Group group = SWTFactory.createGroup(parent, PDEUIMessages.ProfileBlock_0, 1, 1, GridData.FILL_HORIZONTAL); fGenerateProfileButton = SWTFactory.createCheckButton(group, PDEUIMessages.ProfileBlock_1, null, false, 1); fGenerateProfileButton.addSelectionListener(widgetSelectedAdapter(e -> fTab.updateLaunchConfigurationDialog())); }
/** * The <code>MultiPageEditor</code> implementation of this <code>IWorkbenchPart</code> * method creates a <code>TabFolder</code> control. */ @Override public void createPartControl(Composite parent) { tabFolder = new TabFolder(parent, SWT.NONE); tabFolder.addSelectionListener(widgetSelectedAdapter(e -> sync())); }
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()); } }
private void createEditors() { final Table table = fRepositoryTable.getTable(); fEnabledColumnEditor = new TableEditor(table); fEnabledColumnEditor.horizontalAlignment = SWT.CENTER; fEnabledColumnEditor.grabHorizontal = true; fEnabledColumnEditor.minimumWidth = 50; table.addSelectionListener(widgetSelectedAdapter(e -> showControls())); }
private void addClearHistory(Menu menu, int nItems) { new MenuItem(menu, SWT.SEPARATOR); MenuItem miClear = new MenuItem(menu, SWT.PUSH); miClear.setText(WorkbenchMessages.OpenRecentDocumentsClear_text); miClear.addSelectionListener(widgetSelectedAdapter(e -> Arrays.stream(history.getItems()).forEach(item -> { history.remove(item); }))); miClear.setEnabled(nItems > 0); }
private void createEditors() { final Table table = fRepositoryTable.getTable(); fEnabledColumnEditor = new TableEditor(table); fEnabledColumnEditor.horizontalAlignment = SWT.CENTER; fEnabledColumnEditor.grabHorizontal = true; fEnabledColumnEditor.minimumWidth = 50; table.addSelectionListener(widgetSelectedAdapter(e -> showControls())); }
private Link createHelpLink(Composite parent) { Link link = new Link(parent, SWT.WRAP | SWT.NO_FOCUS); ((GridLayout) parent.getLayout()).numColumns++; link.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); link.setText("<a>"+IDialogConstants.HELP_LABEL+"</a>"); //$NON-NLS-1$ //$NON-NLS-2$ link.setToolTipText(IDialogConstants.HELP_LABEL); link.addSelectionListener(widgetSelectedAdapter(e -> helpPressed())); return link; }
private void addCloseItem(final Menu menu) { MenuItem menuItem = new MenuItem(menu, SWT.NONE); menuItem.setText(WorkbenchMessages.WorkbenchWindow_close); menuItem.addSelectionListener(widgetSelectedAdapter(e -> { MPerspective persp = (MPerspective) menu.getData(); if (persp != null) closePerspective(persp); })); }