|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.MouseAdapter
org.pfsw.joi.Inspector
org.pfsw.joi.BasicInspector
public class BasicInspector
This is the default inspector, which can display all normal java objects.
Currently it opens a window on the object to inspect and displays all
of its fields that are not static and not final,
which means no class variables and no constants, but all instance variables
(including inherited attributes).
For arrays it lists up all elements from 0 to n.
For deeper inspection it is possible to open a new inspector on each
attribute.
Here is an example how to use the inspector:
panel = new JPanel() ;
BasicInspector.inspect( panel ) ;
Field Summary | |
---|---|
protected static java.lang.String |
actResetModifiedValue
|
protected static java.lang.String |
actSaveModifiedValue
|
protected static java.lang.String |
actSetValueToNull
|
protected static java.io.PrintStream |
errorDevice
|
protected static int |
MIN_INFO_WIDTH
|
protected static int |
MIN_TREE_HEIGHT
|
protected static int |
MIN_TREE_WIDTH
|
Constructor Summary | |
---|---|
BasicInspector()
Initialize the new instance with default values. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Is called whenever a user action event occured. |
protected void |
basicInspectCurrentElement(int where)
|
protected InspectionView |
buildInspectionView()
|
protected javax.swing.JPopupMenu |
createElementPopupMenu()
|
protected javax.swing.JMenu |
createMenu(java.lang.String text)
|
protected javax.swing.JMenuItem |
createMenuItem(java.lang.String text,
java.lang.String command)
|
protected ObjectSpyTreeNode |
createTreeNodes()
|
protected javax.swing.JComponent |
createTreePanel()
|
protected void |
displayCurrentEditableValue()
|
protected void |
displayValueModificationError(java.lang.Exception ex)
Display an error that occured during an attempt to modify an element's value. |
protected ElementFilter |
elementFilter()
|
protected javax.swing.JTextField |
getActualTypeField()
|
protected InspectionView |
getAssociatedView()
|
protected ObjectValuePanel |
getContentArea()
|
protected InspectionWindowController |
getController()
|
protected Spy |
getCurrentElement()
|
protected javax.swing.JTextField |
getDeclaredTypeField()
|
protected java.awt.Container |
getDialogOwner()
|
protected javax.swing.JTree |
getElementTree()
|
protected InspectionView |
getInspectionView()
|
protected java.lang.String |
getInspectorId()
|
protected java.lang.String |
getObjectDisplayName()
|
protected java.lang.String |
getTypeStringOf(Spy spy)
|
protected java.awt.Component |
getValueComponentOf(Spy spy)
|
protected java.lang.Object |
getValueOf(Spy spy)
|
protected java.lang.String |
getValueStringOf(Spy spy)
|
protected java.lang.String |
getValueTypeStringOf(Spy spy)
|
protected void |
inspectCurrentElement(int where)
|
protected void |
inspectObject(java.lang.String name,
java.lang.Object obj)
Inspect the given object. |
protected boolean |
isEditableElement(Spy spy)
|
protected boolean |
isVisualComponent(java.lang.Object obj)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
This method is called for every mouse click in the tree component. |
protected java.lang.Boolean |
parseToBoolean(java.lang.String str)
|
protected java.lang.Byte |
parseToByte(java.lang.String text)
|
protected java.lang.Character |
parseToCharacter(java.lang.String str)
|
protected java.lang.Double |
parseToDouble(java.lang.String text)
|
protected java.lang.Float |
parseToFloat(java.lang.String text)
|
protected java.lang.Integer |
parseToInteger(java.lang.String text)
|
protected java.lang.Long |
parseToLong(java.lang.String text)
|
protected java.lang.Short |
parseToShort(java.lang.String text)
|
protected Preferences |
prefs()
|
protected void |
resetModifiedValue()
|
protected void |
saveModifiedValue()
|
protected void |
setActualTypeField(javax.swing.JTextField aValue)
|
protected void |
setAssociatedView(InspectionView newValue)
|
protected void |
setContentArea(ObjectValuePanel newValue)
|
protected void |
setController(InspectionWindowController newValue)
|
protected void |
setCurrentElement(Spy aValue)
|
protected void |
setCurrentValueToNull()
|
protected void |
setDeclaredTypeField(javax.swing.JTextField aValue)
|
protected void |
setElementTree(javax.swing.JTree aValue)
|
protected void |
setFilter(ElementFilter filter)
Set the filter flags specified by the given filter in the inspected object |
protected void |
sortElements()
|
protected org.pfsw.text.StringUtil |
str()
|
protected void |
updateDisplay()
|
protected void |
updateInformation(Spy spy)
Is called whenever the selection in the element tree changed. |
void |
valueChanged(javax.swing.event.TreeSelectionEvent event)
Is called whenever the selection in the element tree changed. |
Methods inherited from class java.awt.event.MouseAdapter |
---|
mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int MIN_TREE_WIDTH
protected static final int MIN_TREE_HEIGHT
protected static final int MIN_INFO_WIDTH
protected static final java.io.PrintStream errorDevice
protected static final java.lang.String actSaveModifiedValue
protected static final java.lang.String actResetModifiedValue
protected static final java.lang.String actSetValueToNull
Constructor Detail |
---|
public BasicInspector()
Method Detail |
---|
protected InspectionWindowController getController()
protected void setController(InspectionWindowController newValue)
protected InspectionView getAssociatedView()
protected void setAssociatedView(InspectionView newValue)
protected ObjectValuePanel getContentArea()
protected void setContentArea(ObjectValuePanel newValue)
protected javax.swing.JTextField getDeclaredTypeField()
protected void setDeclaredTypeField(javax.swing.JTextField aValue)
protected javax.swing.JTextField getActualTypeField()
protected void setActualTypeField(javax.swing.JTextField aValue)
protected Spy getCurrentElement()
protected void setCurrentElement(Spy aValue)
protected javax.swing.JTree getElementTree()
protected void setElementTree(javax.swing.JTree aValue)
public void valueChanged(javax.swing.event.TreeSelectionEvent event)
valueChanged
in interface javax.swing.event.TreeSelectionListener
TreeSelectionListener
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- The action event holding further information on what happened.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class java.awt.event.MouseAdapter
protected void inspectCurrentElement(int where)
protected void basicInspectCurrentElement(int where)
protected void inspectObject(java.lang.String name, java.lang.Object obj)
inspectObject
in class Inspector
obj
- The object to look insideprotected java.lang.String getObjectDisplayName()
protected InspectionView getInspectionView()
protected InspectionView buildInspectionView()
protected javax.swing.JMenuItem createMenuItem(java.lang.String text, java.lang.String command)
protected javax.swing.JMenu createMenu(java.lang.String text)
protected javax.swing.JPopupMenu createElementPopupMenu()
protected javax.swing.JComponent createTreePanel()
protected java.lang.String getTypeStringOf(Spy spy)
protected java.lang.String getValueTypeStringOf(Spy spy)
protected java.lang.String getValueStringOf(Spy spy)
protected java.awt.Component getValueComponentOf(Spy spy)
protected java.lang.Object getValueOf(Spy spy)
protected void updateInformation(Spy spy)
TreeSelectionListener
protected boolean isEditableElement(Spy spy)
protected boolean isVisualComponent(java.lang.Object obj)
protected void setFilter(ElementFilter filter)
protected void updateDisplay()
protected void displayValueModificationError(java.lang.Exception ex)
protected void displayCurrentEditableValue()
protected void resetModifiedValue()
protected void setCurrentValueToNull()
protected void saveModifiedValue()
protected java.lang.Integer parseToInteger(java.lang.String text) throws java.lang.Exception
java.lang.Exception
protected java.lang.Boolean parseToBoolean(java.lang.String str) throws java.lang.Exception
java.lang.Exception
protected java.lang.Character parseToCharacter(java.lang.String str) throws java.lang.Exception
java.lang.Exception
protected java.lang.Long parseToLong(java.lang.String text) throws java.lang.Exception
java.lang.Exception
protected java.lang.Short parseToShort(java.lang.String text) throws java.lang.Exception
java.lang.Exception
protected java.lang.Byte parseToByte(java.lang.String text) throws java.lang.Exception
java.lang.Exception
protected java.lang.Double parseToDouble(java.lang.String text) throws java.lang.Exception
java.lang.Exception
protected java.lang.Float parseToFloat(java.lang.String text) throws java.lang.Exception
java.lang.Exception
protected ObjectSpyTreeNode createTreeNodes()
protected void sortElements()
protected ElementFilter elementFilter()
protected java.awt.Container getDialogOwner()
protected java.lang.String getInspectorId()
protected Preferences prefs()
protected org.pfsw.text.StringUtil str()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |