Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package org.litesoft.initfrom.client.boviews;

import org.litesoft.GWT.client.view.*;
import org.litesoft.GWT.client.widgets.*;
import org.litesoft.security.*;

public class CurrentUserViewAccessor implements LoginPasswordResetAccessor {
    private final CurrentUserView mCurrentUserView;
    private final VACMproxy mVACMproxy;
    private UserView mUser = null;

    public CurrentUserViewAccessor( CurrentUserView pCurrentUserView, VACMproxy pVACMproxy ) {
        mCurrentUserView = (pCurrentUserView != null) ? pCurrentUserView : CurrentUserView.NULL;
        mVACMproxy = (pVACMproxy != null) ? pVACMproxy : new VACMproxy();
    }

    public void setUser( UserView pUser ) {
        mVACMproxy.setAccessControlManager( (null != (mUser = pUser)) ? //
                                            UserViewAccessControlFactory.get( mUser ) : //
                                            ViewAccessControlManager.NOTHING );
        mCurrentUserView.setUser( getDisplayName() );
    }

    public String getDisplayName() {
        return (null == mUser) ? "N/A" : mUser.getFirstName() + " " + mUser.getLastName();
    }

    public ViewAccessControlManager getVACM() {
        return mVACMproxy;
    }

    public UserView getUser() {
        return mUser;
    }

    @Override
    public boolean isPasswordResetRequired() {
        return (mUser != null) && Boolean.TRUE.equals( mUser.getResetPassword() );
    }
}

Commits for litesoft/trunk/GWT_Sandbox/InitFrom/src/org/litesoft/initfrom/client/boviews/CurrentUserViewAccessor.java

Diff revisions: vs.
Revision Author Commited Message
948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

459 GeorgeS picture GeorgeS Sun 21 Aug, 2011 00:42:41 +0000