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

org.nakedobjects.plugins.htmlviewer.SetUser Maven / Gradle / Ivy

The newest version!
package org.nakedobjects.plugins.htmlviewer;

import org.nakedobjects.plugins.htmlviewer.component.Page;
import org.nakedobjects.plugins.htmlviewer.component.ViewPane;
import org.nakedobjects.plugins.htmlviewer.request.Action;
import org.nakedobjects.plugins.htmlviewer.request.Context;
import org.nakedobjects.runtime.authentication.standard.ExplorationSession;
import org.nakedobjects.runtime.context.NakedObjectsContext;
import org.nakedobjects.plugins.htmlviewer.request.Request;



class SetUser implements Action {

    public void execute(final Request request, final Context context, final Page page) {
        final String name = request.getName();
        final ExplorationSession session = (ExplorationSession) NakedObjectsContext.getAuthenticationSession();
        session.setName(name);

        final ViewPane content = page.getViewPane();
        content.setTitle("Exploration User changed to " + name, null);

    }

    public String name() {
        return "setuser";
    }
}

// Copyright (c) Naked Objects Group Ltd.




© 2015 - 2025 Weber Informatics LLC | Privacy Policy