|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.common.perspective.CControlPerspective
@ClientOnly public class CControlPerspective
A CControlPerspective
is a wrapper around a CControl
allowing
access to various CPerspective
s.
Constructor Summary | |
---|---|
CControlPerspective(CControlAccess control)
Creates a new wrapper |
Method Summary | |
---|---|
DockFrontendPerspective |
conversion(CPerspective perspective,
boolean includeWorkingAreas)
Creates a new DockFrontendPerspective which uses the settings from perspective to read
and write layouts. |
CPerspective |
createEmptyPerspective()
Creates a new CPerspective that is set up with all the stations of the CControl . |
CControl |
getControl()
Gets the CControl in whose realm this CControlPerspective operates. |
String[] |
getNames()
Gets the names of all the perspectives that are available. |
CPerspective |
getPerspective(boolean includeWorkingAreas)
Gets a perspective that matches the current layout of the application. |
CPerspective |
getPerspective(String name)
Gets the perspective which represents a layout that was stored using CControl.save(String) . |
CPerspective |
getPerspective(String name,
boolean includeWorkingAreas)
Gets the perspective which represents a layout that was stored using CControl.save(String) . |
CPerspective |
read(CSetting setting,
boolean includeWorkingAreas)
Creates a new CPerspective and fills it using the information from setting . |
CPerspective |
read(DataInputStream in)
Creates a new CPerspective using the information stored in in . |
CPerspective |
read(DataInputStream in,
boolean includeWorkingAreas)
Creates a new CPerspective using the information stored in in . |
CControlPerspectiveBlop |
readAll(DataInputStream in)
Emulates a call to CControl.read(DataInputStream) and returns all the layouts that are stored
in the stream in . |
CControlPerspectiveBlop |
readAllXML(XElement root)
Emulates a call to CControl.readXML(XElement) and returns all the layouts that are stored
within root . |
CPerspective |
readXML(XElement root)
Creates a new CPerspective using the information stored in root . |
CPerspective |
readXML(XElement root,
boolean includeWorkingAreas)
Creates a new CPerspective using the information stored in root . |
void |
removePerspective(String name)
Deletes the perspective with name name . |
void |
renamePerspective(String source,
String destination)
Renames the perspective source to destination . |
void |
setPerspective(CPerspective perspective,
boolean includeWorkingAreas)
Changes the layout of the associated CControl such that it matches perspective . |
void |
setPerspective(String name,
CPerspective perspective)
Stores perspective as a layout that can be selected by the user by calling
CControl.load(String) .The contents of working areas are ignored by this method. |
void |
setPerspective(String name,
CPerspective perspective,
boolean includeWorkingAreas)
Stores perspective as a layout that can be selected by the user by calling
CControl.load(String) . |
CSetting |
write(CPerspective perspective,
boolean includeWorkingAreas)
Converts perspective into a CSetting . |
void |
write(DataOutputStream out,
CPerspective perspective)
Writes the contents of perspective into out using the factories provided
by this CControlPerspective . |
void |
write(DataOutputStream out,
CPerspective perspective,
boolean includeWorkingAreas)
Writes the contents of perspective into out using the factories provided
by this CControlPerspective . |
void |
writeXML(XElement root,
CPerspective perspective)
Writes the contents of perspective into root using the factories provided
by this CControlPerspective . |
void |
writeXML(XElement root,
CPerspective perspective,
boolean includeWorkingAreas)
Writes the contents of perspective into root using the factories provided
by this CControlPerspective . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CControlPerspective(CControlAccess control)
control
- the control whose perspectives are modifiedMethod Detail |
---|
public CControl getControl()
CControl
in whose realm this CControlPerspective
operates.
public CPerspective createEmptyPerspective()
CPerspective
that is set up with all the stations of the CControl
.
There are no Dockable
s stored in the new perspective.
public CPerspective getPerspective(boolean includeWorkingAreas)
includeWorkingAreas
- whether Dockable
s that are managed by a working-area should be
included in the layout or not
public String[] getNames()
public CPerspective getPerspective(String name)
CControl.save(String)
.
name
- the name of the stored layout
null
if name
was not foundpublic CPerspective getPerspective(String name, boolean includeWorkingAreas)
CControl.save(String)
.
name
- the name of the stored layoutincludeWorkingAreas
- whether the content of working areas should be included (requires that
the layout was saved in the first place)
null
if name
was not foundpublic void setPerspective(CPerspective perspective, boolean includeWorkingAreas)
CControl
such that it matches perspective
.
perspective
- the perspective to apply, not null
includeWorkingAreas
- whether Dockable
s that are managed by a working-area should be
included in the layout or notpublic void setPerspective(String name, CPerspective perspective)
perspective
as a layout that can be selected by the user by calling
CControl.load(String)
.
name
- the name of the layoutperspective
- the new layout, not null
public void setPerspective(String name, CPerspective perspective, boolean includeWorkingAreas)
perspective
as a layout that can be selected by the user by calling
CControl.load(String)
.
name
- the name of the layoutperspective
- the new layout, not null
includeWorkingAreas
- whether the contents of working areas should be stored as wellpublic void removePerspective(String name)
name
.
name
- the name of the perspectivepublic void renamePerspective(String source, String destination)
source
to destination
. If there is already a
layout with name destination
it will be overriden. This operation works directly on the
CControl
, already existing CPerspective
s will not be affected by invoking this method.
source
- the name of the sourcedestination
- the name of the destination
IllegalArgumentException
- if source
does not point to an existing layout
IllegalArgumentException
- if either source
or destination
are null
public void writeXML(XElement root, CPerspective perspective)
perspective
into root
using the factories provided
by this CControlPerspective
.
root
- the element to write into, not null
perspective
- the perspective to write, not null
public void writeXML(XElement root, CPerspective perspective, boolean includeWorkingAreas)
perspective
into root
using the factories provided
by this CControlPerspective
.
root
- the element to write into, not null
perspective
- the perspective to write, not null
includeWorkingAreas
- whether the output contains information about children of working areas
(includeWorkingAreas = true
) or not (includeWorkingAreas = false
)public void write(DataOutputStream out, CPerspective perspective) throws IOException
perspective
into out
using the factories provided
by this CControlPerspective
.
out
- the stream to write into, not null
perspective
- the perspective to write, not null
IOException
- if out
is not writeablepublic void write(DataOutputStream out, CPerspective perspective, boolean includeWorkingAreas) throws IOException
perspective
into out
using the factories provided
by this CControlPerspective
.
out
- the stream to write into, not null
perspective
- the perspective to write, not null
includeWorkingAreas
- whether the output contains information about children of working areas
(includeWorkingAreas = true
) or not (includeWorkingAreas = false
)
IOException
- if out
is not writeablepublic CSetting write(CPerspective perspective, boolean includeWorkingAreas)
perspective
into a CSetting
.
perspective
- the perspective to convertincludeWorkingAreas
- whether the children of CWorkingArea
s should be stored as well
public CControlPerspectiveBlop readAllXML(XElement root) throws XException
CControl.readXML(XElement)
and returns all the layouts that are stored
within root
.
root
- the root xml element of a file
root
XException
- if root
is not well formedpublic CPerspective readXML(XElement root) throws XException
CPerspective
using the information stored in root
. While this method
uses the factories provided by this CControlPerspective
, the new CPerspective
is not registered
anywhere. It is the clients responsibility to call setPerspective(String, CPerspective)
or
setPerspective(CPerspective, boolean)
to actually use the result of this method.
root
- the element which contains information about a perspective
XException
- if the structure of root
is not as expectedpublic CPerspective readXML(XElement root, boolean includeWorkingAreas) throws XException
CPerspective
using the information stored in root
. While this method
uses the factories provided by this CControlPerspective
, the new CPerspective
is not registered
anywhere. It is the clients responsibility to call setPerspective(String, CPerspective)
or
setPerspective(CPerspective, boolean)
to actually use the result of this method.
root
- the element which contains information about a perspectiveincludeWorkingAreas
- whether the perspective contains information about children of working areas
(includeWorkingAreas = true
) or not (includeWorkingAreas = false
). This parameter should have the same value as was used
when calling write(DataOutputStream, CPerspective, boolean)
.
XException
- if the structure of root
is not as expectedpublic CControlPerspectiveBlop readAll(DataInputStream in) throws IOException
CControl.read(DataInputStream)
and returns all the layouts that are stored
in the stream in
.
in
- the bytes of some layout file
in
IOException
- if there is a problem reading in
or if in
is not well formedpublic CPerspective read(DataInputStream in) throws IOException
CPerspective
using the information stored in in
. While this method
uses the factories provided by this CControlPerspective
, the new CPerspective
is not registered
anywhere. It is the clients responsibility to call setPerspective(String, CPerspective)
or
setPerspective(CPerspective, boolean)
to actually use the result of this method.
in
- the stream to read data from
IOException
- if in
is not readable or in the wrong formatpublic CPerspective read(DataInputStream in, boolean includeWorkingAreas) throws IOException
CPerspective
using the information stored in in
. While this method
uses the factories provided by this CControlPerspective
, the new CPerspective
is not registered
anywhere. It is the clients responsibility to call setPerspective(String, CPerspective)
or
setPerspective(CPerspective, boolean)
to actually use the result of this method.
in
- the stream to read data fromincludeWorkingAreas
- whether the perspective contains information about children of working areas
(includeWorkingAreas = true
) or not (includeWorkingAreas = false
). This parameter should have the same value as was used
when calling write(DataOutputStream, CPerspective, boolean)
.
IOException
- if in
is not readable or in the wrong formatpublic CPerspective read(CSetting setting, boolean includeWorkingAreas)
CPerspective
and fills it using the information from setting
.
setting
- the layout to convertincludeWorkingAreas
- whether the layout contains information about children of CWorkingArea
s
setting
@FrameworkOnly public DockFrontendPerspective conversion(CPerspective perspective, boolean includeWorkingAreas)
DockFrontendPerspective
which uses the settings from perspective
to read
and write layouts. This method adds CommonSingleDockableFactory
, CommonMultipleDockableFactory
and
CommonDockStationFactory
to the perspective.
perspective
- the perspective whose settings should be used for reading or writing a layoutincludeWorkingAreas
- whether the contents of working areas
should be included in the layout or not
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |