Class VSLinkInfo<VSCOMP extends IVSComponent>

java.lang.Object
com.iizigo.vs.link.VSLinkInfo<VSCOMP>
Direct Known Subclasses:
VSLinkAction, VSLinkField, VSLinkVirtualSpace

public abstract class VSLinkInfo<VSCOMP extends IVSComponent> extends Object
Class holding the setup for an individual link type and how to create it.
Author:
Christopher Mindus
  • Constructor Details

    • VSLinkInfo

      public VSLinkInfo()
  • Method Details

    • getVSClass

      public abstract Class<VSCOMP> getVSClass()
      Returns the class used for linking.
      Returns:
      VirtualSpace.class, VSTable.class, VSColumnHEader.class, VSField.class or VSAction.class.
    • isAlreadyLinked

      protected abstract boolean isAlreadyLinked(PropCnr target, VSCOMP component)
      Verifies if the component has been linked already.
      Parameters:
      target - The target for linking.
      component - The component.
      Returns:
      true if already handled by this link info.
    • getAlreadyLinkedMessage

      protected String getAlreadyLinkedMessage()
      Returns the message a component is already linked.
      Returns:
      E.g. "Component is already linked" (default).
    • getNoComponentsMessage

      protected String getNoComponentsMessage()
      Returns the message when no components apply to this.
      Returns:
      E.g. "No linking operation remains to perform" (default);
    • isMultipleComponentsSupported

      protected abstract boolean isMultipleComponentsSupported()
      Returns if the linker implementation supports multiple components or a single one.
      Returns:
      true if multiple components can be handled, or false for a single one in the list of components for the runOperation(PropCnr, ArrayList, VSSubLinkInfo, PropCnr, ComplexOperation) operation.
    • isSkipDialogAllowed

      protected boolean isSkipDialogAllowed()
      Returns if the dialog box always should be displayed, regardless of the "skip dialog" setting.
      Returns:
      true to enable dialog to be skipped (default), or false to force display.
    • getSubOperations

      protected VSSubLinkInfo getSubOperations()
      Returns the sub-operations for the operation. This method is called when the dialog box is displayed to perform user-selection of what should be done.
      Returns:
      null (default) for no sub-operations, otherwise the instance.
    • getOperation

      protected abstract String getOperation(PropCnr target, VSCOMP component)
      Returns the operation that linking will produce.
      Parameters:
      target - The target for linking.
      component - The component to link.
      Returns:
      The text inserted to the table.
    • runOperation

      protected abstract PropCnr runOperation(PropCnr target, ArrayList<VSCOMP> components, VSSubLinkInfo subOperations, PropCnr mainContainer, ComplexOperation op)
      Runs the main operation.
      Parameters:
      target - The target for linking.
      components - The component to link.
      subOperations - Sub-operations to execute, null for none.
      mainContainer - The main container from a parent operation, null for main operation.
      op - The complex operation.
      Returns:
      Potential property container created, for use in sub-operations.