|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LayoutPersistence
An interface to support persist layout.
Field Summary | |
---|---|
static String |
ATTRIBUTE_PERSISTENCE_NAME
|
static String |
NODE_LAYOUT_PERSISTENCE
|
Method Summary | |
---|---|
void |
beginLoadLayoutData()
Starts a process to add/remove frame or dockable bar without showing on screen immediately. |
List<String> |
getAvailableLayouts()
Gets the list of available layout names. |
String |
getLayoutDirectory()
Gets the directory that used for storing layout files. |
String |
getLayoutPersistenceName()
Gets the persistence's name. |
byte[] |
getLayoutRawData()
Gets layout raw data in byte array. |
PersistenceUtilsCallback.Load |
getLoadCallback()
Gets the load callback to help add some customized information while loading layout from XML format. |
PersistenceUtilsCallback.Save |
getSaveCallback()
Gets the save callback to help add some customized information while saving layout to XML format. |
short |
getVersion()
Gets version number of profile. |
String |
getXmlEncoding()
Gets XML encoding while saving layout to XML format. |
boolean |
isLast()
Checks if it is the last one during when loading several several LayoutPersistence s. |
boolean |
isLayoutAvailable(String layoutName)
Checks if the layout is available. |
boolean |
isLayoutDataVersionValid(String layoutName)
Checks if the layout is valid. |
boolean |
isLoadDataSuccessful()
Checks if the loadLayoutFrom(InputStream in) method load successfully from the input stream (false indicates that it called resetToDefault to load the layout.) This method can be called immediately after the loadLayoutFrom(InputStream in) call to determine if a specific LayoutPersistence was forced to call resetToDefault. |
boolean |
isNeedFormatCheck()
Gets the flag indicating if format check is required. |
boolean |
isXmlFormat()
Gets the flag indicating if the layout should be saved to XML format by default. |
void |
loadInitialLayout(Document initialLayoutDocument)
Load initial layout from an initial layout file designed by Visual Designer. |
void |
loadInitialLayout(InputStream initialLayoutStream)
Load initial layout from an initial layout file designed by Visual Designer. |
void |
loadInitialLayout(String initialLayoutFileName)
Load initial layout from an initial layout file designed by Visual Designer. |
void |
loadLayoutData()
Loads layout from default layout data from profile. |
void |
loadLayoutDataFrom(String layoutName)
Load layout data from the profile name specified in layoutName |
void |
loadLayoutDataFromFile(String layoutFileName)
Loads layout from a file. |
boolean |
loadLayoutFrom(Document document)
Load layout data from an Node that specified as node parameter. |
boolean |
loadLayoutFrom(InputStream in)
Load layout data from an InputStream that specified as in parameter. |
void |
removeLayout(String layoutName)
Removes the layout. |
void |
resetToDefault()
Resets layout. |
void |
saveLayoutData()
Save layout data to default layout. |
void |
saveLayoutDataAs(String layoutName)
Save layout data to the layout that specified in layoutName Note: Always use all lower case. |
void |
saveLayoutDataToFile(String layoutFileName)
Save layout data to file that specified in layoutFileName . |
void |
saveLayoutTo(Document document)
Save layout data to a Document that specified as document parameter. |
void |
saveLayoutTo(OutputStream out)
Save layout data to an OutputStream that specified as out parameter. |
void |
setLast(boolean last)
Sets the LayoutPersistence as the last one (or not the last one) when loading several LayoutPersistences. |
void |
setLayoutDirectory(String layoutDirectory)
Sets the layout directory. |
void |
setLayoutPersistenceName(String layoutPersistenceName)
Sets the persistence's name. |
void |
setLayoutRawData(byte[] layoutData)
Sets the layout using layout raw data. |
void |
setLoadCallback(PersistenceUtilsCallback.Load loadCallback)
Sets the load callback to help add some customized information while loading layout from XML format. |
void |
setNeedFormatCheck(boolean needFormatCheck)
Sets the flag indicating if format check is required. |
void |
setProfileKey(String key)
Sets profile key. |
void |
setSaveCallback(PersistenceUtilsCallback.Save saveCallback)
Sets the save callback to help add some customized information while saving layout to XML format. |
void |
setUseFrameBounds(boolean useFrameBounds)
If true, the main frame will be set to the frame bounds information restored from the layout data. |
void |
setUseFrameState(boolean useFrameState)
If true, the main frame will be set to the frame state information will be restored from the layout data. |
void |
setUsePref(boolean use)
If true, we will use javax.util.pref to store the layout information. |
void |
setVersion(short version)
Sets version number of profile. |
void |
setXmlEncoding(String xmlEncoding)
Sets XML encoding while saving layout to XML format. |
void |
setXmlFormat(boolean xmlFormat)
Sets the flag indicating if the layout should be saved to XML format by default. |
Field Detail |
---|
static final String NODE_LAYOUT_PERSISTENCE
static final String ATTRIBUTE_PERSISTENCE_NAME
Method Detail |
---|
void setProfileKey(String key)
key
- the profile keyshort getVersion()
void setVersion(short version)
version
- new versionvoid setUsePref(boolean use)
usePref
is true, you will also need to call setProfileKey(String)
to specify a profile
key. HKEY_CURRENT_USER\Software\JavaSoft\Prefs
in Windows Registry. First you will see a profileKey folder (you can use setProfileKey(String)
to set
it). Then under it you will see a key with the layout name. usePref
is false, you will also need to call setLayoutDirectory(String)
to specify a
folder. If you never set a layout directory, by default the layout directory is {user.home}/.profileKey which is
actually the same on Linux/UNIX when usePref is true. saveLayoutDataToFile(String)
and loadLayoutDataFromFile(String)
use absolute file path so it will not
be affected by usePref
flag or the profileKey
or layoutDirectory
setting.
use
- use java.util.pref or not. Default is true.List<String> getAvailableLayouts()
usePref
is true and profileKey
has been
set, the method will return the list of save layouts. If usePref
is false, it will find out the
layout file in layout directory.
boolean isLayoutAvailable(String layoutName)
layoutName
- the layout name. In Window registry, the layout name is the registry key name. If it's a layout
file, the layout name is the file name with ".layout" as suffix.
void removeLayout(String layoutName)
layoutName
- the layout name. In Window registry, the layout name is the registry key name. If it's a layout
file, the layout name is the file name with ".layout" as suffix.void loadLayoutData()
void loadLayoutDataFrom(String layoutName)
layoutName. Please note: we suggest you to use
all lower cases for layoutName because we found some problems when it is upper case on Windows.
- Parameters:
layoutName
- the layout name. In Window registry, the layout name is the registry key name. If it's a layout
file, the layout name is the file name with ".layout" as suffix. Please don't add ".layout" to
invoke this method.
boolean isLayoutDataVersionValid(String layoutName)
layoutName
- the layout name. In Window registry, the layout name is the registry key name. If it's a layout
file, the layout name is the file name with ".layout" as suffix.
void loadLayoutDataFromFile(String layoutFileName)
layoutFileName
- a layout file name.boolean loadLayoutFrom(InputStream in)
InputStream
that specified as in
parameter. If any exception
happens during the read, it will call resetLayout() to use default layout.
in
- the InputStream where the layout data will be read from.
boolean loadLayoutFrom(Document document)
Node
that specified as node
parameter. If any exception
happens during the read, it will call resetLayout() to use default layout.
document
- the Document where the layout data will be read from
boolean isLoadDataSuccessful()
void saveLayoutData()
void saveLayoutDataAs(String layoutName)
layoutName
Note: Always use all lower case. I found
some problems with upper case on Windows.
layoutName
- the layout name. In Window registry, the layout name is the registry key name. If it's a layout
file, the layout name is the file name with ".layout" as suffix.void saveLayoutDataToFile(String layoutFileName)
layoutFileName
. The fileName should be full qualified
file name. If the file exists, it will be overwritten.
layoutFileName
- full path to the layout file.void saveLayoutTo(OutputStream out) throws IOException
out
parameter.
out
- the OutputStream where the layout data will be written to.
IOException
- if any IO exception happens when writing to the OutputStream
.void saveLayoutTo(Document document) throws ParserConfigurationException
document
parameter.
document
- the Document where the layout data will be written to
ParserConfigurationException
- if any parser exception happens when writing to the document
.byte[] getLayoutRawData()
setLayoutRawData
to set the layout.
void setLayoutRawData(byte[] layoutData)
layoutData
- the byte array that returned from getLayoutRawData
String getLayoutDirectory()
usePref
is false.
void setLayoutDirectory(String layoutDirectory)
usePref
is false.
layoutDirectory
- the layout directory.void resetToDefault()
void setUseFrameState(boolean useFrameState)
LayoutPersistenceManager
.
LayoutPersistenceManager
will automatically designate the last docking manager as the main one which
will set the frame state.
Please be noted that in some latest OS X version, the UI might get frozen if this flag set to true. Please try to
set this flag to false to work around in case you experience the UI frozen issue.
useFrameState
- true if the state of main frame will be restored from the layout data.setUseFrameBounds(boolean)
void setUseFrameBounds(boolean useFrameBounds)
LayoutPersistenceManager
. LayoutPersistenceManager
will automatically designate the last docking manager as the main one which will set the frame bounds.
useFrameBounds
- true if the bounds of main frame will be restored from layout data.setUseFrameState(boolean)
void beginLoadLayoutData()
boolean isLast()
LayoutPersistence
s. Only the last
LayoutPersistence
will restore the main window's state and bounds and make the main window visible.
void setLast(boolean last)
last
- true if the layout persistence is the last one in the LayoutPersistenceManager
.void loadInitialLayout(String initialLayoutFileName) throws ParserConfigurationException, SAXException, IOException
initialLayoutFileName
- the full file path to the .ilayout file.
ParserConfigurationException
- when DocumentBuilder cannot be created which satisfies the configuration
requested.
SAXException
- when DocumentBuilder has trouble parsing the initial layout xml file.
IOException
- when DocumetnBuilder encounters any errors when reading the initial layout
xml file.void loadInitialLayout(InputStream initialLayoutStream) throws ParserConfigurationException, SAXException, IOException
initialLayoutStream
- an input stream containing an initial layout.
ParserConfigurationException
- when DocumentBuilder cannot be created which satisfies the configuration
requested.
SAXException
- when DocumentBuilder has trouble parsing the initial layout xml file.
IOException
- when DocumetnBuilder encounters any errors when reading the initial layout
xml file.void loadInitialLayout(Document initialLayoutDocument)
initialLayoutDocument
- the Document contains an initial layout.boolean isXmlFormat()
setXmlFormat(boolean)
void setXmlFormat(boolean xmlFormat)
xmlFormat
- the flagPersistenceUtilsCallback.Save getSaveCallback()
void setSaveCallback(PersistenceUtilsCallback.Save saveCallback)
saveCallback
- the save call backPersistenceUtilsCallback.Load getLoadCallback()
void setLoadCallback(PersistenceUtilsCallback.Load loadCallback)
loadCallback
- the load call backString getXmlEncoding()
void setXmlEncoding(String xmlEncoding)
xmlEncoding
- the xml encodingString getLayoutPersistenceName()
LayoutPersistenceManager
manages.
void setLayoutPersistenceName(String layoutPersistenceName)
layoutPersistenceName
- the layout persistence nameboolean isNeedFormatCheck()
LayoutPersistenceManager
scenario, it will be set to false if the
format is traditional binary.
void setNeedFormatCheck(boolean needFormatCheck)
LayoutPersistenceManager
.
needFormatCheck
- the flag
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |