Java Code Examples for org.eclipse.swt.widgets.Control#notifyListeners()
The following examples show how to use
org.eclipse.swt.widgets.Control#notifyListeners() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SubtaskSheetImpl.java From birt with Eclipse Public License 1.0 | 6 votes |
public void shellClosed( ShellEvent e ) { Control focusControl = Display.getDefault( ).getFocusControl( ); if ( focusControl instanceof Text ) { // Focus saving the text by focus out focusControl.notifyListeners( SWT.FocusOut, null ); } if ( e.widget.equals( popupShell ) ) { if ( !POPUP_ATTACHING ) { selectAllButtons( false ); } if ( ChartWizard.POPUP_CLOSING_BY_USER ) { // Clear selection if user closed the popup. setCurrentPopupSelection( null ); getParentTask( ).setPopupSelection( null ); } } }
Example 2
Source File: InternalCompositeTable.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Set the focus to the specified (column, row). If rowChange is true, fire * a row change event, otherwise be silent. * * @param column * The 0-based column to focus * @param row * The 0-based row to focus * @param rowChange * true if a row change event should be fired; false otherwise. */ private void internalSetSelection(int column, int row, boolean rowChange) { Control toFocus = getControl(column, row); if (toFocus == null) { return; } if (toFocus.isFocusControl()) { toFocus.notifyListeners(SWT.FocusIn, new Event()); } else { deferredSetFocus(toFocus, rowChange); } }
Example 3
Source File: AbstractPopupSheet.java From birt with Eclipse Public License 1.0 | 5 votes |
private void helpPressed( ) { Control c = cmpTop.getDisplay( ).getFocusControl( ); while ( c != null ) { if ( c.isListening( SWT.Help ) ) { c.notifyListeners( SWT.Help, new Event( ) ); break; } c = c.getParent( ); } }
Example 4
Source File: InternalCompositeTable.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void widgetSelected(SelectionEvent e) { if (vSlider.getSelection() == topRow) { return; } if (!fireRequestRowChangeEvent()) { vSlider.setSelection(topRow); return; } deselectCurrentRowIfVisible(); int delta = topRow - vSlider.getSelection(); int oldCurrentRow = currentRow; currentRow = vSlider.getSelection(); // setTopRow(vSlider.getSelection()); // Removed as a result of patch doSetTopRow(vSlider.getSelection(), currentRow + delta); // If the focused row just became visible, show the focus if (oldCurrentRow < 0 || oldCurrentRow >= getNumRowsVisible()) { if (currentRow >= 0 && currentRow < getNumRowsVisible()) { Control newFocusControl = getControl(currentColumn, currentRow); if (newFocusControl == null) { return; } if (newFocusControl.isFocusControl()) { newFocusControl.notifyListeners(SWT.FocusIn, new Event()); } else { deferredSetFocus(newFocusControl, true); } } } else { // If the new viewport doesn't overlap the old one, hide the focus if (currentRow < 0 || currentRow >= getNumRowsVisible()) { // deleteRowAt(oldCurrentRow); // getControl(currentColumn, oldCurrentRow).getParent().setVisible(false); // getControl(currentColumn, oldCurrentRow).getParent().setVisible(true); Control control = getControl(currentColumn, oldCurrentRow); if (control != null) { control.notifyListeners(SWT.FocusOut, new Event()); } } } }