|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.loaders.OpenSupport.Env org.openide.text.DataEditorSupport.Env
Environment that connects the data object and the CloneableEditorSupport.
Field Summary |
Fields inherited from interface org.openide.text.CloneableEditorSupport.Env |
PROP_TIME |
Fields inherited from interface org.openide.windows.CloneableOpenSupport.Env |
PROP_MODIFIED, PROP_VALID |
Constructor Summary | |
DataEditorSupport.Env(DataObject obj)
Constructor. |
Method Summary | |
protected void |
changeFile()
Method that allows subclasses to notify this environment that the file associated with this support has changed and that the environment should listen on modifications of different file object. |
CloneableOpenSupport |
findCloneableOpenSupport()
Method that allows environment to find its cloneable open support. |
protected abstract FileObject |
getFile()
Getter for file associated with this environment. |
String |
getMimeType()
Mime type of the document. |
Date |
getTime()
The time when the data has been modified |
InputStream |
inputStream()
Obtains the input stream. |
void |
markModified()
First of all tries to lock the primary file and if it succeeds it marks the data object modified. |
OutputStream |
outputStream()
Obtains the output stream. |
protected abstract FileLock |
takeLock()
Locks the file. |
void |
unmarkModified()
Reverse method that can be called to make the environment unmodified. |
Methods inherited from class org.openide.loaders.OpenSupport.Env |
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getDataObject, isModified, isValid, propertyChange, removePropertyChangeListener, removeVetoableChangeListener, vetoableChange |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.openide.windows.CloneableOpenSupport.Env |
addPropertyChangeListener, addVetoableChangeListener, isModified, isValid, removePropertyChangeListener, removeVetoableChangeListener |
Methods inherited from interface java.beans.PropertyChangeListener |
propertyChange |
Methods inherited from interface java.beans.VetoableChangeListener |
vetoableChange |
Constructor Detail |
public DataEditorSupport.Env(DataObject obj)
obj
- this support should be associated withMethod Detail |
protected abstract FileObject getFile()
protected abstract FileLock takeLock() throws IOException
IOException
- if the file cannot be lockedprotected final void changeFile()
public InputStream inputStream() throws IOException
inputStream
in interface CloneableEditorSupport.Env
IOException
- if an I/O error occurespublic OutputStream outputStream() throws IOException
outputStream
in interface CloneableEditorSupport.Env
IOException
- if an I/O error occurespublic Date getTime()
getTime
in interface CloneableEditorSupport.Env
public String getMimeType()
getMimeType
in interface CloneableEditorSupport.Env
public void markModified() throws IOException
Note: There is a contract (better saying a curse)
that this method has to call takeLock()
method
in order to keep working some special filesystem's feature.
See issue #28212.
markModified
in interface CloneableOpenSupport.Env
markModified
in class OpenSupport.Env
IOException
- if the environment cannot be marked modified
(for example when the file is readonly), when such exception
is the support should discard all previous changesFileObject.isReadOnly()
public void unmarkModified()
unmarkModified
in interface CloneableOpenSupport.Env
unmarkModified
in class OpenSupport.Env
public CloneableOpenSupport findCloneableOpenSupport()
OpenSupport.Env
findCloneableOpenSupport
in interface CloneableOpenSupport.Env
findCloneableOpenSupport
in class OpenSupport.Env
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |