Class ManagementEditorDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ManagementEditorDialog extends JDialog
Editor for the actions of a DefaultManagement (Redmine #62). Left the list of actions (in order of execution), right the selected action: description, rule (when the action is done) and a table of its management variables (id, data type, mode, default, value/rule). The rules are checked while typing (syntax with position, unknown variables, hints on operators, see ManagementModel.check(Predicate)); the problems are listed at the bottom. Variable names can be dropped as text into the rule fields. With OK the actions are written to the component (see DefaultManagement.setActions(List)); errors must be fixed first, warnings have to be confirmed.
Author:
Andreas Enders, Claude (Anthropic), co-author
See Also:
  • Constructor Details

    • ManagementEditorDialog

      public ManagementEditorDialog(Window aOwner, String aTitle, ManagementModel aModel, Predicate<String> aKnownVariable, boolean aEditable)
      Creates the (modal) dialog.
      Parameters:
      aOwner - owner window, may be null
      aTitle - title
      aModel - the model, edited directly
      aKnownVariable - tells whether a variable used in a rule is known, or null
      aEditable - false for read-only
    • ManagementEditorDialog

      public ManagementEditorDialog(Window aOwner, String aTitle, ManagementModel aModel, Predicate<String> aKnownVariable, Map<String, net.simplace.sim.util.FWSimVariable<?>> aVariables, boolean aEditable)
      Creates the (modal) dialog with a tree of the variables that can be inserted into the rules.
      Parameters:
      aOwner - owner window, may be null
      aTitle - title
      aModel - the model, edited directly
      aKnownVariable - tells whether a variable used in a rule is known, or null
      aVariables - the variables of the solution by name (e.g. the template var map), or null
      aEditable - false for read-only
  • Method Details

    • edit

      public static boolean edit(Component aParent, net.simplace.sim.components.DefaultManagement aManagement, boolean aEditable)
      Opens the editor for a management component and applies the result.
      Parameters:
      aParent - parent window
      aManagement - the component
      aEditable - false for read-only
      Returns:
      true if the actions were changed
    • isConfirmed

      public boolean isConfirmed()
      Returns:
      true if the dialog was closed with OK
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class Container
      Returns:
      preferred size of the rule area, used to keep the layout stable