org.eaglei.datatools.client.ui
Class FormUtils

java.lang.Object
  extended by org.eaglei.datatools.client.ui.FormUtils

public class FormUtils
extends java.lang.Object

This is a utility class for creating form and form fields

Author:
pp101

Nested Class Summary
protected static interface FormUtils.ListBoxCallback
           
protected static interface FormUtils.TermWidgetCallback
           
protected static interface FormUtils.TextFieldCallback
           
 
Field Summary
 org.eaglei.suggest.client.SharedClassChooser<OntologyDropdown> classChooser
           
 java.util.List<com.google.gwt.user.client.ui.TextBox> dataList
           
 java.lang.String dialogFormName
           
 org.eaglei.model.EIURI dialogSubType
           
 java.lang.String formName
           
 FormsPanel frmPanel
           
 boolean isDialog
           
 boolean isEmailValid
           
 boolean isPhoneValid
           
 java.util.List<com.google.gwt.user.client.ui.ListBox> objList
           
 org.eaglei.model.EIURI subType
           
 
Constructor Summary
FormUtils(FormsPanel frmPanel)
           
 
Method Summary
 void clearAll()
           
 void createDialog(org.eaglei.model.EIInstance parentInstance, org.eaglei.model.EIEntity property, org.eaglei.model.EIClass range, com.google.gwt.user.client.ui.ListBox subClassList, com.google.gwt.user.client.ui.TextBox textBox, com.google.gwt.user.client.ui.Hidden oldValue)
          Creates a popup window to create a new resource
 com.google.gwt.user.client.ui.VerticalPanel createLabelforView(org.eaglei.model.EIEntity entity, java.util.Set<java.lang.String> values, java.lang.String propertyLabel, boolean isPresent)
           
 com.google.gwt.user.client.ui.HorizontalPanel createRadioButon(org.eaglei.model.EIInstance instance, org.eaglei.model.EIEntity entity, java.lang.String value)
          Creates a RadioButton
 com.google.gwt.user.client.ui.VerticalPanel createTermWidget(org.eaglei.model.EIInstance instance, org.eaglei.model.EIClass range, org.eaglei.model.EIClass selectedClass, org.eaglei.model.EIEntity propertyEntity, java.lang.String label, java.lang.Boolean isAddfield)
          Creates a Term widget that displays the subclasses in a hierarchical form in a drop down list
 com.google.gwt.user.client.ui.VerticalPanel createTextField(org.eaglei.model.EIEntity entity, java.util.Set<java.lang.String> values, java.lang.String propertyLabel, boolean isPresent, FormUtils.TextFieldCallback callback)
          Creates a Text field from the given entity value is passed when the formType is 'edit'
 com.google.gwt.user.client.ui.VerticalPanel displayDefaultFields(org.eaglei.model.EIInstance modelInstance, org.eaglei.model.EIClass eClass, java.lang.String nameValue, java.lang.String eagleIURI, org.eaglei.model.EIURI subTypeUri, boolean isTypeView)
          Every form will have ' ' & 'Sub-Type' fields even though they are not defined in the ontology When the user selects an item from the Sub-type drop down, the properties displayed on the form will change depending upon the class of the selected item
 com.google.gwt.user.client.ui.VerticalPanel displayFormFields(org.eaglei.model.EIClass eClass, org.eaglei.model.EIInstance instance, boolean isTypeView)
          Gets the class properties and displays appropriate UI field based on the property type
 com.google.gwt.user.client.ui.DisclosurePanel displayNonOntologyProperties(org.eaglei.model.EIInstance instance)
          Displays the properties that are removed from the new Ontology but still have some values associated
protected  java.lang.String getUriForValue(com.google.gwt.user.client.ui.ListBox listBox, java.lang.String oldValue)
           
 com.google.gwt.user.client.ui.VerticalPanel handleObjectProperty(org.eaglei.model.EIInstance instance, java.util.List<org.eaglei.model.EIClass> rangeList, org.eaglei.model.EIEntity propertyEntity, java.util.Set<org.eaglei.model.EIURI> propertyValues)
           
 boolean isFormValid()
           
protected  org.eaglei.model.EIEntity makeEntityFromWidgetName(java.lang.String name)
           
protected  void updateInstanceType(org.eaglei.model.EIInstance instance, org.eaglei.model.EIEntity newInstanceType, org.eaglei.model.EIClass newClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formName

public java.lang.String formName

subType

public org.eaglei.model.EIURI subType

dialogFormName

public java.lang.String dialogFormName

dialogSubType

public org.eaglei.model.EIURI dialogSubType

isDialog

public boolean isDialog

classChooser

public org.eaglei.suggest.client.SharedClassChooser<OntologyDropdown> classChooser

dataList

public java.util.List<com.google.gwt.user.client.ui.TextBox> dataList

objList

public java.util.List<com.google.gwt.user.client.ui.ListBox> objList

isPhoneValid

public boolean isPhoneValid

isEmailValid

public boolean isEmailValid

frmPanel

public FormsPanel frmPanel
Constructor Detail

FormUtils

public FormUtils(FormsPanel frmPanel)
Method Detail

createTextField

public com.google.gwt.user.client.ui.VerticalPanel createTextField(org.eaglei.model.EIEntity entity,
                                                                   java.util.Set<java.lang.String> values,
                                                                   java.lang.String propertyLabel,
                                                                   boolean isPresent,
                                                                   FormUtils.TextFieldCallback callback)
Creates a Text field from the given entity value is passed when the formType is 'edit'

Parameters:
entity -
value -

createLabelforView

public com.google.gwt.user.client.ui.VerticalPanel createLabelforView(org.eaglei.model.EIEntity entity,
                                                                      java.util.Set<java.lang.String> values,
                                                                      java.lang.String propertyLabel,
                                                                      boolean isPresent)

createRadioButon

public com.google.gwt.user.client.ui.HorizontalPanel createRadioButon(org.eaglei.model.EIInstance instance,
                                                                      org.eaglei.model.EIEntity entity,
                                                                      java.lang.String value)
Creates a RadioButton

Parameters:
lbl -
uri -

displayDefaultFields

public com.google.gwt.user.client.ui.VerticalPanel displayDefaultFields(org.eaglei.model.EIInstance modelInstance,
                                                                        org.eaglei.model.EIClass eClass,
                                                                        java.lang.String nameValue,
                                                                        java.lang.String eagleIURI,
                                                                        org.eaglei.model.EIURI subTypeUri,
                                                                        boolean isTypeView)
Every form will have ' ' & 'Sub-Type' fields even though they are not defined in the ontology When the user selects an item from the Sub-type drop down, the properties displayed on the form will change depending upon the class of the selected item

Parameters:
EIClass -

handleObjectProperty

public com.google.gwt.user.client.ui.VerticalPanel handleObjectProperty(org.eaglei.model.EIInstance instance,
                                                                        java.util.List<org.eaglei.model.EIClass> rangeList,
                                                                        org.eaglei.model.EIEntity propertyEntity,
                                                                        java.util.Set<org.eaglei.model.EIURI> propertyValues)
Parameters:
rangeList -
propertyEntity -
propertyValues -
Returns:

displayFormFields

public com.google.gwt.user.client.ui.VerticalPanel displayFormFields(org.eaglei.model.EIClass eClass,
                                                                     org.eaglei.model.EIInstance instance,
                                                                     boolean isTypeView)
Gets the class properties and displays appropriate UI field based on the property type

Parameters:
eClass -
VerticalPanel - - if this is the main formPanel pass null, if it is a 'create new' term widget panel, pass the panel
Returns:

displayNonOntologyProperties

public com.google.gwt.user.client.ui.DisclosurePanel displayNonOntologyProperties(org.eaglei.model.EIInstance instance)
Displays the properties that are removed from the new Ontology but still have some values associated

Parameters:
instance -
Returns:

createTermWidget

public com.google.gwt.user.client.ui.VerticalPanel createTermWidget(org.eaglei.model.EIInstance instance,
                                                                    org.eaglei.model.EIClass range,
                                                                    org.eaglei.model.EIClass selectedClass,
                                                                    org.eaglei.model.EIEntity propertyEntity,
                                                                    java.lang.String label,
                                                                    java.lang.Boolean isAddfield)
Creates a Term widget that displays the subclasses in a hierarchical form in a drop down list

Parameters:
rangeURI -
propertyEntity -
Returns:

getUriForValue

protected java.lang.String getUriForValue(com.google.gwt.user.client.ui.ListBox listBox,
                                          java.lang.String oldValue)

createDialog

public void createDialog(org.eaglei.model.EIInstance parentInstance,
                         org.eaglei.model.EIEntity property,
                         org.eaglei.model.EIClass range,
                         com.google.gwt.user.client.ui.ListBox subClassList,
                         com.google.gwt.user.client.ui.TextBox textBox,
                         com.google.gwt.user.client.ui.Hidden oldValue)
Creates a popup window to create a new resource

Parameters:
range -
propertyValue -
subClassList -

isFormValid

public boolean isFormValid()

clearAll

public void clearAll()

makeEntityFromWidgetName

protected org.eaglei.model.EIEntity makeEntityFromWidgetName(java.lang.String name)

updateInstanceType

protected void updateInstanceType(org.eaglei.model.EIInstance instance,
                                  org.eaglei.model.EIEntity newInstanceType,
                                  org.eaglei.model.EIClass newClass)


Copyright © 2009-2010 Eagle-I. All Rights Reserved.