|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.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 | |
---|---|
CPerspective |
createEmptyPerspective()
Creates a new CPerspective that is set up with all the stations of the CControl . |
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 |
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 . |
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) . |
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 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 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 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 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 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 format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |