本文整理了Java中org.eclipse.swt.events.MouseEvent.getSource()
方法的一些代码示例,展示了MouseEvent.getSource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MouseEvent.getSource()
方法的具体详情如下:
包路径:org.eclipse.swt.events.MouseEvent
类名称:MouseEvent
方法名:getSource
暂无
代码示例来源:origin: com.metsci.glimpse/glimpse-extras-swt
@Override
protected boolean isValid( MouseEvent e, GlimpseBounds bounds )
{
return e.getSource( ) instanceof Control;
}
代码示例来源:origin: org.piccolo2d/piccolo2d-swt
/** {@inheritDoc} */
public Object getSource() {
return swtEvent.getSource();
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.common.frameworks.ui
/**
* @see org.eclipse.swt.events.MouseListener#mouseUp(MouseEvent)
*/
public void mouseUp(MouseEvent e) {
monitoringTarget = (Widget) e.getSource();
restart();
}
代码示例来源:origin: org.xworker/xworker_swt
public void mouseExit(MouseEvent e) {
lastControl = null;
thread.cancel = true;
Control control = (Control) e.getSource();
closeToolTip(control);
//if(toolTipShell != null)
// toolTipShell.dispose();
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void mouseUp(MouseEvent e) {
if (tree.getSelectionCount() < 1)
return;
if (e.button != 1)
return;
if (tree.equals(e.getSource())) {
Object o= tree.getItem(new Point(e.x, e.y));
TreeItem selection= tree.getSelection()[0];
if (selection.equals(o))
gotoSelectedElement();
}
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void mouseEnter(MouseEvent e) {
Item item= (Item) ((Widget) e.getSource()).getData();
if (item != null)
item.selected();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
@Override
public void mouseUp(MouseEvent e) {
if (fTable.getSelectionCount() < 1)
return;
if (e.button != 1)
return;
if (fTable.equals(e.getSource())) {
Object o= fTable.getItem(new Point(e.x, e.y));
TableItem selection= fTable.getSelection()[0];
if (selection.equals(o))
openSelectedLink();
}
}
});
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void mouseEnter(MouseEvent e) {
Item item= (Item) ((Widget) e.getSource()).getData();
if (item != null)
item.selected();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public void mouseDown(MouseEvent e) {
Item item= (Item) ((Widget) e.getSource()).getData();
// TODO for now, to make double click work: disable single click on the first item
// disable later when the annotationlistener selectively handles input
if (item != null && e.button == 1) // && item.fAnnotation != fInput.fAnnotations[0])
item.defaultSelected(e);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void mouseUp(MouseEvent e) {
if (tree.getSelectionCount() < 1)
return;
if (e.button != 1)
return;
if (tree.equals(e.getSource())) {
Object o= tree.getItem(new Point(e.x, e.y));
TreeItem selection= tree.getSelection()[0];
if (selection.equals(o))
gotoSelectedElement();
}
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void mouseDown(MouseEvent e) {
Item item= (Item) ((Widget) e.getSource()).getData();
// TODO for now, to make double click work: disable single click on the first item
// disable later when the annotationlistener selectively handles input
if (item != null && e.button == 1) // && item.fAnnotation != fInput.fAnnotations[0])
item.defaultSelected(e);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void mouseDown(MouseEvent e) {
Item item= (Item) ((Widget) e.getSource()).getData();
// TODO for now, to make double click work: disable single click on the first item
// disable later when the annotationlistener selectively handles input
if (item != null && e.button == 1) // && item.fAnnotation != fInput.fAnnotations[0])
item.defaultSelected();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public void mouseEnter(MouseEvent e) {
Item item= (Item) ((Widget) e.getSource()).getData();
if (item != null)
item.selected();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
@Override
public void mouseUp(MouseEvent e) {
if (fTable.getSelectionCount() < 1)
return;
if (e.button != 1)
return;
if (fTable.equals(e.getSource())) {
Object o= fTable.getItem(new Point(e.x, e.y));
TableItem selection= fTable.getSelection()[0];
if (selection.equals(o))
openSelectedLink();
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public void mouseUp(MouseEvent e) {
if (table.getSelectionCount() < 1)
return;
if (e.button != 1)
return;
if (table.equals(e.getSource())) {
Object o = table.getItem(new Point(e.x, e.y));
TableItem selection = table.getSelection()[0];
if (selection.equals(o))
handleSelection();
}
}
});
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private void handleTreeViewerMouseUp(final Tree tree, MouseEvent e) {
// Ensure a selection was made, the first mouse button was
// used and the event happened in the tree
if ((tree.getSelectionCount() < 1) || (e.button != 1) || (tree.equals(e.getSource()) == false)) {
return;
}
// Selection is made in the selection changed listener
Object object = tree.getItem(new Point(e.x, e.y));
TreeItem selection = tree.getSelection()[0];
if (selection.equals(object)) {
gotoSelectedElement();
}
}
代码示例来源:origin: cbeust/testng-eclipse
private void handleDoubleClick(MouseEvent e) {
TableItem[] items = ((Table) e.getSource()).getSelection();
if (items.length > 0) {
ExcludedMethod em = (ExcludedMethod) items[0].getData();
System.out.println("Double click " + em.packageName + "." + em.methodName);
OpenTestAction openAction
= new OpenTestAction(m_testRunnerPart, em.packageName, em.methodName,
true /* activate */);
openAction.run();
}
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void mouseDown(MouseEvent e) {
if (e.getSource() == fControl && e.x < fControl.getClient().getLocation().x)
return;
if (e.getSource() == fControl.getClient() && e.x < getChildren().get(0).getControl().getLocation().x)
return;
fToggle.setFocus();
}
};
代码示例来源:origin: org.xworker/xworker_swt
public void mouseEnter(MouseEvent e) {
Control control = (Control) e.getSource();
lastControl = control;
thread = new LabelToolTipOpenThread();
thread.control = control;
thread.parent = control.getShell();
Point point = control.toDisplay(e.x + 10, e.y + 10);
thread.x = point.x;
thread.y = point.y;
thread.listsner = this;
thread.start();
control.setData("labelToolTipThread", thread);
}
代码示例来源:origin: anb0s/EasyShell
@Override
public void mouseDoubleClick(MouseEvent e) {
StyledText text = (StyledText)(e.getSource());
Control control = text;
text.selectAll();
String title = Activator.getResourceString("easyshell.message.copytoclipboard");
String message = text.getText();
Utils.copyToClipboard(message);
Utils.showToolTipInfo(control, title, message);
text.setSelection(0, 0);
}
});
内容来源于网络,如有侵权,请联系作者删除!