org.noos.xing.mydoggy
Interface PersistenceDelegate


public interface PersistenceDelegate

This interface provides useful methods to save and load the tool window manager's workspace. When you request to save the workspace, all settings of ToolWindows with relative descriptors are saved. To obtain an instance of PersistenceDelegate you have to invoke the method getPersistenceDelegate of ToolWindowManager interface. So you can obtain a persistence delegate specific to a particular tool window manager.

Since:
1.2.0
Author:
Angelo De Caro (angelo.decaro@gmail.com)
See Also:
ToolWindowManager

Nested Class Summary
static class PersistenceDelegate.MergePolicy
           
 
Method Summary
 void apply(InputStream inputStream)
          Reads the settings for the ToolWindows, already registered into the manager, from the input stream.
 void merge(InputStream inputStream, PersistenceDelegate.MergePolicy mergePolicy)
          Reads the settings for the ToolWindows, already registered into the manager, from the input stream applying the passed merge policy.
 void merge(InputStream inputStream, PersistenceDelegate.MergePolicy mergePolicy, PersistenceDelegateCallback callback)
          Reads the settings for the ToolWindows, already registered into the manager, from the input stream applying the passed merge policy and using the passed callback.
 void save(OutputStream outputStream)
          Writes all settings of ToolWindows with relative descriptors to the output stream in a format suitable for loading using the apply(java.io.InputStream) method.
 void save(OutputStream outputStream, PersistenceDelegateFilter filter)
          Writes all settings that the filter accept to the output stream in a format suitable for loading using the apply(java.io.InputStream) method.
 

Method Detail

save

void save(OutputStream outputStream)
Writes all settings of ToolWindows with relative descriptors to the output stream in a format suitable for loading using the apply(java.io.InputStream) method.

After the entries have been written, the output stream is flushed. The output stream remains open after this method returns.

Look at the specific implementation for the data format.

Parameters:
outputStream - an output stream
Throws:
RuntimeException - if an error occurred when writing to the ouput stream.
Since:
1.2.0
See Also:
apply(java.io.InputStream)

save

void save(OutputStream outputStream,
          PersistenceDelegateFilter filter)
Writes all settings that the filter accept to the output stream in a format suitable for loading using the apply(java.io.InputStream) method.

After the entries have been written, the output stream is flushed. The output stream remains open after this method returns.

Look at the specific implementation for the data format.

Parameters:
outputStream - an output stream
filter - a filter used to accept or not each specific part.
Throws:
RuntimeException - if an error occurred when writing to the ouput stream.
Since:
1.5.0
See Also:
PersistenceDelegateFilter

apply

void apply(InputStream inputStream)
Reads the settings for the ToolWindows, already registered into the manager, from the input stream. By dafault the MergePolicy.RESET policy is used.

Parameters:
inputStream - the input stream.
Throws:
RuntimeException - if an error occurred when reading from the input stream.
Since:
1.2.0
See Also:
save(java.io.OutputStream), PersistenceDelegate.MergePolicy.RESET

merge

void merge(InputStream inputStream,
           PersistenceDelegate.MergePolicy mergePolicy)
Reads the settings for the ToolWindows, already registered into the manager, from the input stream applying the passed merge policy.

Parameters:
inputStream - the input stream.
mergePolicy - the merget policy used to apply settings.
Throws:
RuntimeException - if an error occurred when reading from the input stream.
Since:
1.3.0
See Also:
PersistenceDelegate.MergePolicy

merge

void merge(InputStream inputStream,
           PersistenceDelegate.MergePolicy mergePolicy,
           PersistenceDelegateCallback callback)
Reads the settings for the ToolWindows, already registered into the manager, from the input stream applying the passed merge policy and using the passed callback.

Parameters:
inputStream - the input stream.
mergePolicy - the merget policy used to apply settings.
callback - a callback object instance. It can be null.
Throws:
RuntimeException - if an error occurred when reading from the input stream.
Since:
1.5.0
See Also:
PersistenceDelegateCallback


Copyright © 2012. All Rights Reserved.