public Runnable onApply( LocationModeEvent event ) {
if( event.isDone() )
return null;
Location location = event.getLocation();
Dockable dockable = event.getDockable();
if( event.getMode().getUniqueIdentifier().equals( ExternalizedMode.IDENTIFIER )){
CLocationMode last = manager.getCurrentMode( dockable );
CLocationMode secondLast = manager.getPreviousMode( dockable );
if( last != null && secondLast != null ){
if( ExternalizedMode.IDENTIFIER.equals( secondLast.getUniqueIdentifier() ) &&
MaximizedMode.IDENTIFIER.equals( last.getUniqueIdentifier() )){
MaximizedModeArea area = maximizedMode.get( location.getRoot() );
if( area == this ){
dockable = maximizedMode.getMaximizingElement( dockable );
area.setMaximized( dockable, false, null, event.getAffected() );