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

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


    }
    return null;
  }

  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 IHyperlink createHyperlink(final String name, final String target, Node node,
      Node parentNode, IDocument document, ITextViewer textViewer,
      final IRegion hyperlinkRegion, IRegion cursor) {
    IFile file = BeansEditorUtils.getFile(document);
    if (file != null && file.exists()) {
      final IWebflowConfig config = Activator.getModel().getProject(file.getProject())
          .getConfig(target);
      if (config != null) {
        return new IHyperlink() {
 
          public IRegion getHyperlinkRegion() {
            return hyperlinkRegion;
          }
 
          public String getHyperlinkText() {
            return target;
          }
 
          public String getTypeLabel() {
            return name;
          }
 
          public void open() {
            SpringUIUtils.openInEditor(config.getResource(), -1);
          }
        };
      }
    }
    return null;
View Full Code Here

      IRegion hyperlinkRegion, IRegion cursor) {
    if (BeansEditorUtils.hasAttribute(node, "bean")) {
      String bean = BeansEditorUtils.getAttribute(node, "bean");
      IFile file = BeansEditorUtils.getFile(document);
      if (file != null && file.exists()) {
        IWebflowConfig config = Activator.getModel().getProject(file.getProject()).getConfig(
            file);
        if (config != null) {
          String className = null;
          Set<IBean> beans = WebflowModelUtils.getBeans(config);
          for (IBean modelBean : beans) {
View Full Code Here

  public IHyperlink createHyperlink(String name, String target, Node node,
      Node parentNode, IDocument document, ITextViewer textViewer,
      IRegion hyperlinkRegion, IRegion cursor) {
    IFile file = BeansEditorUtils.getFile(document);
    if (file != null && file.exists()) {
      IWebflowConfig config = Activator.getModel().getProject(file.getProject()).getConfig(
          file);
      if (config != null) {
        Set<IBean> beans = WebflowModelUtils.getBeans(config);
        for (IBean bean : beans) {
          if (bean.getElementName().equals(target)) {
View Full Code Here

      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;
View Full Code Here

    this.project = project;
    this.configs = new ArrayList<IWebflowConfig>();
  }

  public IWebflowConfig addConfig(IFile file) {
    IWebflowConfig config = new WebflowConfig(project);
    config.setResource(file);
    configs.add(config);
    return config;
  }
View Full Code Here

  public List<IWebflowConfig> getConfigs() {
    return configs;
  }

  public void removeConfig(IFile file) {
    IWebflowConfig config = null;
    for (IWebflowConfig c : configs) {
      if (c.getResource().equals(file)) {
        config = c;
      }
    }
View Full Code Here

  private void handleEditButtonPressed() {
    IStructuredSelection selection = (IStructuredSelection) configsViewer
        .getSelection();
    if (!selection.isEmpty()) {
      IWebflowConfig file = (IWebflowConfig) selection.getFirstElement();
      Set<IModelElement> configs = new HashSet<IModelElement>();
      String name = file.getName();
      List<String> names = new ArrayList<String>();
      names.add(name);
      if (this.configFilesToBeansConfigs.containsKey(file)) {
        Set<IModelElement> oldConfigs = this.configFilesToBeansConfigs
            .get(file);
        configs.addAll(oldConfigs);
      }
      WebflowConfigDialog dialog = new WebflowConfigDialog(SpringUIUtils
          .getStandardDisplay().getActiveShell(),
          project.getProject(), configs, names, file.getResource());
      if (dialog.open() == Dialog.OK) {
        this.configFilesToBeansConfigs.put(file, configs);
        this.configFilesToNames.put(file, names.get(0));
        hasUserMadeChanges = true;
      }
View Full Code Here

    if (dialog.open() == ElementTreeSelectionDialog.OK) {
      Object[] selection = dialog.getResult();
      if (selection != null && selection.length > 0) {
        for (int i = 0; i < selection.length; i++) {
          IFile file = (IFile) selection[i];
          IWebflowConfig config = new WebflowConfig(project);
          config.setResource(file);
          int j = file.getName().lastIndexOf('.');
          if (j > 0) {
            config.setName(file.getName().substring(0, j));
          } else {
            config.setName(file.getName());
          }
          configFiles.add(config);
        }
        hasUserMadeChanges = true;
        configsViewer.refresh();
View Full Code Here

  }

  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,
            new NullProgressMonitor());
        return validator.getValidationProblems();
      }
View Full Code Here

TOP

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

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.