Examples of ViewState


Examples of org.apache.oodt.cas.workflow.gui.perspective.view.ViewState

        List<ModelGraph> graphs = new Vector<ModelGraph>();
        for (ModelGraph graph : repo.getGraphs())
          if (graph.getModel().getFile().equals(file))
            graphs.add(graph);
        System.out.println(graphs);
        perspective.addState(new ViewState(file, null, graphs, repo
            .getGlobalConfigGroups()));
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.gui.perspective.view.ViewState

      this.activeState = ((ViewChange.NEW_ACTIVE_STATE) change).getObject();
      this.refresh();
    } else if (change instanceof ViewChange.REFRESH_VIEW) {
      this.refresh();
    } else if (change instanceof ViewChange.STATE_NAME_CHANGE) {
      ViewState state = ((ViewChange.STATE_NAME_CHANGE) change).getObject();
      this.refresh();
    } else if (change instanceof ViewChange.VIEW_MODEL) {
      String modelId = ((ViewChange.VIEW_MODEL) change).getObject();
      for (ViewState state : this.stateViews.keySet()) {
        for (ModelGraph graph : state.getGraphs()) {
          ModelGraph found = graph.recursiveFindByModelId(modelId);
          if (found != null && !found.getModel().isRef()) {
            this.activeState = state;
            this.activeState.setSelected(found);
            break;
View Full Code Here

Examples of org.apache.oodt.cas.workflow.gui.perspective.view.ViewState

      return (View) this.tabbedPane.getSelectedComponent();
    }

    public void refresh() {
      if (this.getActiveView() != null) {
        ViewState viewState = null;
        if (this.state.getSelected() != null && findSelectedInTab) {
          TOP: for (Entry<View, ViewState> entry : this.mainViews.entrySet()) {
            for (ModelGraph graph : entry.getValue().getGraphs()) {
              ModelGraph found = graph.recursiveFindByModelId(this.state
                  .getSelected().getModel().getModelId());
              if (found != null && !found.getModel().isRef()) {
                viewState = entry.getValue();
                viewState.setSelected(found);
                this.tabbedPane.setSelectedComponent(entry.getKey());
                break TOP;
              }
            }
          }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.gui.perspective.view.ViewState

    public void stateChangeNotify(ViewChange<?> change) {
      if (change instanceof ViewChange.NEW_VIEW) {
        this.addMainView(
            createMainView(((ViewChange.NEW_VIEW) change).getObject()
                .getModel().getModelId()),
            new ViewState(this.state.getFile(), null, Collections
                .singletonList(GuiUtils.find(this.state.getGraphs(),
                    ((ViewChange.NEW_VIEW) change).getObject().getModel()
                        .getId())), this.state.getGlobalConfigGroups()));
        this.refresh();
      }
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

  public void testStateEnteringNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    listener.stateEntering(context, state);
  }
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

  public void testStateEnteringWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    SecurityRule rule = getSecurityRuleAllAuthorized();
    ((LocalAttributeMap) state.getAttributes()).put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.stateEntering(context, state);
  }
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

    }
  }

  public void testResume() {
    Flow flow = new Flow("flow");
    new ViewState(flow, "view", new StubViewFactory());
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

    }
  }

  public void testResumeException() {
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory()) {
      public void resume(RequestControlContext context) {
        throw new IllegalStateException("Oops");
      }
    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    context = new MockExternalContext();
    try {
      execution.resume(context);
    } catch (FlowExecutionException e) {
      assertEquals(flow.getId(), e.getFlowId());
      assertEquals(state.getId(), e.getStateId());
      assertEquals(1, mockListener.getResumingCount());
      assertEquals(2, mockListener.getPausedCount());
    }
  }
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

    }
  }

  public void testResumeFlowExecutionException() {
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory()) {
      public void resume(RequestControlContext context) {
        throw new FlowExecutionException("flow", "view", "oops");
      }
    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    context = new MockExternalContext();
    try {
      execution.resume(context);
    } catch (FlowExecutionException e) {
      assertEquals(flow.getId(), e.getFlowId());
      assertEquals(state.getId(), e.getStateId());
      assertEquals(1, mockListener.getResumingCount());
      assertEquals(2, mockListener.getPausedCount());
    }
  }
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

    }
  }

  public void testExecuteTransition() {
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory()) {
      public void resume(RequestControlContext context) {
        context.execute(getRequiredTransition(context));
      }
    };
    state.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("finish")));
    EndState end = new EndState(flow, "finish");
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.