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

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


    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


    String elementId = memento.getString(TAG_PATH);
    if (elementId == null) {
      return null;
    }

    IWebflowConfig config = (IWebflowConfig) Activator.getModel()
        .getElement(elementId);
    if (config != null) {
      return new WebflowEditorInput(config);
    }
    return null;
View Full Code Here

        for (IAdaptable adaptable : elements) {
          if (element.equals(adaptable)) {
            return true;
          }
          else if (adaptable instanceof IFile) {
            IWebflowConfig wc = WebflowModelUtils.getWebflowConfig(
                (IFile) adaptable);
            if (element.equals(wc)) {
              return true;
            }
          }
View Full Code Here

        catch (Exception e) {
        }
      }
    };

    IWebflowConfig config = ((WebflowEditorInput) getEditorInput())
        .getConfig();
    IWebflowConfig newConfig = org.springframework.ide.eclipse.webflow.core.Activator
        .getModel().getProject(file.getProject()).getConfig(file);

    if (newConfig == null) {
      newConfig = new WebflowConfig(config.getProject());
      newConfig.setBeansConfigs(config.getBeansConfigs());
      newConfig.setResource(file);
      List<IWebflowConfig> configs = config.getProject().getConfigs();
      configs.add(newConfig);
      config.getProject().setConfigs(configs);
    }
    else {
      newConfig.setBeansConfigs(config.getBeansConfigs());
      List<IWebflowConfig> configs = config.getProject().getConfigs();
      config.getProject().setConfigs(configs);
    }

    try {
View Full Code Here

    else if (element instanceof IFile) {
      IFile file = (IFile) element;
      return WebflowModelUtils.isWebflowConfig(file);
    }
    else if (element instanceof IWebflowConfig) {
      IWebflowConfig config = (IWebflowConfig) element;
      if (config.getBeansConfigs() != null
          && config.getBeansConfigs().size() > 0) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  protected String getText(Object element, Object parentElement) {
    if (element instanceof IWebflowProject) {
      return "Web Flow"; // TODO Externalize text
    }
    else if (element instanceof IWebflowConfig) {
      IWebflowConfig config = (IWebflowConfig) element;
      if (config.getName() != null) {
        return config.getName();
      }
      else {
        return getFileLabel(config.getResource());
      }
    }
    else if (element instanceof IFile
        && parentElement != null) {
      return getFileLabel((IFile) element);
View Full Code Here

  protected final IBean getBean() {
    IBean bean = null;
    if (getFirstSelectedEditPart() != null) {
      Object flowModelElement = getFirstSelectedEditPart().getModel();
      String beanId = null;
      IWebflowConfig config = WebflowUtils.getActiveWebflowConfig();
      if (config != null && config.getBeansConfigs() != null && config.getBeansConfigs().size() > 0) {
        if (flowModelElement instanceof Action) {
          Action action = (Action) flowModelElement;
          beanId = action.getBean();
        }
        else if (flowModelElement instanceof BeanAction) {
          BeanAction action = (BeanAction) flowModelElement;
          beanId = action.getBean();
        }
        else if (flowModelElement instanceof ExceptionHandler) {
          ExceptionHandler action = (ExceptionHandler) flowModelElement;
          beanId = action.getBean();
        }
        else if (flowModelElement instanceof AttributeMapper) {
          AttributeMapper action = (AttributeMapper) flowModelElement;
          beanId = action.getBean();
        }
      }
      if (beanId != null) {
        Set<IModelElement> configs = config.getBeansConfigs();
        for (IModelElement bc : configs) {
          if (BeansModelUtils.getBean(beanId, bc) != null) {
            bean = BeansModelUtils.getBean(beanId, bc);
            break;
          }
View Full Code Here

          final IFile newFile = ResourcesPlugin.getWorkspace()
              .getRoot().getFile(delta.getMovedToPath());
          display.asyncExec(new Runnable() {

            public void run() {
              IWebflowConfig config = ((WebflowEditorInput) getEditorInput())
                  .getConfig();
              config.setResource(newFile);
              List<IWebflowConfig> configs = config.getProject()
                  .getConfigs();
              config.getProject().setConfigs(configs);
              superSetInput(new WebflowEditorInput(config));
            }
          });
        }
      }
      else if (delta.getKind() == IResourceDelta.CHANGED) {
        if (!isDirty() || isCurrentlySaving) {
          Display display = getSite().getShell().getDisplay();
          display.asyncExec(new Runnable() {

            public void run() {
              IWebflowConfig config = ((WebflowEditorInput) getEditorInput())
                  .getConfig();
              setInput(new WebflowEditorInput(config));
              getCommandStack().flush();
              initializeGraphicalViewer();
              if (outlinePage != null) {
                outlinePage.initializeOutlineViewer();
              }
            }
          });
        }
        else if (isDirty()
            && MessageDialog
                .openQuestion(
                    Activator.getDefault().getWorkbench()
                        .getActiveWorkbenchWindow()
                        .getShell(),
                    "File Changed",
                    "The file has been changed on the file system. Do you want to load the changes?")) {
          Display display = getSite().getShell().getDisplay();
          display.asyncExec(new Runnable() {

            public void run() {
              IWebflowConfig config = ((WebflowEditorInput) getEditorInput())
                  .getConfig();
              setInput(new WebflowEditorInput(config));
              getCommandStack().flush();
              initializeGraphicalViewer();
              if (outlinePage != null) {
View Full Code Here

  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

      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(
              (IFile) parentConfig.getElementResource());
        }
        if (model != null) {
          IDOMDocument document = ((DOMModelImpl) model).getDocument();
          IWebflowState parentState = new WebflowState(parentConfig);
          parentState.init((IDOMNode) document.getDocumentElement(), null);
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.