Java Code Examples for org.eclipse.swt.events.SelectionListener#widgetSelected()
The following examples show how to use
org.eclipse.swt.events.SelectionListener#widgetSelected() .
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: MarkOccurrencesConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
void initializeFields() { Iterator<Button> iter= fCheckBoxes.keySet().iterator(); while (iter.hasNext()) { Button b= iter.next(); String key= fCheckBoxes.get(b); b.setSelection(fStore.getBoolean(key)); } // Update slaves Iterator<SelectionListener> iter2= fMasterSlaveListeners.iterator(); while (iter2.hasNext()) { SelectionListener listener= iter2.next(); listener.widgetSelected(null); } }
Example 2
Source File: HorizontalSpinner.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * Verify the entry and store the value in the field storedValue * * @param entry entry to check * @param keyCode code of the typed key * @return <code>true</code> if the entry if correct, <code>false</code> * otherwise */ private boolean verifyEntryAndStoreValue(final String entry, final int keyCode) { final String work; if (keyCode == SWT.DEL) { work = StringUtil.removeCharAt(text.getText(), text.getCaretPosition()); } else if (keyCode == SWT.BS && text.getCaretPosition() == 0) { work = StringUtil.removeCharAt(text.getText(), text.getCaretPosition() - 1); } else if (keyCode == 0) { work = entry; } else { work = StringUtil.insertString(text.getText(), entry, text.getCaretPosition()); } try { final double d = Double.parseDouble(work.replace(decimalFormatSeparator, '.')); storedValue = (int) (d * Math.pow(10, getDigits())); } catch (final NumberFormatException nfe) { return false; } for (final SelectionListener s : selectionListeners) { s.widgetSelected(null); } return true; }
Example 3
Source File: DualList.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * Call all selection listeners * * @param item selected item */ private void fireSelectionEvent(final DLItem item) { if (selectionListeners == null) { return; } final Event event = new Event(); event.button = 1; event.display = getDisplay(); event.item = null; event.widget = this; event.data = item; final SelectionEvent selectionEvent = new SelectionEvent(event); for (final SelectionListener listener : selectionListeners) { listener.widgetSelected(selectionEvent); } }
Example 4
Source File: ColumnBrowserWidget.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * Fire the selection listeners * * @param selectionEvent mouse event * @return true if the selection could be changed, false otherwise */ private boolean fireSelectionListeners(final Event selectionEvent) { final Event event = new Event(); event.button = 0; event.display = getDisplay(); event.item = null; event.widget = this; event.data = null; event.time = selectionEvent.time; event.x = selectionEvent.x; event.y = selectionEvent.y; final SelectionEvent selEvent = new SelectionEvent(event); for (final SelectionListener listener : selectionListeners) { listener.widgetSelected(selEvent); if (!selEvent.doit) { return false; } } return true; }
Example 5
Source File: SwitchButton.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * Fire the selection listeners * * @param e mouse event * @return true if the selection could be changed, false otherwise */ private boolean fireSelectionListeners(final Event e) { for (final SelectionListener listener : listOfSelectionListeners) { final Event event = new Event(); event.button = e.button; event.display = getDisplay(); event.item = null; event.widget = this; event.data = null; event.time = e.time; event.x = e.x; event.y = e.y; final SelectionEvent selEvent = new SelectionEvent(event); listener.widgetSelected(selEvent); if (!selEvent.doit) { return false; } } return true; }
Example 6
Source File: EventCircle.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
public void select() { selected = true; parent.setEvent(event); for(SelectionListener listener : parent.getSelectionListeners()){ Event e = new Event() ; e.widget = parent ; SelectionEvent se = new SelectionEvent(e); se.data = event; listener.widgetSelected(se); } setForegroundColor(SELECTED) ; setBackgroundColor(SELECTED) ; if (getParent() != null) { // Unselect others for (Object item : getParent().getChildren()) { IFigure figure = (IFigure)item; if (figure instanceof EventCircle && figure != this) { ((EventCircle)figure).unselect(); } } } }
Example 7
Source File: BreadcrumbItem.java From nebula with Eclipse Public License 2.0 | 5 votes |
void fireSelectionEvent() { final Event event = new Event(); event.widget = parentBreadcrumb; event.display = getDisplay(); event.item = this; event.type = SWT.Selection; for (final SelectionListener selectionListener : selectionListeners) { selectionListener.widgetSelected(new SelectionEvent(event)); } }
Example 8
Source File: BaseSelectableControl.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 5 votes |
protected void fireSelectionEvent(MouseEvent me) { Event e = new Event(); e.widget = this; SelectionEvent event = new SelectionEvent(e); event.stateMask = me.stateMask; event.widget = this; for (SelectionListener listener : selectionListeners) { listener.widgetSelected(event); } }
Example 9
Source File: TagCloud.java From gef with Eclipse Public License 2.0 | 5 votes |
private void fireSelectionChanged() { Event e = new Event(); e.widget = this; final SelectionEvent event = new SelectionEvent(e); event.data = getSelection(); event.widget = this; event.display = Display.getCurrent(); for (SelectionListener listener : selectionListeners) { listener.widgetSelected(event); } }
Example 10
Source File: BuilderChooser.java From texlipse with Eclipse Public License 1.0 | 5 votes |
/** * Forward the event forward. * @param event event */ private void fireSelectionEvent(SelectionEvent event) { for (int i = 0; i < selectionListeners.size(); i++) { SelectionListener lis = (SelectionListener) selectionListeners.get(i); lis.widgetSelected(event); } }
Example 11
Source File: BreadcrumbItem.java From SWET with MIT License | 5 votes |
void fireSelectionEvent() { final Event event = new Event(); event.widget = this.parentBreadcrumb; event.display = getDisplay(); event.item = this; event.type = SWT.Selection; for (final SelectionListener selectionListener : this.selectionListeners) { selectionListener.widgetSelected(new SelectionEvent(event)); } }
Example 12
Source File: StarRating.java From nebula with Eclipse Public License 2.0 | 5 votes |
private void fireSelectionEvent() { final Event event = new Event(); event.widget = this; event.display = getDisplay(); event.item = this; event.type = SWT.Selection; for (final SelectionListener selectionListener : selectionListeners) { selectionListener.widgetSelected(new SelectionEvent(event)); } }
Example 13
Source File: RangeSlider.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Fire all selection listeners * * @param event selection event * @return <code>true</code> if no listener cancels the selection, * <code>false</code> otherwise */ private boolean fireSelectionListeners(final Event event) { for (final SelectionListener selectionListener : listeners) { final SelectionEvent selectionEvent = new SelectionEvent(event); selectionListener.widgetSelected(selectionEvent); if (!selectionEvent.doit) { return false; } } return true; }
Example 14
Source File: ComponentTable.java From arx with Apache License 2.0 | 5 votes |
/** * Fires a new event. */ private void fireSelectionEvent(){ Event event = new Event(); event.display = table.getDisplay(); event.item = table; event.widget = table; SelectionEvent sEvent = new SelectionEvent(event); for (SelectionListener listener : selectionListeners) { listener.widgetSelected(sEvent); } }
Example 15
Source File: RoundedToolItem.java From nebula with Eclipse Public License 2.0 | 5 votes |
void fireSelectionEvent() { final Event event = new Event(); event.widget = parentToolbar; event.display = getDisplay(); event.item = this; event.type = SWT.Selection; for (final SelectionListener selectionListener : selectionListeners) { selectionListener.widgetSelected(new SelectionEvent(event)); } }
Example 16
Source File: CheckBoxGroup.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Fire the selection listeners * * @param selectionEvent mouse event * @return true if the selection could be changed, false otherwise */ private boolean fireSelectionListeners(final SelectionEvent selectionEvent) { selectionEvent.widget = this; for (final SelectionListener listener : selectionListeners) { listener.widgetSelected(selectionEvent); if (!selectionEvent.doit) { return false; } } return true; }
Example 17
Source File: NebulaSlider.java From nebula with Eclipse Public License 2.0 | 5 votes |
private void fireSelectionEvent() { final Event event = new Event(); event.widget = this; event.display = getDisplay(); event.type = SWT.Selection; for (final SelectionListener selectionListener : selectionListeners) { selectionListener.widgetSelected(new SelectionEvent(event)); } }
Example 18
Source File: ImageContainer.java From nebula with Eclipse Public License 2.0 | 5 votes |
private void fireSelectionEvent() { final Event e = new Event(); e.widget = carousel; e.display = getDisplay(); e.index = carousel.selection; e.type = SWT.Selection; final SelectionEvent event = new SelectionEvent(e); for (final SelectionListener listener : carousel.selectionListeners) { listener.widgetSelected(event); if (!event.doit) { break; } } }
Example 19
Source File: EnterXMPPAccountComposite.java From saros with GNU General Public License v2.0 | 4 votes |
private void notifyCreateAccountSelected(SelectionEvent e) { for (SelectionListener selectionListener : createAccountSelectionListeners) { selectionListener.widgetSelected(e); } }
Example 20
Source File: NebulaToolbar.java From nebula with Eclipse Public License 2.0 | 4 votes |
/** * Handles mouse up event. * * @param e MouseEvent */ private void handleMouseUp(MouseEvent e) { if (!buttonPushed) { return; } buttonPushed = false; if (selectedItemIndex == -1) { return; } if (selectedItemIndex != itemUnderCursor) { items[selectedItemIndex].setHovered(false); } items[selectedItemIndex].setSelected(true); if (e.x < 0 || e.y < 0 || e.x > getClientArea().width || e.y > getClientArea().height || itemUnderCursor == -1) { if (selectedItemIndex != itemUnderCursor) { redraw(); } return; } items[selectedItemIndex].setPushedDown(false); items[itemUnderCursor].setHovered(true); redraw(); int selectedItemIndexFromUp = getItemIndexUnderCursor(e.x, e.y); if (selectedItemIndexFromUp != selectedItemIndex) { return; } SelectionListener selectionListener = items[selectedItemIndex].getSelectionListener(); if (selectionListener == null) { return; } Event event = new Event(); event.widget = this; selectionListener.widgetSelected(new SelectionEvent(event)); MouseEvent newEvent = generateFalseMouseEvent(); if (newEvent != null && getItemIndexUnderCursor(newEvent.x, newEvent.y) != selectedItemIndexFromUp) { items[selectedItemIndex].setHovered(false); redraw(); } }