public interface IlvDocumentView extends MessageListener, ActionHandler, IlvPropertyManager
IlvDocument
.
Creation of document views
As for view containers, there are two modes of creating views:
IlvDocument
instance.
It is automatically created by an IlvDocumentViewConfiguration
according to the class specified in the <viewTemplate>
element in the view configuration settings.IlvMainWindow.registerStaticView(java.lang.String, ilog.views.appframe.docview.IlvDocumentView)
.initializeView(ilog.views.appframe.docview.IlvDocument)
method invoked.
Processing action events
The IlvDocumentView
class implements the
ActionHandler
interface for processing
action events triggered by the application. A document view only receives
action events when it is active in the application. It is added as a
new action handler to the application when it is activated and removed from
the list of action handlers of the application when it is deactivated.
An implementation of the IlvDocumentView
interface can handle
action events in the implementation of the methods:
ActionListener.actionPerformed(java.awt.event.ActionEvent)
ActionHandler.updateAction(javax.swing.Action)
ActionHandler.isProcessingAction(java.lang.String)
Implementing a document view
If the document view visualizes or edits the data of a document in
Swing components, it is recommended that it
inherits from the IlvPanelView
class or its
subclasses. First, this prevents the IlvDocumentView
interface from being implemented. It also makes processing action events and updates easier with
the methods IlvPanelView.addActionHandler(ilog.views.appframe.event.ActionHandler)
and IlvPanelView.registerMappings(ilog.views.appframe.event.IlvMessageMapper)
.
However, if implementing the IlvDocumentView
interface is necessary,
the class IlvDocumentViewSupport
provides support for
the implementation.
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVE_PROPERTY
Bound property name for the active state of the view.
|
static String |
ACTIVE_VIEW_NAME
Name used to send messages to the active document.
|
static String |
APPLICATION_PROPERTY
Bound property name for the application of the view.
|
static String |
CLOSABLE_PROPERTY
Name of the the bound property that determines whether the view
can be closed.
|
static String |
CLOSING_VIEW_MSG
Name of the message that is sent by the document template associated with
this view to indicate that the view is being closed.
|
static String |
DOCUMENT_PROPERTY
Bound property name for the document of the view.
|
static String |
SETTINGS_ELEMENT_PROPERTY
Stores the settings element for initializing the view.
|
static String |
STATIC_VIEW_PROPERTY
Bound property name that determines whether the view has been registered
as a static view or has been dynamically created for a specific document.
|
static String |
VIEW_CONTAINER_PROPERTY
Bound property name for the view container of the view.
|
Modifier and Type | Method and Description |
---|---|
IlvApplication |
getApplication()
Returns the application associated with the view.
|
IlvDocument |
getDocument()
Returns the document associated with the view.
|
IlvViewContainer |
getViewContainer()
Returns the view container that owns this view.
|
void |
initializeView(IlvDocument document)
Initializes the document view with the specified document.
|
void |
viewClosed()
Invoked after the view was closed.
|
void |
viewClosing()
Invoked before the view closes.
|
receiveMessage
isProcessingAction, updateAction
actionPerformed
addPropertyChangeListener, getProperty, removePropertyChangeListener, setProperty
static final String DOCUMENT_PROPERTY
static final String VIEW_CONTAINER_PROPERTY
static final String APPLICATION_PROPERTY
static final String ACTIVE_PROPERTY
Boolean.TRUE
, the view is
currently active in the application. It receives the action events and
updates. Otherwise, the view is not active and does not receive action
events.static final String STATIC_VIEW_PROPERTY
Boolean.TRUE
, the view has been
registered with the main window of the application as a static view, using
one of the two methods
IlvMainWindow.registerStaticView(java.lang.String, ilog.views.appframe.docview.IlvDocumentView)
or IlvMainWindow.registerStaticContainer(java.lang.String, ilog.views.appframe.docview.IlvViewContainer)
.
In this case, the view is associated with a new document each time a
document that has a document template that refers to this view becomes active.
null
or is equal to
Boolean.FALSE
, the document view has been dynamically created
for a specific document.static final String CLOSABLE_PROPERTY
When closing a view container, the associated document template sends the
CLOSING_VIEW_MSG
message to the views contained by the
container. While processing this message, if one of the views of the container
has set its CLOSABLE_PROPERTY
to Boolean.FALSE
,
the closing process will be stopped and the view container will not be closed.
Otherwise, if this property is not set or if it is equal to
Boolean.TRUE
, the view will be closed with its container.
static final String SETTINGS_ELEMENT_PROPERTY
The settings element stored in this property depends on how the view has been created:
documentTemplate/containerTemplates/containerTemplate/viewTemplate
,
this property stores the viewTemplate
element.dockConfigs/paneStyles/pane
with the attribute
viewContainer
set to true
,
this property stores the pane
element.IlvPanelView
and have its settings query that corresponds to a valid settings element,
this property does not stores this element but the settings element
as defined above.
See IlvPanelView.getSettingsQuery()
.static final String CLOSING_VIEW_MSG
CLOSABLE_PROPERTY
to
stop the closing process. This message has no parameters.
static final String ACTIVE_VIEW_NAME
void initializeView(IlvDocument document)
DOCUMENT_PROPERTY
of the view.document
- The document to initialize the content of the view with.void viewClosing()
viewClosed()
void viewClosed()
viewClosing()
IlvDocument getDocument()
DOCUMENT_PROPERTY
that is automatically set by the
document template.IlvApplication getApplication()
APPLICATION_PROPERTY
that is automatically set by the
document template.IlvViewContainer getViewContainer()
VIEW_CONTAINER_PROPERTY
that is automatically set by the
document template.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.