Class EditorJSONElementWrapper

All Implemented Interfaces:
IPropDesigner, IWrappedElement, IWSPropDesigner, EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable, org.eclipse.core.runtime.IAdaptable

public class EditorJSONElementWrapper extends JSONElementWrapper implements IWrappedElement
Editor version of an JSON element wrapper for a JSON element, used to process the output of a Web Service reply.
Author:
Christopher Mindus
  • Constructor Details

    • EditorJSONElementWrapper

      public EditorJSONElementWrapper()
      Creates the property container without a name. The name must be set in all cases using the setPropertyAtom call.
    • EditorJSONElementWrapper

      public EditorJSONElementWrapper(Atom propertyAtom)
      Creates the property container with the specified name. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
  • Method Details

    • createJSONElementWrapper

      protected EditorJSONElementWrapper createJSONElementWrapper(Atom atom)
      Creates a new JSONElementWrapper instance.
      Overrides:
      createJSONElementWrapper in class JSONElementWrapper
    • getDesigner

      public WebServiceDesignerProp getDesigner()
      Gets the Designer Extension for Properties.
      Specified by:
      getDesigner in interface IPropDesigner
      Returns:
      The instance of the Designer Extension.
    • clone

      Clones the JSONElementWrapper.
      Overrides:
      clone in class JSONElementWrapper
      Returns:
      A new wrapper for a cloned JSON element.
      Throws:
      CloneNotSupportedException - For property errors when cloning.
    • getOutputProps

      public EditorOutputProps getOutputProps()
      Gets the Output properties.
      Overrides:
      getOutputProps in class JSONElementWrapper
      Returns:
      The Output properties, or null if this property is orphan.
    • getCNImage

      public org.eclipse.swt.graphics.Image getCNImage()
      Gets the image for the Common Navigator.
      Specified by:
      getCNImage in interface IWSPropDesigner
      Returns:
      Image or null if there is no image.
    • getCNText

      public String getCNText()
      Gets the label text for the Common Navigator.
      Specified by:
      getCNText in interface IWSPropDesigner
      Returns:
      The text.
    • getCNImage

      public org.eclipse.swt.graphics.Image getCNImage(int columnIndex)
      Gets the image for the Common Navigator.
      Specified by:
      getCNImage in interface IWSPropDesigner
      Parameters:
      columnIndex - Index of column.
      Returns:
      Image or null if there is no image.
    • getCNText

      public String getCNText(int columnIndex)
      Gets the label text for the Common Navigator.
      Specified by:
      getCNText in interface IWSPropDesigner
      Parameters:
      columnIndex - Index of column.
      Returns:
      The column text.
    • createCNToolTip

      public org.eclipse.swt.widgets.Composite createCNToolTip(org.eclipse.swt.widgets.Composite parent, int columnIndex)
      Requests creates of the Composite used to show the tooltip.
      Specified by:
      createCNToolTip in interface IWSPropDesigner
      Parameters:
      parent - The parent composite.
      columnIndex - Index of column.
      Returns:
      The created composite in the parent, or null for none.
    • getCNDescriptionType

      public String getCNDescriptionType()
      Provide a type description for the status bar view, if available.
      Specified by:
      getCNDescriptionType in interface IWSPropDesigner
      Returns:
      A type description for the status bar view, or null if not available.
    • canMapToVSField

      public boolean canMapToVSField()
      Verifies if the element is potentially not a repeated value that can be placed in a VS Field. For e.g. XML, there is often no way of knowing this unless there is an XML Schema (XSD) present. For JSON, it is obvious if it's not an Array.
      Specified by:
      canMapToVSField in interface IWrappedElement
      Returns:
      true by default.
    • canMapToVSTableColumn

      public boolean canMapToVSTableColumn()
      Verifies if the element is potentially a repeated value that can be placed in a VS Table Column. For e.g. XML, there is often no way of knowing this unless there is an XML Schema (XSD) present. For JSON, it is obvious if it's an Array.
      Specified by:
      canMapToVSTableColumn in interface IWrappedElement
      Returns:
      true by default.
    • isRepeated

      public boolean isRepeated()
      Checks if an element that can be mapped to a column is perhaps repeated. Such elements will prefer creation of VS Table Columns instead of VS Fields as default operation.
      Specified by:
      isRepeated in interface IWrappedElement
      Returns:
      The flag.
    • getValueType

      public Value.Type getValueType()
      Gets the Value type that applies for this element.
      Specified by:
      getValueType in interface IWrappedElement
      Returns:
      The value type to use, or null if it can't be connected at all.
    • createCNToolTip

      public org.eclipse.swt.widgets.Composite createCNToolTip(org.eclipse.swt.widgets.Composite parent)
      Creates a tooltip for the input variables.
      Specified by:
      createCNToolTip in interface IWSPropDesigner
      Parameters:
      parent - The parent composite.
      Returns:
      The created composite in the parent.
    • getWrappedElementValue

      public String getWrappedElementValue()
      Gets the String version of the Wrapped Element value.
      Specified by:
      getWrappedElementValue in interface IWrappedElement
      Returns:
      The wrapped element value, or null for none.
    • canCombineSelection

      public boolean canCombineSelection(GProp<?>[] props)
      Checks if the element can be combined in a selection with other properties.
      Specified by:
      canCombineSelection in interface IWrappedElement
      Parameters:
      props - The selected properties (at least one [itself - this]).
      Returns:
      The flag.
    • createComposite

      public org.eclipse.swt.widgets.Composite createComposite(WebServiceEditor editor, org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.widgets.Composite existingComposite, GProp<?>[] props)
      Creates the composite to show. The property editor must be disposed of if required.
      Specified by:
      createComposite in interface IWrappedElement
      Parameters:
      editor - The editor.
      parent - Parent composite.
      existingComposite - The existing composite for wrapped elements, null for none.
      props - The selected properties (at least one).
      Returns:
      The composite for to show.