@ClientOnly public class CControlPerspective extends Object
Constructor and Description |
---|
CControlPerspective(CControlAccess control)
Creates a new wrapper
|
Modifier and Type | Method and Description |
---|---|
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 . |
public CControlPerspective(CControlAccess control)
control
- the control whose perspectives are modifiedpublic 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 notpublic String[] getNames()
public CPerspective getPerspective(String name)
CControl.save(String)
.name
- the name of the stored layoutnull
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 overridden. 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 destinationIllegalArgumentException
- if source
does not point to an existing layoutIllegalArgumentException
- 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 wellpublic 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 fileroot
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 perspectiveXException
- 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 filein
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 fromIOException
- 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
ssetting
@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