Examples of History


Examples of org.apache.abdera.ext.sharing.History

    public void testSharingFactory() throws Exception {
        Abdera abdera = new Abdera();
        Factory factory = abdera.getFactory();
        Conflicts conflicts = factory.newElement(SharingHelper.SSE_CONFLICTS);
        assertNotNull(conflicts);
        History history = factory.newElement(SharingHelper.SSE_HISTORY);
        assertNotNull(history);
        Related related = factory.newElement(SharingHelper.SSE_RELATED);
        assertNotNull(related);
        Sharing sharing = factory.newElement(SharingHelper.SSE_SHARING);
        assertNotNull(sharing);
View Full Code Here

Examples of org.apache.commons.scxml.model.History

     */
    public static void serializeHistory(final StringBuffer b, final List l,
            final String indent) {
        if (l.size() > 0) {
            for (int i = 0; i < l.size(); i++) {
                History h = (History) l.get(i);
                b.append(indent).append("<history");
                serializeTransitionTargetAttributes(b, h);
                 if (h.isDeep()) {
                     b.append(" type=\"deep\"");
                 } else {
                     b.append(" type=\"shallow\"");
                 }
                b.append(">\n");
                serializeTransition(b, h.getTransition(), indent + INDENT);
                b.append(indent).append("</history>\n");
            }
        }
    }
View Full Code Here

Examples of org.apache.commons.scxml.model.History

        while (histIter.hasNext()) {
            if (s.isSimple()) {
                logAndThrowModelError(ERR_HISTORY_SIMPLE_STATE,
                    new Object[] {getStateName(s)});
            }
            History h = (History) histIter.next();
            Transition historyTransition = h.getTransition();
            if (historyTransition == null) {
                // try to assign initial as default
                if (initialStates != null && initialStates.size() > 0) {
                    for (int i = 0; i < initialStates.size(); i++) {
                        if (initialStates.get(i) instanceof History) {
                            logAndThrowModelError(ERR_HISTORY_BAD_DEFAULT,
                                new Object[] {h.getId(), getStateName(s)});
                        }
                    }
                    historyTransition = new Transition();
                    historyTransition.getTargets().addAll(initialStates);
                    h.setTransition(historyTransition);
                } else {
                    logAndThrowModelError(ERR_HISTORY_NO_DEFAULT,
                        new Object[] {h.getId(), getStateName(s)});
                }
            }
            updateTransition(historyTransition, targets);
            List historyStates = historyTransition.getTargets();
            if (historyStates.size() == 0) {
                logAndThrowModelError(ERR_STATE_NO_HIST,
                    new Object[] {getStateName(s)});
            }
            for (int i = 0; i < historyStates.size(); i++) {
                TransitionTarget historyState = (TransitionTarget)
                    historyStates.get(i);
                if (!h.isDeep()) {
                    if (!c.containsValue(historyState)) {
                        logAndThrowModelError(ERR_STATE_BAD_SHALLOW_HIST,
                            new Object[] {getStateName(s)});
                    }
                } else {
View Full Code Here

Examples of org.apache.commons.scxml.model.History

                    s.setOnEntry(include.getOnEntry());
                    s.setOnExit(include.getOnExit());
                    s.setDatamodel(include.getDatamodel());
                    List histories = include.getHistory();
                    for (int i = 0; i < histories.size(); i++) {
                        History h = (History) histories.get(i);
                        s.addHistory(h);
                        parent.addTarget(h);
                    }
                    Iterator childIter = include.getChildren().values().iterator();
                    while (childIter.hasNext()) {
View Full Code Here

Examples of org.apache.commons.scxml.model.History

         * @param tt The transition target to import
         */
        private static void addTargets(final SCXML parent, final TransitionTarget tt) {
            Iterator histIter = tt.getHistory().iterator();
            while (histIter.hasNext()) {
                History h = (History) histIter.next();
                parent.addTarget(h);
            }
            if (tt instanceof State) {
                Iterator childIter = ((State) tt).getChildren().values().iterator();
                while (childIter.hasNext()) {
View Full Code Here

Examples of org.apache.commons.scxml.model.History

                    s.setOnEntry(include.getOnEntry());
                    s.setOnExit(include.getOnExit());
                    s.setDatamodel(include.getDatamodel());
                    List histories = include.getHistory();
                    for (int i = 0; i < histories.size(); i++) {
                        History h = (History) histories.get(i);
                        s.addHistory(h);
                        parent.addTarget(h);
                    }
                    Iterator childIter = include.getChildren().values().iterator();
                    while (childIter.hasNext()) {
View Full Code Here

Examples of org.apache.commons.scxml.model.History

         * @param tt The transition target to import
         */
        private static void addTargets(final SCXML parent, final TransitionTarget tt) {
            Iterator histIter = tt.getHistory().iterator();
            while (histIter.hasNext()) {
                History h = (History) histIter.next();
                parent.addTarget(h);
            }
            if (tt instanceof State) {
                Iterator childIter = ((State) tt).getChildren().values().iterator();
                while (childIter.hasNext()) {
View Full Code Here

Examples of org.apache.commons.scxml2.model.History

     * @param tt The TransitionTarget
     */
    public void addDescendantStatesToEnter(final SCXMLExecutionContext exctx, final Step step,
                                              final TransitionTarget tt) {
        if (tt instanceof History) {
            History h = (History) tt;
            Set<EnterableState> lastConfiguration = step.getNewHistoryConfigurations().get(h);
            if (lastConfiguration == null) {
                lastConfiguration = exctx.getScInstance().getLastConfiguration(h);
            }
            if (lastConfiguration.isEmpty()) {
                step.getDefaultHistoryTransitions().put(h.getParent(), h.getTransition());
                for (TransitionTarget dtt : h.getTransition().getTargets()) {
                    addDescendantStatesToEnter(exctx, step, dtt);
                    addAncestorStatesToEnter(exctx, step, dtt, tt.getParent());
                }
            } else {
                for (TransitionTarget dtt : lastConfiguration) {
View Full Code Here

Examples of org.apache.felix.gogo.shell.History

    private History history;

    @Before
    public void setup() {
        this.history = new History();
        for (String cmd : COMMANDS) {
            this.history.append(cmd);
        }
    }
View Full Code Here

Examples of org.apache.felix.gogo.shell.History

        }
    }

    @Test
    public void test_add_get_history() {
        final History his = new History();

        his.append("cmd1");
        Iterator<String> hi = his.getHistory();
        TestCase.assertEquals("cmd1", hi.next());
        TestCase.assertFalse(hi.hasNext());
    }
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.