热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.eclipse.swt.widgets.Control.addMouseTrackListener()方法的使用及代码示例

本文整理了Java中org.eclipse.swt.widgets.Control.addMouseTrackListener()方法的一些代码示例,展示了

本文整理了Java中org.eclipse.swt.widgets.Control.addMouseTrackListener()方法的一些代码示例,展示了Control.addMouseTrackListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Control.addMouseTrackListener()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Control
类名称:Control
方法名:addMouseTrackListener

Control.addMouseTrackListener介绍

[英]Adds the listener to the collection of listeners who will be notified when the mouse passes or hovers over controls, by sending it one of the messages defined in the MouseTrackListener interface.
[中]通过发送MouseTrackListener界面中定义的消息之一,将侦听器添加到侦听器集合中,当鼠标经过或悬停在控件上时,将通知这些侦听器。

代码示例

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

/**
* @param infoControl
* @param control
* @param provider
*/
public static void addHoverListenerToControl(final IInformationControl infoControl, final Control control, final IControlHoverContentProvider provider) {
control.addMouseTrackListener(new MouseTrackListener() {
@Override
public void mouseEnter(MouseEvent e) {
}
@Override
public void mouseExit(MouseEvent e) {
if (infoControl instanceof PDEDefaultInformationControl && ((PDEDefaultInformationControl) infoControl).isDisposed())
return;
infoControl.setVisible(false);
}
@Override
public void mouseHover(MouseEvent e) {
if (infoControl instanceof PDEDefaultInformationControl && ((PDEDefaultInformationControl) infoControl).isDisposed())
return;
String text = provider.getHoverContent(control);
if (text == null || text.trim().length() == 0)
return;
updateHover(infoControl, text);
infoControl.setLocation(control.toDisplay(new Point(10, 25)));
infoControl.setVisible(true);
}
});
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
* Starts this mouse tracker. The given control becomes this tracker's subject control.
* Installs itself as mouse track listener on the subject control. The mouse move listener
* gets installed on the area control. The subject control is the element the hover element
* is attached to. The area control is the container that holds the subject control. It
* denotes the area to be tracked for mouse move events while the hover is open. Usually
* this should be the root composite of the current view. If the area is too small, the
* hover will not close correctly on some occasions.
*
* @param subjectControl the subject control
* @param areaControl the area control
* @since 3.11
*/
public void start(Control subjectControl, Control areaControl) {
fSubjectCOntrol= subjectControl;
fAreaCOntrol= areaControl;
if (fSubjectControl != null && !fSubjectControl.isDisposed())
fSubjectControl.addMouseTrackListener(this);

fIsInRestartMode= false;
fIsComputing= false;
fMouseLostWhileComputing= false;
fShellDeactivatedWhileComputing= false;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
* Starts this mouse tracker. The given control becomes this tracker's subject control.
* Installs itself as mouse track listener on the subject control. The mouse move listener
* gets installed on the area control. The subject control is the element the hover element
* is attached to. The area control is the container that holds the subject control. It
* denotes the area to be tracked for mouse move events while the hover is open. Usually
* this should be the root composite of the current view. If the area is too small, the
* hover will not close correctly on some occasions.
*
* @param subjectControl the subject control
* @param areaControl the area control
* @since 3.11
*/
public void start(Control subjectControl, Control areaControl) {
fSubjectCOntrol= subjectControl;
fAreaCOntrol= areaControl;
if (fSubjectControl != null && !fSubjectControl.isDisposed())
fSubjectControl.addMouseTrackListener(this);
fIsInRestartMode= false;
fIsComputing= false;
fMouseLostWhileComputing= false;
fShellDeactivatedWhileComputing= false;
}

代码示例来源:origin: org.eclipse.e4.ui.css/swt

public void initialize() {
super.initialize();
if (!dynamicEnabled) return;

Control cOntrol= getControl();
// Add focus listener
control.addFocusListener(focusListener);
// Add mouse track listener
control.addMouseTrackListener(mouseHoverListener);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

@Override
public void initialize() {
super.initialize();
if (!dynamicEnabled) {
return;
}
Control cOntrol= getControl();
// Add focus listener
control.addFocusListener(focusListener);
// Add mouse track listener
control.addMouseTrackListener(mouseHoverListener);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

control. addMouseTrackListener((MouseTrackListener) listener);
return;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

control. addMouseTrackListener((MouseTrackListener) listener);
return;

代码示例来源:origin: BiglySoftware/BiglyBT

/**
* Adds mousetracklistener to composite and all it's children
*
* @param parent Composite to start at
* @param listener Listener to add
*/
private void addMouseTrackListener(Composite parent,
MouseTrackListener listener) {
if (parent == null || listener == null || parent.isDisposed())
return;
parent.addMouseTrackListener(listener);
Control[] children = parent.getChildren();
for (int i = 0; i Control cOntrol= children[i];
if (control instanceof Composite)
addMouseTrackListener((Composite) control, listener);
else
control.addMouseTrackListener(listener);
}
}

代码示例来源:origin: org.eclipse/org.eclipse.help.ui

/**
* @param control
* org.eclipse.swt.widgets.Control
* @param listener
* org.eclipse.help.ui.internal.IHyperlinkListener
*/
public void registerHyperlink(Control control, IHyperlinkListener listener) {
if (background != null)
control.setBackground(background);
if (foreground != null)
control.setForeground(foreground);
control.addMouseListener(this);
control.addMouseTrackListener(this);
control.addListener(SWT.DefaultSelection, this);
if (hyperlinkUnderlineMode == UNDERLINE_ALWAYS)
control.addPaintListener(this);
hyperlinkListeners.put(control, listener);
removeDisposedLinks();
}
public IHyperlinkListener getLinkListener(Control c) {

代码示例来源:origin: org.xworker/xworker_swt

if(!SwtUtils.isRWT()) {
control.addPaintListener(designer.listener);
control.addMouseTrackListener(designer.listener);

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

control.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseExit(MouseEvent e) {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

control.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseExit(MouseEvent e) {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
* Ensures that the column is fully instantiated, i.e. has a control, and that the viewer is
* visible.
*/
private void connectIfNeeded() {
if (isConnected() || fParentRuler == null)
return;
fViewer= fParentRuler.getTextViewer();
if (fViewer == null)
return;
fWidget= fViewer.getTextWidget();
if (fWidget == null)
return;
fCOntrol= fColumn.getControl();
if (fCOntrol== null)
return;
fControl.addMouseTrackListener(fMouseHandler);
fControl.addMouseMoveListener(fMouseHandler);
fControl.addListener(SWT.MouseUp, fMouseHandler);
fControl.addListener(SWT.MouseDown, fMouseHandler);
fControl.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
handleDispose();
}
});
fRevisionSelectionProvider.install(fViewer);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
* Ensures that the column is fully instantiated, i.e. has a control, and that the viewer is
* visible.
*/
private void connectIfNeeded() {
if (isConnected() || fParentRuler == null)
return;
fViewer= fParentRuler.getTextViewer();
if (fViewer == null)
return;
fWidget= fViewer.getTextWidget();
if (fWidget == null)
return;
fCOntrol= fColumn.getControl();
if (fCOntrol== null)
return;
fControl.addMouseTrackListener(fMouseHandler);
fControl.addMouseMoveListener(fMouseHandler);
fControl.addListener(SWT.MouseUp, fMouseHandler);
fControl.addListener(SWT.MouseDown, fMouseHandler);
fControl.addDisposeListener(e -> handleDispose());
fRevisionSelectionProvider.install(fViewer);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public void start(Rectangle subjectArea) {
if (fIsActive) return;
fIsActive= true;
fSubjectArea= subjectArea;
fInformationControlToClose.addDisposeListener(this);
if (fSubjectControl != null && !fSubjectControl.isDisposed()) {
fSubjectControl.addMouseListener(this);
fSubjectControl.addMouseMoveListener(this);
fSubjectControl.addMouseTrackListener(this);
fSubjectControl.getShell().addShellListener(this);
fSubjectControl.addControlListener(this);
fSubjectControl.addKeyListener(this);
fDisplay= fSubjectControl.getDisplay();
if (!fDisplay.isDisposed() && fHideOnMouseWheel) {
fHasWheelFilter= true;
fDisplay.addFilter(SWT.MouseHorizontalWheel, this);
fDisplay.addFilter(SWT.MouseVerticalWheel, this);
}
}
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

mainControl.addMouseTrackListener(labelComboListener);
labelControl.addMouseTrackListener(labelComboListener);

代码示例来源:origin: ajermakovics/eclipse-instasearch

resultViewer.addTreeListener(this);
resultViewer.getControl().addMouseTrackListener(new MouseTrackAdapter()

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void start(Rectangle subjectArea) {
if (fIsActive) return;
fIsActive= true;
fSubjectArea= subjectArea;
fInformationControlToClose.addDisposeListener(this);
if (fSubjectControl != null && !fSubjectControl.isDisposed()) {
fSubjectControl.addMouseListener(this);
fSubjectControl.addMouseMoveListener(this);
fSubjectControl.addMouseTrackListener(this);
fSubjectControl.getShell().addShellListener(this);
fSubjectControl.addControlListener(this);
fSubjectControl.addKeyListener(this);
fDisplay= fSubjectControl.getDisplay();
if (!fDisplay.isDisposed() && fHideOnMouseWheel) {
fHasWheelFilter= true;
fDisplay.addFilter(SWT.MouseHorizontalWheel, this);
fDisplay.addFilter(SWT.MouseVerticalWheel, this);
}
}
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

control.addMouseTrackListener(new MouseTrackAdapter () {
@Override
public void mouseExit(MouseEvent e) {

代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.sqleditor

_viewer.getControl().addMouseTrackListener(new TooltipPresenter());
_viewer.setContentProvider(new SQLContentProvider());
SQLLabelProvider labelProvider = new SQLLabelProvider();

推荐阅读
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 本文介绍了一个Java猜拳小游戏的代码,通过使用Scanner类获取用户输入的拳的数字,并随机生成计算机的拳,然后判断胜负。该游戏可以选择剪刀、石头、布三种拳,通过比较两者的拳来决定胜负。 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文介绍了Java高并发程序设计中线程安全的概念与synchronized关键字的使用。通过一个计数器的例子,演示了多线程同时对变量进行累加操作时可能出现的问题。最终值会小于预期的原因是因为两个线程同时对变量进行写入时,其中一个线程的结果会覆盖另一个线程的结果。为了解决这个问题,可以使用synchronized关键字来保证线程安全。 ... [详细]
  • [大整数乘法] java代码实现
    本文介绍了使用java代码实现大整数乘法的过程,同时也涉及到大整数加法和大整数减法的计算方法。通过分治算法来提高计算效率,并对算法的时间复杂度进行了研究。详细代码实现请参考文章链接。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文介绍了在Java中gt、gtgt、gtgtgt和lt之间的区别。通过解释符号的含义和使用例子,帮助读者理解这些符号在二进制表示和移位操作中的作用。同时,文章还提到了负数的补码表示和移位操作的限制。 ... [详细]
  • 本文详细介绍了Java中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
  • Android源码深入理解JNI技术的概述和应用
    本文介绍了Android源码中的JNI技术,包括概述和应用。JNI是Java Native Interface的缩写,是一种技术,可以实现Java程序调用Native语言写的函数,以及Native程序调用Java层的函数。在Android平台上,JNI充当了连接Java世界和Native世界的桥梁。本文通过分析Android源码中的相关文件和位置,深入探讨了JNI技术在Android开发中的重要性和应用场景。 ... [详细]
  • 开发笔记:Java是如何读取和写入浏览器Cookies的
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了Java是如何读取和写入浏览器Cookies的相关的知识,希望对你有一定的参考价值。首先我 ... [详细]
  • Java值传递机制的说明及示例代码
    本文对Java值传递机制进行了详细说明,包括形参和实参的定义和传递方式,以及通过示例代码展示了交换值的方法。 ... [详细]
author-avatar
玩上加瘾_926
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有