|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame org.johndavidtaylor.beans.beanpeeler.BeanPeeler
BeanPeeler is a property sheet allowing you to customize javabeans. It's similar to the property sheets that you get in IDEs such as Netbeans' Forte that you use to customise components before you drop them onto a form. It examines a bean for any read/write properties and constructs a property sheet using dropdown boxes for properties such as booleans which have discrete values and textboxes for strings and numbers.
Usage:
MyBean mb = new MyBean();
BeanPeeler bp = new BeanPeeler(mb);
mb.addPropertyChangeListener(bp); //if appropriate
bp.show();
BeanPeeler bp2 = new BeanPeeler(mb, BeanPeeler.ENABLE_OK); //disable Cancel and apply buttons
bp2.showAndWait(); // if you want a modal dialog
Nested Class Summary |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static int |
ENABLE_APPLY
Show Apply button |
static int |
ENABLE_CANCEL
Show Cancel button |
static int |
ENABLE_OK
Show OK button |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
BeanPeeler(java.lang.Object bean)
Constructs a new BeanPeeler to edit the given bean. |
|
BeanPeeler(java.lang.Object bean,
int options)
Constructs a new BeanPeeler to edit the given bean. |
Method Summary | |
java.awt.Color |
getBackground()
Getter for property background. |
java.lang.Object |
getBean()
Getter for property bean. |
java.util.Vector |
getErrors()
As properties are added to the sheet certain exceptions and warnings may arise. |
java.awt.Font |
getFont()
Getter for property font. |
java.awt.Color |
getForeground()
Getter for property foreground. |
java.lang.String |
getLastError()
Returns the last warning posted when creating the dialog - @see getErrors() |
java.awt.Dimension |
getPaintAreaSize()
Getter for property paintAreaSize. |
boolean |
getProcessNames()
|
java.lang.String |
getTitle()
Getter for property title. |
boolean |
isFollowInheritanceTree()
Getter for property followInheritanceTree. |
boolean |
isVerbose()
Getter for property verbose. |
void |
propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
The bean we're editing has changed.... |
void |
setBackground(java.awt.Color background)
Setter for property background. |
void |
setBean(java.lang.Object bean)
Setter for property bean. |
void |
setFollowInheritanceTree(boolean followInheritanceTree)
Setter for property followInheritanceTree. |
void |
setFont(java.awt.Font font)
Setter for property font. |
void |
setForeground(java.awt.Color foreground)
Setter for property foreground. |
void |
setPaintAreaSize(java.awt.Dimension paintAreaSize)
Setter for property paintAreaSize. |
void |
setProcessNames(boolean processNames)
Attempts to make the labels more attractive by parsing the names. |
void |
setTitle(java.lang.String title)
Setter for property title. |
void |
setVerbose(boolean verbose)
Setter for property verbose. |
void |
showAndWait()
Use instead of Window.show() if you want a modal dialog |
protected void |
warn(java.lang.String msg)
|
protected void |
warn(java.lang.String msg,
java.lang.Exception e)
|
Methods inherited from class java.awt.Frame |
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
postEvent |
Field Detail |
public static final int ENABLE_OK
public static final int ENABLE_CANCEL
public static final int ENABLE_APPLY
Constructor Detail |
public BeanPeeler(java.lang.Object bean)
bean
- The bean to be edited.public BeanPeeler(java.lang.Object bean, int options)
bean
- The bean to be edited.options
- the allowed options for the buttons (see fields list) = usual bitwise orMethod Detail |
public void showAndWait()
Window.show()
if you want a modal dialog
public java.lang.Object getBean()
public void setBean(java.lang.Object bean)
bean
- New value of property bean.public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- New value of property title.public boolean getProcessNames()
public void setProcessNames(boolean processNames)
public java.lang.String getLastError()
public java.util.Vector getErrors()
List
containing all the posted warnings.protected void warn(java.lang.String msg, java.lang.Exception e)
protected void warn(java.lang.String msg)
public java.awt.Color getBackground()
public void setBackground(java.awt.Color background)
background
- New value of property background.public java.awt.Color getForeground()
public void setForeground(java.awt.Color foreground)
foreground
- New value of property foreground.public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
public void setFont(java.awt.Font font)
font
- New value of property font.public java.awt.Dimension getPaintAreaSize()
public void setPaintAreaSize(java.awt.Dimension paintAreaSize)
paintAreaSize
- New value of property paintAreaSize.public boolean isVerbose()
public void setVerbose(boolean verbose)
verbose
- New value of property verbose.public boolean isFollowInheritanceTree()
public void setFollowInheritanceTree(boolean followInheritanceTree)
followInheritanceTree
- New value of property followInheritanceTree.public void propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
propertyChange
in interface java.beans.PropertyChangeListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |