本文整理汇总了Java中org.eclipse.swt.events.SelectionListener.widgetSelected方法的典型用法代码示例。如果您正苦于以下问题:Java SelectionListener.widgetSelected方法的具体用法?Java SelectionListener.widgetSelected怎么用?Java SelectionListener.widgetSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.events.SelectionListener
的用法示例。
在下文中一共展示了SelectionListener.widgetSelected方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: widgetSelected
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
@Override
public void widgetSelected(SelectionEvent e) {
// e.doit = false;
if (e.getSource() instanceof Button) {
Button b = (Button) e.getSource();
String text = b.getText();
if (!text.isEmpty()) {
Event e1 = new Event();
e1.widget = VirtualKeyboard.this;
e1.detail = text.charAt(0);
e1.text = b.getToolTipText();
for (SelectionListener l : selListener) {
l.widgetSelected(new SelectionEvent(e1));
}
}
}
}
示例2: fireSelectionListeners
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
/**
* Fire the selection listeners
*
* @param mouseEvent
* mouse event
* @return true if the selection could be changed, false otherwise
*/
private boolean fireSelectionListeners(final MouseEvent mouseEvent) {
for (final SelectionListener listener : this.listOfSelectionListeners) {
final Event event = new Event();
event.button = mouseEvent.button;
event.display = this.getDisplay();
event.item = null;
event.widget = this;
event.data = null;
event.time = mouseEvent.time;
event.x = mouseEvent.x;
event.y = mouseEvent.y;
final SelectionEvent selEvent = new SelectionEvent(event);
listener.widgetSelected(selEvent);
if (!selEvent.doit) { return false; }
}
return true;
}
示例3: fireSelectionEvent
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
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));
}
}
示例4: linkActivated
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
private void linkActivated(final Event e) {
setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
final SelectionListener listener = (SelectionListener) selectionListeners.getListener();
listener.widgetSelected(new SelectionEvent(e));
if (!isDisposed()) {
setCursor(getDisplay().getSystemCursor(SWT.CURSOR_HAND));
}
}
示例5: notifyListeners
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
private void notifyListeners() {
final Event e = new Event();
e.widget = this;
final SelectionEvent se = new SelectionEvent(e);
final SelectionListener listener = (SelectionListener) listeners.getListener(false);
listener.widgetSelected(se);
}
示例6: fireSelectionEvent
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
/**
* 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);
}
}
示例7: fireSelectionListeners
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
/**
* 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 : this.listeners) {
final SelectionEvent selectionEvent = new SelectionEvent(event);
selectionListener.widgetSelected(selectionEvent);
if (!selectionEvent.doit) {
return false;
}
}
return true;
}
示例8: fireSelectionEvent
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
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);
}
}
示例9: notifySelection
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
/***************************************************************************
* Notify the listeners this widget's selection
**************************************************************************/
public void notifySelection()
{
for (SelectionListener listener : m_selectionListeners)
{
Event event = new Event();
event.widget = this;
listener.widgetSelected(new SelectionEvent(event));
}
}
示例10: callSelectionListeners
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
/**
* When the user click the square are this call all the register listeners, passing in the
* event this widget and the new color selected by the user as RGB (inside the data field of the
* event)
*/
private void callSelectionListeners(){
Event e = new Event();
e.widget = this;
SelectionEvent event = new SelectionEvent(e);
event.data = selectedColorRGB;
for(SelectionListener listener : selListeners){
listener.widgetSelected(event);
}
}
示例11: callListeners
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
/**
* Call all the registered selection listener
*
* @param widget widget where the selection action is happened
* @param property property cahnged by the action
*/
private void callListeners(Control widget, String property){
Event e = new Event();
e.widget = widget;
SelectionEvent sEvent = new SelectionEvent(e);
sEvent.data = property;
for(SelectionListener listener : selectionListeners){
listener.widgetSelected(sEvent);
}
}
示例12: fireSelection
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
void fireSelection(Control c)
{
for (SelectionListener listener : new ArrayList<>(listeners))
{
Event e = new Event();
e.item = c;
e.widget = c;
listener.widgetSelected(new SelectionEvent(e));
}
}
示例13: fireApplyPressed
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
private void fireApplyPressed(SelectionEvent e) {
for (SelectionListener listener : listeners)
listener.widgetSelected(e);
}
示例14: fireTestPressed
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
private void fireTestPressed(SelectionEvent e) {
for (SelectionListener listener : listeners) {
listener.widgetSelected(e);
}
}
示例15: notifyListeners
import org.eclipse.swt.events.SelectionListener; //导入方法依赖的package包/类
/**
* Notifies listeners that the selected time has changed. This is performed
* on the UI thread as with all SWT selection events.
*
* @param e
* The event triggering the updated time.
*/
private void notifyListeners(SelectionEvent e) {
e.data = getTime();
for (SelectionListener listener : listeners) {
listener.widgetSelected(e);
}
}