MCPcopy Index your code
hub / github.com/beanshell/beanshell / setClassTree

Method setClassTree

src/bsh/util/ClassBrowser.java:239–263  ·  view source on GitHub ↗
( Class clas )

Source from the content-addressed store, hash-verified

237 }
238
239 void setClassTree( Class clas ) {
240 if ( clas == null ) {
241 tree.setModel( null );
242 return;
243 }
244
245 MutableTreeNode bottom = null, top = null;
246 DefaultMutableTreeNode up;
247 do {
248 up= new DefaultMutableTreeNode( clas.toString() );
249 if ( top != null )
250 up.add( top );
251 else
252 bottom = up;
253 top = up;
254 } while ( (clas = clas.getSuperclass()) != null );
255 tree.setModel( new DefaultTreeModel(top) );
256
257 TreeNode tn = bottom.getParent();
258 if ( tn != null ) {
259 TreePath tp = new TreePath (
260 ((DefaultTreeModel)tree.getModel()).getPathToRoot( tn ) );
261 tree.expandPath( tp );
262 }
263 }
264
265 JPanel labeledPane( JComponent comp, String label ) {
266 JPanel jp = new JPanel( new BorderLayout() );

Callers 2

setMlistMethod · 0.95
initMethod · 0.95

Calls 3

toStringMethod · 0.45
addMethod · 0.45
getParentMethod · 0.45

Tested by

no test coverage detected