KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > engines > filemanager > TableEntry


1 package org.jahia.engines.filemanager;
2
3 import org.apache.slide.webdav.util.URLUtil;
4
5 import java.io.Serializable JavaDoc;
6
7 /**
8  * Created by IntelliJ IDEA. User: toto Date: Jul 1, 2003 Time: 12:20:40 PM To change this
9  * template use Options | File Templates.
10  */

11 public class TableEntry implements Serializable JavaDoc {
12     private String JavaDoc name;
13     private String JavaDoc encodedName;
14     private String JavaDoc displayName;
15     private boolean hasChildren = false;
16     private boolean isExpanded;
17     private int indent;
18     private boolean isLastSister;
19     private String JavaDoc type;
20     private boolean canWrite;
21     private boolean canAdmin;
22     private boolean canWriteParent;
23     private boolean canAdminParent;
24     private boolean hasRevisions;
25     private boolean isLocked;
26
27     public TableEntry (String JavaDoc name, String JavaDoc displayName, boolean expanded, int indent,
28                        String JavaDoc type, boolean canWrite, boolean canAdmin, boolean canWriteParent,
29                        boolean canAdminParent, boolean hasRevisions, boolean isLocked) {
30         this.name = name;
31         this.displayName = displayName;
32         isExpanded = expanded;
33         this.indent = indent;
34         this.type = type;
35         this.canWrite = canWrite;
36         this.canAdmin = canAdmin;
37         this.canWriteParent = canWriteParent;
38         this.canAdminParent = canAdminParent;
39         this.hasRevisions = hasRevisions;
40         this.isLocked = isLocked;
41     }
42
43     public String JavaDoc getName () {
44         return name;
45     }
46
47     public String JavaDoc getDisplayName () {
48         return displayName;
49     }
50
51     public String JavaDoc getEncodedName() {
52         if (encodedName == null) {
53             encodedName = javascriptEncode(name);
54         }
55         return encodedName;
56     }
57
58     public static String JavaDoc javascriptEncode(String JavaDoc name) {
59         if (name == null) return null;
60         name = URLUtil.URLEncode(name, "UTF-8");
61         name = name.replace('%','|');
62         return name;
63     }
64
65     public static String JavaDoc javascriptDecode(String JavaDoc name) {
66         if (name == null) return null;
67         name = name.replace('|','%');
68         name = URLUtil.URLDecode(name, "UTF-8");
69         return name;
70     }
71
72     public boolean hasChildren () {
73         return hasChildren;
74     }
75
76     public void setHasChildren (boolean hasChildren) {
77         this.hasChildren = hasChildren;
78     }
79
80     public boolean isExpanded () {
81         return isExpanded;
82     }
83
84     public int getIndent () {
85         return indent;
86     }
87
88     public String JavaDoc getType () {
89         return type;
90     }
91
92     public boolean isLastSister () {
93         return isLastSister;
94     }
95
96     public void setLastSister (boolean lastSister) {
97         isLastSister = lastSister;
98     }
99
100 // public Enumeration getPermissionsList() {
101
// return permissionsList;
102
// }
103
//
104
// public Enumeration getLocksList() {
105
// return locksList;
106
// }
107

108     public boolean isCanWrite () {
109         return canWrite;
110     }
111
112     public boolean isCanAdmin () {
113         return canAdmin;
114     }
115
116     public boolean isCanWriteParent () {
117         return canWriteParent;
118     }
119
120     public boolean isCanAdminParent () {
121         return canAdminParent;
122     }
123
124     public boolean hasRevisions () {
125         return hasRevisions;
126     }
127
128     public boolean isLocked () {
129         return isLocked;
130     }
131 }
132
Popular Tags