|
@@ -1,78 +1,65 @@ |
1 |
1 |
|
package org.litesoft.prioritizer.client.boviews; |
2 |
2 |
|
|
3 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
4 |
|
- |
|
5 |
|
- |
import java.util.*; |
6 |
|
- |
|
7 |
3 |
|
import org.litesoft.bo.views.*; |
|
4 |
+ |
import org.litesoft.commonfoundation.typeutils.*; |
8 |
5 |
|
import org.litesoft.core.simpletypes.*; |
9 |
6 |
|
import org.litesoft.prioritizer.client.support.*; |
10 |
7 |
|
|
11 |
|
- |
public class StoryView extends StoryViewGO implements Synopsisable |
12 |
|
- |
{ |
|
8 |
+ |
import java.util.*; |
|
9 |
+ |
|
|
10 |
+ |
public class StoryView extends StoryViewGO implements Synopsisable { |
13 |
11 |
|
@Deprecated |
14 |
12 |
|
protected StoryView() // For Serialization |
15 |
13 |
|
{ |
16 |
14 |
|
} |
17 |
15 |
|
|
18 |
|
- |
public StoryView( PriorityGroup pPrioritizeToGroup ) |
19 |
|
- |
{ |
|
16 |
+ |
public StoryView( PriorityGroup pPrioritizeToGroup ) { |
20 |
17 |
|
mPrioritizeToGroup = pPrioritizeToGroup; |
21 |
18 |
|
} |
22 |
19 |
|
|
23 |
|
- |
protected StoryView( boolean pNew, org.litesoft.bo.views.TransactionSet pTransactionSet ) |
24 |
|
- |
{ |
|
20 |
+ |
protected StoryView( boolean pNew, org.litesoft.bo.views.TransactionSet pTransactionSet ) { |
25 |
21 |
|
super( pNew, pTransactionSet ); |
26 |
22 |
|
} |
27 |
23 |
|
|
28 |
|
- |
public static StoryView createNew() |
29 |
|
- |
{ |
|
24 |
+ |
public static StoryView createNew() { |
30 |
25 |
|
StoryView zVO = new StoryView( true, StoryViewDataProvider.getInstance().createTransactionSet() ); |
31 |
26 |
|
zVO.initialize(); |
32 |
27 |
|
return zVO; |
33 |
28 |
|
} |
34 |
29 |
|
|
35 |
30 |
|
@Override |
36 |
|
- |
public String getPriorityToDisplay() |
37 |
|
- |
{ |
|
31 |
+ |
public String getPriorityToDisplay() { |
38 |
32 |
|
return PriorityGroup.from( getPriority() ).toString(); |
39 |
33 |
|
} |
40 |
34 |
|
|
41 |
35 |
|
@Override |
42 |
|
- |
public String getDescriptionThreeLines() |
43 |
|
- |
{ |
|
36 |
+ |
public String getDescriptionThreeLines() { |
44 |
37 |
|
return Strings.makeNonBlankLines( getDescription(), 3 ); |
45 |
38 |
|
} |
46 |
39 |
|
|
47 |
40 |
|
@Override |
48 |
|
- |
public String getSynopsis( int pLines ) |
49 |
|
- |
{ |
|
41 |
+ |
public String getSynopsis( int pLines ) { |
50 |
42 |
|
return Strings.makeNonBlankLines( Strings.deNull( getName() ) + "\n" + Strings.deNull( getDescription() ), 4 ); |
51 |
43 |
|
} |
52 |
44 |
|
|
53 |
45 |
|
private PriorityGroup mPrioritizeToGroup; |
54 |
46 |
|
|
55 |
|
- |
public PriorityGroup getPrioritizeToGroup() |
56 |
|
- |
{ |
|
47 |
+ |
public PriorityGroup getPrioritizeToGroup() { |
57 |
48 |
|
return mPrioritizeToGroup; |
58 |
49 |
|
} |
59 |
50 |
|
|
60 |
51 |
|
@Override |
61 |
|
- |
public int compareTo( StoryView them ) |
62 |
|
- |
{ |
|
52 |
+ |
public int compareTo( StoryView them ) { |
63 |
53 |
|
return them.getPriority().compareTo( this.getPriority() ); // Backwards to produce Descending! |
64 |
54 |
|
} |
65 |
55 |
|
|
66 |
|
- |
public static StoryView get( IViewObject[] pViewObjects, int pIndex ) |
67 |
|
- |
{ |
|
56 |
+ |
public static StoryView get( IViewObject[] pViewObjects, int pIndex ) { |
68 |
57 |
|
return ((pViewObjects != null) && (pIndex < pViewObjects.length)) ? (StoryView) pViewObjects[pIndex] : null; |
69 |
58 |
|
} |
70 |
59 |
|
|
71 |
60 |
|
@SuppressWarnings({"SuspiciousSystemArraycopy"}) |
72 |
|
- |
public static StoryView[] extract( IViewObject[] pViewObjects, int pFromIndex ) |
73 |
|
- |
{ |
74 |
|
- |
if ( (pViewObjects != null) && (pFromIndex < pViewObjects.length) ) |
75 |
|
- |
{ |
|
61 |
+ |
public static StoryView[] extract( IViewObject[] pViewObjects, int pFromIndex ) { |
|
62 |
+ |
if ( (pViewObjects != null) && (pFromIndex < pViewObjects.length) ) { |
76 |
63 |
|
StoryView[] zStoryViews = new StoryView[pViewObjects.length - pFromIndex]; |
77 |
64 |
|
System.arraycopy( pViewObjects, pFromIndex, zStoryViews, 0, zStoryViews.length ); |
78 |
65 |
|
return zStoryViews; |
|
@@ -80,10 +67,8 @@ |
80 |
67 |
|
return new StoryView[0]; |
81 |
68 |
|
} |
82 |
69 |
|
|
83 |
|
- |
public static StoryView[] toArrayPaddedSorted( Set<StoryView> pViewObjects, int pEmptyPreSlots ) |
84 |
|
- |
{ |
85 |
|
- |
if ( (pViewObjects != null) && !pViewObjects.isEmpty() ) |
86 |
|
- |
{ |
|
70 |
+ |
public static StoryView[] toArrayPaddedSorted( Set<StoryView> pViewObjects, int pEmptyPreSlots ) { |
|
71 |
+ |
if ( (pViewObjects != null) && !pViewObjects.isEmpty() ) { |
87 |
72 |
|
StoryView[] zStoryViews = new StoryView[pViewObjects.size() + pEmptyPreSlots]; |
88 |
73 |
|
System.arraycopy( pViewObjects.toArray( new StoryView[pViewObjects.size()] ), 0, zStoryViews, pEmptyPreSlots, pViewObjects.size() ); |
89 |
74 |
|
Arrays.sort( zStoryViews, pEmptyPreSlots, zStoryViews.length ); |