KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > editors > Editor


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.him.editors;
20
21 import org.openharmonise.vfs.*;
22 import org.openharmonise.vfs.status.*;
23
24
25 /**
26  * Interface for classes which need to act as content editors within
27  * Harmonise Information Manager.
28  *
29  * @author Matthew Large
30  * @version $Revision: 1.1 $
31  *
32  */

33 public interface Editor {
34
35     /**
36      * Opens a virtual file for editing.
37      *
38      * @param sPath Full path
39      * @param vfs Virtual file system
40      * @return Local file path to working version or null if there is no working version
41      */

42     public PathStatusWrapper open(String JavaDoc sPath, AbstractVirtualFileSystem vfs);
43     
44     /**
45      * Creates a new virtual file.
46      *
47      * @param sPath Full path
48      * @param vfs Virtual file system
49      * @return Local file path to working version or null if there is no working version
50      */

51     public PathStatusWrapper createNew(String JavaDoc sPath, AbstractVirtualFileSystem vfs);
52     
53     /**
54      * Creates a new virtual file.
55      *
56      * @param sPath Full path
57      * @param content Content for new virtual file
58      * @param vfs Virtual file system
59      * @return Local file path to working version or null if there is no working version
60      */

61     public PathStatusWrapper createNew(String JavaDoc sPath, byte[] content, AbstractVirtualFileSystem vfs);
62     
63     /**
64      * Discards any changes that have been made to a virtual file's
65      * content.
66      *
67      * @param sPath Full path
68      * @param vfs Virtual file system
69      */

70     public StatusData discardChanges(String JavaDoc sPath, AbstractVirtualFileSystem vfs);
71     
72     /**
73      * Exports the content of a virtual file.
74      *
75      * @param sPath Full path
76      * @param vfs Virtual file system
77      */

78     public StatusData export(String JavaDoc sPath, AbstractVirtualFileSystem vfs);
79     
80     /**
81      * Checks if a resource was actually created the last time one
82      * of the create new methods was called.
83      *
84      * @return true if a resource was actually created
85      */

86     public boolean hasResourceBeenCreated();
87     
88     /**
89      * Opens the virtual file in a suitable preview environment.
90      * @param sPath
91      * @param vfs
92      */

93     public PathStatusWrapper preview(String JavaDoc sPath, AbstractVirtualFileSystem vfs);
94
95     /**
96      * @param path
97      * @param vfs
98      * @return
99      */

100     public PathStatusWrapper upload(String JavaDoc path, AbstractVirtualFileSystem vfs);
101 }
102
Popular Tags