001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.vfs;
020:
021: import javax.swing.Icon;
022:
023: import org.openharmonise.vfs.metadata.*;
024:
025: /**
026: * Interface for handlers for GUI elements that view the file system,
027: * e.g. file icons, display names etc.
028: *
029: * @author Matthew Large
030: * @version $Revision: 1.1 $
031: *
032: */
033: public interface VirtualFileSystemView {
034:
035: /**
036: * Underlying file system independant identifier for file size property.
037: */
038: public static final String PROP_SIZE = "size";
039:
040: /**
041: * Underlying file system independant identifier for file modification date property.
042: */
043: public static final String PROP_MODIFICATION_DATE = "modificationdate";
044:
045: /**
046: * Underlying file system independant identifier for file creation date property.
047: */
048: public static final String PROP_CREATION_DATE = "creationdate";
049:
050: /**
051: * Underlying file system independant identifier for file content type property.
052: */
053: public static final String PROP_CONTENT_TYPE = "contenttype";
054:
055: /**
056: * Returns an Icon for a virtual file.
057: *
058: * @param vfFile Virtual file to get icon for
059: * @return Display icon
060: */
061: public Icon getIcon(VirtualFile vfFile);
062:
063: /**
064: * Returns the modification date for a virtual file.
065: *
066: * @param vfFile Virtual file to get modification date for
067: * @return Modification date
068: */
069: public String getModificationDate(VirtualFile vfFile);
070:
071: /**
072: * Returns the publication date for a virtual file.
073: *
074: * @param vfFile Virtual file to get the publication date for
075: * @return Publication date
076: */
077: public String getPublicationDate(VirtualFile vfFile);
078:
079: /**
080: * Returns that archive date for a virtual file.
081: *
082: * @param vfFile Virtual file to get the archive date for
083: * @return Archive date
084: */
085: public String getArchiveDate(VirtualFile vfFile);
086:
087: /**
088: * Returns the content type for a virtual file
089: *
090: * @param vfFile Virtual file to get the content type for
091: * @return Content type
092: */
093: public String getContentType(VirtualFile vfFile);
094:
095: /**
096: * Sets the content type for a virtual file.
097: *
098: * @param vfFile Virtual file to set the content type on
099: * @param sContentType Content type
100: */
101: public void setContentType(VirtualFile vfFile, String sContentType);
102:
103: /**
104: * Returns the summary for a virtual file.
105: *
106: * @param vfFile Virtual file to get the summary for
107: * @return Summary
108: */
109: public String getSummary(VirtualFile vfFile);
110:
111: /**
112: * Returns an Icon for a virtual file that is either open or closed
113: * e.g. for directories.
114: *
115: * @param vfFile Virtual file to get icon for
116: * @param bIsDirectoryOpen True for an open file
117: * @return Icon for the file
118: */
119: public Icon getIcon(VirtualFile vfFile, boolean bIsDirectoryOpen);
120:
121: /**
122: * Return the display name for a virtual file.
123: *
124: * @param vfFile Virtual file to get display name for
125: * @return Display name
126: */
127: public String getDisplayName(VirtualFile vfFile);
128:
129: public String getLogicalFileName(VirtualFile vfFile);
130:
131: /**
132: * Returns an Icon for the virtual file system.
133: *
134: * @return Display icon
135: */
136: public Icon getFileSystemIcon();
137:
138: /**
139: * Returns a display name for the virtual file system.
140: *
141: * @return Display name
142: */
143: public String getFileSystemDisplayName();
144:
145: /**
146: * Used to get one of a set of properties that expected to be available for all
147: * files no matter what filesystem they come from. These include file size and
148: * modification/creation dates.
149: *
150: * @param sIndependantPropName VFS independant property name
151: * @return Actual file property for requested VFS indepentant property name
152: * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_SIZE
153: * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_MODIFICATION_DATE
154: * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_CREATION_DATE
155: * @see org.openharmonise.vfs.VirtualFileSystemView#PROP_CONTENT_TYPE
156: */
157: public PropertyInstance getVFSIndependantProperty(
158: String sIndependantPropName);
159: }
|