|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.antelmann.util.gui.FormPanel
public class FormPanel
uses a plain JPanel as a Form, where the given component is placed in the center while the control buttons are placed at one edge.
FormDialog,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected JButton |
closeButton
|
protected JButton |
saveButton
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface com.antelmann.util.gui.Form |
|---|
EDIT_PROPERTY_KEY |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
FormPanel(JComponent form,
FormValidator<?> validator)
calls the next constructor with saveAlwaysEnabled=true |
|
FormPanel(JComponent form,
FormValidator<?> validator,
boolean saveAlwaysEnabled)
|
|
FormPanel(JComponent form,
FormValidator<?> validator,
boolean saveAlwaysEnabled,
String borderLayoutOptionForButtons)
|
|
| Method Summary | |
|---|---|
void |
addListener(FormListener l)
|
boolean |
closeAction()
|
protected void |
dispose()
removes this component from its parent |
boolean |
disposeForm(boolean forceWithoutConfirm)
allows to programmatically close the form. |
JToolBar |
getButtonContainer()
provides the container that contains the functional buttons of the Form, so that other additional buttons may be added here |
JComponent |
getFormComponent()
|
Container |
getFormContainer()
provides access to the overall window, dialog, frame, internal frame or other that holds the form with the formComponent and all the functional buttons that belong to the form |
FormListener[] |
getFormListeners()
|
FormValidator<?> |
getFormValidator()
|
boolean |
getWarnOnClose()
determines whether a warning is displayed upon cancel if the form is marked as changed (false by default) |
boolean |
isDirty()
determines whether the form is currently considered to be in a 'changed'-mode. |
Object |
performSaveAction()
programmatically performs the action that would commonly be performed upon pressing 'save' on the form. |
void |
propertyChange(PropertyChangeEvent evt)
marks the form dirty and enables the save button (in case it's not already generally enabled) |
boolean |
removeListener(FormListener l)
|
void |
setWarnOnClose(boolean flag)
if set to true, a warning is displayed when the form is closed w/o saving if it is marked changed |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected JButton saveButton
protected JButton closeButton
| Constructor Detail |
|---|
public FormPanel(JComponent form,
FormValidator<?> validator)
public FormPanel(JComponent form,
FormValidator<?> validator,
boolean saveAlwaysEnabled)
public FormPanel(JComponent form,
FormValidator<?> validator,
boolean saveAlwaysEnabled,
String borderLayoutOptionForButtons)
| Method Detail |
|---|
public JToolBar getButtonContainer()
Form
getButtonContainer in interface Formpublic JComponent getFormComponent()
getFormComponent in interface Formpublic FormValidator<?> getFormValidator()
getFormValidator in interface Formpublic boolean isDirty()
Form
isDirty in interface Formpublic void addListener(FormListener l)
addListener in interface Formpublic boolean removeListener(FormListener l)
removeListener in interface Formpublic FormListener[] getFormListeners()
getFormListeners in interface Formpublic Object performSaveAction()
FormFormValidator.validateForm(Component)
and then call FormValidator.commitFormAction(Component); also this method
resets the Form.isDirty() status if the commit was successful.
performSaveAction in interface Formpublic boolean getWarnOnClose()
Form
getWarnOnClose in interface Formpublic void setWarnOnClose(boolean flag)
Form
setWarnOnClose in interface Formpublic boolean closeAction()
public boolean disposeForm(boolean forceWithoutConfirm)
Form
disposeForm in interface FormforceWithoutConfirm - if true, the form will be disposed no matter what;
if false, a confirmation dialog may appear if the form
is dirty and warnOnClose is true
protected void dispose()
public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic Container getFormContainer()
Form
getFormContainer in interface Form
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||