Package bibliothek.util.xml

Examples of bibliothek.util.xml.XException


        conversion.getSituation().add( new CommonMultipleDockableFactory( item.getKey(), item.getValue(), control, perspective ) );
      }
     
      XElement xstations = root.getElement( "stations" );
      if( xstations == null ){
        throw new XException( "missing element 'stations'" );
      }
     
      Map<String, DockLayoutComposition> stations = conversion.getSituation().readCompositionsXML( xstations );
      factory.setStations( stations );
     
      for( DockLayoutComposition composition : stations.values() ){
        PerspectiveElement station = conversion.convert( composition );
        if( station instanceof CommonElementPerspective ){
          CStationPerspective stationPerspective = ((CommonElementPerspective)station).getElement().asStation();
          if( stationPerspective != null ){
            perspective.addStation( stationPerspective );
          }
        }
      }
     
      perspective.storeLocations();
     
      // read the last known location of all elements
      XElement xinvisible = root.getElement( "invisible" );
      if( xinvisible != null ){
        PropertyTransformer transformer = frontend.getPropertyTransformer();
        for( XElement xdockable : xinvisible.getElements( "dockable" )){
          String key = xdockable.getString( "key" );
          CDockablePerspective dockable = perspective.getDockable( key );
          if( dockable == null ){
            XElement xcontent = xdockable.getElement( "content" );
            if( xcontent != null ){
              PerspectiveElement element = conversion.convert( conversion.getSituation().readCompositionXML( xcontent ) );
                if( element instanceof CommonElementPerspective ){
                  dockable = ((CommonElementPerspective)element).getElement().asDockable();
                  if( dockable != null ){
                    perspective.putDockable( dockable );
                  }
                }   
            }
          }
          if( dockable != null ){
            XElement xlocation = xdockable.getElement( "location" );
            String locationRoot = xlocation.getString( "root" );
            DockableProperty location = transformer.readXML( xlocation );
            Path mode = new Path( xlocation.getString( "mode" ));
           
            ExtendedMode extendedMode = perspective.getLocationManager().getMode( mode );
            if( extendedMode != null ){
              dockable.getLocationHistory().add( extendedMode, new Location( mode, locationRoot, location ) );
            }
          }
        }
      }
     
     
      XElement xmodes = root.getElement( "modes" );
      if( xmodes == null ){
        throw new XException( "missing element 'modes'" );
      }
     
      ModeSettingsConverter<Location, Location> converter = new LocationSettingConverter( control.getOwner().getController() );
      ModeSettings<Location, Location> modes = control.getOwner().getLocationManager().createModeSettings( converter );
      modes.readXML( xmodes );
View Full Code Here


    XElement content = layout.getLayoutXML();
    if( content == null ){
      layout.updateLayout( factory, null );
      DockLayout<?> data = layout.getLayout();
      if( data == null ){
        throw new XException( "data are null, but data were just updated" );
      }
      content = new XElement("content");
      factory.write( data.getData(), content );
    }
   
View Full Code Here

   
    boolean root = element.getElement( "root" ).getBoolean();
   
    XElement xcontent = element.getElement( "content" );
    if( xcontent == null ){
      throw new XException( "missing content element" );
    }
   
    String factoryId = xcontent.getString( "delegate" );
    DockFactory<DockElement, ?, Object> factory = (DockFactory<DockElement, ?, Object>)control.intern().getDockFactory( factoryId );
    if( factory == null ){
View Full Code Here

TOP

Related Classes of bibliothek.util.xml.XException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.