File tree Expand file tree Collapse file tree 4 files changed +307
-262
lines changed
java/org/woehlke/simpleworklist Expand file tree Collapse file tree 4 files changed +307
-262
lines changed Original file line number Diff line number Diff line change 99import org .woehlke .simpleworklist .context .Context ;
1010import org .woehlke .simpleworklist .project .Project ;
1111import org .woehlke .simpleworklist .task .TaskService ;
12+ import org .woehlke .simpleworklist .taskstate .TaskState ;
1213import org .woehlke .simpleworklist .user .account .UserAccount ;
1314import org .woehlke .simpleworklist .task .TaskEnergy ;
1415import org .woehlke .simpleworklist .task .TaskTime ;
2223import org .woehlke .simpleworklist .user .account .UserAccountAccessService ;
2324import org .woehlke .simpleworklist .user .login .UserAccountLoginSuccessService ;
2425
26+ import java .util .ArrayList ;
2527import java .util .List ;
2628import java .util .Locale ;
2729
@@ -96,6 +98,15 @@ public final List<Context> getContexts(){
9698 return contextService .getAllForUser (user );
9799 }
98100
101+ @ ModelAttribute ("listTaskState" )
102+ public final List <TaskState > getTaskStates (){
103+ List <TaskState > listTaskState = new ArrayList <>(TaskState .values ().length );
104+ for (TaskState taskState :TaskState .values ()){
105+ listTaskState .add (taskState );
106+ }
107+ return listTaskState ;
108+ }
109+
99110 @ ModelAttribute ("context" )
100111 public final String getCurrentArea (@ ModelAttribute ("userSession" ) UserSessionBean userSession ,
101112 Locale locale ){
Original file line number Diff line number Diff line change 11package org .woehlke .simpleworklist .taskstate ;
22
3+ import org .woehlke .simpleworklist .task .TaskEnergy ;
4+
35import javax .persistence .Enumerated ;
46import javax .persistence .Transient ;
57import java .io .Serializable ;
8+ import java .util .Arrays ;
9+ import java .util .List ;
610
711/**
812 * Created by tw on 21.02.16.
@@ -40,6 +44,14 @@ public enum TaskState implements Serializable {
4044 this .icon =icon ;
4145 }
4246
47+ public int getId (){
48+ return this .ordinal ();
49+ }
50+
51+ public String getValue (){
52+ return this .name ();
53+ }
54+
4355 public String getCode () {
4456 return "layout.page." +this .name ().toLowerCase ();
4557 }
@@ -48,6 +60,11 @@ public String getUrl() {
4860 return "/taskstate/" +this .name ().toLowerCase ();
4961 }
5062
63+ public static List <TaskState > list () {
64+ return Arrays .asList (values ());
65+ }
66+
67+
5168 public String getIcon () {
5269 return icon ;
5370 }
You can’t perform that action at this time.
0 commit comments