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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package org.litesoft.datt.client.boviews;

import org.litesoft.bo.views.*;
import org.litesoft.commonfoundation.base.*;
import org.litesoft.commonfoundation.typeutils.*;
import org.litesoft.core.simpletypes.*;
import org.litesoft.datt.client.support.*;

import java.util.*;

public class StoryView extends StoryViewGO implements Synopsisable {
    @Deprecated
    protected StoryView() // For Serialization
    {
    }

    public StoryView( PriorityGroup pPrioritizeToGroup ) {
        mPrioritizeToGroup = pPrioritizeToGroup;
    }

    protected StoryView( boolean pNew, org.litesoft.bo.views.TransactionSet pTransactionSet ) {
        super( pNew, pTransactionSet );
    }

    public static StoryView createNew() {
        StoryView zVO = new StoryView( true, StoryViewDataProvider.getInstance().createTransactionSet() );
        zVO.initialize();
        return zVO;
    }

    @Override
    public String getPriorityToDisplay() {
        return PriorityGroup.from( getPriority() ).toString();
    }

    @Override
    public String getDescriptionThreeLines() {
        return Strings.makeNonBlankLines( getDescription(), 3 );
    }

    @Override
    public String getSynopsis( int pLines ) {
        return Strings.makeNonBlankLines( ConstrainTo.notNull( getName() ) + "\n" + ConstrainTo.notNull( getDescription() ), 4 );
    }

    private PriorityGroup mPrioritizeToGroup;

    public PriorityGroup getPrioritizeToGroup() {
        return mPrioritizeToGroup;
    }

    @Override
    public int compareTo( StoryView them ) {
        return them.getPriority().compareTo( this.getPriority() ); // Backwards to produce Descending!
    }

    public static StoryView get( IViewObject[] pViewObjects, int pIndex ) {
        return ((pViewObjects != null) && (pIndex < pViewObjects.length)) ? (StoryView) pViewObjects[pIndex] : null;
    }

    @SuppressWarnings({"SuspiciousSystemArraycopy"})
    public static StoryView[] extract( IViewObject[] pViewObjects, int pFromIndex ) {
        if ( (pViewObjects != null) && (pFromIndex < pViewObjects.length) ) {
            StoryView[] zStoryViews = new StoryView[pViewObjects.length - pFromIndex];
            System.arraycopy( pViewObjects, pFromIndex, zStoryViews, 0, zStoryViews.length );
            return zStoryViews;
        }
        return new StoryView[0];
    }

    public static StoryView[] toArrayPaddedSorted( Set<StoryView> pViewObjects, int pEmptyPreSlots ) {
        if ( (pViewObjects != null) && !pViewObjects.isEmpty() ) {
            StoryView[] zStoryViews = new StoryView[pViewObjects.size() + pEmptyPreSlots];
            System.arraycopy( pViewObjects.toArray( new StoryView[pViewObjects.size()] ), 0, zStoryViews, pEmptyPreSlots, pViewObjects.size() );
            Arrays.sort( zStoryViews, pEmptyPreSlots, zStoryViews.length );
            return zStoryViews;
        }
        return new StoryView[pEmptyPreSlots];
    }
}

Commits for litesoft/trunk/Java/DATT/src/org/litesoft/datt/client/boviews/StoryView.java

Diff revisions: vs.
Revision Author Commited Message
950 Diff Diff GeorgeS picture GeorgeS Thu 19 Jun, 2014 17:57:04 +0000

New Lines

948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

939 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 21:30:31 +0000

Extracting commonfoundation

803 Diff Diff GeorgeS picture GeorgeS Wed 15 Aug, 2012 04:08:34 +0000
802 Diff Diff GeorgeS picture GeorgeS Wed 15 Aug, 2012 04:04:47 +0000
502 Diff Diff markcmarkc Mon 12 Sep, 2011 00:46:45 +0000
430 GeorgeS picture GeorgeS Sat 20 Aug, 2011 19:46:21 +0000