org.kuali.student.common.ui.client.configurable.mvc
Class Configurer

java.lang.Object
  extended by org.kuali.student.common.ui.client.configurable.mvc.Configurer
Direct Known Subclasses:
AbstractCourseConfigurer, AbstractProgramConfigurer, CourseSummaryConfigurer

public abstract class Configurer
extends Object

A configurer defines the configuration of screens in KS, in particular this is where you add views, sections, and fields to a LayoutController preferably passed in in an configurer's implementation. This abstract class contains helper methods to do this.

Author:
Kuali Student Team

Field Summary
protected  String groupName
           
protected  ModelDefinition modelDefinition
           
protected  String nextState
           
protected  String state
           
protected  String type
           
 
Constructor Summary
Configurer()
           
 
Method Summary
 FieldDescriptor addField(Section section, String fieldKey)
          Adds a field with the field key specified to the passed in section.
 FieldDescriptor addField(Section section, String fieldKey, MessageKeyInfo messageKey)
          Adds a field with the field key specified to the passed in section.
 FieldDescriptor addField(Section section, String fieldKey, MessageKeyInfo messageKey, String parentPath)
          Adds a field with the field key specified to the passed in section.
 FieldDescriptor addField(Section section, String fieldKey, MessageKeyInfo messageKey, com.google.gwt.user.client.ui.Widget widget)
          Adds a field with the field key specified to the passed in section.
 FieldDescriptor addField(Section section, String fieldKey, MessageKeyInfo messageKey, com.google.gwt.user.client.ui.Widget widget, String parentPath)
          Adds a field with the field key specified to the passed in section.
 FieldDescriptor addReadOnlyField(Section section, String fieldKey)
          Read only variant of the corresponding addField method.
 FieldDescriptor addReadOnlyField(Section section, String fieldKey, MessageKeyInfo messageKey)
          Read only variant of the corresponding addField method.
 FieldDescriptor addReadOnlyField(Section section, String fieldKey, MessageKeyInfo messageKey, String parentPath)
          Read only variant of the corresponding addField method.
 FieldDescriptor addReadOnlyField(Section section, String fieldKey, MessageKeyInfo messageKey, com.google.gwt.user.client.ui.Widget widget)
          Read only variant of the corresponding addField method.
 FieldDescriptor addReadOnlyField(Section section, String fieldKey, MessageKeyInfo messageKey, com.google.gwt.user.client.ui.Widget widget, String parentPath)
          Read only variant of the corresponding addField method.
protected  MessageKeyInfo generateMessageInfo(String labelKey)
          Generates a message info to be used in your field descriptor to get the label for the field.
protected  SectionTitle getH1Title(String labelKey)
          Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message
protected  SectionTitle getH2Title(String labelKey)
          Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message
protected  SectionTitle getH3Title(String labelKey)
          Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message
protected  SectionTitle getH4Title(String labelKey)
          Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message
protected  SectionTitle getH5Title(String labelKey)
          Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message
protected  String getLabel(String labelKey)
          Gets the string corresponding to the label key passed in from the application messages
 ModelDefinition getModelDefinition()
           
 String getNextState()
           
 String getState()
          The initial state of the objects for the screen
 void setModelDefinition(ModelDefinition modelDefinition)
          Sets the modelDefinition which is the metadata backing the fields to be configured, this needs to be set before adding any fields in the configurer
 void setNextState(String nextState)
           
 void setState(String state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelDefinition

protected ModelDefinition modelDefinition

type

protected String type

state

protected String state

nextState

protected String nextState

groupName

protected String groupName
Constructor Detail

Configurer

public Configurer()
Method Detail

setModelDefinition

public void setModelDefinition(ModelDefinition modelDefinition)
Sets the modelDefinition which is the metadata backing the fields to be configured, this needs to be set before adding any fields in the configurer

Parameters:
modelDefinition -

getModelDefinition

public ModelDefinition getModelDefinition()

generateMessageInfo

protected MessageKeyInfo generateMessageInfo(String labelKey)
Generates a message info to be used in your field descriptor to get the label for the field. Used by the field descriptor with the application context to determine the label to show based on the labelKey

Parameters:
labelKey - key of the message - must match a message in your messages (stored in the db)
Returns:

getLabel

protected String getLabel(String labelKey)
Gets the string corresponding to the label key passed in from the application messages

Parameters:
labelKey -
Returns:

getH1Title

protected SectionTitle getH1Title(String labelKey)
Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message

Parameters:
labelKey -
Returns:

getH2Title

protected SectionTitle getH2Title(String labelKey)
Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message

Parameters:
labelKey -
Returns:

getH3Title

protected SectionTitle getH3Title(String labelKey)
Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message

Parameters:
labelKey -
Returns:

getH4Title

protected SectionTitle getH4Title(String labelKey)
Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message

Parameters:
labelKey -
Returns:

getH5Title

protected SectionTitle getH5Title(String labelKey)
Gets a section title which is an h1 element using the label key passed to retrieve the corresponding message

Parameters:
labelKey -
Returns:

addField

public FieldDescriptor addField(Section section,
                                String fieldKey)
Adds a field with the field key specified to the passed in section. Returns the generated FieldDescriptor. The field will have no label in this case. The widget will be auto generated in field descriptor based on the field's metadata in the model definition defined in this configurer - using the default widget factory. The fieldKey passed in MUST match a logical path in the metadata (ex. proposal/proposalTitle, etc.) Note: It also is acceptable to not use this helper method and add the FieldDescriptor directly to the section

Parameters:
section -
fieldKey -
Returns:

addField

public FieldDescriptor addField(Section section,
                                String fieldKey,
                                MessageKeyInfo messageKey)
Adds a field with the field key specified to the passed in section. Returns the generated FieldDescriptor. Uses the message key provided to generate the field label. The widget will be auto generated in field descriptor based on the field's metadata in the model definition defined in this configurer - using the default widget factory. The fieldKey passed in MUST match a logical path in the metadata (ex. proposal/proposalTitle, etc.) Note: It also is acceptable to not use this helper method and add the FieldDescriptor directly to the section

Parameters:
section -
fieldKey -
messageKey -
Returns:

addField

public FieldDescriptor addField(Section section,
                                String fieldKey,
                                MessageKeyInfo messageKey,
                                com.google.gwt.user.client.ui.Widget widget)
Adds a field with the field key specified to the passed in section. Returns the generated FieldDescriptor. Uses the message key provided to generate the field label. The widget is not autogenerated based on the metadata in the defined model definition, but instead the passed in widget is used. The widget must be a type that is compatible with the default bindings (such as being a widget which implements HasText or HasValue), unless a custom binding is set on the returned FieldDescriptor from this method manually. Note: It also is acceptable to not use this helper method and add the FieldDescriptor directly to the section

Parameters:
section -
fieldKey -
messageKey -
widget -
Returns:

addField

public FieldDescriptor addField(Section section,
                                String fieldKey,
                                MessageKeyInfo messageKey,
                                String parentPath)
Adds a field with the field key specified to the passed in section. Returns the generated FieldDescriptor. Uses the message key provided to generate the field label. The widget will be auto generated in field descriptor based on the field's metadata in the model definition defined in this configurer - using the default widget factory. The fieldKey passed in MUST match a logical path in the metadata (ex. proposal/proposalTitle, etc.). The parentPath will be concatenated onto the front of the fieldKey. Note: It also is acceptable to not use this helper method and add the FieldDescriptor directly to the section

Parameters:
section -
fieldKey -
messageKey -
parentPath -
Returns:

addField

public FieldDescriptor addField(Section section,
                                String fieldKey,
                                MessageKeyInfo messageKey,
                                com.google.gwt.user.client.ui.Widget widget,
                                String parentPath)
Adds a field with the field key specified to the passed in section. Returns the generated FieldDescriptor. Uses the message key provided to generate the field label. The widget is not autogenerated based on the metadata in the defined model definition, but instead the passed in widget is used. The widget must be a type that is compatible with the default bindings (such as being a widget which implements HasText or HasValue), unless a custom binding is set on the returned FieldDescriptor from this method manually. The parentPath will be concatenated onto the front of the fieldKey. Note: It also is acceptable to not use this helper method and add the FieldDescriptor directly to the section

Parameters:
section -
fieldKey -
messageKey -
widget -
parentPath -
Returns:

addReadOnlyField

public FieldDescriptor addReadOnlyField(Section section,
                                        String fieldKey)
Read only variant of the corresponding addField method. This method will generate the read only version of the widget from the metadata found in the model definition that matches the fieldKey.

Parameters:
section -
fieldKey -
Returns:

addReadOnlyField

public FieldDescriptor addReadOnlyField(Section section,
                                        String fieldKey,
                                        MessageKeyInfo messageKey)
Read only variant of the corresponding addField method. This method will generate the read only version of the widget from the metadata found in the model definition that matches the fieldKey.

Parameters:
section -
fieldKey -
messageKey -
Returns:

addReadOnlyField

public FieldDescriptor addReadOnlyField(Section section,
                                        String fieldKey,
                                        MessageKeyInfo messageKey,
                                        com.google.gwt.user.client.ui.Widget widget)
Read only variant of the corresponding addField method. Uses widget passed in.

Parameters:
section -
fieldKey -
messageKey -
widget -
Returns:

addReadOnlyField

public FieldDescriptor addReadOnlyField(Section section,
                                        String fieldKey,
                                        MessageKeyInfo messageKey,
                                        String parentPath)
Read only variant of the corresponding addField method. This method will generate the read only version of the widget from the metadata found in the model definition that matches the fieldKey.

Parameters:
section -
fieldKey -
messageKey -
parentPath -
Returns:

addReadOnlyField

public FieldDescriptor addReadOnlyField(Section section,
                                        String fieldKey,
                                        MessageKeyInfo messageKey,
                                        com.google.gwt.user.client.ui.Widget widget,
                                        String parentPath)
Read only variant of the corresponding addField method. Uses widget passed in.

Parameters:
section -
fieldKey -
messageKey -
widget -
parentPath -
Returns:

getState

public String getState()
The initial state of the objects for the screen

Returns:

setState

public void setState(String state)

getNextState

public String getNextState()

setNextState

public void setNextState(String nextState)


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.