Class AbstractSectionParm

java.lang.Object
org.eclipse.ui.forms.AbstractFormPart
org.eclipse.ui.forms.SectionPart
org.apache.uima.taeconfigurator.editors.ui.AbstractSection
org.apache.uima.taeconfigurator.editors.ui.AbstractSectionParm
All Implemented Interfaces:
StandardStrings, org.eclipse.swt.widgets.Listener, org.eclipse.ui.forms.IFormPart
Direct Known Subclasses:
ParameterDelegatesSection, ParameterSection, ParameterSettingsSection, ValueSection

public abstract class AbstractSectionParm extends AbstractSection
The Class AbstractSectionParm.
  • Field Details

    • NOT_IN_ANY_GROUP

      public static final String NOT_IN_ANY_GROUP
      The Constant NOT_IN_ANY_GROUP.
    • COMMON_GROUP

      public static final String COMMON_GROUP
      The Constant COMMON_GROUP.
    • DELEGATE_HEADER

      protected static final String DELEGATE_HEADER
      The Constant DELEGATE_HEADER.
    • FLOWCTLR_HEADER

      protected static final String FLOWCTLR_HEADER
      The Constant FLOWCTLR_HEADER.
      See Also:
    • GROUP_HEADER

      protected static final String GROUP_HEADER
      The Constant GROUP_HEADER.
    • COMMON_GROUP_HEADER

      protected static final String COMMON_GROUP_HEADER
      The Constant COMMON_GROUP_HEADER.
    • NOT_IN_ANY_GROUP_HEADER

      protected static final String NOT_IN_ANY_GROUP_HEADER
      The Constant NOT_IN_ANY_GROUP_HEADER.
    • OVERRIDE_HEADER

      protected final String OVERRIDE_HEADER
      The override header.
    • MULTI_VALUE_INDICATOR

      protected static final String MULTI_VALUE_INDICATOR
      The Constant MULTI_VALUE_INDICATOR.
      See Also:
    • SINGLE_VALUE_INDICATOR

      protected static final String SINGLE_VALUE_INDICATOR
      The Constant SINGLE_VALUE_INDICATOR.
      See Also:
    • OPTIONAL_INDICATOR

      protected static final String OPTIONAL_INDICATOR
      The Constant OPTIONAL_INDICATOR.
      See Also:
    • REQUIRED_INDICATOR

      protected static final String REQUIRED_INDICATOR
      The Constant REQUIRED_INDICATOR.
      See Also:
    • EXTERNAL_OVERRIDE_INDICATOR

      protected static final String EXTERNAL_OVERRIDE_INDICATOR
      The Constant EXTERNAL_OVERRIDE_INDICATOR.
      See Also:
    • NO_EXTERNAL_OVERRIDE_INDICATOR

      protected static final String NO_EXTERNAL_OVERRIDE_INDICATOR
      The Constant NO_EXTERNAL_OVERRIDE_INDICATOR.
      See Also:
    • nameHeader

      protected final String nameHeader
      The name header.
      See Also:
    • typeNamesW

      protected static final Map<String,String> typeNamesW
      The Constant typeNamesW.
    • tree

      protected org.eclipse.swt.widgets.Tree tree
      The tree.
    • parameterSectionTree

      protected org.eclipse.swt.widgets.Tree parameterSectionTree
      The parameter section tree.
    • showOverrides

      protected boolean showOverrides
      The show overrides.
    • splitGroupNames

      protected boolean splitGroupNames
      The split group names.
    • commonParms

      protected ConfigurationParameter[] commonParms
      The common parms.
    • groupParms

      protected Map groupParms
      The group parms.
    • cpd

      The cpd.
    • settings

      protected ParameterSettingsSection settings
      The settings.
    • settingsTree

      protected org.eclipse.swt.widgets.Tree settingsTree
      The settings tree.
  • Constructor Details

    • AbstractSectionParm

      public AbstractSectionParm(MultiPageEditor aEditor, org.eclipse.swt.widgets.Composite parent, String header, String description)
      Instantiates a new abstract section parm.
      Parameters:
      aEditor - the a editor
      parent - the parent
      header - the header
      description - the description
  • Method Details

    • setSettings

      public void setSettings(ParameterSettingsSection v)
      Sets the settings.
      Parameters:
      v - the new settings
    • enable

      public void enable()
      Description copied from class: AbstractSection
      Enable.
      Specified by:
      enable in class AbstractSection
    • handleEvent

      public abstract void handleEvent(org.eclipse.swt.widgets.Event event)
    • clearAndRefillTree

      protected void clearAndRefillTree(boolean usingGroups)
      Two modes: settingsDisplayMode - if true, shows groups one name at a time, and puts all <common> parms in other groups
      Parameters:
      usingGroups - the using groups
    • fill

      protected void fill(ConfigurationParameter[] parms, org.eclipse.swt.widgets.TreeItem group)
      called by refresh() when no groups, just plain parm sets, also for group case.
      Parameters:
      parms - the parms
      group - <Not in any group> if not in a group, otherwise the group tree item
    • groupNameArrayToString

      public static String groupNameArrayToString(String[] strings)
      Group name array to string.
      Parameters:
      strings - the strings
      Returns:
      the string
    • groupNamesToArray

      protected String[] groupNamesToArray(String names)
      Group names to array.
      Parameters:
      names - the names
      Returns:
      the string[]
    • fillParmItem

      protected void fillParmItem(org.eclipse.swt.widgets.TreeItem item, ConfigurationParameter parm)
      Takes an existing model parm and fills a pre-allocated treeItem. 3 callers: addNewConfigurationParameter, alterExistingConfigurationParamater (editing), fill (bulk update from refresh)
      Parameters:
      item - the item
      parm - the parm
    • parmGuiString

      protected String parmGuiString(ConfigurationParameter parm)
      Parm gui string.
      Parameters:
      parm - the parm
      Returns:
      the string
    • setGroupText

      protected void setGroupText(org.eclipse.swt.widgets.TreeItem groupItem, String names)
      Sets the group text.
      Parameters:
      groupItem - the group item
      names - the names
    • addGroupToGUI

      protected org.eclipse.swt.widgets.TreeItem addGroupToGUI(String names, ConfigurationGroup cg)
      Adds the group to GUI.
      Parameters:
      names - the names
      cg - the cg
      Returns:
      the tree item
    • addNewConfigurationParameterToGUI

      protected void addNewConfigurationParameterToGUI(ConfigurationParameter newCP, org.eclipse.swt.widgets.TreeItem group)
      This is called sometimes with Settings group.
      Parameters:
      newCP - the new CP
      group - - is never null. May be <Not in any group>, indicate no groups; may be the "<Common>" group; or may be a regular group with a set of group names
    • fillOverrides

      protected void fillOverrides(org.eclipse.swt.widgets.TreeItem parent, ConfigurationParameter modelCP)
      Fill overrides.
      Parameters:
      parent - the parent
      modelCP - the model CP
    • isOverride

      protected boolean isOverride(org.eclipse.swt.widgets.TreeItem item)
      Checks if is override.
      Parameters:
      item - the item
      Returns:
      true, if is override
    • isParameter

      protected boolean isParameter(org.eclipse.swt.widgets.TreeItem item)
      Checks if is parameter.
      Parameters:
      item - the item
      Returns:
      true, if is parameter
    • isGroup

      protected boolean isGroup(org.eclipse.swt.widgets.TreeItem item)
      Checks if is group.
      Parameters:
      item - the item
      Returns:
      true, if is group
    • isNOT_IN_ANY_GROUP

      protected boolean isNOT_IN_ANY_GROUP(org.eclipse.swt.widgets.TreeItem item)
      Checks if is not in any group.
      Parameters:
      item - the item
      Returns:
      true, if is not in any group
    • isCommonGroup

      protected boolean isCommonGroup(org.eclipse.swt.widgets.TreeItem item)
      Checks if is common group.
      Parameters:
      item - the item
      Returns:
      true, if is common group
    • isDelegate

      protected boolean isDelegate(org.eclipse.swt.widgets.TreeItem item)
      Checks if is delegate.
      Parameters:
      item - the item
      Returns:
      true, if is delegate
    • isGroupSelection

      protected boolean isGroupSelection()
      Checks if is group selection.
      Returns:
      true, if is group selection
    • isCommonGroupSelection

      protected boolean isCommonGroupSelection()
      Checks if is common group selection.
      Returns:
      true, if is common group selection
    • isOverrideSelection

      protected boolean isOverrideSelection()
      Checks if is override selection.
      Returns:
      true, if is override selection
    • isParmSelection

      protected boolean isParmSelection()
      Checks if is parm selection.
      Returns:
      true, if is parm selection
    • getName

      protected String getName(org.eclipse.swt.widgets.TreeItem item)
      Gets the name.
      Parameters:
      item - the item
      Returns:
      the name
    • getName

      protected String getName(String s)
      Gets the name.
      Parameters:
      s - the s
      Returns:
      the name
    • getItemIndex

      protected int getItemIndex(org.eclipse.swt.widgets.TreeItem parent, org.eclipse.swt.widgets.TreeItem child)
      Gets the item index.
      Parameters:
      parent - the parent
      child - the child
      Returns:
      the item index
    • getItemIndex

      protected int getItemIndex(org.eclipse.swt.widgets.Tree parent, org.eclipse.swt.widgets.TreeItem child)
      Gets the item index.
      Parameters:
      parent - the parent
      child - the child
      Returns:
      the item index
    • getSettingsParameter

      protected org.eclipse.swt.widgets.TreeItem[] getSettingsParameter(org.eclipse.swt.widgets.TreeItem containingGroup, String sourceItemName)
      Works between parameter tree and settings tree. We don't use any relative index offsets. Instead, we search for the item with the same parameter name.
      Parameters:
      containingGroup - in parm section; if null = means all groups (common parms)
      sourceItemName - the source item name
      Returns:
      the settings parameter
    • getSettingsGroups

      protected org.eclipse.swt.widgets.TreeItem[] getSettingsGroups(org.eclipse.swt.widgets.TreeItem group)
      get set of settings group from settingsTree that correspond to parmsection group.
      Parameters:
      group - the group
      Returns:
      set of settings group from settingsTree that correspond to parm-section group
    • getSettingsGroupTreeItemByName

      protected org.eclipse.swt.widgets.TreeItem getSettingsGroupTreeItemByName(String name)
      find settings tree item for group name.
      Parameters:
      name - the name
      Returns:
      settings tree item for group name
    • getCorrespondingModelParm

      protected ConfigurationParameter getCorrespondingModelParm(org.eclipse.swt.widgets.TreeItem item)
      Gets the corresponding model parm.
      Parameters:
      item - the item
      Returns:
      the corresponding model parm
    • getCorrespondingModelGroup

      protected ConfigGroup getCorrespondingModelGroup(org.eclipse.swt.widgets.TreeItem item)
      Gets the corresponding model group.
      Parameters:
      item - the item
      Returns:
      the corresponding model group
    • getConfigurationParameterSettings

      public ConfigurationParameterSettings getConfigurationParameterSettings()
      Gets the configuration parameter settings.
      Returns:
      the configuration parameter settings
    • getModelSettings

      public ConfigurationParameterSettings getModelSettings()
    • removeParmSettingFromMultipleGroups

      public void removeParmSettingFromMultipleGroups(org.eclipse.swt.widgets.TreeItem parmItem, boolean removeFromGUI)
      Remove a parameter from all groups it lives in the Settings. If settings page is shown, also update the GUI.
      Parameters:
      parmItem - in ParameterSection of parameter belonging to (multiple) groups
      removeFromGUI - the remove from GUI
    • updateParmInSettingsGUI

      public void updateParmInSettingsGUI(ConfigurationParameter existingCP, org.eclipse.swt.widgets.TreeItem existingTreeItem, String prevName)
      Update parm in settings GUI.
      Parameters:
      existingCP - the existing CP
      existingTreeItem - the existing tree item
      prevName - the prev name
    • getAllGroupNames

      protected String[] getAllGroupNames()
      Gets the all group names.
      Returns:
      the all group names
    • getAllGroupNames

      protected String[] getAllGroupNames(ConfigurationParameterDeclarations aCpd)
      Gets the all group names.
      Parameters:
      aCpd - the a cpd
      Returns:
      all named groups, excludes <Common> and <Not in any group>
    • removeCommonParmSettingsFromMultipleGroups

      public void removeCommonParmSettingsFromMultipleGroups()
      Removes the common parm settings from multiple groups.
    • removeIncludedParmSettingsFromMultipleGroups

      public void removeIncludedParmSettingsFromMultipleGroups(String[] groupNames, ConfigurationParameter[] cps)
      Remove some of the parameter settings associated with this particular group, not all the parameters for that group name (some parameters may be associated with other instances of a particular group name.) If no other group-set contains a particular individual group name, in the Settings: remove the common parameters, and remove the individual group itself. Remove the particular group-set definition. Note that a group may be defined in more than one group-set. Method: for the group-set, get the parms. Remove just those parms from all groups. Remove the group on the settings page (together with common parms for it) if no other group-set has this group name Remove the group-set.
      Parameters:
      groupNames - the group names
      cps - the cps
    • removeIncludedParmSettingsFromSingleGroup

      public void removeIncludedParmSettingsFromSingleGroup(String groupName, ConfigurationParameter[] cps)
      Removes the included parm settings from single group.
      Parameters:
      groupName - the group name
      cps - in ParameterSection of items an array of tree items to remove Can be all items under a particular group, or a set of items from different groups
    • disposeAllChildItems

      public void disposeAllChildItems(org.eclipse.swt.widgets.TreeItem parent)
      Dispose all child items.
      Parameters:
      parent - the parent
    • showDescriptionAsToolTip

      protected void showDescriptionAsToolTip(org.eclipse.swt.widgets.Event event)
      Show description as tool tip.
      Parameters:
      event - the event