@Override public Object getFirstElement() { return isEmpty() ? null : elements[0]; }
/** * Internal method which returns a string representation of this * selection suitable for debug purposes only. * * @return debug string */ @Override public String toString() { return isEmpty() ? JFaceResources.getString("<empty_selection>") : toList().toString(); //$NON-NLS-1$ } }
private boolean doOpen(ISelection selection) { if (!(selection instanceof StructuredSelection)) return false; StructuredSelection structuredSelection= (StructuredSelection) selection; if (structuredSelection.isEmpty()) return false; return open(structuredSelection.getFirstElement()); }
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection(); if ( !selection.isEmpty() ) { String saslRealm = ( String ) selection.getFirstElement(); saslRealms.remove( saslRealm ); saslRealmsTableViewer.refresh(); setEditorDirty(); } } } );
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection(); if ( !selection.isEmpty() ) { String saslRealm = ( String ) selection.getFirstElement(); saslRealms.remove( saslRealm ); saslRealmsTableViewer.refresh(); setEditorDirty(); } } } );
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection(); if ( !selection.isEmpty() ) { String saslRealm = ( String ) selection.getFirstElement(); saslRealms.remove( saslRealm ); saslRealmsTableViewer.refresh(); setEditorDirty(); } } } );
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) binaryAttributesTableViewer.getSelection(); if ( !selection.isEmpty() ) { String attribute = ( String ) selection.getFirstElement(); binaryAttributes.remove( attribute ); binaryAttributesTableViewer.refresh(); setEditorDirty(); } } };
/** * Deletes selected labels. */ private void deleteSelectedlabels() { StructuredSelection structuredSelection = (StructuredSelection) labelsTableViewer.getSelection(); if (!structuredSelection.isEmpty()) { for (Iterator<?> it = structuredSelection.iterator(); it.hasNext();) { labelsToAdd.remove(it.next()); } labelsTableViewer.refresh(); setPageComplete(isPageComplete()); } }
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) viewer.getSelection(); if ( !selection.isEmpty() ) { ExtendedOperationEnum extendedOperation = ( ExtendedOperationEnum ) selection.getFirstElement(); extendedOperations.remove( extendedOperation ); 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(); } } } );
/** * {@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(); } } } );
/** * {@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() ) { Interceptor interceptor = ( Interceptor ) selection.getFirstElement(); interceptors.remove( interceptor ); viewer.refresh(); setEditorDirty(); } } } );
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) indexedAttributesTableViewer.getSelection(); if ( !selection.isEmpty() ) { IndexedAttribute indexedAttribute = ( IndexedAttribute ) selection.getFirstElement(); indexedAttributes.remove( indexedAttribute ); indexedAttributesTableViewer.refresh(); masterDetailsBlock.setEditorDirty(); dirty = true; } } };
public void widgetSelected( SelectionEvent e ) { StructuredSelection selection = ( StructuredSelection ) indexedAttributesTableViewer.getSelection(); if ( !selection.isEmpty() ) { IndexedAttribute indexedAttribute = ( IndexedAttribute ) selection.getFirstElement(); indexedAttributes.remove( indexedAttribute ); indexedAttributesTableViewer.refresh(); masterDetailsBlock.setEditorDirty(); dirty = true; } } };
/** * Selects and reveals the specified elements. */ @Override public void selectReveal(ISelection selection) { StructuredSelection ssel = convertSelection(selection); if (!ssel.isEmpty()) { getViewer().getControl().setRedraw(false); getViewer().setSelection(ssel, true); getViewer().getControl().setRedraw(true); } }