本文整理了Java中org.eclipse.swt.widgets.Table.addMouseListener()
方法的一些代码示例,展示了Table.addMouseListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.addMouseListener()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:addMouseListener
暂无
代码示例来源:origin: pentaho/pentaho-kettle
wFields.table.addMouseListener( new MouseListener() {
@Override
public void mouseDoubleClick( MouseEvent arg0 ) {
代码示例来源:origin: caoxinyu/RedisClient
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
protected void addMouseListener(final Table table, final Shell dialog) {
table.addMouseListener(new MouseListener() {
@Override
public void mouseDoubleClick(MouseEvent e) {
ok(dialog, table);
}
@Override
public void mouseDown(MouseEvent e) {
ok(dialog, table);
}
@Override
public void mouseUp(MouseEvent e) {
ok(dialog, table);
}
});
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
table.addMouseListener(new MouseListener() {
@Override
public void mouseDoubleClick(MouseEvent e) {
代码示例来源:origin: pentaho/pentaho-kettle
table.addMouseListener( lsMouseT );
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
protected void hookControl(Control control) {
super.hookControl(control);
((Table) control).addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
if (getTable().getSelection().length == 0)
return;
TableItem item= getTable().getSelection()[0];
if (item.getBounds(STATE_PROP).contains(e.x, e.y)) {
List widgetSel= getSelectionFromWidget();
if (widgetSel == null || widgetSel.size() != 1)
return;
NLSSubstitution substitution= (NLSSubstitution) widgetSel.get(0);
Integer value= (Integer) getCellModifier().getValue(substitution, PROPERTIES[STATE_PROP]);
int newValue= MultiStateCellEditor.getNextValue(NLSSubstitution.STATE_COUNT, value.intValue());
getCellModifier().modify(item, PROPERTIES[STATE_PROP], new Integer(newValue));
}
}
});
}
};
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
protected void hookControl(Control control) {
super.hookControl(control);
((Table) control).addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
if (getTable().getSelection().length == 0)
return;
TableItem item= getTable().getSelection()[0];
if (item.getBounds(STATE_PROP).contains(e.x, e.y)) {
List<?> widgetSel= getSelectionFromWidget();
if (widgetSel == null || widgetSel.size() != 1)
return;
NLSSubstitution substitution= (NLSSubstitution) widgetSel.get(0);
Integer value= (Integer) getCellModifier().getValue(substitution, PROPERTIES[STATE_PROP]);
int newValue= MultiStateCellEditor.getNextValue(NLSSubstitution.STATE_COUNT, value.intValue());
getCellModifier().modify(item, PROPERTIES[STATE_PROP], Integer.valueOf(newValue));
}
}
});
}
};
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
protected void hookControl(Control control) {
super.hookControl(control);
((Table) control).addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
if (getTable().getSelection().length == 0)
return;
TableItem item= getTable().getSelection()[0];
if (item.getBounds(STATE_PROP).contains(e.x, e.y)) {
List<?> widgetSel= getSelectionFromWidget();
if (widgetSel == null || widgetSel.size() != 1)
return;
NLSSubstitution substitution= (NLSSubstitution) widgetSel.get(0);
Integer value= (Integer) getCellModifier().getValue(substitution, PROPERTIES[STATE_PROP]);
int newValue= MultiStateCellEditor.getNextValue(NLSSubstitution.STATE_COUNT, value.intValue());
getCellModifier().modify(item, PROPERTIES[STATE_PROP], new Integer(newValue));
}
}
});
}
};
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
public AsyncTableRenderingViewer(AbstractAsyncTableRendering rendering, Composite parent, int style) {
super(parent, style);
fRendering = rendering;
getTable().addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
handleTableMouseEvent(e);
}});
createCursor(getTable());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
@Override
protected void hookControl(Control control) {
super.hookControl(control);
tableTree.getTable().addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
/*
* If user clicked on the [+] or [-], do not activate
* CellEditor.
*/
// XXX: This code should not be here. SWT should either have
// support to see
// if the user clicked on the [+]/[-] or manage the table editor
// activation
org.eclipse.swt.widgets.TableItem[] items = tableTree
.getTable().getItems();
for (TableItem item : items) {
Rectangle rect = item.getImageBounds(0);
if (rect.contains(e.x, e.y)) {
return;
}
}
tableEditorImpl.handleMouseDown(e);
}
});
}
代码示例来源:origin: org.codehaus.openxma/xmartclient
private void addContextMenuListeners (EventAdapter adapter, Table ta) {
Menu menu = ta.getMenu();
if (menu != null) {
for (int i=0; i<menu.getItems().length; i++) {
MenuItem item = menu.getItem(i);
item.addSelectionListener(adapter);
}
// add MouseListener for immediatly chaning context menu item texts before they are shown
ta.addMouseListener(adapter);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
fTable.addMouseListener(new MouseAdapter() {
@Override
public void mouseUp(MouseEvent e) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
fTable.addMouseListener(new MouseAdapter() {
@Override
public void mouseUp(MouseEvent e) {
代码示例来源:origin: org.eclipse/org.eclipse.search
table.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
okPressed();
代码示例来源:origin: org.eclipse.platform/org.eclipse.search
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Creates the widgets in the "child" group.
*/
@Override
void createChildWidgets () {
/* Add common controls */
super.createChildWidgets ();
/* Add TableEditors */
comboEditor = new TableEditor (table);
nameEditor = new TableEditor (table);
table.addMouseListener(MouseListener.mouseDownAdapter(e -> {
resetEditors();
index = table.getSelectionIndex();
if (index == -1)
return;
TableItem oldItem = comboEditor.getItem();
newItem = table.getItem(index);
if (newItem == oldItem || newItem != lastSelected) {
lastSelected = newItem;
return;
}
table.showSelection();
combo = new CCombo(table, SWT.READ_ONLY);
createComboEditor(combo, comboEditor);
nameText = new Text(table, SWT.SINGLE);
nameText.setText(data.get(index)[NAME_COL]);
createTextEditor(nameText, nameEditor, NAME_COL);
}));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
table.addMouseListener(MouseListener.mouseDownAdapter(e -> {
resetEditors();
index = table.getSelectionIndex();
代码示例来源:origin: org.eclipse/org.eclipse.search
protected Control createDialogArea(Composite container) {
Composite parent= (Composite) super.createDialogArea(container);
createMessageArea(parent);
fViewer= new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
fViewer.setContentProvider(fContentProvider);
final Table table= fViewer.getTable();
table.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
if (fCreateCancelButton)
okPressed();
}
});
fViewer.setLabelProvider(fLabelProvider);
fViewer.setInput(fInput);
List initialSelection= getInitialElementSelections();
if (initialSelection != null)
fViewer.setSelection(new StructuredSelection(initialSelection));
GridData gd= new GridData(GridData.FILL_BOTH);
gd.heightHint= convertHeightInCharsToPixels(15);
gd.widthHint= convertWidthInCharsToPixels(WIDTH_IN_CHARACTERS);
table.setLayoutData(gd);
applyDialogFont(table);
return table;
}
代码示例来源:origin: net.sf.okapi.steps/okapi-step-tokenization-ui
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
table.addMouseListener(mouseAdapter);
createButtons(namespaceInfoGroup);
ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
内容来源于网络,如有侵权,请联系作者删除!