com.jidesoft.plaf.basic.LazyMutableTreeNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jide-oss Show documentation
Show all versions of jide-oss Show documentation
JIDE Common Layer (Professional Swing Components)
/*
* @(#)LazyMutableTreeNode.java 10/9/2005
*
* Copyright 2002 - 2005 JIDE Software Inc. All rights reserved.
*/
package com.jidesoft.plaf.basic;
import javax.swing.tree.DefaultMutableTreeNode;
/**
* LazyMutableTreeNode.
*/
public abstract class LazyMutableTreeNode extends DefaultMutableTreeNode {
protected boolean _loaded = false;
public LazyMutableTreeNode() {
super();
}
public LazyMutableTreeNode(Object userObject) {
super(userObject);
}
public LazyMutableTreeNode(Object userObject, boolean allowsChildren) {
super(userObject, allowsChildren);
}
@Override
public int getChildCount() {
synchronized (this) {
if (!_loaded) {
_loaded = true;
initChildren();
}
}
return super.getChildCount();
}
public void clear() {
removeAllChildren();
_loaded = false;
}
public boolean isLoaded() {
return _loaded;
}
protected abstract void initChildren();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy