Class WorkflowElementAdapter

java.lang.Object
org.eclipse.emf.mwe.internal.core.debug.mwe.WorkflowElementAdapter
All Implemented Interfaces:
ElementAdapter

public class WorkflowElementAdapter extends Object implements ElementAdapter
The IElementAdapter implementation for WorkflowComponents.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHandle(Object element)
    returns true, if the implementation handles the element type
    boolean
    check if the variable representation of this element shall show members
    computes a SyntaxElement for a specific element type
    the containerName should be the name of the underlying file name
    the element name should be the name of the surrounding element (e.g.
    computes a SyntaxElement for a surrounding element representing the end position to be highlighted before returning
    the containerName should be the name of the file that holds the element
    the element name should be a description of the end element
    start, end and line should point to the end text to be highlighted
    findElement(SyntaxElement se, Object actual, int flag)
    find the element that corresponds to the given syntax element information
    a unique type must be provided for each implementation
     
    compute the string representation of the element ready to display in the variables detail view.
    collect all available variables for a given element.
    compute a shorter string representation of the element ready to display in the variables view.
    boolean
    returns whether the element has a body and debugger shall stop again at the end of the execution of that element
    void
    setContext(Object context)
    set the current execution context
    the context should be cached and can be used to collect information about elements
    boolean
    Returns true if the syntax element should be appended to callstack.
    boolean
    this method is called from the DebugMonitor prior to all other suspension activities (e.g.
    boolean
    shallSuspend(Object element, int flag)
    this method is called from the DebugMonitor after all other suspension activities (e.g.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • WorkflowElementAdapter

      public WorkflowElementAdapter()
  • Method Details

    • getContext

      public Object getContext()
      Specified by:
      getContext in interface ElementAdapter
    • setContext

      public void setContext(Object context)
      Description copied from interface: ElementAdapter
      set the current execution context
      the context should be cached and can be used to collect information about elements
      Specified by:
      setContext in interface ElementAdapter
      Parameters:
      context - the context
    • getAdapterType

      public String getAdapterType()
      Description copied from interface: ElementAdapter
      a unique type must be provided for each implementation
      Specified by:
      getAdapterType in interface ElementAdapter
      Returns:
      the adapterType
    • canHandle

      public boolean canHandle(Object element)
      Description copied from interface: ElementAdapter
      returns true, if the implementation handles the element type
      Specified by:
      canHandle in interface ElementAdapter
      Parameters:
      element - the element that is going to be debugged
      Returns:
      true, if this class handles the element type
    • shallHandle

      public boolean shallHandle(Object element)
      Description copied from interface: ElementAdapter
      this method is called from the DebugMonitor prior to all other suspension activities (e.g. breakpoint check, subroutine level check)
      this provides the opportunity to handle specific elements individually
      Normal return value should be true
      Specified by:
      shallHandle in interface ElementAdapter
      Parameters:
      element - the element that is going to be debugged
      Returns:
      whether or not to suspend the debugger process for the element
    • shallSuspend

      public boolean shallSuspend(Object element, int flag)
      Description copied from interface: ElementAdapter
      this method is called from the DebugMonitor after all other suspension activities (e.g. breakpoint check, subroutine level check)
      this provides the opportunity for a last call by the adapter.
      Implementations can *avoid* suspension, although it would suspend otherwise, if the return value is set to false here
      Specified by:
      shallSuspend in interface ElementAdapter
      Parameters:
      element - the element that is going to be debugged
      flag - one of the values IProcessHandler.PUSH or IProcessHandler.POP
      Returns:
      whether or not to suspend the debugger process for the element
    • shallAddToCallStack

      public boolean shallAddToCallStack(Object element)
      Description copied from interface: ElementAdapter
      Returns true if the syntax element should be appended to callstack.
      Specified by:
      shallAddToCallStack in interface ElementAdapter
      Parameters:
      element - element to be checked.
      Returns:
      true if the element will be added to callstack.
    • isSurroundingElement

      public boolean isSurroundingElement(Object element)
      Description copied from interface: ElementAdapter
      returns whether the element has a body and debugger shall stop again at the end of the execution of that element
      Specified by:
      isSurroundingElement in interface ElementAdapter
      Parameters:
      element - the element that is debugged currently
      Returns:
      whether the element has a body
    • createElement

      public SyntaxElement createElement(Object element)
      Description copied from interface: ElementAdapter
      computes a SyntaxElement for a specific element type
      the containerName should be the name of the underlying file name
      the element name should be the name of the surrounding element (e.g. in Java we highlight the line to be debugged, but show the surrounding method name in the Launch view)
      start, end and line should point to the text that shall be highlighted for the element
      Specified by:
      createElement in interface ElementAdapter
      Parameters:
      element - the element that is going to be debugged
      Returns:
      a SyntaxElement that contains the information to be shown in the debugger views in a common neutral way
    • createEndElementTO

      public SyntaxElement createEndElementTO(Object element)
      Description copied from interface: ElementAdapter
      computes a SyntaxElement for a surrounding element representing the end position to be highlighted before returning
      the containerName should be the name of the file that holds the element
      the element name should be a description of the end element
      start, end and line should point to the end text to be highlighted
      Specified by:
      createEndElementTO in interface ElementAdapter
      Parameters:
      element - the element that is going to be debugged
      Returns:
      a SyntaxElement that contains the information to be shown in the debugger views in a common neutral way
    • getVariables

      public List<NameValuePair> getVariables(Object element)
      Description copied from interface: ElementAdapter
      collect all available variables for a given element. With this method only the variables themselfs are collected, not their members.
      Implementations must consider that elementcan be both a syntax element or an arbitrary java element to collect the member variables from!!
      Specified by:
      getVariables in interface ElementAdapter
      Parameters:
      element - the current element
      Returns:
      a name/value list that contains the variables
    • getVariableDetailRep

      public String getVariableDetailRep(Object element)
      Description copied from interface: ElementAdapter
      compute the string representation of the element ready to display in the variables detail view.
      Specified by:
      getVariableDetailRep in interface ElementAdapter
      Parameters:
      element - the element to be considered
      Returns:
      the String representation of this element
    • getVariableSimpleRep

      public String getVariableSimpleRep(Object element)
      Description copied from interface: ElementAdapter
      compute a shorter string representation of the element ready to display in the variables view.
      Specified by:
      getVariableSimpleRep in interface ElementAdapter
      Parameters:
      element - the element to be considered
      Returns:
      a string representation of this element
    • checkVariableHasMembers

      public boolean checkVariableHasMembers(Object element)
      Description copied from interface: ElementAdapter
      check if the variable representation of this element shall show members
      Specified by:
      checkVariableHasMembers in interface ElementAdapter
      Parameters:
      element - the element to be considered
      Returns:
      the decision
    • findElement

      public Object findElement(SyntaxElement se, Object actual, int flag)
      Description copied from interface: ElementAdapter
      find the element that corresponds to the given syntax element information
      Specified by:
      findElement in interface ElementAdapter
      Parameters:
      se - the syntax element transfer object
      Returns:
      the corresponding element