* @param element the element from which the properties should be read
* @see #writeXML(XElement)
*/
public void readXML( XElement element ){
dockables.clear();
XElement delement = element.getElement( "dockables" );
if( delement != null ){
for( XElement xentry : delement.getElements( "entry" )){
DockableEntry entry = new DockableEntry();
dockables.add( entry );
entry.id = xentry.getString( "id" );
XAttribute current = xentry.getAttribute( "current" );
if( current != null )
entry.current = new Path( current.getString() );
XElement xhistory = xentry.getElement( "history" );
if( xhistory == null )
entry.history = new Path[]{};
else{
XElement[] xmodes = xhistory.getElements( "mode" );
entry.history = new Path[ xmodes.length ];
for( int i = 0; i < xmodes.length; i++ )
entry.history[i] = new Path( xmodes[i].getString() );
}
XElement xproperties = xentry.getElement( "properties" );
entry.properties = new HashMap<Path, B>();
if( xproperties != null ){
for( XElement xproperty : xproperties.getElements( "property" )){
entry.properties.put( new Path( xproperty.getString( "id" )), converter.readPropertyXML( xproperty ) );
}
}
}
}
modes.clear();
XElement melement = element.getElement( "modes" );
if( melement != null ){
for( XElement xmode : melement.getElements( "entry" )){
Path id = new Path( xmode.getString( "id" ));
ModeSettingFactory<A> factory = factories.get( id );
if( factory != null ){
ModeSetting<A> setting = factory.create();
setting.read( xmode, converter );