Class TypeSection

java.lang.Object
org.eclipse.ui.forms.AbstractFormPart
org.eclipse.ui.forms.SectionPart
All Implemented Interfaces:
StandardStrings, org.eclipse.swt.widgets.Listener, org.eclipse.ui.forms.IFormPart

public class TypeSection extends AbstractImportablePartSection
The Class TypeSection.
  • Field Details

    • CASCADE_MESSAGE

      public static final String CASCADE_MESSAGE
      The Constant CASCADE_MESSAGE.
      See Also:
    • CASCADE_DELETE_WARNING

      public static final String CASCADE_DELETE_WARNING
      The Constant CASCADE_DELETE_WARNING.
      See Also:
    • NAME_COL

      public static final int NAME_COL
      The Constant NAME_COL.
      See Also:
    • SUPER_COL

      public static final int SUPER_COL
      The Constant SUPER_COL.
      See Also:
    • RANGE_COL

      public static final int RANGE_COL
      The Constant RANGE_COL.
      See Also:
    • MULTIPLE_REF_OK_COL

      public static final int MULTIPLE_REF_OK_COL
      The Constant MULTIPLE_REF_OK_COL.
      See Also:
    • ELEMENT_TYPE_COL

      public static final int ELEMENT_TYPE_COL
      The Constant ELEMENT_TYPE_COL.
      See Also:
    • AV_COL

      public static final int AV_COL
      The Constant AV_COL.
      See Also:
    • HEADER_ALLOWED_VALUE

      public static final String HEADER_ALLOWED_VALUE
      The Constant HEADER_ALLOWED_VALUE.
      See Also:
  • Constructor Details

    • TypeSection

      public TypeSection(MultiPageEditor editor, org.eclipse.swt.widgets.Composite parent)
      Instantiates a new type section.
      Parameters:
      editor - the editor
      parent - the parent
  • Method Details

    • initialize

      public void initialize(org.eclipse.ui.forms.IManagedForm form)
      Specified by:
      initialize in interface org.eclipse.ui.forms.IFormPart
      Overrides:
      initialize in class AbstractSection
    • refresh

      public void refresh()
      Specified by:
      refresh in interface org.eclipse.ui.forms.IFormPart
      Overrides:
      refresh in class org.eclipse.ui.forms.AbstractFormPart
    • handleEvent

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

      public void handleHover(org.eclipse.swt.widgets.Event event)
      Handle hover.
      Parameters:
      event - the event
    • getTypeDescriptionFromTableTreeItem

      public org.apache.uima.resource.metadata.TypeDescription getTypeDescriptionFromTableTreeItem(org.eclipse.swt.widgets.TreeItem item)
      Gets the type description from table tree item.
      Parameters:
      item - the item
      Returns:
      the type description from table tree item
    • handleAddAllowedValue

      public void handleAddAllowedValue(org.eclipse.swt.widgets.TreeItem parent)
      Handle add allowed value.
      Parameters:
      parent - the parent
    • handleAddFeature

      public void handleAddFeature(org.eclipse.swt.widgets.TreeItem parent)
      Handle add feature.
      Parameters:
      parent - the parent
    • allowedValueUpdate

      public void allowedValueUpdate(org.apache.uima.resource.metadata.AllowedValue av, AddAllowedValueDialog dialog)
      Allowed value update.
      Parameters:
      av - the av
      dialog - the dialog
    • featureUpdate

      public void featureUpdate(org.apache.uima.resource.metadata.FeatureDescription fd, AddFeatureDialog dialog)
      Feature update.
      Parameters:
      fd - the fd
      dialog - the dialog
    • handleAddType

      public void handleAddType()
      Handle add type.
    • getFeatureDescriptionFromTableTreeItem

      public org.apache.uima.resource.metadata.FeatureDescription getFeatureDescriptionFromTableTreeItem(org.eclipse.swt.widgets.TreeItem item)
      Gets the feature description from table tree item.
      Parameters:
      item - the item
      Returns:
      the feature description from table tree item
    • getAllowedValueFromTableTreeItem

      public org.apache.uima.resource.metadata.AllowedValue getAllowedValueFromTableTreeItem(org.eclipse.swt.widgets.TreeItem item)
      Gets the allowed value from table tree item.
      Parameters:
      item - the item
      Returns:
      the allowed value from table tree item
    • checkFeature

      public String checkFeature(AddFeatureDialog dialog, org.apache.uima.resource.metadata.TypeDescription td, org.apache.uima.resource.metadata.FeatureDescription oldFd)
      verify a new or edited feature is valid. For new features: The name must be unique locally. It may duplicate a non-local feature that isn't also built-in. (We presume built-in features are fixed). (We allow dupl non-local feature in case this type system is used without the import, in some other context?) We don't use the TCas because it isn't necessarily being updated For edited features: If the name changed, do "new" test above on new name If the name changed, do "remove" test on old name: If used in an index or capability, but merged/built-in name not still there, warn about index being invalidated (not done here - done during feature update itself). If name used in index, and range is not indexable - error
      Parameters:
      dialog - the dialog
      td - the td
      oldFd - the old fd
      Returns:
      error message or null
    • checkAllowedValue

      public String checkAllowedValue(AddAllowedValueDialog dialog, org.apache.uima.resource.metadata.TypeDescription td, org.apache.uima.resource.metadata.AllowedValue av)
      Check allowed value.
      Parameters:
      dialog - the dialog
      td - the td
      av - the av
      Returns:
      the string
    • checkDuplTypeName

      public String checkDuplTypeName(String newTypeName)
      returns null or error message about a duplicate type name Cases: Dupl type in local descriptor not allowed. Type that duplicates imported type is OK. Type that duplicates built-in type is OK.
      Parameters:
      newTypeName - the new type name
      Returns:
      the string
    • enable

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