Class SecretsContextPropEditor

All Implemented Interfaces:
IThemeListener, IEditedPropControllerOwner<StringProp, String>, IEditedPropertyEntry<StringProp, String>, IEditedPropertyEntryMultiProp<StringProp, String>, IPropertyDefined, IDisposedPart

public class SecretsContextPropEditor extends StringPropEditor
The editor of the secrets context of a server configuration, $secretsContext (CC-SECRETS-CONTEXT-EDIT): a string entry field that shows the proposed name server.<project>.<file base name> while it is empty, and takes that name as its value when the property is defined. The proposal is the one the save of the configuration file sets at the first secret-marked member (EditorServerSettings.getProposedSecretsContext()); the name typed is checked by SecretsContextValidator.
Author:
Christopher Mindus
  • Constructor Details

    • SecretsContextPropEditor

      public SecretsContextPropEditor()
      Default constructor called before createControls.
  • Method Details

    • getProposedContext

      public static String getProposedContext(PropCnr[] parents)
      Gets the secrets context proposed for the server configuration being edited.
      Parameters:
      parents - The property containers of the edited property, may be null.
      Returns:
      The proposed context, null when no container is a server configuration with a file.
    • create

      protected void create()
      Creates the property editor controls: the entry field shows the proposed context while it is empty.
      Overrides:
      create in class StringPropEditor
    • onDefine

      public void onDefine(boolean on)
      Called from the PropertyDefinedButton: defining the property gives it the proposed context.
      Specified by:
      onDefine in interface IPropertyDefined
      Overrides:
      onDefine in class BaseEditor<StringProp, String>
      Parameters:
      on - The defined state.
    • getDefaultValue

      public String getDefaultValue()
      Gets the default defined value to set in the property when defined: the proposed context when the user defines the property. A property that is created to carry the error of a refused name gets the empty default of a string, never a name the user did not choose.
      Specified by:
      getDefaultValue in interface IEditedPropControllerOwner<StringProp, String>
      Overrides:
      getDefaultValue in class StringPropEditor