Package com.nexirius.framework.htmlview.function

Examples of com.nexirius.framework.htmlview.function.HTMLTransition


        //Optionally you can insert an HTMLCommand as third argument, so that the transition is only performed
        //if the execute-method of the command returns true.

        //Events are defined as buttons in the templates : $!button("eventname")
        return new HTMLTransition[]{
            new HTMLTransition(overviewState, "newPerson", newPersonState),
            new HTMLTransition(overviewState, "editPerson", editPersonState),
            new HTMLTransition(overviewState, "deletePerson", new DeletePersonCommand(), overviewState),
            new HTMLTransition(overviewState, "saveAll", new SaveAllCommand(), overviewState),
            new HTMLTransition(newPersonState, "OK", new NewPersonCommand(), overviewState),
            new HTMLTransition(newPersonState, "CANCEL", overviewState),
            new HTMLTransition(editPersonState, "OK", new EditPersonCommand(), overviewState),
            new HTMLTransition(editPersonState, "CANCEL", overviewState),
            new HTMLTransition("toggleLanguage", new ToggleLanguageCommand()),
            new HTMLTransition(overviewState, "sort", new SortPersonArrayCommand(), overviewState),
        };

       //As you could see, an HTML-State, a template and an event can have the same name.

    }
View Full Code Here


        HTMLState overview = new HTMLState("Overview", list, true, null);
        HTMLState drillDown = new HTMLState("DrillDown", null, true, TEMPLATE_DrillDown);
        HTMLState newItem = new HTMLState("NewItem", list.getSelected(), true, TEMPLATE_NewItem);

        return new HTMLTransition[]{
            new HTMLTransition(overview, HTMLFunction.EVENT_POPUP, drillDown),
            new HTMLTransition(overview, EVENT_reload, new ReloadCommand(), overview),
            new HTMLTransition(overview, "deleteItemCommand", new DeleteCommand(), overview),
            new HTMLTransition(overview, "sort", new SortItemsCommand(), overview),
            new HTMLTransition(drillDown, HTMLFunction.EVENT_OK, new UpdateCommand(), overview),
            new HTMLTransition(drillDown, HTMLFunction.EVENT_CANCEL, overview),
            new HTMLTransition(overview, "newItemCommand", newItem),
            new HTMLTransition(newItem, HTMLFunction.EVENT_OK, new NewCommand(), overview),
            new HTMLTransition(newItem, HTMLFunction.EVENT_CANCEL, overview),
            new HTMLTransition("toggleDebug", new ToggleDebugCommand()),
        };
    }
View Full Code Here

                        application.handleException(sessionVariable, e);
                    }
                }

                if (doSwitchState) {
                    HTMLTransition defaultTransition = application.getDefaultHTMLTransition(sessionVariable.getEvent());
                    HTMLState targetState = defaultTransition == null ? null : defaultTransition.getTargetState();

                    if (BackButtonHTMLFunction.BACK_EVENT.equals(sessionVariable.getEvent())) {
                        targetState = sessionVariable.getActState();
                        FWLog.debug("targetState = " + targetState.getName());
                    }
View Full Code Here

        HTMLState firstState = null;
        DataModel homeModel = createHomeModel();
        HTMLTransition[] htmlTransistions = getHTMLTransistions(homeModel);

        for (int i = 0; i < htmlTransistions.length; i++) {
            HTMLTransition htmlTransistion = htmlTransistions[i];
            HTMLState state = htmlTransistion.getState();
            String event = htmlTransistion.getEvent();

            if (state == null) {
                // register default command
                FWLog.debug("default command(" + event + ")");
                defaultTransitionMap.put(event, htmlTransistion);
            } else {
                FWLog.debug("Transition(" + state.getName() + ", " + event + ", " + htmlTransistion.getTargetState().getName() + ")");
                new Transition(state, event, htmlTransistion.getTargetState());

                if (htmlTransistion.getCommand() != null) {
                    defaultTransitionMap.put(state.getName() + "." + event, htmlTransistion);
                }

                if (firstState == null) {
                    firstState = state;
View Full Code Here

     * @param state
     * @param event
     * @return null or the registered HTMLCommand instance
     */
    public HTMLCommand getHTMLCommand(String state, String event) {
        HTMLTransition transition = ((HTMLTransition) defaultTransitionMap.get(state + "." + event));

        if (transition == null) {
            return null;
        }

        return transition.getCommand();
    }
View Full Code Here

     * Access the command which is registered with the given event (no specific state)
     * @param event
     * @return null or the registered HTMLCommand instance
     */
    public HTMLCommand getDefaultHTMLCommand(String event) {
        HTMLTransition transition = (HTMLTransition) defaultTransitionMap.get(event);

        if (transition == null) {
            return null;
        }

        return transition.getCommand();
    }
View Full Code Here

TOP

Related Classes of com.nexirius.framework.htmlview.function.HTMLTransition

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.