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

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


  public static IWebflowConfig getActiveWebflowConfig() {
    IEditorInput editorInput = SpringUIUtils.getActiveEditor()
        .getEditorInput();
    if (editorInput != null && editorInput instanceof IFileEditorInput) {
      IWebflowProject project = org.springframework.ide.eclipse.webflow.core.Activator
          .getModel().getProject(
              ((IFileEditorInput) editorInput).getFile()
                  .getProject());
      if (project != null) {
        return project.getConfig(((IFileEditorInput) editorInput).getFile());
      }
    }
    return null;
  }
View Full Code Here


  }

  public static String[] getWebflowConfigNames() {
    IWebflowConfig webflowConfig = getActiveWebflowConfig();
    if (webflowConfig != null) {
      IWebflowProject project = webflowConfig.getProject();
      return WebflowModelUtils.getWebflowConfigNames(project).toArray(
          new String[0]);
    }
    return new String[0];
  }
View Full Code Here

    }
  }

  public IWebflowConfig getConfig(IFile configFile) {
    if (configFile != null) {
      IWebflowProject project = getProject(configFile.getProject());
      if (project != null) {
        return project.getConfig(configFile);
      }
    }
    return null;
  }
View Full Code Here

      switch (delta.getKind()) {

      case IResourceDelta.REMOVED:
        if (resource instanceof IFile) {
          IFile file = (IFile) resource;
          IWebflowProject wfProject = getProject(file.getProject());
          if (wfProject != null && wfProject.getConfig((IFile) resource) != null) {
            IWebflowConfig config = wfProject.getConfig((IFile) resource);
            List<IWebflowConfig> configs = wfProject.getConfigs();
            configs.remove(config);
            wfProject.setConfigs(configs);
          }
          return false;
        }
        break;
      }
View Full Code Here

  public void configAdded(IFile file, int eventType) {
  }

  public void configChanged(IFile file, int eventType) {
    IProject project = file.getProject();
    IWebflowProject wfp = Activator.getModel().getProject(project);
    if (wfp != null) {
      Activator.getModel().fireModelChangedEvent(wfp);
    }
  }
View Full Code Here

  }

  public static IWebflowConfig getActiveWebflowConfig() {
    WebflowEditorInput editorInput = getActiveFlowEditorInput();
    if (editorInput != null && editorInput.getFile() != null) {
      IWebflowProject project = org.springframework.ide.eclipse.webflow.core.Activator
          .getModel().getProject(editorInput.getFile().getProject());
      if (project != null) {
        return project.getConfig(editorInput.getFile());
      }
    }
    return null;
  }
View Full Code Here

    }
    return NO_METHOD_MATCHES;
  }

  public static String[] getWebflowConfigNames() {
    IWebflowProject project = getActiveWebflowConfig().getProject();
    return WebflowModelUtils.getWebflowConfigNames(project).toArray(new String[0]);
  }
View Full Code Here

  }

  protected void decorateFolder(IFolder folder, IDecoration decoration) {
    IWebflowModel model = org.springframework.ide.eclipse.webflow.core.Activator.getModel();
    if (model.hasProject(folder.getProject())) {
      IWebflowProject project = model.getProject(folder.getProject());
      String path = folder.getProjectRelativePath().toString() + '/';
      for (IWebflowConfig config : project.getConfigs()) {
        if (config.getResource().getProjectRelativePath().toString().startsWith(path)) {
          decoration.addOverlay(WebflowUIImages.DESC_OVR_WEBFLOW);
          break;
        }
      }
View Full Code Here

  }

  protected Control createContents(Composite parent) {

    // Build project model
    IWebflowProject project = getSpringProject();

    TabFolder folder = new TabFolder(parent, SWT.NONE);
    folder.setLayoutData(new GridData(GridData.FILL_BOTH));

    configFilesBlock = new WebflowConfigTab(project, getElement(), selectedModelElement);
View Full Code Here

    return folder;
  }

  public boolean performOk() {
    IWebflowProject project = getSpringProject();

    // Save config files from model in project
    if (configFilesBlock.hasUserMadeChanges()) {

      Set<IWebflowConfig> files = configFilesBlock.getConfigFiles();
      Map<IWebflowConfig, Set<IModelElement>> filesToConfig = configFilesBlock.getConfigFilesToBeansConfigs();
      Map<IWebflowConfig, String> names = configFilesBlock.getConfigFilesToNames();
      List<IWebflowConfig> webflowConfigs = new ArrayList<IWebflowConfig>();
      for (IWebflowConfig file : files) {
        WebflowConfig webflowConfig = new WebflowConfig(project);
        webflowConfig.setBeansConfigs(filesToConfig.get(file));
        webflowConfig.setResource(file.getResource());
        if (names.get(file) != null) {
          webflowConfig.setName(names.get(file));
        }
        webflowConfigs.add(webflowConfig);
      }

      // At first delete all problem markers from the removed config files
      List<IWebflowConfig> currentConfigs = project.getConfigs();
      for (IWebflowConfig currentConfig : currentConfigs) {
        if (getConfig(currentConfig.getResource(), webflowConfigs) == null) {
          MarkerUtils.deleteMarkers(currentConfig.getResource(), ValidatorDefinitionFactory
              .getValidatorDefinition(WebflowValidator.VALIDATOR_ID).getMarkerId());
        }
      }
      project.setConfigs(webflowConfigs);

      // Refresh label decoration of Spring project and config files
      WebflowModelLabelDecorator.update();
    }
    return super.performOk();
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.