|
||||||||||
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
org.jminor.framework.client.ui.EntityPanel
public class EntityPanel
A panel representing a Entity via a EntityModel, which facilitates browsing and editing of records.
To lay out the panel components and initialize the panel you must call the method initializePanel()
.
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 | |
---|---|
static int |
DIALOG
|
static int |
EMBEDDED
|
static int |
HIDDEN
|
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
EntityPanel(EntityModel entityModel)
Initializes a new EntityPanel instance. |
|
EntityPanel(EntityModel entityModel,
EntityEditPanel editPanel)
Instantiates a new EntityPanel instance. |
|
EntityPanel(EntityModel entityModel,
EntityEditPanel editPanel,
EntityTablePanel tablePanel)
Instantiates a new EntityPanel instance. |
|
EntityPanel(EntityModel entityModel,
EntityTablePanel tablePanel)
Instantiates a new EntityPanel instance. |
|
EntityPanel(EntityModel entityModel,
String caption)
Initializes a new EntityPanel instance. |
|
EntityPanel(EntityModel entityModel,
String caption,
EntityEditPanel editPanel)
Instantiates a new EntityPanel instance. |
|
EntityPanel(EntityModel entityModel,
String caption,
EntityEditPanel editPanel,
EntityTablePanel tablePanel)
Instantiates a new EntityPanel instance. |
|
EntityPanel(EntityModel entityModel,
String caption,
EntityTablePanel tablePanel)
Instantiates a new EntityPanel instance. |
Method Summary | |
---|---|
void |
activatePanel()
Activates this panel, showing it and preparing it for input |
EntityPanel |
addDetailPanel(EntityPanel detailPanel)
Adds the given detail panel, and adds the detail model to the underlying model if it does not contain it already, and then sets includeDetailPanelTabPane
to true |
EntityPanel |
addDetailPanels(EntityPanel... detailPanels)
|
boolean |
containsEditPanel()
|
boolean |
containsTablePanel()
|
String |
getCaption()
|
String |
getControlPanelConstraints()
|
MasterDetailPanel |
getCurrentDetailPanel()
|
EntityPanel |
getDetailPanel(String entityID)
Returns the detail panel for the given entityID , if one is available |
List<EntityPanel> |
getDetailPanels()
|
int |
getDetailPanelState()
|
double |
getDetailSplitPaneResizeWeight()
|
JPanel |
getEditControlPanel()
|
EntityEditModel |
getEditModel()
|
EntityEditPanel |
getEditPanel()
|
int |
getEditPanelState()
|
Collection<EntityPanel> |
getLinkedDetailPanels()
|
MasterDetailPanel |
getMasterPanel()
|
EntityModel |
getModel()
|
MasterDetailPanel |
getNextPanel()
|
MasterDetailPanel |
getPreviousPanel()
|
EntityPanel |
getSelectedDetailPanel()
|
EntityTableModel |
getTableModel()
|
EntityTablePanel |
getTablePanel()
|
Control |
getToggleDetailPanelControl()
|
Control |
getToggleEditPanelControl()
|
void |
handleException(Exception exception)
By default this delegates to the edit panel |
protected boolean |
includeComponentSelectionProperty(String propertyID)
|
protected void |
initialize()
Override to add code that should be called during the initialization routine after the panel has been initialized |
protected void |
initializeAssociatedPanels()
Called during initialization, before controls have been initialized |
protected void |
initializeControlPanels()
Called during initialization, after controls have been initialized, use this method to initialize any application panels that rely on controls having been initialized |
EntityPanel |
initializePanel()
Initializes this EntityPanel's UI, in case of some specific initialization code you can override the initialize() method and add your code there. |
protected void |
initializeUI()
Initializes this EntityPanel's UI. |
boolean |
isCompactDetailLayout()
|
boolean |
isIncludeControlPanel()
|
boolean |
isIncludeDetailPanelTabPane()
|
boolean |
isPanelInitialized()
|
void |
prepareUI(boolean setInitialFocus,
boolean clearUI)
Prepares the UI, by clearing the input fields and setting the initial focus, if both parameters are set to false then there is no effect |
void |
resizePanel(int direction,
int pixelAmount)
Resizes this panel in the given direction |
EntityPanel |
setCompactDetailLayout(boolean compactDetailLayout)
|
EntityPanel |
setControlPanelConstraints(String controlPanelConstraints)
|
void |
setDetailPanelState(int state)
|
EntityPanel |
setDetailSplitPanelResizeWeight(double detailSplitPanelResizeWeight)
|
void |
setEditPanelState(int state)
|
void |
setFilterPanelsVisible(boolean value)
Hides or shows the active filter panels for this panel and all its child panels (detail panels and their detail panels etc.) |
EntityPanel |
setIncludeControlPanel(boolean includeControlPanel)
|
EntityPanel |
setIncludeDetailPanelTabPane(boolean includeDetailPanelTabPane)
|
protected void |
setMasterPanel(EntityPanel masterPanel)
|
void |
showDetailPanel(MasterDetailPanel detailPanel)
Shows the given detail panel |
void |
toggleDetailPanelState()
Toggles the detail panel state between DIALOG, HIDDEN and EMBEDDED |
void |
toggleEditPanelState()
Toggles the edit panel state between DIALOG, HIDDEN and EMBEDDED |
String |
toString()
|
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 |
---|
public static final int DIALOG
public static final int EMBEDDED
public static final int HIDDEN
Constructor Detail |
---|
public EntityPanel(EntityModel entityModel)
entityModel
- the EntityModelpublic EntityPanel(EntityModel entityModel, String caption)
entityModel
- the EntityModelcaption
- the caption to use when presenting this entity panelpublic EntityPanel(EntityModel entityModel, EntityEditPanel editPanel)
entityModel
- the EntityModeleditPanel
- the edit panelpublic EntityPanel(EntityModel entityModel, EntityTablePanel tablePanel)
entityModel
- the EntityModeltablePanel
- the table panelpublic EntityPanel(EntityModel entityModel, String caption, EntityEditPanel editPanel)
entityModel
- the EntityModelcaption
- the caption to use when presenting this entity paneleditPanel
- the edit panelpublic EntityPanel(EntityModel entityModel, String caption, EntityTablePanel tablePanel)
entityModel
- the EntityModelcaption
- the caption to use when presenting this entity paneltablePanel
- the table panelpublic EntityPanel(EntityModel entityModel, EntityEditPanel editPanel, EntityTablePanel tablePanel)
entityModel
- the EntityModeleditPanel
- the edit paneltablePanel
- the table panelpublic EntityPanel(EntityModel entityModel, String caption, EntityEditPanel editPanel, EntityTablePanel tablePanel)
entityModel
- the EntityModelcaption
- the caption to use when presenting this entity paneleditPanel
- the edit paneltablePanel
- the table panelMethod Detail |
---|
public final EntityModel getModel()
public final EntityEditModel getEditModel()
public final EntityTableModel getTableModel()
public final String getControlPanelConstraints()
public final EntityPanel setControlPanelConstraints(String controlPanelConstraints)
controlPanelConstraints
- the control panel layout constraints (BorderLayout constraints)
public final boolean isCompactDetailLayout()
public final EntityPanel setCompactDetailLayout(boolean compactDetailLayout)
compactDetailLayout
- true if this panel and it's detail panels should be laid out in a compact state
public final EntityPanel addDetailPanels(EntityPanel... detailPanels)
detailPanels
- the detail panels
public final EntityPanel addDetailPanel(EntityPanel detailPanel)
includeDetailPanelTabPane
to true
detailPanel
- the detail panel to add
public final EntityPanel initializePanel()
initialize()
method and add your code there.
This method marks this panel as initialized which prevents it from running again, whether or not an exception occurs.
initialize()
,
isPanelInitialized()
public final boolean isPanelInitialized()
initializePanel()
public final EntityEditPanel getEditPanel()
public final boolean containsEditPanel()
public final EntityTablePanel getTablePanel()
public final boolean containsTablePanel()
public final JPanel getEditControlPanel()
public final Collection<EntityPanel> getLinkedDetailPanels()
public final EntityPanel getSelectedDetailPanel()
public final EntityPanel getDetailPanel(String entityID)
entityID
, if one is available
entityID
- the entiy ID of the detail panel to retrieve
IllegalArgumentException
- in case the panel was not foundpublic final String toString()
toString
in class Component
public final String getCaption()
public final void activatePanel()
activatePanel
in interface MasterDetailPanel
public final MasterDetailPanel getMasterPanel()
getMasterPanel
in interface MasterDetailPanel
public final MasterDetailPanel getCurrentDetailPanel()
getCurrentDetailPanel
in interface MasterDetailPanel
public final MasterDetailPanel getPreviousPanel()
getPreviousPanel
in interface MasterDetailPanel
public final MasterDetailPanel getNextPanel()
getNextPanel
in interface MasterDetailPanel
public final List<EntityPanel> getDetailPanels()
getDetailPanels
in interface MasterDetailPanel
public final void showDetailPanel(MasterDetailPanel detailPanel)
showDetailPanel
in interface MasterDetailPanel
detailPanel
- the detail panel to showpublic final Control getToggleEditPanelControl()
public final Control getToggleDetailPanelControl()
public final void handleException(Exception exception)
exception
- the exception to handlepublic final double getDetailSplitPaneResizeWeight()
public final EntityPanel setDetailSplitPanelResizeWeight(double detailSplitPanelResizeWeight)
detailSplitPanelResizeWeight
- the detail panel split size weight
public final boolean isIncludeDetailPanelTabPane()
public final EntityPanel setIncludeDetailPanelTabPane(boolean includeDetailPanelTabPane)
includeDetailPanelTabPane
- true if the detail panel tab pane should be included
public final boolean isIncludeControlPanel()
public final EntityPanel setIncludeControlPanel(boolean includeControlPanel)
includeControlPanel
- true if the control panel should be included
public final void toggleDetailPanelState()
public final void toggleEditPanelState()
public final int getDetailPanelState()
public final int getEditPanelState()
public final void setDetailPanelState(int state)
state
- the detail panel state (HIDDEN or EMBEDDED, DIALOG)public final void setEditPanelState(int state)
state
- the edit panel state, either HIDDEN, EMBEDDED or DIALOGpublic final void setFilterPanelsVisible(boolean value)
value
- true if the active panels should be shown, false if they should be hiddenpublic final void resizePanel(int direction, int pixelAmount)
direction
- the resize directionpixelAmount
- the resize amountpublic final void prepareUI(boolean setInitialFocus, boolean clearUI)
setInitialFocus
- if true the component defined as the initialFocusComponent
gets the input focus, if none is defined the first child component of this EntityPanel is used,
if no edit panel is available the table receives the focusclearUI
- if true the the input components are clearedValueChangeMapEditPanel.setInitialFocusComponent(javax.swing.JComponent)
protected boolean includeComponentSelectionProperty(String propertyID)
propertyID
- the ID of the property
protected void initializeUI()
The default layout is as follows: __________________________________ | edit panel |control| | (EntityEditPanel) | panel | } edit control panel |________________________|_______| | | | | table panel | detail | |(EntityTablePanel)| panel | | | | |__________________|_____________| or in case of compact layout: __________________________________ | edit |control| | | panel | panel | | |__________|_______| detail | | | panel | | table panel | | |(EntityTablePanel)| | | | | |__________________|_____________|
protected void initializeAssociatedPanels()
initializePanel()
protected void initializeControlPanels()
initializePanel()
protected void initialize()
initializePanel()
protected final void setMasterPanel(EntityPanel masterPanel)
masterPanel
- the panel serving as master panel for this entity panel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |