Top Description Inners Fields Constructors Methods
bsh.util

public Class ClassBrowser

extends JSplitPane
implements ListSelectionListener, ClassPathListener
Class Inheritance
All Implemented Interfaces
bsh.classpath.ClassPathListener, javax.swing.event.ListSelectionListener, java.util.EventListener
Imports
java.util.*, .List, java.util.zip.*, javax.swing.*, javax.swing.tree.*, javax.swing.event.*, javax.swing.border.*, java.io.*, java.awt.*, java.lang.reflect.*, bsh.BshClassManager, .ClassPathException, .StringUtil, .ConsoleInterface, bsh.classpath.BshClassPath, .ClassPathListener, .ClassManagerImpl

A simple class browser for the BeanShell desktop.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv String[]
pack-priv JList<E>
pack-priv BshClassManager
pack-priv BshClassPath
pack-priv JList<E>
pack-priv Constructor<T>[]
pack-priv JList<E>
pack-priv Field[]
pack-priv JFrame
pack-priv JInternalFrame
private static final Color
pack-priv JTextArea
pack-priv Method[]
pack-priv JList<E>
pack-priv String[]
pack-priv ClassBrowser.PackageTree
pack-priv Class<T>
pack-priv String
pack-priv JTree
Inherited from javax.swing.JSplitPane:
BOTTOMCONTINUOUS_LAYOUT_PROPERTYcontinuousLayoutDIVIDERDIVIDER_LOCATION_PROPERTYDIVIDER_SIZE_PROPERTYdividerSizeHORIZONTAL_SPLITLAST_DIVIDER_LOCATION_PROPERTYlastDividerLocationLEFTleftComponentONE_TOUCH_EXPANDABLE_PROPERTYoneTouchExpandableorientationORIENTATION_PROPERTYRESIZE_WEIGHT_PROPERTYRIGHTrightComponentTOPVERTICAL_SPLIT

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
driveToClass(String classname)

pack-priv Constructor<T>[]
pack-priv Field[]
pack-priv Method[]
public void
init()

pack-priv JPanel
public static void
main(String[] args)

pack-priv String[]
parseConstructors(Constructor<T>[] constructors)

pack-priv String[]
parseFields(Field[] fields)

pack-priv String[]
parseMethods(Method[] methods)

pack-priv void
pack-priv void
setClist(String packagename)

pack-priv void
setConslist(Class<T> clas)

pack-priv void
public void
public void
pack-priv void
pack-priv void
setMlist(String classname)

private JSplitPane
splitPane(int orientation, boolean redraw, JComponent c1, JComponent c2)

public void
pack-priv String[]
public void
valueChanged(ListSelectionEvent
the event that characterizes the change.
e
)

Implements javax.swing.event.ListSelectionListener.valueChanged.

Called whenever the value of the selection changes.
Inherited from javax.swing.JSplitPane:
addImplgetAccessibleContextgetBottomComponentgetDividerLocationgetDividerSizegetLastDividerLocationgetLeftComponentgetMaximumDividerLocationgetMinimumDividerLocationgetOrientationgetResizeWeightgetRightComponentgetTopComponentgetUIgetUIClassIDisContinuousLayoutisOneTouchExpandableisValidateRootpaintChildrenparamStringremoveremoveremoveAllresetToPreferredSizessetBottomComponentsetContinuousLayoutsetDividerLocationsetDividerLocationsetDividerSizesetLastDividerLocationsetLeftComponentsetOneTouchExpandablesetOrientationsetResizeWeightsetRightComponentsetTopComponentsetUIupdateUI

Field Detail

classesListback to summary
pack-priv String[] classesList
classlistback to summary
pack-priv JList<E> classlist
classManagerback to summary
pack-priv BshClassManager classManager
classPathback to summary
pack-priv BshClassPath classPath
conslistback to summary
pack-priv JList<E> conslist
consListback to summary
pack-priv Constructor<T>[] consList
fieldlistback to summary
pack-priv JList<E> fieldlist
fieldListback to summary
pack-priv Field[] fieldList
frameback to summary
pack-priv JFrame frame
iframeback to summary
pack-priv JInternalFrame iframe
LIGHT_BLUEback to summary
private static final Color LIGHT_BLUE
methodLineback to summary
pack-priv JTextArea methodLine
methodListback to summary
pack-priv Method[] methodList
mlistback to summary
pack-priv JList<E> mlist
packagesListback to summary
pack-priv String[] packagesList
ptreeback to summary
pack-priv ClassBrowser.PackageTree ptree
selectedClassback to summary
pack-priv Class<T> selectedClass
selectedPackageback to summary
pack-priv String selectedPackage
treeback to summary
pack-priv JTree tree

Constructor Detail

ClassBrowserback to summary
public ClassBrowser()
ClassBrowserback to summary
public ClassBrowser(BshClassManager classManager)

Method Detail

classPathChangedback to summary
public void classPathChanged()

Implements bsh.classpath.ClassPathListener.classPathChanged.

driveToClassback to summary
public void driveToClass(String classname)
getPublicConstructorsback to summary
pack-priv Constructor<T>[] getPublicConstructors(Constructor<T>[] constructors)
getPublicFieldsback to summary
pack-priv Field[] getPublicFields(Field[] fields)
getPublicMethodsback to summary
pack-priv Method[] getPublicMethods(Method[] methods)
initback to summary
public void init() throws ClassPathException
labeledPaneback to summary
pack-priv JPanel labeledPane(JComponent comp, String label)
mainback to summary
public static void main(String[] args) throws Exception
parseConstructorsback to summary
pack-priv String[] parseConstructors(Constructor<T>[] constructors)
parseFieldsback to summary
pack-priv String[] parseFields(Field[] fields)
parseMethodsback to summary
pack-priv String[] parseMethods(Method[] methods)
setClassTreeback to summary
pack-priv void setClassTree(Class<T> clas)
setClistback to summary
pack-priv void setClist(String packagename)
setConslistback to summary
pack-priv void setConslist(Class<T> clas)
setFieldListback to summary
pack-priv void setFieldList(Class<T> clas)
setFrameback to summary
public void setFrame(JFrame frame)
setFrameback to summary
public void setFrame(JInternalFrame frame)
setMethodLineback to summary
pack-priv void setMethodLine(Object method)
setMlistback to summary
pack-priv void setMlist(String classname)
splitPaneback to summary
private JSplitPane splitPane(int orientation, boolean redraw, JComponent c1, JComponent c2)
toFrontback to summary
public void toFront()
toSortedStringsback to summary
pack-priv String[] toSortedStrings(Collection<E> c)
valueChangedback to summary
public void valueChanged(ListSelectionEvent e)

Implements javax.swing.event.ListSelectionListener.valueChanged.

Doc from javax.swing.event.ListSelectionListener.valueChanged.

Called whenever the value of the selection changes.

Parameters
e:ListSelectionEvent

the event that characterizes the change.

bsh.util back to summary

pack-priv Class ClassBrowser.PackageTree

extends JTree
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv Map<K, V>
pack-priv TreeNode
pack-priv DefaultTreeModel
Inherited from javax.swing.JTree:
ANCHOR_SELECTION_PATH_PROPERTYCELL_EDITOR_PROPERTYCELL_RENDERER_PROPERTYcellEditorcellRenderereditableEDITABLE_PROPERTYEXPANDS_SELECTED_PATHS_PROPERTYINVOKES_STOP_CELL_EDITING_PROPERTYinvokesStopCellEditingLARGE_MODEL_PROPERTYlargeModelLEAD_SELECTION_PATH_PROPERTYROOT_VISIBLE_PROPERTYrootVisibleROW_HEIGHT_PROPERTYrowHeightSCROLLS_ON_EXPAND_PROPERTYscrollsOnExpandSELECTION_MODEL_PROPERTYselectionModelselectionRedirectorSHOWS_ROOT_HANDLES_PROPERTYshowsRootHandlesTOGGLE_CLICK_COUNT_PROPERTYtoggleClickCountTREE_MODEL_PROPERTYtreeModelListenerVISIBLE_ROW_COUNT_PROPERTYvisibleRowCount

Constructor Summary

AccessConstructor and Description
pack-priv
PackageTree(Collection<E> packages)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addNodeMap(TreeNode node)

map a single node up to the root

pack-priv MutableTreeNode
makeNode(Map<K, V> map, String nodeName)

pack-priv DefaultTreeModel
pack-priv void
mapNodes(TreeNode node)

Map out the location of the nodes by package name.

public void
setPackages(Collection<E> packages)

pack-priv void
Inherited from javax.swing.JTree:
addSelectionIntervaladdSelectionPathaddSelectionPathsaddSelectionRowaddSelectionRowsaddTreeExpansionListeneraddTreeSelectionListeneraddTreeWillExpandListenercancelEditingclearSelectionclearToggledPathscollapsePathcollapseRowconvertValueToTextcreateTreeModelcreateTreeModelListenerexpandPathexpandRowfireTreeCollapsedfireTreeExpandedfireTreeWillCollapsefireTreeWillExpandfireValueChangedgetAccessibleContextgetAnchorSelectionPathgetCellEditorgetCellRenderergetClosestPathForLocationgetClosestRowForLocationgetDefaultTreeModelgetDescendantToggledPathsgetDragEnabledgetDropLocationgetDropModegetEditingPathgetExpandedDescendantsgetExpandsSelectedPathsgetInvokesStopCellEditinggetLastSelectedPathComponentgetLeadSelectionPathgetLeadSelectionRowgetMaxSelectionRowgetMinSelectionRowgetModelgetNextMatchgetPathBetweenRowsgetPathBoundsgetPathForLocationgetPathForRowgetPreferredScrollableViewportSizegetRowBoundsgetRowCountgetRowForLocationgetRowForPathgetRowHeightgetScrollableBlockIncrementgetScrollableTracksViewportHeightgetScrollableTracksViewportWidthgetScrollableUnitIncrementgetScrollsOnExpandgetSelectionCountgetSelectionModelgetSelectionPathgetSelectionPathsgetSelectionRowsgetShowsRootHandlesgetToggleClickCountgetToolTipTextgetTreeExpansionListenersgetTreeSelectionListenersgetTreeWillExpandListenersgetUIgetUIClassIDgetVisibleRowCounthasBeenExpandedisCollapsedisCollapsedisEditableisEditingisExpandedisExpandedisFixedRowHeightisLargeModelisPathEditableisPathSelectedisRootVisibleisRowSelectedisSelectionEmptyisVisiblemakeVisibleparamStringremoveDescendantSelectedPathsremoveDescendantToggledPathsremoveSelectionIntervalremoveSelectionPathremoveSelectionPathsremoveSelectionRowremoveSelectionRowsremoveTreeExpansionListenerremoveTreeSelectionListenerremoveTreeWillExpandListenerscrollPathToVisiblescrollRowToVisiblesetAnchorSelectionPathsetCellEditorsetCellRenderersetDragEnabledsetDropModesetEditablesetExpandedStatesetExpandsSelectedPathssetInvokesStopCellEditingsetLargeModelsetLeadSelectionPathsetModelsetRootVisiblesetRowHeightsetScrollsOnExpandsetSelectionIntervalsetSelectionModelsetSelectionPathsetSelectionPathssetSelectionRowsetSelectionRowssetShowsRootHandlessetToggleClickCountsetUIsetVisibleRowCountstartEditingAtPathstopEditingtreeDidChangeupdateUI

Field Detail

nodeForPackageback to summary
pack-priv Map<K, V> nodeForPackage
rootback to summary
pack-priv TreeNode root
treeModelback to summary
pack-priv DefaultTreeModel treeModel

Hides javax.swing.JTree.treeModel.

Constructor Detail

PackageTreeback to summary
pack-priv PackageTree(Collection<E> packages)

Method Detail

addNodeMapback to summary
pack-priv void addNodeMap(TreeNode node)

map a single node up to the root

makeNodeback to summary
pack-priv MutableTreeNode makeNode(Map<K, V> map, String nodeName)
makeTreeModelback to summary
pack-priv DefaultTreeModel makeTreeModel(Collection<E> packages)
mapNodesback to summary
pack-priv void mapNodes(TreeNode node)

Map out the location of the nodes by package name. Seems like we should be able to do this while we build above... I'm tired... just going to do this.

setPackagesback to summary
public void setPackages(Collection<E> packages)
setSelectedPackageback to summary
pack-priv void setSelectedPackage(String pack)