Package org.springframework.ide.eclipse.webflow.core.model

Examples of org.springframework.ide.eclipse.webflow.core.model.IState


    /* (non-Javadoc)
     * @see org.eclipse.gef.commands.Command#canExecute()
     */
    public boolean canExecute() {
        for (int i = 0; i < source.getOutputTransitions().size(); i++) {
            IState target = ((ITransition) source.getOutputTransitions().get(i))
                    .getToState();
            if (target.equals(child))
                return false;
        }
        return true;
    }
View Full Code Here


    CompoundCommand result = new CompoundCommand();
    for (int i = 0; i < parts.size(); i++) {
      EditPart part = (EditPart) parts.get(i);
      if (part.getModel() instanceof IActionElement) {
        IActionElement ae = (IActionElement) part.getModel();
        IState state = (IState) getHost().getModel();
        if ((ae.getType() == IActionElement.ACTION_TYPE.ACTION && state instanceof IActionState)
            || (ae.getType() == IActionElement.ACTION_TYPE.RENDER_ACTION && state instanceof IViewState)
            || (ae.getType() == IActionElement.ACTION_TYPE.ENTRY_ACTION && state instanceof IState)
            || (ae.getType() == IActionElement.ACTION_TYPE.EXIT_ACTION && state instanceof ITransitionableFrom)) {
          ActionCloneCommand orphan = new ActionCloneCommand();
          orphan.setChild((IActionElement) ((EditPart) parts.get(i))
              .getModel());
          orphan.setNewState((IWebflowModelElement) getHost()
              .getModel());
          result.add(orphan);
        }
      }
      else if (part.getModel() instanceof IExceptionHandler) {
        IState state = (IState) getHost().getModel();
        if (!(state instanceof IWebflowState)
            && !(state instanceof IInlineFlowState)) {
          ExceptionHandlerCloneCommand orphan = new ExceptionHandlerCloneCommand();
          orphan.setChild((IExceptionHandler) ((EditPart) parts.get(i))
              .getModel());
          orphan.setNewState((IWebflowModelElement) getHost()
              .getModel());
          result.add(orphan);
        }
      }
      else if (part.getModel() instanceof IAttributeMapper) {
        IState state = (IState) getHost().getModel();
        if (state instanceof SubflowState
            && ((SubflowState) state).getAttributeMapper() == null) {
          AttributeMapperCloneCommand orphan = new AttributeMapperCloneCommand();
          orphan.setChild((IAttributeMapper) ((EditPart) parts.get(i))
              .getModel());
View Full Code Here

  /**
   *
   */
  protected void primExecute() {
    IState parent = (IState) child.getElementParent();
    index = parent.getExceptionHandlers().indexOf(child);
    parent.removeExceptionHandler(child);
  }
View Full Code Here

  /*
   * (non-Javadoc)
   * @see org.eclipse.gef.commands.Command#undo()
   */
  public void undo() {
    IState parent = (IState) child.getElementParent();
    parent.addExceptionHandler(child, index);
  }
View Full Code Here

    GraphAnimation.recordInitialState(getConnectionFigure());
    Node source = (Node) map.get(getSource());
    Node target = (Node) map.get(getTarget());
    Edge e = null;
    if (target.data != null && target.data instanceof AbstractStatePart) {
      IState startState = ((IWebflowState) ((AbstractStatePart) target.data)
          .getState().getElementParent()).getStartState();
      IState sourceState = ((AbstractStatePart) source.data).getState();
      IState targetState = ((AbstractStatePart) target.data).getState();
      if (startState != null
          && startState.getId().equals(targetState.getId())) {
        e = new Edge(this, target, source);
      }
      else {
        List children = ((IWebflowState) ((AbstractStatePart) target.data)
            .getState().getElementParent()).getStates();
View Full Code Here

    CompoundCommand command = new CompoundCommand();
    for (int i = 0; i < editParts.size(); i++) {
      EditPart child = (EditPart) editParts.get(i);
      if (child.getModel() instanceof IActionElement) {
        IActionElement ae = (IActionElement) child.getModel();
        IState state = (IState) getHost().getModel();
        if ((ae.getType() == IActionElement.ACTION_TYPE.ACTION && state instanceof IActionState)
            || (ae.getType() == IActionElement.ACTION_TYPE.RENDER_ACTION && state instanceof IViewState)
            || (ae.getType() == IActionElement.ACTION_TYPE.ENTRY_ACTION && state instanceof IState)
            || (ae.getType() == IActionElement.ACTION_TYPE.EXIT_ACTION && state instanceof ITransitionableFrom)) {
          command.add(createAddActionCommand(child));
        }
      }
      else if (child.getModel() instanceof IExceptionHandler) {
        IState state = (IState) getHost().getModel();
        if (!(state instanceof IWebflowState) && !(state instanceof IInlineFlowState)) {
          command.add(createAddExceptionHandlerCommand(child));
        }
      }
      else if (child.getModel() instanceof IAttributeMapper
View Full Code Here

      return command;
    }
    else if (getHost().getModel() instanceof IState
        && request.getNewObject() instanceof IActionElement) {
      IActionElement ae = (IActionElement) request.getNewObject();
      IState state = (IState) getHost().getModel();
      if ((ae.getType() == IActionElement.ACTION_TYPE.ACTION && state instanceof IActionState)
          || (ae.getType() == IActionElement.ACTION_TYPE.RENDER_ACTION && state instanceof IViewState)
          || (ae.getType() == IActionElement.ACTION_TYPE.ENTRY_ACTION && state instanceof IState)
          || (ae.getType() == IActionElement.ACTION_TYPE.EXIT_ACTION && state instanceof ITransitionableFrom)) {
        CreateActionCommand command = new CreateActionCommand();
View Full Code Here

      }
      child.setElementParent(state.getRenderActions());
    }
    else if (child.getType() == IActionElement.ACTION_TYPE.ENTRY_ACTION
        && parent instanceof IState) {
      IState state = (IState) parent;
      if (state.getEntryActions() == null) {
        EntryActions entry = new EntryActions();
        entry.createNew(state);
        state.setEntryActions(entry);
      }
      child.setElementParent(state.getEntryActions());
    }
    else if (child.getType() == IActionElement.ACTION_TYPE.EXIT_ACTION
        && parent instanceof IState) {
      IState state = (IState) parent;
      if (state.getExitActions() == null) {
        ExitActions entry = new ExitActions();
        entry.createNew(state);
        state.setExitActions(entry);
      }
      child.setElementParent(state.getExitActions());
    }

    if (child.getElementParent() instanceof IEntryActions) {
      ((IEntryActions) child.getElementParent()).addEntryAction(child);
    }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void contributeNodesToGraph(CompoundDirectedGraph graph, Subgraph s,
      Map map) {
    GraphAnimation.recordInitialState(getContentPane());
    Subgraph me = new Subgraph(this, s);
    IState state = (IState) getModel();

    if (!(state instanceof IWebflowState)) {
      int index = -1;
      int stateCount = ((IWebflowState) state.getElementParent())
          .getStates().size();
      if (state instanceof IInlineFlowState) {
        index = ((IWebflowState) state.getElementParent())
            .getInlineFlowStates().indexOf(state)
            + stateCount;
      }
      else {
        index = ((IWebflowState) state.getElementParent()).getStates()
            .indexOf(state);
      }
      me.setRowConstraint(index);
    }
View Full Code Here

      }
      child.setElementParent(state.getRenderActions());
    }
    else if (child.getType() == IActionElement.ACTION_TYPE.ENTRY_ACTION
        && newState instanceof IState) {
      IState state = (IState) newState;
      if (state.getEntryActions() == null) {
        EntryActions entry = new EntryActions();
        entry.createNew(state);
        state.setEntryActions(entry);
      }
      child.setElementParent(state.getEntryActions());
    }
    else if (child.getType() == IActionElement.ACTION_TYPE.EXIT_ACTION
        && newState instanceof IState) {
      IState state = (IState) newState;
      if (state.getExitActions() == null) {
        ExitActions entry = new ExitActions();
        entry.createNew(state);
        state.setExitActions(entry);
      }
      child.setElementParent(state.getExitActions());
    }

    if (child.getElementParent() instanceof IEntryActions) {
      ((IEntryActions) child.getElementParent()).addEntryAction(child);
    }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.webflow.core.model.IState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.