The DesignContext is one of the most important classes in the implementation of the Agent System.
Many classes present context-dependent interface and/or behaviour. Instead of having to subclass
these classes for each Context, this presentation and/or behaviour is this class.
Classes that delegate to DesignContext are:
recomputeCurrentRules() Recompute the current Rules to be shown in the UI, based on the logged user-id,
the filters applied (if any) and the public status of the other Rules.
Instantiates a new design context.
It has to be passed an ObjectEditor, used to display modified objects and persist those
changes (primarily used in the Preview Mode).
Parameters: objectEditor - an OSBL object editor instance
Populates a SidePanel with context-specific filters. Called by the SidePanel when
it is time to include the filters during its UI construction.
Parameters: targetPanel - the target panel where the filter components are to be added.
Adds the Specifier components to a RuleEditorPanel. Called by the latter when building
its UI. The DesignContext can put context-specific components in it.
Parameters: targetPanel - the target RuleEditorPanel instance.
belongsToDesignContext
public boolean belongsToDesignContext(Rule rule)(Code)
Answers whether a given Rule belongs to this DesignContext.
Parameters: rule - the Rule to be analyzed. true, if it does belong to this context.
Change the Specifier Parameters on-screen to reflect the ones set in the Rule.
Parameters: rule - the Rule which contains Specifier Parameters whose state should be reflected in the UI.
Enable/disable Specifier UI-components. Permits/avoids edition or change of the parameters.
Used when the user is not editable.
Parameters: enabled - whether to enable the components or not.
Convenience method to retrieve a localized version of a String. The String might contain
format indicators, in which case the data corresponding to those are provided as
additional arguments.
Parameters: code - the code of the localizable String. Parameters: args - additional arguments applicable to the (format) String. the localized String
Returns the context-specific OSBL ObjectEditor passed upon construction.
Requested principally by the PreviewMode to show the modified object,
allow further edition to it, and persist it.
the ObjectEditor.
Obtains a context-dependent PreviewController instance. The instance will be
created only once. Successive calls to this method will return the same instance.
the context-specific PreviewController instance.
Factory method that instantiates and returns a context-specific PreviewController.
Usually invoked by the SidePanel.
the context-specific PreviewController instance.
Obtains the context-specific RuleEditorPanel instance. Successive calls to this
method will yield the same instance.
the context-specific RuleEditorPanel instance.
Convenience method to retrieve a localized version of a String. The String might contain
format indicators, in which case the data corresponding to those are provided as
additional arguments.
Parameters: code - the code of the localizable String. Parameters: args - additional arguments applicable to the (format) String. the localized String
Recompute the current Rules to be shown in the UI, based on the logged user-id,
the filters applied (if any) and the public status of the other Rules.
Called whenever the filters have changed.
Subclasses implement a context-specific way of recomputing the Rules, usually using
the filter settings.