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

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


   * @param id
   */
  @Override
  public void setId(String id) {
    String oldId = getId();
    IState oldStartState = ((WebflowState) parent).getStartState();
    setAttribute("id", id);
    if (!id.equals(oldId) && parent instanceof WebflowState) {
      // we are the startstate and rename the id
      if (this.equals(oldStartState)) {
        ((WebflowState) parent).setStartState(this);
View Full Code Here


    if (!getStates().contains(state)) {
      int refIndex = i;
      if (i >= this.states.size()) {
        refIndex = this.states.size() - 1;
      }
      IState refState = getStates().get(refIndex);
      this.states.add(i, state);
      WebflowModelXmlUtils.insertBefore(state.getNode(), refState.getNode());
      super.firePropertyChange(ADD_CHILDREN, new Integer(i), state);
    }

  }
View Full Code Here

        List<IDOMNode> nodes = getChildrenNodeByTagName("start-state");
        IDOMNode node = nodes.get(0);
        return WebflowModelXmlUtils.getStateById(this, getAttribute(node, "idref"));
      }
      else {
        IState state = WebflowModelXmlUtils.getStateById(this, getAttribute(node,
            "start-state"));
        if (state != null) {
          return state;
        }
        else {
View Full Code Here

    if (!getStates().contains(state)) {
      int refIndex = i;
      if (i >= this.states.size()) {
        refIndex = this.states.size() - 1;
      }
      IState refState = getStates().get(refIndex);
      removeState(state);
      this.states.add(i, state);
      WebflowModelXmlUtils.insertBefore(state.getNode(), refState.getNode());
      super.firePropertyChange(MOVE_CHILDREN, new Integer(i), state);
    }
  }
View Full Code Here

  /**
   * @param state
   */
  public void setStartState(IState state) {
    IState oldState = getStartState();

    if (WebflowModelXmlUtils.isVersion1Flow(this)) {
      List<IDOMNode> nodes = getChildrenNodeByTagName("start-state");
      if (nodes != null && nodes.size() > 0) {
        IDOMNode node = nodes.get(0);
        setAttribute(node, "idref", state.getId());
      }
      else {
        Element startNode = getNode().getOwnerDocument().createElement("start-state");
        WebflowModelXmlUtils.insertNode(startNode, node);
        setAttribute((IDOMNode) startNode, "idref", state.getId());
      }
    }
    else {
      setAttribute("start-state", state.getId());
    }

    // removeState(state);
    // addState(state, 0);
    if (oldState != null) {
      oldState.fireStructureChange(PROPS, oldState);
    }
    state.fireStructureChange(PROPS, state);
  }
View Full Code Here

    if (!this.inlineFlows.contains(state)) {
      int refIndex = i;
      if (i >= this.inlineFlows.size()) {
        refIndex = this.inlineFlows.size();
      }
      IState refState = getStates().get(refIndex);
      this.inlineFlows.add(i, state);
      WebflowModelXmlUtils.insertBefore(state.getNode(), refState.getNode());
      super.firePropertyChange(ADD_CHILDREN, new Integer(i), state);
    }

  }
View Full Code Here

      child.setElementParent(state);
    }
    else if (child.getType() == IActionElement.ACTION_TYPE.ENTRY_ACTION
        && parent instanceof IEntryActions) {
      IEntryActions state = (IEntryActions) parent;
      IState viewState = (IState) state.getElementParent();
      if (viewState.getEntryActions() == null) {
        viewState.setEntryActions(state);
      }
      child.setElementParent(state);
    }
    else if (child.getType() == IActionElement.ACTION_TYPE.EXIT_ACTION
        && parent instanceof IExitActions) {
      IExitActions state = (IExitActions) parent;
      IState viewState = (IState) state.getElementParent();
      if (viewState.getExitActions() == null) {
        viewState.setExitActions(state);
      }
      child.setElementParent(state);
    }
   
    if (parent instanceof IEntryActions) {
View Full Code Here

            CreateConnectionRequest request) {
        if (request.getNewObject() instanceof IStateTransition) {
            if (getHost().getModel() instanceof ITransitionableTo) {
                StateTransitionCreateCommand cmd = (StateTransitionCreateCommand) request
                        .getStartCommand();
                IState source = cmd.getSource();
                ITransitionableTo target = (ITransitionableTo) getState();
                if (!(target instanceof IInlineFlowState) && source.getElementParent().equals(target.getElementParent())) {
                  cmd.setTarget((ITransitionableTo) getState());
                  return cmd;
                }
                else {
                  return null;
View Full Code Here

        children.addAll(properties.getAttributes());
      }
    }
    if (getModel() instanceof IState
        && !(getModel() instanceof IWebflowState)) {
      IState state = (IState) getModel();
      if (state.getEntryActions() != null) {
        children.addAll((state.getEntryActions().getEntryActions()));
      }
    }
    if (getModel() instanceof IActionState) {
      if (((IActionState) getState()).getActions() != null) {
        children.addAll(((IActionState) getState()).getActions());
      }
    }
    if (getModel() instanceof IViewState) {
      if (((IViewState) getState()).getRenderActions() != null) {
        children.addAll(((IViewState) getState()).getRenderActions()
            .getRenderActions());
      }
    }
    else if (getModel() instanceof ISubflowState) {
      if (((ISubflowState) getModel()).getAttributeMapper() != null)
        children.add(((ISubflowState) getModel()).getAttributeMapper());
    }
    else if (getModel() instanceof IInlineFlowState) {
      children.addAll(((IInlineFlowState) getModel()).getWebFlowState()
          .getStates());
      children.addAll(((IInlineFlowState) getModel()).getWebFlowState()
          .getInlineFlowStates());
    }
    else if (getModel() instanceof IWebflowState) {
      if (((IWebflowState) getState()).getStates() != null
          && ((IWebflowState) getState()).getInlineFlowStates() != null) {
        children.addAll(((IWebflowState) getState()).getStates());
        children.addAll(((IWebflowState) getState())
            .getInlineFlowStates());
      }
    }
    else if (getModel() instanceof IDecisionState) {
      if (((IDecisionState) getModel()).getIfs() != null) {
        children.addAll(((IDecisionState) getModel()).getIfs());
      }
    }
    if (getModel() instanceof IState
        && !(getModel() instanceof IWebflowState)) {
      IState state = (IState) getModel();
      if (state.getExitActions() != null) {
        children.addAll((state.getExitActions().getExitActions()));
      }
      if (state.getExceptionHandlers() != null) {
        children.addAll((state.getExceptionHandlers()));
      }
    }

    return children;
  }
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();
      IIf sourceState = (IIf) ((AbstractStatePart) source.data)
          .getModel();
      IState targetState = ((AbstractStatePart) target.data).getState();
      if (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

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.