Package com.saperion.ngc.iform
Class ElementCreator
- java.lang.Object
-
- com.saperion.ngc.iform.ElementCreator
-
public final class ElementCreator extends java.lang.Object
Helper class to create form elements.
-
-
Constructor Summary
Constructors Constructor Description ElementCreator(IntelligentFormView parent, com.saperion.ngc.iform.xml.PosType framePos, boolean noLocalizeation)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createBitmaps(java.util.List<com.saperion.ngc.iform.xml.BitmapType> bitmaps, org.zkoss.zk.ui.Component parent)
Creates bitmaps.java.util.Map<java.lang.Long,FormButton>
createButtons(java.util.List<com.saperion.ngc.iform.xml.ButtonType> buttons, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component eventParent)
Creates buttons.boolean
createDisabledFields(FormMode formMode)
Decides if fields will be disabled.boolean
createEditableFields(FormMode formMode)
Decides if fields will be editable.java.util.Map<java.lang.Long,IntelligentField>
createEditFields(java.util.List<com.saperion.ngc.iform.xml.EditFieldType> editFields, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component eventParent)
Creates fields.org.zkoss.zul.Box
createElementsBox(org.zkoss.zk.ui.Component mainContainer)
Creates a box to hold multiple elements.java.util.Map<java.lang.Long,IntelligentField>
createHiddenElements(com.saperion.ngc.iform.xml.HiddenType hiddenElements, org.zkoss.zk.ui.Component parent)
Creates and handles hidden elements.java.util.Map<java.lang.Long,IntelligentFormView>
createIncludes(java.util.List<com.saperion.ngc.iform.xml.IncludeType> includes, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component eventTarget, boolean autoQuery)
Creates included elements.java.util.Map<java.lang.Long,FormLabel>
createLabels(java.util.List<com.saperion.ngc.iform.xml.LabelType> labels, org.zkoss.zk.ui.Component parent)
Creates labels.java.util.Map<java.lang.Long,FormMashup>
createMashup(java.util.List<com.saperion.ngc.iform.xml.MashupType> mashups, org.zkoss.zk.ui.Component parent)
Creates Mashups.java.util.Map<java.lang.Long,ResultSetView>
createResults(java.util.List<com.saperion.ngc.iform.xml.ResultType> results, org.zkoss.zk.ui.Component parent, boolean stretch, org.zkoss.zk.ui.Component eventParent, java.lang.String formName, java.lang.String ddcName)
Creates result lists.java.util.Map<java.lang.Long,FormTabbox>
createTabs(java.util.List<com.saperion.ngc.iform.xml.TabListType> tabs, boolean stretch, org.zkoss.zk.ui.Component parent, boolean isQueryForm, java.lang.String formName, java.lang.String ddcName)
Creates tabs.java.util.Map<java.lang.Long,FormEditableImage>
createThumbnail(java.util.List<com.saperion.ngc.iform.xml.ThumbnailType> thumbnails, org.zkoss.zk.ui.Component parent)
Creates thumbnail components.java.util.Map<java.lang.Long,DocumentView>
createViewers(java.util.List<com.saperion.ngc.iform.xml.ViewerType> viewerTypes, org.zkoss.zk.ui.Component parent, boolean stretch, org.zkoss.zk.ui.Component eventParent, java.lang.String className)
Creates viewers.static boolean
visible(com.saperion.ngc.iform.xml.PosType position)
Checks the visibility-property of the providedPosType
.
-
-
-
Constructor Detail
-
ElementCreator
public ElementCreator(IntelligentFormView parent, com.saperion.ngc.iform.xml.PosType framePos, boolean noLocalizeation)
Constructor.- Parameters:
parent
- parent iForm component of all elements to create.framePos
- Frame pos or null, if no pane layoutnoLocalizeation
- option to disable localization of the created elements
-
-
Method Detail
-
createBitmaps
public void createBitmaps(java.util.List<com.saperion.ngc.iform.xml.BitmapType> bitmaps, org.zkoss.zk.ui.Component parent) throws NgcUiException
Creates bitmaps.- Parameters:
bitmaps
- bitmap definitionsparent
- parent component for the bitmaps- Throws:
NgcUiException
- exception to be handled by view
-
createLabels
public java.util.Map<java.lang.Long,FormLabel> createLabels(java.util.List<com.saperion.ngc.iform.xml.LabelType> labels, org.zkoss.zk.ui.Component parent)
Creates labels.- Parameters:
labels
- label definitionsparent
- parent component for the labels- Returns:
- a map containing the created labels mapped to their frame-ids
-
createButtons
public java.util.Map<java.lang.Long,FormButton> createButtons(java.util.List<com.saperion.ngc.iform.xml.ButtonType> buttons, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component eventParent) throws NgcUiException
Creates buttons.- Parameters:
buttons
- button definitionsparent
- parent component for the buttonseventParent
- Event parent- Returns:
- List of buttons
- Throws:
NgcUiException
- exception to be handled by view
-
createEditFields
public java.util.Map<java.lang.Long,IntelligentField> createEditFields(java.util.List<com.saperion.ngc.iform.xml.EditFieldType> editFields, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component eventParent)
Creates fields.- Parameters:
editFields
- list of field definitionsparent
- parent component for the fieldseventParent
- Event parent- Returns:
- list of created fields
-
createResults
public java.util.Map<java.lang.Long,ResultSetView> createResults(java.util.List<com.saperion.ngc.iform.xml.ResultType> results, org.zkoss.zk.ui.Component parent, boolean stretch, org.zkoss.zk.ui.Component eventParent, java.lang.String formName, java.lang.String ddcName)
Creates result lists.- Parameters:
results
- list of result list definitionsparent
- parent component of the result listsstretch
- true, if the result lists should fill it's containereventParent
- Event parentformName
- Form nameddcName
- DDC name- Returns:
- map of created result sets, identified by their frame id
-
createMashup
public java.util.Map<java.lang.Long,FormMashup> createMashup(java.util.List<com.saperion.ngc.iform.xml.MashupType> mashups, org.zkoss.zk.ui.Component parent) throws NgcUiException
Creates Mashups.- Parameters:
mashups
- mashup definitionsparent
- parent component for the mashups- Returns:
- List of mashups
- Throws:
NgcUiException
- exception to be handled by view
-
createThumbnail
public java.util.Map<java.lang.Long,FormEditableImage> createThumbnail(java.util.List<com.saperion.ngc.iform.xml.ThumbnailType> thumbnails, org.zkoss.zk.ui.Component parent) throws NgcUiException
Creates thumbnail components.- Parameters:
thumbnails
- mashup definitionsparent
- parent component for the mashups- Returns:
- List of mashups
- Throws:
NgcUiException
- exception to be handled by view
-
createViewers
public java.util.Map<java.lang.Long,DocumentView> createViewers(java.util.List<com.saperion.ngc.iform.xml.ViewerType> viewerTypes, org.zkoss.zk.ui.Component parent, boolean stretch, org.zkoss.zk.ui.Component eventParent, java.lang.String className)
Creates viewers.- Parameters:
viewerTypes
- list of viewer definitionsparent
- parent component for the viewersstretch
- true if the viewers should fill their parenteventParent
- Event parentclassName
- name of the view class to override setting in web.xml (or null if not required)- Returns:
- Map with created viewers identified by their frame id
-
createTabs
public java.util.Map<java.lang.Long,FormTabbox> createTabs(java.util.List<com.saperion.ngc.iform.xml.TabListType> tabs, boolean stretch, org.zkoss.zk.ui.Component parent, boolean isQueryForm, java.lang.String formName, java.lang.String ddcName) throws NgcUiException
Creates tabs.- Parameters:
tabs
- list of tablist definitionsstretch
- true if the component should fill its targetparent
- parent component for the tabsisQueryForm
- true is tabs belong to a query formformName
- Form nameddcName
- DDC name- Returns:
- tabboxes list of created tab boxes
- Throws:
NgcUiException
- exception to be handled by view
-
createHiddenElements
public java.util.Map<java.lang.Long,IntelligentField> createHiddenElements(com.saperion.ngc.iform.xml.HiddenType hiddenElements, org.zkoss.zk.ui.Component parent)
Creates and handles hidden elements.- Parameters:
hiddenElements
- hidden elementsparent
- Parent- Returns:
- Intelligent fields
-
createIncludes
public java.util.Map<java.lang.Long,IntelligentFormView> createIncludes(java.util.List<com.saperion.ngc.iform.xml.IncludeType> includes, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component eventTarget, boolean autoQuery) throws NgcUiException
Creates included elements.- Parameters:
includes
- included element definitionsparent
- parent componenteventTarget
- Event targetautoQuery
- perform a query automatically- Returns:
- Created forms
- Throws:
NgcUiException
- exception to be handled by view
-
createElementsBox
public org.zkoss.zul.Box createElementsBox(org.zkoss.zk.ui.Component mainContainer)
Creates a box to hold multiple elements.- Parameters:
mainContainer
- parent of the box- Returns:
- box
-
createEditableFields
public boolean createEditableFields(FormMode formMode)
Decides if fields will be editable.- Parameters:
formMode
- form mode- Returns:
- editable
-
createDisabledFields
public boolean createDisabledFields(FormMode formMode)
Decides if fields will be disabled.- Parameters:
formMode
- form mode- Returns:
- disabled
-
visible
public static boolean visible(com.saperion.ngc.iform.xml.PosType position)
Checks the visibility-property of the providedPosType
.- Parameters:
position
- PosType to check- Returns:
- true if the position's visibility property is true for the web client
-
-