Package bibliothek.gui.dock.common.mode

Examples of bibliothek.gui.dock.common.mode.CLocationModeManager


    }
   
    @Override
    protected Setting createSetting() {
        CSetting setting = new CSetting();
        CLocationModeManager manager = control.getLocationManager();
        ModeSettings<Location, Location> modeSettings = manager.createSettings( new LocationSettingConverter( getController() ) );
        setting.setModes( modeSettings );
        return setting;
    }
View Full Code Here


        return setting;
    }

    @Override
    public Setting getSetting( boolean entry ) {
      CLocationModeManager manager = control.getLocationManager();
     
      CSetting setting = (CSetting)super.getSetting( entry );
       
        ModeSettings<Location, Location> modeSettings = manager.createSettings( new LocationSettingConverter( getController() ) );
        setting.setModes( modeSettings );
        manager.writeSettings( modeSettings );
       
        return setting;
    }
View Full Code Here

    public void setSetting( final Setting setting, final boolean entry ) {
      for( CDockFrontendListener listener : frontendListeners() ){
        listener.loading( this, (CSetting)setting );
      }
      try{
        CLocationModeManager manager = control.getLocationManager();
          if( entry ){
              manager.resetWorkingAreaChildren();
          }
 
          // location manager reads first to be able to change modes of dockables
          manager.readSettings( ((CSetting)setting).getModes() );
 
          // set new layout as transaction, preventing the manager to react on events
          manager.runLayoutTransaction( new Runnable() {
        public void run(){
          CDockFrontend.super.setSetting( setting, entry );   
        }
          });

          if( revertToBasicModes ){
            manager.ensureBasicModes();
          }
          manager.refresh();
      }
      finally{
        for( CDockFrontendListener listener : frontendListeners() ){
            listener.loaded( this, (CSetting)setting );
         
View Full Code Here

 
  @Override
  public void setFocusedDockable( FocusRequest request ){
    if( request.getSource() != null ){
      Dockable focusedDockable = request.getSource().getElement().asDockable();
      CLocationModeManager states = owner.getLocationManager();
      if( states != null && !states.isOnTransaction() && focusedDockable != null ){
        states.ensureNotHidden( focusedDockable );
      }
    }
    super.setFocusedDockable( request );
  }
View Full Code Here

        throw new IllegalStateException( "dockable is registered at another CControl" );
      }
      if( dockable.getWorkingArea() != getWorkingArea() ){
        throw new IllegalArgumentException( "dockable has another working-area as this" );
      }
      CLocationModeManager locationManager = getControl().getLocationManager();
      locationManager.setLocationAside( intern(), dockable.intern() );
     
      CLocationMode mode = locationManager.getCurrentMode( dockable.intern() );
      if( mode != null ){
        setLocation( new CExtendedModeLocation( mode.getExtendedMode() ) );
      }
    }
View Full Code Here

          }
         
            defaultLocations.put( mode, location );
       
            if( control != null ){
                CLocationModeManager state = control.getLocationManager();
                if( state.getLocation( intern(), mode ) == null )
                    state.setLocation( intern(), mode, location );
            }
        }
    }
View Full Code Here

                    return listenerCollection.getDoubleClickListener();
                }
                public void setUniqueId( String id ) {
                  if( (id != null && !id.equals( uniqueId )) || (id == null && uniqueId != null) ){
                    if( AbstractCDockable.this.control != null && uniqueId != null ){
                      CLocationModeManager manager = AbstractCDockable.this.control.getLocationManager();
                      manager.remove( intern() );
                    }
                   
                      uniqueId = id;
                     
                      if( AbstractCDockable.this.control != null && id != null ){
                          CLocationModeManager manager = AbstractCDockable.this.control.getLocationManager();
                          manager.put( uniqueId, intern() );
                         
                          for( Map.Entry<ExtendedMode, CLocation> location : defaultLocations.entrySet() ){
                              if( manager.getLocation( intern(), location.getKey() ) == null )
                                  manager.setLocation( intern(), location.getKey(), location.getValue() );
                          }
                      }
                  }
                }
               
View Full Code Here

    /**
     * Sets up the {@link #locationManager}.
     */
    private void initExtendedModes(){
      locationManager = new CLocationModeManager( access );
      locationManager.setHistoryRewriter( new CStationContainerHistoryRewriter( this ) );
      initExternalizeArea();
    }
View Full Code Here

    initLocations();
  }
 
  private void initLocations(){
    locationModeManager = new LocationModeManagerPerspective( this, control );
    CLocationModeManager manager = control.getLocationManager();
   
    for( CLocationMode mode : manager.modes() ){
      LocationModePerspective perspective = mode.createPerspective();
      if( perspective != null ){
        locationModeManager.addMode( perspective );
      }
      else{
View Full Code Here

        return false;
      }
    }
   
    public boolean accept( DockStation parent, Dockable child ) {
      CLocationModeManager manager = control.getLocationManager();
      if( manager.isOnTransaction() ){
        CGroupMovement action = manager.getCurrentAction();
        if( action == null || action.forceAccept( parent, child )){
          return true;
        }
      }
     
      ExtendedMode extendedMode = manager.childsExtendedMode( parent );
      if( extendedMode == null ){
        extendedMode = manager.getMode( child )
        if( extendedMode == null ){
          return true;
        }
      }
     
      CLocationMode mode = manager.getMode( extendedMode.getModeIdentifier() );
      if( mode == null )
        return true;
     
      if( !mode.respectWorkingAreas( parent ) ){
        return true;
View Full Code Here

TOP

Related Classes of bibliothek.gui.dock.common.mode.CLocationModeManager

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.