|
@@ -1,46 +1,46 @@ |
1 |
|
- |
package org.litesoft.prioritizer.client.ui.views.home; |
2 |
|
- |
|
3 |
|
- |
import org.litesoft.GWT.client.command.*; |
4 |
|
- |
import org.litesoft.GWT.client.view.*; |
5 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
6 |
|
- |
import org.litesoft.prioritizer.client.*; |
7 |
|
- |
import org.litesoft.uispecification.*; |
8 |
|
- |
|
9 |
|
- |
import com.google.gwt.user.client.ui.*; |
10 |
|
- |
|
11 |
|
- |
public class Home extends ScreenView implements ViewDefs { |
12 |
|
- |
public static final String TITLE = "Prioritizer"; |
13 |
|
- |
|
14 |
|
- |
@Override |
15 |
|
- |
protected UriFragmentIdParams createRefreshParams() { |
16 |
|
- |
return null; |
17 |
|
- |
} |
18 |
|
- |
|
19 |
|
- |
public Home() { |
20 |
|
- |
super( title( TITLE ) ); |
21 |
|
- |
addStandardTitleBar(); |
22 |
|
- |
|
23 |
|
- |
add( new BigButtonScreenHelper() { |
24 |
|
- |
@Override |
25 |
|
- |
public Widget build() { |
26 |
|
- |
// UserView zUser = ClientContext.get().get( CurrentUserViewAccessor.class ).getUser(); |
27 |
|
- |
// Role zLastRole = Role.valueFor( zUser.getLastRestrictedResourceRole() ); |
28 |
|
- |
Widget zRestrictedResource = createButton( ADMIN_RESTRICTED_RESOURCE_MANAGEMENT ); |
29 |
|
- |
if ( zRestrictedResource == null ) { |
30 |
|
- |
zRestrictedResource = createButton( ADMIN_RESTRICTED_RESOURCE_EDITOR ); |
31 |
|
- |
} |
32 |
|
- |
return addVerticallyDistributed( // |
33 |
|
- |
createSection( HOME_SECTION_STORIES, REPRIORITIZE_STORIES, CREATE_EDIT_STORY, INITIAL_PRIORITIZING_STORIES ), // |
34 |
|
- |
createSection( HOME_SECTION_ADMIN, zRestrictedResource, ADMIN_CHANGE_PASSWORD, ADMIN_MY_PROFILE, ADMIN_REPORTS, |
35 |
|
- |
ADMIN_USERS ) ); |
36 |
|
- |
} |
37 |
|
- |
|
38 |
|
- |
@Override |
39 |
|
- |
protected Widget createScreenButton( ViewDef pViewDef ) { |
40 |
|
- |
String zUiString = pViewDef.getUiString(); |
41 |
|
- |
ShowScreenCommand zScreenCommand = new ShowScreenCommand( pViewDef ); |
42 |
|
- |
return ScreenBigButton.factory( zUiString ).add( zScreenCommand ).create(); |
43 |
|
- |
} |
44 |
|
- |
}.build() ); |
45 |
|
- |
} |
46 |
|
- |
} |
|
1 |
+ |
package org.litesoft.prioritizer.client.ui.views.home; |
|
2 |
+ |
|
|
3 |
+ |
import org.litesoft.GWT.client.command.*; |
|
4 |
+ |
import org.litesoft.GWT.client.view.*; |
|
5 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
6 |
+ |
import org.litesoft.prioritizer.client.*; |
|
7 |
+ |
import org.litesoft.uispecification.*; |
|
8 |
+ |
|
|
9 |
+ |
import com.google.gwt.user.client.ui.*; |
|
10 |
+ |
|
|
11 |
+ |
public class Home extends ScreenView implements ViewDefs { |
|
12 |
+ |
public static final String TITLE = "Prioritizer"; |
|
13 |
+ |
|
|
14 |
+ |
@Override |
|
15 |
+ |
protected UriFragmentIdParams createRefreshParams() { |
|
16 |
+ |
return null; |
|
17 |
+ |
} |
|
18 |
+ |
|
|
19 |
+ |
public Home() { |
|
20 |
+ |
super( title( TITLE ) ); |
|
21 |
+ |
addStandardTitleBar(); |
|
22 |
+ |
|
|
23 |
+ |
add( new BigButtonScreenHelper() { |
|
24 |
+ |
@Override |
|
25 |
+ |
public Widget build() { |
|
26 |
+ |
// UserView zUser = ClientContext.get().get( CurrentUserViewAccessor.class ).getUser(); |
|
27 |
+ |
// Role zLastRole = Role.valueFor( zUser.getLastRestrictedResourceRole() ); |
|
28 |
+ |
Widget zRestrictedResource = createButton( ADMIN_RESTRICTED_RESOURCE_MANAGEMENT ); |
|
29 |
+ |
if ( zRestrictedResource == null ) { |
|
30 |
+ |
zRestrictedResource = createButton( ADMIN_RESTRICTED_RESOURCE_EDITOR ); |
|
31 |
+ |
} |
|
32 |
+ |
return addVerticallyDistributed( // |
|
33 |
+ |
createSection( HOME_SECTION_STORIES, REPRIORITIZE_STORIES, CREATE_EDIT_STORY, INITIAL_PRIORITIZING_STORIES ), // |
|
34 |
+ |
createSection( HOME_SECTION_ADMIN, zRestrictedResource, ADMIN_CHANGE_PASSWORD, ADMIN_MY_PROFILE, ADMIN_REPORTS, |
|
35 |
+ |
ADMIN_USERS ) ); |
|
36 |
+ |
} |
|
37 |
+ |
|
|
38 |
+ |
@Override |
|
39 |
+ |
protected Widget createScreenButton( ViewDef pViewDef ) { |
|
40 |
+ |
String zUiString = pViewDef.getUiString(); |
|
41 |
+ |
ShowScreenCommand zScreenCommand = new ShowScreenCommand( pViewDef ); |
|
42 |
+ |
return ScreenBigButton.factory( zUiString ).add( zScreenCommand ).create(); |
|
43 |
+ |
} |
|
44 |
+ |
}.build() ); |
|
45 |
+ |
} |
|
46 |
+ |
} |