Interface ILinkOperation

All Known Implementing Classes:
AddAnnotationPrecondition, ButtonBuilderSubOp, ComboBoxBuilderSubOp, LayoutNewComponentsOperation, LopAssignVirtualSpace, LopVSAction, LopVSComponent, LopVSField, MenuItemBuilderSubOp, TextAreaBuilderSubOp, TextBuilderSubOp, UIBuilderOperation, UIBuilderSubOperation, VSActionBuilderSubOp, VSFieldBuilderSubOp

public interface ILinkOperation
The link operation contains the information required to identify the link operation to perform, potentially present what should be done to the user for his/her selection. The operation must also be able to verify if it is incompatible with other operations in the global operation. Perhaps one operation may require others to be performed in order to be successful (e.g. create a VS Field reference for a panel component may required the panel to become VirtualSpace participant first).

The "equals(Object)" method MUST be implemented in the link operation class. This equal method must return equality if two operations would produce the SAME result if executed.

Author:
Christopher Mindus
  • Method Details

    • isPrecondition

      default boolean isPrecondition()
      Returns if the operation is a precondition required to run BEFORE the parent operation runs, or if it should be run AFTERWARDS.
      Returns:
      true to run BEFORE, false to run AFTERWARDS.
    • isSelected

      default boolean isSelected()
      Returns if this operation is selected or not.

      This method is used e.g. in the build operations where a page shouldn't be displayed if the build wizard is not selected.

      Returns:
      true by default.
    • createOperationNode

      Creates the operation node for presentation in the link wizard main page.
      Parameters:
      parent - The parent node.
      Returns:
      The node.
    • isOperationEnabled

      IStatus isOperationEnabled()
      Returns if the operation is enabled for execution, regardless of any preconditions. These are tested once all parties have agreed that the operation might be a "go".
      Returns:
      The status for the operation.
    • isOperationEnabled

      default IStatus isOperationEnabled(List<ILinkOperation> allOperations)
      Returns if the operation is enabled for execution, regardless of any preconditions. These are tested once all parties have agreed that the operation might be a "go".
      Parameters:
      allOperations - A list of all operations, including the preconditions.
      Returns:
      The status for the operation, default is to return isOperationEnabled().
    • getDependentOperations

      default List<ILinkOperation> getDependentOperations()
      Returns the dependent operations that must be performed in order for this operation to be able to complete.
      Returns:
      The collection of dependency operations, default empty list.
    • isWizardDialogRequired

      default boolean isWizardDialogRequired()
      Returns if the link wizard dialog must be shown.
      Returns:
      true in order to present user choices, etc, false otherwise, default false.
    • validateOperations

      default IStatus validateOperations(List<ILinkOperation> operations)
      Verifies all the operations for each operation using this call. This makes it possible for link operations that are not compatible or e.g. defined multiple times with different targets (or same target for multiple sources) and this is not allowed.
      Parameters:
      operations - All link operations, including preconditions.
      Returns:
      The status of the validation, default OK.
    • addPages

      default void addPages(LinkWizard wizard)
      Called when the wizard is created and allows the creation of additional wizard pages required. All created pages MUST implement done to get the link wizard information.
    • executeOperation

      IStatus executeOperation(ComplexOperation op) throws CoreException
      Executes the operation.
      Parameters:
      op - The complex operation.
      Returns:
      The status of the operation. A complex operation would have a MultiStatus return code.
      Throws:
      CoreException - If the execution failed.
    • equalsOp

      boolean equalsOp(ILinkOperation op)
      Checks if two operations are equal.
      Parameters:
      op - Operation to compare with.
      Returns:
      true if they produce the same result, false otherwise.