@Override public void selectionChanged(SelectionChangedEvent event) { fPerspectivesPanel.refreshPanel(event.getStructuredSelection()); } });
/** * Responds to a selection changed event in the environment table * @param event the selection change event */ protected void handleTableSelectionChanged(SelectionChangedEvent event) { int size = event.getStructuredSelection().size(); envEditButton.setEnabled(size == 1); envRemoveButton.setEnabled(size > 0); }
@Override public void selectionChanged(SelectionChangedEvent event) { updateForSelection(event.getStructuredSelection()); }
/* private */ void updatedEnablement(SelectionChangedEvent event) { updateEnablement(event.getStructuredSelection()); }
/** * Update the selection object. */ protected void updateSelection(SelectionChangedEvent event) { ArrayList<MPartDescriptor> descs = new ArrayList<>(); IStructuredSelection sel = event.getStructuredSelection(); for (Iterator<?> i = sel.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof MPartDescriptor) { descs.add((MPartDescriptor) o); } } viewDescs = new MPartDescriptor[descs.size()]; descs.toArray(viewDescs); }
@Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection ss = event.getStructuredSelection(); if(ss != null && !ss.isEmpty()) { ILaunchDelegate delegate = (ILaunchDelegate)ss.getFirstElement(); fDescription.setText(delegate.getDescription()); } else { fDescription.setText(IInternalDebugCoreConstants.EMPTY_STRING); } } });
@Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection ss = event.getStructuredSelection(); if(ss != null && !ss.isEmpty()) { SelectLaunchersDialog.this.description.setText(((ILaunchDelegate)ss.getFirstElement()).getDescription()); } else { SelectLaunchersDialog.this.description.setText(IInternalDebugCoreConstants.EMPTY_STRING); } } });
/** * Update the selection object. */ protected void updateSelection(SelectionChangedEvent event) { perspDesc = null; IStructuredSelection sel = event.getStructuredSelection(); if (!sel.isEmpty()) { Object obj = sel.getFirstElement(); if (obj instanceof IPerspectiveDescriptor) { perspDesc = (IPerspectiveDescriptor) obj; } } }
@Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = event.getStructuredSelection(); if (!selection.isEmpty()) { LaunchShortcutExtension shortcutSource = (LaunchShortcutExtension) selection.getFirstElement(); String description = shortcutSource.getShortcutDescription(fMode); fDescriptionText.setText((description == null ? LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_3 : description)); } } });
/** * Responds to a selection changed event in the variable table * @param event the selection change event */ protected void handleTableSelectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (event.getStructuredSelection()); VariableWrapper variable= (VariableWrapper) selection.getFirstElement(); if (variable == null || variable.isReadOnly()) { envEditButton.setEnabled(false); envRemoveButton.setEnabled(false); } else { envEditButton.setEnabled(selection.size() == 1); envRemoveButton.setEnabled(selection.size() > 0); } }
void setupListeners() { wsTableViewer.addSelectionChangedListener(event -> { IStructuredSelection s = event.getStructuredSelection(); Object obj = s.getFirstElement(); if (obj instanceof IWorkingSet) wsNameText.setText(((IWorkingSet) obj).getName()); }); wsNameText.addModifyListener(e -> setErrorMessage(null)); }
@Override protected void initializeListeners(final StructuredViewer viewer) { super.initializeListeners(viewer); viewer.addSelectionChangedListener(event -> updateStatusLine(event.getStructuredSelection())); }
@Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = event.getStructuredSelection(); if (!selection.isEmpty()) { ISourceContainerType type = (ISourceContainerType) selection.getFirstElement(); setMessage(type.getDescription()); getButton(IDialogConstants.OK_ID).setEnabled(true); } else { getButton(IDialogConstants.OK_ID).setEnabled(false); setMessage(SourceLookupUIMessages.AddSourceContainerDialog_select_source_container); } } });
@Override public void selectionChanged(SelectionChangedEvent event) { Object element = event.getStructuredSelection().getFirstElement(); filter.setActionSet((ActionSet) element); filterViewer.refresh(); filterViewer.expandAll(); } }
@Override public void selectionChanged(SelectionChangedEvent event) { // Clear the previous error message (if any) // Field input value is lost on selection any way setMessage(null, IMessageProvider.NONE); Object selectionObject = null; // if preselection exists use that if (fPC != null) selectionObject = fPC; else if (event.getSelection() instanceof IStructuredSelection) selectionObject = event.getStructuredSelection().getFirstElement(); if (selectionObject != null && selectionObject.equals(fCommandDetails.getCommand())) return; fCommandDetails.showDetailsFor(selectionObject); }
@Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) style |= SWT.BORDER; else style |= toolkit.getBorderStyle(); TableViewer tableViewer = new TableViewer(parent, style); tableViewer.addSelectionChangedListener(e -> TablePart.this.selectionChanged(e.getStructuredSelection())); tableViewer.addDoubleClickListener(e -> TablePart.this.handleDoubleClick((IStructuredSelection) e.getSelection())); return tableViewer; }
private void handleCategorySelection(SelectionChangedEvent selectionEvent) { setErrorMessage(null); setDescriptionText(""); //$NON-NLS-1$ setSelectedNode(null); WizardCollectionElement selectedCategory = (WizardCollectionElement) getSingleSelection( selectionEvent.getStructuredSelection()); if (selectedCategory == null) wizardSelectionViewer.setInput(null); else wizardSelectionViewer.setInput(selectedCategory.getWizards()); }
@Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) style |= SWT.BORDER; else style |= toolkit.getBorderStyle(); TreeViewer treeViewer = createTreeViewer(parent, style); treeViewer.addSelectionChangedListener(e -> TreePart.this.selectionChanged(e.getStructuredSelection())); treeViewer.addDoubleClickListener(e -> TreePart.this.handleDoubleClick((IStructuredSelection) e.getSelection())); return treeViewer; }
private void handleWizardSelection(SelectionChangedEvent selectionEvent) { setErrorMessage(null); WizardElement currentSelection = (WizardElement) getSingleSelection(selectionEvent.getStructuredSelection()); // If no single selection, clear and return if (currentSelection == null) { setDescriptionText(""); //$NON-NLS-1$ setSelectedNode(null); return; } final WizardElement finalSelection = currentSelection; setSelectedNode(createWizardNode(finalSelection)); setDescriptionText(finalSelection.getDescription()); }
@Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) { style |= SWT.BORDER; } else { style |= toolkit.getBorderStyle(); } CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, style); tableViewer .addSelectionChangedListener(e -> CheckboxTablePart.this.selectionChanged(e.getStructuredSelection())); tableViewer.addCheckStateListener(event -> elementChecked(event.getElement(), event.getChecked())); return tableViewer; }