本文整理匯總了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();
}
}