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

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


  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof IFolder) {
      IFolder folder = (IFolder) element;
      IWebflowModel model = Activator.getModel();
      IWebflowProject project = model.getProject(folder.getProject());
      if (project != null) {
        String path = folder.getProjectRelativePath().toString() + '/';
        for (IWebflowConfig config : project.getConfigs()) {
          if (config.getResource().getProjectRelativePath()
              .toString().startsWith(path)) {
            return true;
          }
        }
      }
      return false;
    } else if (element instanceof IFile) {
      IFile file = (IFile) element;
      IWebflowModel model = Activator.getModel();
      IWebflowProject project = model.getProject(file.getProject());
      if (project != null) {
        for (IWebflowConfig config : project.getConfigs()) {
          // The following comparison works for archived config files
          // too
          if (config.getResource().equals(file)) {
            return true;
          }
View Full Code Here


    if (name != null && !"".equals(name)) {
      newConfig.setName(name);
    }
    newConfig.setBeansConfigs(linkPage.getBeansConfigs());

    IWebflowProject wfp = getProject(file);
    List<IWebflowConfig> configs = wfp.getConfigs();
    configs.add(newConfig);

    wfp.setConfigs(configs);
  }
View Full Code Here

      catch (InterruptedException e) {
        SpringCore.log(e);
      }
    }

    IWebflowProject webflowProject = org.springframework.ide.eclipse.webflow.core.Activator.getModel().getProject(
        file.getProject());

    if (webflowProject != null) {
      return webflowProject;
    }
View Full Code Here

    if (name == null || name.trim().length() == 0) {
      errorLabel.setText("Please specify a valid flow id");
      isEnabled = false;
    }
    else {
      IWebflowProject wp = Activator.getModel().getProject(project);
      for (IWebflowConfig config : wp.getConfigs()) {
        if (name.equals(config.getName()) && !config.getResource().equals(file)){
          errorLabel.setText("Flow id already in use in this project");
          isEnabled = false;
        }
      }
View Full Code Here

    if (object instanceof ISpringProject) {
      object = Activator.getModel().getProject(
          ((ISpringProject) object).getProject());
    }
    else if (object instanceof IFile) {
      IWebflowProject project = Activator.getModel().getProject(
          ((IFile) object).getProject());
      if (project != null) {
        object = project.getConfig((IFile) object);
      }
    }
    if (object instanceof IWebflowModelElement) {
      if (object instanceof IWebflowProject) {
        for (IWebflowConfig wc : ((IWebflowProject) object)
View Full Code Here

    Set<IResource> resources = new LinkedHashSet<IResource>();
    if (WebflowModelUtils.isWebflowConfig(resource)) {
      resources.add(resource);
    }
    else if (JdtUtils.isClassPathFile(resource)) {
      IWebflowProject webflowProject = Activator.getModel().getProject(
          resource.getProject());
      if (webflowProject != null) {
        for (IWebflowConfig config : webflowProject.getConfigs()) {
          resources.add(config.getElementResource());
        }
      }

    }
    else if (BeansCoreUtils.isBeansConfig(resource)) {
      IBeansConfig bc = BeansCorePlugin.getModel().getConfig(
          (IFile) resource);
      IWebflowProject wp = Activator.getModel().getProject(
          resource.getProject());
      for (IWebflowConfig fc : wp.getConfigs()) {
        if (fc.getBeansConfigs().contains(bc)) {
          resources.add(fc.getElementResource());
        }

        for (IModelElement me : fc.getBeansConfigs()) {
View Full Code Here

    return beans;
  }

  public static List<IFile> getFiles(IProject project) {
    IWebflowProject webflowProject = Activator.getModel().getProject(
        project);
    List<IFile> files = new ArrayList<IFile>();
    if (webflowProject != null) {
      for (IWebflowConfig config : webflowProject.getConfigs()) {
        files.add(config.getResource());
      }
    }
    return files;
  }
View Full Code Here

      IState state = null;
      int i = stateId.lastIndexOf('#');
      String parentFlowId = stateId.substring(0, i);
      String parentStateId = stateId.substring(i + 1);

      IWebflowProject project = Activator.getModel().getProject(
          getRootElement().getElementResource().getProject());
      IWebflowConfig parentConfig = project.getConfig(parentFlowId);
      try {
        model = StructuredModelManager.getModelManager().getExistingModelForRead(
            parentConfig.getElementResource());
        if (model == null) {
          model = StructuredModelManager.getModelManager().getModelForRead(
View Full Code Here

      if (parent != null) {
        for (Object p : StringUtils.commaDelimitedListToSet(parent)) {
          IState state = null;

          IWebflowProject project = Activator.getModel().getProject(
              getRootElement().getElementResource().getProject());
          IWebflowConfig parentConfig = project.getConfig((String) p);
          try {
            model = StructuredModelManager.getModelManager().getExistingModelForRead(
                parentConfig.getElementResource());
            if (model == null) {
              model = StructuredModelManager.getModelManager().getModelForRead(
View Full Code Here

        }
      }

      if (modelElement instanceof ISpringProject) {
        IProject project = ((ISpringProject) modelElement).getProject();
        IWebflowProject webflowProject = Activator.getModel().getProject(project);
        return canFilter(webflowProject);
      }

      IInteractionElement node = ContextCore.getContextManager().getElement(
          getHandleIdentifier(obj));
View Full Code Here

TOP

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

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.