org.pm4j.core.pm
Interface PmConversation

All Superinterfaces:
java.lang.Comparable<PmObject>, PmDataInput, PmElement, PmObject, PmTreeNode
All Known Implementing Classes:
PmConversationImpl, PmConversationImpl.ChildSession

public interface PmConversation
extends PmElement

A presentation model conversation is a controller for a set of presentation models. It is responsible for

Author:
olaf boede

Field Summary
 
Fields inherited from interface org.pm4j.core.pm.PmObject
STYLE_CLASS_DISABLED, STYLE_CLASS_ERROR, STYLE_CLASS_INFO, STYLE_CLASS_REQUIRED, STYLE_CLASS_WARN
 
Method Summary
 void addPmMessage(PmMessage pmMessage)
          Adds a message to the conversation.
 boolean getHasPmErrors()
           
 PmCommandHistory getPmCommandHistory()
           
 PmDefaults getPmDefaults()
          The default definitions may be defined for a tree of PMs.
 java.util.Locale getPmLocale()
          Provides the language to be used for the for titles, tool tips etc.
 java.util.List<PmMessage> getPmMessages()
          Gets all active messages within this conversation.
 java.util.List<PmMessage> getPmMessages(PmObject forPm, PmMessage.Severity severity)
          Gets all messages for the given model.
 java.lang.Object getPmNamedObject(java.lang.Object key)
           
 org.pm4j.navi.NaviHistory getPmNaviHistory()
           
 PmConversation getPmParentConversation()
           
 void setBufferedPmValueMode(boolean bufferedMode)
          Defines if changes should be applied to the buffer only or to the data container behind the presentation model.
 void setPmLocale(java.util.Locale locale)
           
 java.lang.Object setPmNamedObject(java.lang.Object key, java.lang.Object value)
          Sets a property that is stored within this conversation instance.
 
Methods inherited from interface org.pm4j.core.pm.PmElement
getPmAttribute, getPmAttributes, getPmKey
 
Methods inherited from interface org.pm4j.core.pm.PmDataInput
commitBufferedPmChanges, isBufferedPmValueMode, isPmValueChanged, pmValidate, resetPmValues, rollbackBufferedPmChanges
 
Methods inherited from interface org.pm4j.core.pm.PmTreeNode
getNodeDetailsPm, getPmChildNodes, isPmTreeLeaf
 
Methods inherited from interface org.pm4j.core.pm.PmObject
accept, canSetPmTitle, compareTo, getPmConversation, getPmIconPath, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmShortTitle, getPmStyleClasses, getPmTitle, getPmTooltip, isPmEnabled, isPmReadonly, isPmValid, isPmVisible, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible
 

Method Detail

getPmParentConversation

PmConversation getPmParentConversation()
Returns:
The optional parent conversation context.

null if this is the top most conversation instance.


getPmLocale

java.util.Locale getPmLocale()
Provides the language to be used for the for titles, tool tips etc. of the PMs within the scope of this conversation.

If no language is defined for this conversation and all (optionally existing) parent conversations, the default language of the Java VM will be used.

Returns:
The locale that is used within this conversation.
Returns never null.

setPmLocale

void setPmLocale(java.util.Locale locale)
Parameters:
locale - The locale to be used within the scope of this conversation.
May be null for sub conversations to switch back to the locale of the parent conversation or (in case of a root conversation) to the language of the Java VM.

getPmCommandHistory

PmCommandHistory getPmCommandHistory()
Returns:
The undo/redo command history of this conversation.

getPmMessages

java.util.List<PmMessage> getPmMessages()
Gets all active messages within this conversation.

Returns:
The messages. An empty collection if there are no messages.

getPmMessages

java.util.List<PmMessage> getPmMessages(PmObject forPm,
                                        PmMessage.Severity severity)
Gets all messages for the given model.

Parameters:
severity - Severities to return. If null is passed here all messages will be returned.
Returns:
The messages. An empty collection if there are no messages.

getHasPmErrors

boolean getHasPmErrors()
Returns:
true when any validation has failed and/or another error message exists.

addPmMessage

void addPmMessage(PmMessage pmMessage)
Adds a message to the conversation.

Parameters:
pmMessage - The message to add.

setPmNamedObject

java.lang.Object setPmNamedObject(java.lang.Object key,
                                  java.lang.Object value)
Sets a property that is stored within this conversation instance.

ATTENTION for Web application developers: If your PmConversation is used in session scope, this property value will be shared for all opened tabs and windows of the user session.
If you want to manage specific property values for each tab or window, consider the usage of conversation or navigation scoped properties.

If you have configured a NaviHistory, you may use conversation and navigation scoped variables.
See NaviHistory.setNaviScopeProperty(String, Object) for more information.

Alternatively you may consider the usage of dialog specific memory scopes provided by your application framework.
Frameworks like Seem and Spring Webflow offer some solutions.

Parameters:
key - The property key.
value - The property value. When it is null, the property will be removed.
Returns:
The value that was bound to the given key before this call.
null if the property was set for the first time.

getPmNamedObject

java.lang.Object getPmNamedObject(java.lang.Object key)
Parameters:
key - The property key.
Returns:
The found property value. May be null when the property is not set.
See Also:
for more detailed information.

setBufferedPmValueMode

void setBufferedPmValueMode(boolean bufferedMode)
Defines if changes should be applied to the buffer only or to the data container behind the presentation model.

Parameters:
bufferedMode - true switches to buffered mode.
false switches to unbuffered mode.

getPmDefaults

PmDefaults getPmDefaults()
The default definitions may be defined for a tree of PMs.

Returns:
The PmDefaults definitions to be used.

getPmNaviHistory

org.pm4j.navi.NaviHistory getPmNaviHistory()
Returns:
The history of visited pages.