java类org.eclipse.swt.widgets.TypedListener的实例源码

Popup2.java 文件源码 项目:gama 阅读 42 收藏 0 点赞 0 评论 0
public Popup2(final IPopupProvider provider, final Widget... controls) {
    super(WorkbenchHelper.getShell(), PopupDialog.HOVER_SHELLSTYLE, false, false, false, false, false, null, null);
    this.provider = provider;
    final Shell parent = provider.getControllingShell();
    parent.addListener(SWT.Move, hide);
    parent.addListener(SWT.Resize, hide);
    parent.addListener(SWT.Close, hide);
    parent.addListener(SWT.Deactivate, hide);
    parent.addListener(SWT.Hide, hide);
    parent.addListener(SWT.Dispose, event -> close());
    for (final Widget c : controls) {
        if (c == null) {
            continue;
        }
        final TypedListener typedListener = new TypedListener(mtl);
        c.addListener(SWT.MouseEnter, typedListener);
        c.addListener(SWT.MouseExit, typedListener);
        c.addListener(SWT.MouseHover, typedListener);
    }
}
Popup.java 文件源码 项目:gama 阅读 36 收藏 0 点赞 0 评论 0
public Popup(final IPopupProvider provider, final Widget... controls) {
    this.provider = provider;
    final Shell parent = provider.getControllingShell();
    parent.addListener(SWT.Move, hide);
    parent.addListener(SWT.Resize, hide);
    parent.addListener(SWT.Close, hide);
    parent.addListener(SWT.Deactivate, hide);
    parent.addListener(SWT.Hide, hide);
    for (final Widget c : controls) {
        if (c == null) {
            continue;
        }
        final TypedListener typedListener = new TypedListener(mtl);
        c.addListener(SWT.MouseEnter, typedListener);
        c.addListener(SWT.MouseExit, typedListener);
        c.addListener(SWT.MouseHover, typedListener);
    }
}
CommonMergeViewer.java 文件源码 项目:APICloud-Studio 阅读 26 收藏 0 点赞 0 评论 0
private CursorLinePainter getCursorLinePainterInstalled(TextViewer viewer)
{
    Listener[] listeners = viewer.getTextWidget().getListeners(3001/* StyledText.LineGetBackground */);
    for (Listener listener : listeners)
    {
        if (listener instanceof TypedListener)
        {
            TypedListener typedListener = (TypedListener) listener;
            if (typedListener.getEventListener() instanceof CursorLinePainter)
            {
                return (CursorLinePainter) typedListener.getEventListener();
            }
        }
    }
    return null;
}
ChartsComposite.java 文件源码 项目:pm 阅读 29 收藏 0 点赞 0 评论 0
public void setChartDisplayStrategy(ChartDisplayStrategy chartDisplayStrategy) {

        this.chartDisplayStrategy = chartDisplayStrategy;

        //XXX XXX
        if (MainGui.viewEventsMenuItem.getSelection()) {
            MainGui.viewEventsMenuItem.setSelection(false);
            Listener[] listeners = MainGui.viewEventsMenuItem.getListeners(SWT.Selection);
            ((SelectionListener)((TypedListener)listeners[0]).getEventListener()).widgetSelected(null);
            updateCharts(true);
        } else {
            updateCharts(true);
        }

    }
CSpinner.java 文件源码 项目:birt 阅读 37 收藏 0 点赞 0 评论 0
protected void addSelectionListener( SelectionListener listener )
{

    if ( listener == null )
        throw new SWTError( SWT.ERROR_NULL_ARGUMENT );
    addListener( SWT.Selection, new TypedListener( listener ) );
}
CVerticalLabel.java 文件源码 项目:Mailster 阅读 33 收藏 0 点赞 0 评论 0
public void addSelectionListener(SelectionListener listener)
{
    checkWidget();
    if (listener == null)
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Selection, typedListener);
    addListener(SWT.DefaultSelection, typedListener);
}
DayDateCombo.java 文件源码 项目:elexis-3-core 阅读 32 收藏 0 点赞 0 评论 0
public void addSelectionListener(SelectionListener listener){
    checkWidget();

    if (listener == null) {
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    }

    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Selection, typedListener);
    addListener(SWT.DefaultSelection, typedListener);

}
GenericMenuButton.java 文件源码 项目:team-explorer-everywhere 阅读 30 收藏 0 点赞 0 评论 0
@Override
public void addSelectionListener(final SelectionListener listener) {
    Check.notNull(listener, "listener"); //$NON-NLS-1$
    addListener(SWT.Selection, new TypedListener(listener));
}
Datepicker.java 文件源码 项目:team-explorer-everywhere 阅读 26 收藏 0 点赞 0 评论 0
public void addSelectionListener(final SelectionListener listener) {
    addListener(SWT.Selection, new TypedListener(listener));
}
DatepickerDate.java 文件源码 项目:team-explorer-everywhere 阅读 36 收藏 0 点赞 0 评论 0
@Override
public void addMouseListener(final MouseListener listener) {
    addListener(SWT.MouseDown, new TypedListener(listener));
    addListener(SWT.MouseUp, new TypedListener(listener));
    addListener(SWT.MouseDoubleClick, new TypedListener(listener));
}
DatepickerDate.java 文件源码 项目:team-explorer-everywhere 阅读 32 收藏 0 点赞 0 评论 0
@Override
public void removeMouseListener(final MouseListener listener) {
    removeListener(SWT.MouseDown, listener);
    removeListener(SWT.MouseUp, listener);
    removeListener(SWT.MouseDoubleClick, new TypedListener(listener));
}
DatepickerDate.java 文件源码 项目:team-explorer-everywhere 阅读 28 收藏 0 点赞 0 评论 0
@Override
public void addMouseMoveListener(final MouseMoveListener listener) {
    addListener(SWT.MouseMove, new TypedListener(listener));
}
DatepickerButton.java 文件源码 项目:team-explorer-everywhere 阅读 57 收藏 0 点赞 0 评论 0
public void addSelectionListener(final SelectionListener listener) {
    addListener(SWT.Selection, new TypedListener(listener));
}
ConflictNameSelectionControl.java 文件源码 项目:team-explorer-everywhere 阅读 33 收藏 0 点赞 0 评论 0
public void addModifyListener(final ModifyListener modifyListener) {
    addListener(SWT.Modify, new TypedListener(modifyListener));
}
AdvancedMenuForActions.java 文件源码 项目:mytourbook 阅读 32 收藏 0 点赞 0 评论 0
/**
 * This is called when the parent menu is displayed. An arm listener is added to each menu item
 * in the parent menu.
 * 
 * @param menuEvent
 * @param menuParentControl
 * @param isAutoOpen
 * @param autoOpenDelay
 * @param menuPosition
 * @param toolTip
 */
public void onShowParentMenu(   final MenuEvent menuEvent,
                                final Control menuParentControl,
                                final boolean isAutoOpen,
                                final boolean isAnimationEnabled,
                                final int autoOpenDelay,
                                final Point menuPosition,
                                final ToolTip toolTip) {

    _menuParentControl = menuParentControl;
    _isAutoOpen = isAutoOpen;
    _isAnimationEnabled = isAnimationEnabled;
    _autoOpenDelay = autoOpenDelay;
    _advMenuPosition = menuPosition;
    _toolTip = toolTip;

    final Menu menu = (Menu) menuEvent.widget;

    // add arm listener to each menu item
    for (final MenuItem menuItem : menu.getItems()) {

        /*
         * check if an arm listener is already set
         */
        final Listener[] itemArmListeners = menuItem.getListeners(SWT.Arm);
        boolean isArmAvailable = false;

        for (final Listener listener : itemArmListeners) {
            if (listener instanceof TypedListener) {
                if (((TypedListener) listener).getEventListener() instanceof ContextArmListener) {
                    isArmAvailable = true;
                    break;
                }
            }
        }

        if (isArmAvailable == false) {
            menuItem.addArmListener(_contextArmListener);
        }

        /*
         * it happened that the text of the menu item was not reset when the menu was opened
         * with a mouse click and not automatically
         */
        if (_armMenuItem != null && _armMenuItem.isDisposed() == false && _armMenuItem == menuItem) {
            _armMenuItem.setText(_armActionText);
        }
    }

    // reset data from previous menu
    final IAction action = _actionContributionItem.getAction();
    if (action instanceof IAdvancedMenuForActions) {
        ((IAdvancedMenuForActions) action).resetData();
    }
}
SimpleSpinner.java 文件源码 项目:OpenSPIFe 阅读 30 收藏 0 点赞 0 评论 0
public void addSelectionListener(SelectionListener listener) {
    if (listener == null)
        throw new SWTError(SWT.ERROR_NULL_ARGUMENT);
    addListener(SWT.Selection, new TypedListener(listener));
}
Tiles.java 文件源码 项目:swttiles 阅读 37 收藏 0 点赞 0 评论 0
/**
    * Adds a selection listener
    * @param listener
    */
public void addSelectionListener(SelectionListener listener) {
    super.checkWidget();
    addListener(SWT.Selection, new TypedListener(listener));
}
ShadePicker.java 文件源码 项目:superluminal2 阅读 23 收藏 0 点赞 0 评论 0
public void addSelectionListener( SelectionListener listener )
{
    addListener( SWT.Selection, new TypedListener( listener ) );
}
HuePicker.java 文件源码 项目:superluminal2 阅读 26 收藏 0 点赞 0 评论 0
public void addSelectionListener( SelectionListener listener )
{
    addListener( SWT.Selection, new TypedListener( listener ) );
}
SWTNullableSpinner.java 文件源码 项目:atdl4j 阅读 36 收藏 0 点赞 0 评论 0
public void addSelectionListener(SelectionListener listener) {
    if (listener == null)
        throw new SWTError(SWT.ERROR_NULL_ARGUMENT);
    addListener(SWT.Selection, new TypedListener(listener));
}
JobStepDialog.java 文件源码 项目:pentaho-kettle 阅读 26 收藏 0 点赞 0 评论 0
private void addListener( Control el, int event, TypedListener listener ) {
  if ( ArrayUtils.contains( el.getListeners( event ), listener ) ) {
    return;
  }
  el.addListener( event, listener );
}
MyTableCombo.java 文件源码 项目:TranskribusSwtGui 阅读 38 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will be notified
 * when the receiver's text is modified, by sending it one of the messages
 * defined in the <code>ModifyListener</code> interface.
 *
 * @param listener
 *            the listener which should be notified
 *
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the receiver has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the receiver</li>
 *                </ul>
 *
 * @see ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener(ModifyListener listener) {
    checkWidget();
    if (listener == null) {
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    }
    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Modify, typedListener);
}
MyTableCombo.java 文件源码 项目:TranskribusSwtGui 阅读 29 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will be notified
 * when the user changes the receiver's selection, by sending it one of the
 * messages defined in the <code>SelectionListener</code> interface.
 * <p>
 * <code>widgetSelected</code> is called when the combo's list selection
 * changes. <code>widgetDefaultSelected</code> is typically called when
 * ENTER is pressed the combo's text area.
 * </p>
 *
 * @param listener
 *            the listener which should be notified when the user changes
 *            the receiver's selection
 *
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the receiver has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the receiver</li>
 *                </ul>
 *
 * @see SelectionListener
 * @see #removeSelectionListener
 * @see SelectionEvent
 */
public void addSelectionListener(SelectionListener listener) {
    checkWidget();
    if (listener == null) {
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    }

    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Selection, typedListener);
    addListener(SWT.DefaultSelection, typedListener);
}
MyTableCombo.java 文件源码 项目:TranskribusSwtGui 阅读 29 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will be notified
 * when the receiver's text is verified, by sending it one of the messages
 * defined in the <code>VerifyListener</code> interface.
 *
 * @param listener
 *            the listener which should be notified
 *
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the receiver has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the receiver</li>
 *                </ul>
 *
 * @see VerifyListener
 * @see #removeVerifyListener
 *
 * @since 3.3
 */
public void addVerifyListener(VerifyListener listener) {
    checkWidget();
    if (listener == null) {
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    }
    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Verify, typedListener);
}
ImageCombo.java 文件源码 项目:scouter 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will be notified
 * when the receiver's text is modified, by sending it one of the messages
 * defined in the <code>ModifyListener</code> interface.
 * 
 * @param listener
 *            the listener which should be notified
 * 
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the receiver has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the receiver</li>
 *                </ul>
 * 
 * @see ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener(ModifyListener listener) {
    checkWidget();
    if (listener == null)
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Modify, typedListener);
}
ImageCombo.java 文件源码 项目:scouter 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will be notified
 * when the receiver's selection changes, by sending it one of the messages
 * defined in the <code>SelectionListener</code> interface.
 * <p>
 * <code>widgetSelected</code> is called when the combo's list selection
 * changes. <code>widgetDefaultSelected</code> is typically called when
 * ENTER is pressed the combo's text area.
 * </p>
 * 
 * @param listener
 *            the listener which should be notified
 * 
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the receiver has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the receiver</li>
 *                </ul>
 * 
 * @see SelectionListener
 * @see #removeSelectionListener
 * @see SelectionEvent
 */
public void addSelectionListener(SelectionListener listener) {
    checkWidget();
    if (listener == null)
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Selection, typedListener);
    addListener(SWT.DefaultSelection, typedListener);
}
Gallery.java 文件源码 项目:PDFReporter-Studio 阅读 30 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will be notified
 * when the receiver's selection changes, by sending it one of the messages
 * defined in the <code>SelectionListener</code> interface.
 * <p>
 * When <code>widgetSelected</code> is called, the item field of the event
 * object is valid.
 * </p>
 * 
 * @param listener
 *            the listener which should be notified
 * 
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the receiver has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the receiver</li>
 *                </ul>
 * 
 * @see SelectionListener
 * @see #removeSelectionListener
 * @see SelectionEvent
 */
public void addSelectionListener(SelectionListener listener) {
    checkWidget();
    if (listener == null)
        SWT.error(SWT.ERROR_NULL_ARGUMENT);

    TypedListener typedListener = new TypedListener(listener);
    addListener(SWT.Selection, typedListener);
    addListener(SWT.DefaultSelection, typedListener);
}
Gallery.java 文件源码 项目:PDFReporter-Studio 阅读 43 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will be notified
 * when an item in the receiver is expanded or collapsed by sending it one
 * of the messages defined in the TreeListener interface.
 * 
 * @param listener
 */
public void addTreeListener(TreeListener listener) {
    checkWidget();
    if (listener == null)
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    addListener(SWT.Expand, new TypedListener(listener));
}
TableCombo.java 文件源码 项目:PDFReporter-Studio 阅读 32 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is modified, by sending
 * it one of the messages defined in the <code>ModifyListener</code>
 * interface.
 *
 * @param listener the listener which should be notified
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener (ModifyListener listener) {
    checkWidget();
    if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
    TypedListener typedListener = new TypedListener (listener);
    addListener (SWT.Modify, typedListener);
}
TableCombo.java 文件源码 项目:PDFReporter-Studio 阅读 38 收藏 0 点赞 0 评论 0
/**
 * Adds the listener to the collection of listeners who will
 * be notified when the user changes the receiver's selection, by sending
 * it one of the messages defined in the <code>SelectionListener</code>
 * interface.
 * <p>
 * <code>widgetSelected</code> is called when the combo's list selection changes.
 * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area.
 * </p>
 *
 * @param listener the listener which should be notified when the user changes the receiver's selection
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see SelectionListener
 * @see #removeSelectionListener
 * @see SelectionEvent
 */
public void addSelectionListener(SelectionListener listener) {
    checkWidget();
    if (listener == null) {
        SWT.error (SWT.ERROR_NULL_ARGUMENT);
    }

    TypedListener typedListener = new TypedListener (listener);
    addListener (SWT.Selection,typedListener);
    addListener (SWT.DefaultSelection,typedListener);
}


问题


面经


文章

微信
公众号

扫码关注公众号