KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > vfs > VirtualFileSystemView


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.vfs;
20
21 import javax.swing.Icon JavaDoc;
22
23 import org.openharmonise.vfs.metadata.*;
24
25
26 /**
27  * Interface for handlers for GUI elements that view the file system,
28  * e.g. file icons, display names etc.
29  *
30  * @author Matthew Large
31  * @version $Revision: 1.1 $
32  *
33  */

34 public interface VirtualFileSystemView {
35     
36     /**
37      * Underlying file system independant identifier for file size property.
38      */

39     public static final String JavaDoc PROP_SIZE = "size";
40     
41     /**
42      * Underlying file system independant identifier for file modification date property.
43      */

44     public static final String JavaDoc PROP_MODIFICATION_DATE = "modificationdate";
45     
46     /**
47      * Underlying file system independant identifier for file creation date property.
48      */

49     public static final String JavaDoc PROP_CREATION_DATE = "creationdate";
50     
51     /**
52      * Underlying file system independant identifier for file content type property.
53      */

54     public static final String JavaDoc PROP_CONTENT_TYPE = "contenttype";
55     
56     /**
57      * Returns an Icon for a virtual file.
58      *
59      * @param vfFile Virtual file to get icon for
60      * @return Display icon
61      */

62     public Icon JavaDoc getIcon(VirtualFile vfFile);
63     
64     /**
65      * Returns the modification date for a virtual file.
66      *
67      * @param vfFile Virtual file to get modification date for
68      * @return Modification date
69      */

70     public String JavaDoc getModificationDate(VirtualFile vfFile);
71     
72     /**
73      * Returns the publication date for a virtual file.
74      *
75      * @param vfFile Virtual file to get the publication date for
76      * @return Publication date
77      */

78     public String JavaDoc getPublicationDate(VirtualFile vfFile);
79     
80     /**
81      * Returns that archive date for a virtual file.
82      *
83      * @param vfFile Virtual file to get the archive date for
84      * @return Archive date
85      */

86     public String JavaDoc getArchiveDate(VirtualFile vfFile);
87     
88     /**
89      * Returns the content type for a virtual file
90      *
91      * @param vfFile Virtual file to get the content type for
92      * @return Content type
93      */

94     public String JavaDoc getContentType(VirtualFile vfFile);
95     
96     /**
97      * Sets the content type for a virtual file.
98      *
99      * @param vfFile Virtual file to set the content type on
100      * @param sContentType Content type
101      */

102     public void setContentType(VirtualFile vfFile, String JavaDoc sContentType);
103     
104     /**
105      * Returns the summary for a virtual file.
106      *
107      * @param vfFile Virtual file to get the summary for
108      * @return Summary
109      */

110     public String JavaDoc getSummary(VirtualFile vfFile);
111     
112     /**
113      * Returns an Icon for a virtual file that is either open or closed
114      * e.g. for directories.
115      *
116      * @param vfFile Virtual file to get icon for
117      * @param bIsDirectoryOpen True for an open file
118      * @return Icon for the file
119      */

120     public Icon JavaDoc getIcon(VirtualFile vfFile, boolean bIsDirectoryOpen);
121
122     /**
123      * Return the display name for a virtual file.
124      *
125      * @param vfFile Virtual file to get display name for
126      * @return Display name
127      */

128     public String JavaDoc getDisplayName(VirtualFile vfFile);
129     
130     public String JavaDoc getLogicalFileName(VirtualFile vfFile);
131     
132     /**
133      * Returns an Icon for the virtual file system.
134      *
135      * @return Display icon
136      */

137     public Icon JavaDoc getFileSystemIcon();
138     
139     /**
140      * Returns a display name for the virtual file system.
141      *
142      * @return Display name
143      */

144     public String JavaDoc getFileSystemDisplayName();
145     
146     /**
147      * Used to get one of a set of properties that expected to be available for all
148      * files no matter what filesystem they come from. These include file size and
149      * modification/creation dates.
150      *
151      * @param sIndependantPropName VFS independant property name
152      * @return Actual file property for requested VFS indepentant property name
153      * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_SIZE
154      * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_MODIFICATION_DATE
155      * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_CREATION_DATE
156      * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_CONTENT_TYPE
157      */

158     public PropertyInstance getVFSIndependantProperty(String JavaDoc sIndependantPropName);
159 }
160
Popular Tags