/** * API method which returns the current selection. * * @return the current selection (element type: <code>IMarker</code>) */ public ISelection getSelection() { return viewer.getSelection(); }
private List<?> getSelectedTableEntries() { ISelection sel= fTableViewer.getSelection(); if (sel instanceof IStructuredSelection) return((IStructuredSelection) sel).toList(); else return Collections.EMPTY_LIST; }
@Override protected boolean isValid() { if(fListViewer != null) { ISelection sel = fListViewer.getSelection(); if(sel instanceof IStructuredSelection) { return ((IStructuredSelection)sel).size() == 1; } } return false; }
@Override public void selectionChanged(SelectionChangedEvent event){ if (fOpenButton != null){ fOpenButton.setEnabled(! getTableViewer().getSelection().isEmpty()); } } });
private void removeSyntax() { Object o = ( ( StructuredSelection ) syntaxViewer.getSelection() ).getFirstElement(); syntaxList.remove( o ); syntaxViewer.refresh(); }
protected void okPressed() { IStructuredSelection selection = (IStructuredSelection) componentTableViewer.getSelection(); componentSelection = selection.getFirstElement(); super.okPressed(); }
@Override public void selectionChanged(final SelectionChangedEvent event) { performSelectionChanged(((IStructuredSelection) fViewer.getSelection()).toArray()); } });
@Override public void widgetSelected(SelectionEvent e) { for (Object spec : ((IStructuredSelection) specViewer .getSelection()).toArray()) config.removeFetchRefSpec((RefSpec) spec); updateControls(); } });
private void revertStateOfSelection() { List<?> selection= getSelectedTableEntries(); for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { NLSSubstitution substitution= (NLSSubstitution) iter.next(); substitution.revert(); } fTableViewer.refresh(); updateButtonStates((IStructuredSelection) fTableViewer.getSelection()); }
/** * */ private void openRenameDialog() { IStructuredSelection sel= (IStructuredSelection) fTableViewer.getSelection(); List<NLSSubstitution> elementsToRename= getExternalizedElements(sel); RenameKeysDialog dialog= new RenameKeysDialog(getShell(), elementsToRename); if (dialog.open() == Window.OK) { fTableViewer.refresh(); updateButtonStates((IStructuredSelection) fTableViewer.getSelection()); } }
protected void updateButtonState() { if (fButtonControls != null && isOkToUse(fTableControl) && fTableControl.isEnabled()) { ISelection sel= fTable.getSelection(); for (int i= 0; i < fButtonControls.length; i++) { Button button= fButtonControls[i]; if (isOkToUse(button)) { button.setEnabled(isButtonEnabled(sel, i)); } } } }
/** * {@inheritDoc} */ protected void okPressed() { StructuredSelection selection = ( StructuredSelection ) extendedOperationsTableViewer.getSelection(); if ( !selection.isEmpty() ) { selectedExtendedOperation = ( ExtendedOperationEnum ) selection.getFirstElement(); } super.okPressed(); }
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) viewer.getSelection(); if ( !selection.isEmpty() ) { InterceptorEnum interceptor = ( InterceptorEnum ) selection.getFirstElement(); interceptors.remove( interceptor ); viewer.refresh(); setEditorDirty(); } } } );
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) viewer.getSelection(); if ( !selection.isEmpty() ) { InterceptorEnum interceptor = ( InterceptorEnum ) selection.getFirstElement(); interceptors.remove( interceptor ); viewer.refresh(); setEditorDirty(); } } } );
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) viewer.getSelection(); if ( !selection.isEmpty() ) { ExtendedOperationEnum extendedOperation = ( ExtendedOperationEnum ) selection.getFirstElement(); extendedOperations.remove( extendedOperation ); viewer.refresh(); setEditorDirty(); } } } );
private void fireModifyEvent(Object newValue) { fTableViewer.getCellModifier().modify( ((IStructuredSelection) fTableViewer.getSelection()).getFirstElement(), fProperty, newValue); }
/** * The <code>WizardSelectionPage</code> implementation of * this <code>IWizardPage</code> method returns the first page * of the currently selected wizard if there is one. * * @see WizardPage#getNextPage */ public IWizardPage getNextPage() { if (selectedWizard == null) return null; if(! WorkbenchActivityHelper.allowUseOf(getTriggerPoint(), ((IStructuredSelection)viewer.getSelection()).getFirstElement())) return null; return selectedWizard.getStartingPage(); }
protected final void performSelectionChanged() { StatusInfo status= new StatusInfo(); IStructuredSelection selection= (IStructuredSelection) fFixSelectionTable.getSelection(); Object firstElement= selection.getFirstElement(); if (firstElement instanceof ClasspathFixProposal) { fSelectedFix= (ClasspathFixProposal) firstElement; } else { status.setError(""); //$NON-NLS-1$ } updateStatus(status); }
public void widgetSelected(SelectionEvent e) { IStructuredSelection sel = (IStructuredSelection) monitorTableViewer.getSelection(); IMonitoredServerPort msp = (IMonitoredServerPort) sel.getFirstElement(); smm.stopMonitor(msp); monitorTableViewer.refresh(msp); monitorTableViewer.setSelection(new StructuredSelection(msp)); } });
/** * Save the page settings into the dialog settings */ public void savePageSettings() { if (fViewer.getControl().isDisposed()) return; final IStructuredSelection selection= (IStructuredSelection)fViewer.getSelection(); final Object selected= selection.getFirstElement(); if (!(selected instanceof SynchronizeWizardDescription)) return; getDialogSettings().put(DEFAULT_SELECTION, ((SynchronizeWizardDescription)selected).getId()); }