本文整理汇总了Java中org.eclipse.jface.viewers.DoubleClickEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleClickEvent.getSource方法的具体用法?Java DoubleClickEvent.getSource怎么用?Java DoubleClickEvent.getSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.DoubleClickEvent
的用法示例。
在下文中一共展示了DoubleClickEvent.getSource方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doubleClick
import org.eclipse.jface.viewers.DoubleClickEvent; //导入方法依赖的package包/类
/**
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
*/
public void doubleClick(final DoubleClickEvent dce) {
if (dce.getSelection() instanceof ITreeSelection) {
final ITreeSelection treeSelection = (ITreeSelection) dce.getSelection();
final AbstractTreeViewer treeViewer = (AbstractTreeViewer) dce.getSource();
boolean state = treeViewer.getExpandedState(treeSelection.getPaths()[0]);
treeViewer.setExpandedState(treeSelection.getPaths()[0], !state);
}
if (UserPreferences.getInstance().getBoolean(
JpwPreferenceConstants.DOUBLE_CLICK_COPIES_TO_CLIPBOARD)) {
cpa.run();
} else {
era.run();
}
}
示例2: doubleClick
import org.eclipse.jface.viewers.DoubleClickEvent; //导入方法依赖的package包/类
public void doubleClick( DoubleClickEvent event )
{
IStructuredSelection selection = (IStructuredSelection) event.getSelection( );
if ( selection.isEmpty( ) )
{
return;
}
if ( event.getSource( ) == functionTable )
{
insertSelection( selection );
return;
}
}
示例3: doubleClick
import org.eclipse.jface.viewers.DoubleClickEvent; //导入方法依赖的package包/类
@Override
public void doubleClick(DoubleClickEvent arg0) {
setNode(arg0);
if (arg0.getSource() instanceof TreeViewer) {
if (IsoExplorerSashForm.getInstance().getIsoDirectoriesTree().getExpandedState(node)) {
IsoExplorerSashForm.getInstance().getIsoDirectoriesTree().collapseToLevel(node, 1);
} else {
IsoExplorerSashForm.getInstance().getIsoDirectoriesTree().expandToLevel(node, 1);
}
} else {
run();
}
}
示例4: doubleClick
import org.eclipse.jface.viewers.DoubleClickEvent; //导入方法依赖的package包/类
@Override
public void doubleClick(DoubleClickEvent arg0) {
setFile(arg0);
if (arg0.getSource() instanceof TreeViewer) {
if (OSExplorerSashForm.getInstance().getOsDirectoriesTree().getExpandedState(file)) {
OSExplorerSashForm.getInstance().getOsDirectoriesTree().collapseToLevel(file, 1);
} else {
OSExplorerSashForm.getInstance().getOsDirectoriesTree().expandToLevel(file, 1);
}
} else {
run();
}
}