Package bibliothek.gui.dock.common

Examples of bibliothek.gui.dock.common.SingleCDockable


    }

    public CommonSingleDockableLayout getLayout( CommonDockable element, Map<Dockable, Integer> children ) {
        CDockable dockable = element.getDockable();
        if( dockable instanceof SingleCDockable ){
            SingleCDockable single = (SingleCDockable)dockable;
            CommonSingleDockableLayout layout = new CommonSingleDockableLayout();
            layout.setId( single.getUniqueId() );
            layout.setArea( single.getWorkingArea() == null ? null : single.getWorkingArea().getUniqueId() );
            return layout;
        }
        else
            throw new IllegalArgumentException( "A CommonSingleDockableFactory works only with Dockables of type SingleCDockable, but this is not a single dockable: " + element );
    }
View Full Code Here


    public CommonDockable layout( CommonSingleDockableLayout layout, PlaceholderStrategy placeholders ) {
        SingleCDockableFactory backup = getFactory( layout.getId() );
        if( backup == null )
            return null;
       
        SingleCDockable dockable = backup.createBackup( layout.getId() );
        if( dockable == null )
            return null;
       
        String factoryId = dockable.intern().getFactoryID();
        if( !factoryId.equals( getID() )){
          throw new IllegalArgumentException( "Wrong type of dockable for unique id '" + layout.getId() + "': The backup factory created a dockable which expects a factory with type-id '" + factoryId +
              "',  but the call was done from a factory with type-id '" + getID() + "'" );
        }
       
        control.addDockable( dockable );
        if( layout.isAreaSet()){
          if( layout.getArea() != null ){
            CStation<?> station = control.getStation( layout.getArea() );
            if( station == null ){
              DelayedWorkingAreaSetter setter = new DelayedWorkingAreaSetter( layout.getArea(), dockable, control );
              setter.install();
            }
            else {
              dockable.setWorkingArea( station );
            }
          }
          else{
            dockable.setWorkingArea( null );
          }
        }
        return dockable.intern();
    }
View Full Code Here

      SingleCDockableFactory factory = singleDockableFactory.getFactory( id );
      if( factory == null ){
        return null;
      }
     
      SingleCDockable dockable = factory.createBackup( id );
      if( dockable == null ){
        return null;
      }
     
        String factoryId = dockable.intern().getFactoryID();
        if( !factoryId.equals( getID() )){
          throw new IllegalArgumentException( "Wrong type of dockable for unique id '" + id + "': The backup factory created a dockable which expects a factory of type '" + factoryId +
              "',  but the call was done from a factory of type '" + getID() + "'" );
        }
       
      CStation<?> station = dockable.asStation();
      if( station == null ){
        System.err.println( "unique identifier '" + id + "' was supposed to be a CStation, but factory created a dockable" );
        return null;
      }
     
View Full Code Here

      control.addStation( station, root );
    }
    CDockable dockable = station.asDockable();
    if( dockable != null ){
      if( dockable instanceof SingleCDockable ){
        SingleCDockable single = (SingleCDockable)dockable;
        if( control.getSingleDockable( single.getUniqueId() ) != single ){
          control.addDockable( single );
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of bibliothek.gui.dock.common.SingleCDockable

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.