本文整理了Java中org.eclipse.swt.widgets.Tree.getSelection()
方法的一些代码示例,展示了Tree.getSelection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getSelection()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:getSelection
[英]Returns an array of TreeItem
s that are currently selected in the receiver. The order of the items is unspecified. An empty array indicates that no items are selected.
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
[中]
代码示例来源:origin: pentaho/pentaho-kettle
public void handleEvent( Event e ) {
renameFunction( wTree.getSelection()[0] );
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent event ) {
if ( tree.getSelectionCount() == 1 ) {
TreeItem item = tree.getSelection()[0];
if ( item.getParentItem() != null ) { // has a category above it
String functionName = item.getText();
FunctionDescription functionDescription = functionLib.getFunctionDescription( functionName );
if ( functionDescription != null ) {
String report = functionDescription.getHtmlReport();
message.setText( report );
}
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void handleEvent( Event e ) {
renameFunction( wTree.getSelection()[0] );
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void handleEvent( Event e ) {
renameFunction( wTree.getSelection()[0] );
}
} );
代码示例来源:origin: caoxinyu/RedisClient
@Override
public void widgetSelected(SelectionEvent e) {
TreeItem[] items = tree.getSelection();
refreshOrder();
dbContainerTreeItemSelected(items[0], true);
}
});
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetSelected( SelectionEvent e ) {
if ( wTree.getSelection().length > 0 ) {
wOK.setEnabled( !Boolean.TRUE.equals( wTree.getSelection()[ 0 ].getData( "isFolder" ) ) );
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void dragSetData( DragSourceEvent event ) {
// Set the data to be the first selected item's text
event.data = wTree.getSelection()[0].getText();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
private TreeEntry getTreeEntry() {
TreeItem[] ti = wTree.getSelection();
if ( ti.length == 1 ) {
return getTreeEntry( ti[ 0 ] );
} else {
return null;
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void dragSetData( DragSourceEvent event ) {
// Set the data to be the first selected item's data
event.data = wTree.getSelection()[0].getData();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void dragSetData( DragSourceEvent event ) {
// Set the data to be the first selected item's text
event.data = wTree.getSelection()[0].getText();
}
} );
代码示例来源:origin: caoxinyu/RedisClient
@Override
public void widgetSelected(SelectionEvent e) {
if (flatView == true) {
TreeItem[] treeItems = tree.getSelection();
ContainerKeyInfo cinfo = new ContainerKeyInfo();
parseContainer(treeItems[0], cinfo);
flatView = false;
updateView(cinfo);
}
}
});
代码示例来源:origin: caoxinyu/RedisClient
@Override
public void widgetSelected(SelectionEvent e) {
if (flatView == false) {
TreeItem[] treeItems = tree.getSelection();
ContainerKeyInfo cinfo = new ContainerKeyInfo();
parseContainer(treeItems[0], cinfo);
flatView = true;
updateView(cinfo);
}
}
});
代码示例来源:origin: pentaho/pentaho-kettle
public void handleEvent( Event e ) {
String snippitFullName = wTree.getSelection()[0].getText();
String sampleTabName = snippitFullName.replace( "Implement ", "" ).replace( ' ', '_' ) + "_Sample";
if ( getCTabPosition( sampleTabName ) == -1 ) {
addCtab( sampleTabName, snippitsHelper.getSample( snippitFullName ), TabAddActions.ADD_DEFAULT );
}
if ( getCTabPosition( sampleTabName ) != -1 ) {
setActiveCtab( sampleTabName );
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void handleEvent( Event e ) {
String strFunctionName = wTree.getSelection()[0].getText();
String strFunctionNameWithArgs = strFunctionName;
strFunctionName = strFunctionName.substring( 0, strFunctionName.indexOf( '(' ) );
String strHelpTabName = strFunctionName + "_Sample";
if ( getCTabPosition( strHelpTabName ) == -1 ) {
addCtab( strHelpTabName, scVHelp.getSample( strFunctionName, strFunctionNameWithArgs ), 0 );
}
if ( getCTabPosition( strHelpTabName ) != -1 ) {
setActiveCtab( strHelpTabName );
}
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public void handleEvent( Event e ) {
String strFunctionName = wTree.getSelection()[0].getText();
String strFunctionNameWithArgs = strFunctionName;
strFunctionName = strFunctionName.substring( 0, strFunctionName.indexOf( '(' ) );
String strHelpTabName = strFunctionName + "_Sample";
if ( getCTabPosition( strHelpTabName ) == -1 ) {
addCtab( strHelpTabName, scVHelp.getSample( strFunctionName, strFunctionNameWithArgs ), 0 );
}
if ( getCTabPosition( strHelpTabName ) != -1 ) {
setActiveCtab( strHelpTabName );
}
}
} );
代码示例来源:origin: caoxinyu/RedisClient
private void orderMenuSelected(Order order) {
TreeItem[] items = tree.getSelection();
if (items.length > 0) {
NodeType type = (NodeType) items[0].getData(NODE_TYPE);
if (type == NodeType.CONTAINER || type == NodeType.DATABASE) {
clientOrder = order;
columnSelected();
}
}
}
代码示例来源:origin: caoxinyu/RedisClient
@Override
public void widgetSelected(SelectionEvent e) {
TreeItem[] items = tree.getSelection();
if (items[0] != rootRedisServers) {
history.add(items[0].getParentItem());
btnBackward.setEnabled(true);
btnForward.setEnabled(false);
tree.setSelection(items[0].getParentItem());
treeItemSelected(false);
}
}
});
代码示例来源:origin: pentaho/pentaho-kettle
public void handleOK() {
TreeItem[] ti = wTree.getSelection();
if ( ti.length == 1 ) {
String[] tree = ConstUI.getTreeStrings( ti[ 0 ] );
selection = repositoryTree.findDirectory( tree );
dispose();
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void widgetDefaultSelected( SelectionEvent selectionEvent ) {
TreeItem[] items = tree.getSelection();
for ( int i = 0; i < items.length; i++ ) {
String[] path2 = ConstUI.getTreeStrings( items[i] );
if ( equalPaths( path1, path2 ) ) {
doubleClick.action( treeItem );
}
}
}
};
代码示例来源:origin: caoxinyu/RedisClient
private void deleteKey(Item item) {
ContainerKeyInfo cinfo = new ContainerKeyInfo();
TreeItem[] items = tree.getSelection();
parseContainer(items[0], cinfo);
String key = cinfo.getContainerStr();
key += item.getText();
service2.deleteKey(cinfo.getId(), cinfo.getDb(), key);
item.dispose();
}
内容来源于网络,如有侵权,请联系作者删除!