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

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


    Set<ValidationProblem> validationProblems = validate(element);
    return validationProblems == null || validationProblems.size() == 0;
  }

  public static Set<ValidationProblem> validate(IWebflowModelElement element) {
    IWebflowState webflowState = WebflowModelUtils.getWebflowState(element, true);
    if (webflowState != null) {
      IWebflowConfig config = (IWebflowConfig) webflowState.getElementParent();
      NoMarkerCreatingWebflowValidator validator = new NoMarkerCreatingWebflowValidator();
      Set<IResource> affectedResources = new HashSet<IResource>();
      affectedResources.add(config.getElementResource());
      try {
        validator.validate(affectedResources, IncrementalProjectBuilder.INCREMENTAL_BUILD,
View Full Code Here


    return buf.toString();
  }

  public static String[] getStateId(IWebflowModelElement parent) {
    IWebflowState webflowState = WebflowModelUtils.getWebflowState(parent, false);
    List<String> stateIds = new ArrayList<String>();
    if (webflowState != null) {
      for (IState state : webflowState.getStates()) {
        stateIds.add(state.getId());
      }
    }
    return stateIds.toArray(new String[stateIds.size()]);
  }
View Full Code Here

                return false;
            if (part instanceof FlowPart)
                return false;
            if (part.getModel() instanceof IState
                    && !(part.getModel() instanceof IWebflowState)) {
                IWebflowState parent = (IWebflowState) ((IState) part
                        .getModel()).getElementParent();
                if (parent.isStartState((IState) part.getModel())) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here

     * (non-Javadoc)
     * @see org.eclipse.gef.commands.Command#execute()
     */
    public void execute() {
      if (child.getElementParent() instanceof IWebflowState) {
        IWebflowState state = (IWebflowState) child.getElementParent();
        oldChild = state.getStartState();
        index = state.getStates().indexOf(child);
        state.setStartState(child);
      }
    }
View Full Code Here

     * (non-Javadoc)
     * @see org.eclipse.gef.commands.Command#undo()
     */
    public void undo() {
      if (child.getElementParent() instanceof IWebflowState) {
        IWebflowState state = (IWebflowState) child.getElementParent();
        state.setStartState(oldChild);
        state.moveState(child, index);
      }
    }
View Full Code Here

  @Override
  protected IValidationContext createContext(
      IResourceModelElement rootElement,
      IResourceModelElement contextElement) {
    if (rootElement instanceof IWebflowState) {
      IWebflowState state = (IWebflowState) rootElement;
      IWebflowConfig config = WebflowModelUtils
          .getWebflowConfig((IFile) state.getElementResource());
      return new WebflowValidationContext(state, config);
    }
    return null;
  }
View Full Code Here

            .getModelForRead(file);

      }
      if (model != null) {
        IDOMDocument document = ((DOMModelImpl) model).getDocument();
        IWebflowState webflowState = new WebflowState(WebflowModelUtils
            .getWebflowConfig(file));
        webflowState.init((IDOMNode) document.getDocumentElement(),
            null);
        return webflowState;
      }
    }
    catch (Exception e) {
View Full Code Here

    }
    return false;
  }

  public static boolean isStateIdUnique(IState state) {
    IWebflowState webflowState = getWebflowState(state, false);
    List<IState> foundStates = new ArrayList<IState>();
    if (webflowState != null) {
      List<IState> states = new ArrayList<IState>();
      states.addAll(webflowState.getStates());
      states.addAll(webflowState.getInlineFlowStates());
      for (IState s : states) {
        if (s.getId().equals(state.getId())) {
          foundStates.add(s);
        }
      }
View Full Code Here

          model = StructuredModelManager.getModelManager().getModelForRead(
              (IFile) parentConfig.getElementResource());
        }
        if (model != null) {
          IDOMDocument document = ((DOMModelImpl) model).getDocument();
          IWebflowState parentState = new WebflowState(parentConfig);
          parentState.init((IDOMNode) document.getDocumentElement(), null);

          state = WebflowModelXmlUtils.getStateById(parentState, parentStateId);
        }
      }
      catch (Exception e) {
View Full Code Here

              model = StructuredModelManager.getModelManager().getModelForRead(
                  (IFile) parentConfig.getElementResource());
            }
            if (model != null) {
              IDOMDocument document = ((DOMModelImpl) model).getDocument();
              IWebflowState parentState = new WebflowState(parentConfig);
              parentState.init((IDOMNode) document.getDocumentElement(), null);

              state = WebflowModelXmlUtils.getStateById(parentState, stateId);
            }
          }
          catch (Exception e) {
View Full Code Here

TOP

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

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.