本文整理了Java中javax.swing.JTree.isCollapsed()
方法的一些代码示例,展示了JTree.isCollapsed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.isCollapsed()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:isCollapsed
暂无
代码示例来源:origin: igvteam/igv
private void collapsePath(TreePath treePath) {
if (!tree.isCollapsed(treePath)) {
tree.collapsePath(treePath);
}
}
代码示例来源:origin: net.sf.jt400/jt400
/**
Indicates if the object is currently collapsed.
@param object The object.
@return true if the object is collapsed; false otherwise.
**/
public boolean isCollapsed (VNode object)
{
if (object == null)
throw new NullPointerException ("object");
int row = findRow (object);
if (row >= 0)
return tree_.isCollapsed (row);
else
return false;
}
代码示例来源:origin: org.jboss.jbossts.arjunacore/arjunacore
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: jbosstm/narayana
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: jbosstm/narayana
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: jboss.jbossts/jbossjts
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: org.jboss.jbossts.arjunacore/arjuna
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: jbosstm/narayana
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: org.jboss.jbossts/jbossjta
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: org.jboss.narayana.arjunacore/arjuna
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: org.jboss.narayana.arjunacore/arjunacore
private void modifyTransactionView ()
{
if (transactions.isCollapsed(1))
transactions.expandRow(1);
else
transactions.collapseRow(1);
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
@Override
public void keyReleased(KeyEvent e)
{
if(e.getKeyCode() == KeyEvent.VK_ENTER){
int selectedRow = arvore.getSelectionRows()[0];
if(arvore.isCollapsed(selectedRow)){
arvore.expandRow(selectedRow);
}else{
arvore.collapseRow(selectedRow);
}
}
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
private void onWindowClosing()
{
JTree tre = _dialog.treFiles;
tre.isCollapsed(new TreePath(_recentFilesNode.getPath()));
Preferences.userRoot().putBoolean(PREF_KEY_RECENT_FILES_EXPANDED, tre.isExpanded(new TreePath(_recentFilesNode.getPath())));
Preferences.userRoot().putBoolean(PREF_KEY_FAVOURITE_FILES_EXPANDED, tre.isExpanded(new TreePath(_favouriteFilesNode.getPath())));
Preferences.userRoot().putBoolean(PREF_KEY_RECENT_ALIAS_FILES_EXPANDED, tre.isExpanded(new TreePath(_recentFilesForAliasNode.getPath())));
Preferences.userRoot().putBoolean(PREF_KEY_FAVOURITE_ALIAS_FILES_EXPANDED, tre.isExpanded(new TreePath(_favouriteFilesForAliasNode.getPath())));
}
代码示例来源:origin: realXuJiang/bigtable-sql
private void onWindowClosing()
{
JTree tre = _dialog.treFiles;
tre.isCollapsed(new TreePath(_recentFilesNode.getPath()));
Preferences.userRoot().putBoolean(PREF_KEY_RECENT_FILES_EXPANDED, tre.isExpanded(new TreePath(_recentFilesNode.getPath())));
Preferences.userRoot().putBoolean(PREF_KEY_FAVOURITE_FILES_EXPANDED, tre.isExpanded(new TreePath(_favouriteFilesNode.getPath())));
Preferences.userRoot().putBoolean(PREF_KEY_RECENT_ALIAS_FILES_EXPANDED, tre.isExpanded(new TreePath(_recentFilesForAliasNode.getPath())));
Preferences.userRoot().putBoolean(PREF_KEY_FAVOURITE_ALIAS_FILES_EXPANDED, tre.isExpanded(new TreePath(_favouriteFilesForAliasNode.getPath())));
}
代码示例来源:origin: net.sf.sfac/sfac-core
private static void expandNodesOfLevels(JTree tree, TreePath currentPath, int toLevel) {
int currentLevel = currentPath.getPathCount();
if (currentLevel < toLevel) {
if (tree.isCollapsed(currentPath)) {
tree.expandPath(currentPath);
collapseChildNodes(tree, currentPath);
tree.expandPath(currentPath);
}
Object currentNode = currentPath.getLastPathComponent();
TreeModel model = tree.getModel();
RecursiveTreePath childPath;
int len = model.getChildCount(currentNode);
for (int i = 0; i < len; i++) {
childPath = new RecursiveTreePath(currentPath, model.getChild(currentNode, i));
expandNodesOfLevels(tree, childPath, toLevel);
}
}
}
代码示例来源:origin: Vhati/Slipstream-Mod-Manager
/**
* Cycles through expanding all nodes and collapsing them.
*/
public void toggleAllNodeExpansion() {
boolean canExpand = false;
boolean canCollapse = false;
for ( int i = tree.getRowCount()-1; i >= 0; i-- ) {
if ( tree.isCollapsed( i ) ) {
canExpand = true;
}
else if ( tree.isExpanded( i ) ) {
canCollapse = true;
}
}
if ( canExpand ) {
expandAllNodes( tree.getRowCount() );
}
else if ( canCollapse ) {
collapseAllNodes( new TreePath( treeModel.getRoot() ) );
}
}
内容来源于网络,如有侵权,请联系作者删除!