All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mplates.1.2.source-code.GWTAppActivityMapper.ftl Maven / Gradle / Ivy

<#include "license.ftl">
<@license/>
package ${doc.all.package}.gwt.mvp;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import redora.client.mvp.*;
import redora.configuration.rdo.gwt.model.*;
import redora.configuration.rdo.gwt.mvp.view.*;
import ${doc.all.package}.gwt.model.*;

public class AppActivityMapper implements ActivityMapper {

    private ClientFactory clientFactory;

    public AppActivityMapper(ClientFactory clientFactory) {
        super();
        this.clientFactory = clientFactory;
    }

    @Override
    public Activity getActivity(Place place) {
        if (place instanceof BrowsePlace) {
<#assign elseThing = "">
<#list doc["/all/object"] as model>
            ${elseThing}if ("${model.@name?lower_case}".equals(((redora.client.mvp.Place)place).name)) {
                return new BrowseActivity<${model.@name}>(${model.@name}.class, clientFactory);
    <#assign elseThing = "} else ">

            } else if ("redoratrash".equals(((redora.client.mvp.Place)place).name)) {
                return new BrowseActivity(RedoraTrash.class, clientFactory);
            } else if ("redoraconfiguration".equals(((redora.client.mvp.Place)place).name)) {
                return new BrowseActivity(RedoraConfiguration.class, clientFactory);
            }
        } else if (place instanceof EditPlace) {
<#assign elseThing = "">
<#list doc["/all/object"] as model>
            ${elseThing}if ("${model.@name?lower_case}".equals(((redora.client.mvp.Place)place).name)) {
                return new EditActivity<${model.@name}>(${model.@name}.class, clientFactory);
    <#assign elseThing = "} else ">

            } else if ("redoratrash".equals(((redora.client.mvp.Place)place).name)) {
                return new EditActivity(RedoraTrash.class, clientFactory);
            } else if ("redoraconfiguration".equals(((redora.client.mvp.Place)place).name)) {
                return new EditActivity(RedoraConfiguration.class, clientFactory);
            }
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy