KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > presentation > bookmarks > formbeans > FolderFormEx


1
2 package org.roller.presentation.bookmarks.formbeans;
3
4 import org.apache.struts.upload.FormFile;
5 import org.roller.RollerException;
6 import org.roller.pojos.FolderData;
7 import org.roller.presentation.forms.FolderForm;
8
9
10 /**
11  * Extends the FolderForm so that additional properties may be added.
12  * These properties are not persistent and are only needed for the UI.
13  *
14  * @struts.form name="folderFormEx"
15  */

16 public class FolderFormEx extends FolderForm
17 {
18     private boolean mMoveContents = false;
19     private String JavaDoc mMoveToFolderId = null;
20     private String JavaDoc[] mSelectedBookmarks = null;
21     private String JavaDoc[] mSelectedFolders = null;
22     private transient FormFile mBookmarksFile = null;
23
24     public FolderFormEx()
25     {
26         super();
27     }
28
29     public FolderFormEx(FolderData folderData, java.util.Locale JavaDoc locale) throws RollerException
30     {
31         super(folderData, locale);
32     }
33
34     public String JavaDoc getShortenedDesc()
35     {
36         if ( getDescription().length() > 20 )
37         {
38             return getDescription().substring(0,19)+"...";
39         }
40         return getDescription();
41     }
42
43     public void setShortenedDesc( String JavaDoc desc )
44     {
45         // readonly
46
}
47
48     //------------------------------------------------- Property bookmarksFile
49

50     /** Bookmark file to be imported */
51     public void setBookmarksFile(FormFile file) { mBookmarksFile = file; }
52
53     /** Bookmark file to be imported */
54     public FormFile getBookmarksFile() { return mBookmarksFile; }
55
56     //-------------------------------------------------- Property moveContents
57

58     /** If true then contents should be moved when this folder is removed */
59     public boolean getMoveContents() { return mMoveContents; }
60
61     /** If true then contents should be moved when this folder is removed */
62     public void setMoveContents( boolean flag ) { mMoveContents = flag;}
63
64     //------------------------------------------------ Property moveToFolderId
65

66     /** Folder where contents should be moved if this folder is removed */
67     public String JavaDoc getMoveToFolderId() { return mMoveToFolderId; }
68
69     /** Folder where contents should be moved if this folder is removed */
70     public void setMoveToFolderId( String JavaDoc id ) { mMoveToFolderId = id;}
71
72     //--------------------------------------------- Property selectedBookmarks
73

74     /** Get selected bookmarks */
75     public String JavaDoc[] getSelectedBookmarks() { return mSelectedBookmarks; }
76
77     /** Set selected bookmarks */
78     public void setSelectedBookmarks( String JavaDoc[] b ) { mSelectedBookmarks = b; }
79
80     //--------------------------------------------- Property selectedBookmarks
81

82     /** Get selected folders */
83     public String JavaDoc[] getSelectedFolders() { return mSelectedFolders; }
84
85     /** Set selected bookmarks */
86     public void setSelectedFolders( String JavaDoc[] f ) { mSelectedFolders = f; }
87 }
88
89
Popular Tags