@Override public String getIdentifier( DockLayoutComposition composition ){ DockLayout<?> layout = composition.getLayout().getDataLayout(); if( layout != null && layout.getFactoryID().equals( KNOWN )){ PredefinedLayout predefined = (PredefinedLayout) layout.getData(); return predefined.getPredefined(); } return null; }
@Override public String getIdentifier( DockLayoutComposition composition ){ DockLayout<?> layout = composition.getLayout().getDataLayout(); if( layout != null && layout.getFactoryID().equals( KNOWN )){ PredefinedLayout predefined = (PredefinedLayout) layout.getData(); return predefined.getPredefined(); } return null; }
private void findVisible( Set<Dockable> visible, DockLayoutComposition layout ){ DockLayoutInfo info = layout.getLayout(); if( info != null ){ DockLayout<?> data = info.getDataLayout(); if( data != null ){ if( REPLACEMENT_FACTORY_ID.equals( data.getFactoryID() )){ CDockable dockable = (CDockable)data.getData(); visible.add( dockable.intern() ); } } } for( DockLayoutComposition child : layout.getChildren() ){ findVisible( visible, child ); } }
private void findVisible( Set<Dockable> visible, DockLayoutComposition layout ){ DockLayoutInfo info = layout.getLayout(); if( info != null ){ DockLayout<?> data = info.getDataLayout(); if( data != null ){ if( REPLACEMENT_FACTORY_ID.equals( data.getFactoryID() )){ CDockable dockable = (CDockable)data.getData(); visible.add( dockable.intern() ); } } } for( DockLayoutComposition child : layout.getChildren() ){ findVisible( visible, child ); } }
@SuppressWarnings("unchecked") public void setLayout( CommonDockStation<?, ?> element, CommonDockStationLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ){ String factoryId = element.getConverterID(); DockFactory<DockElement, ?, Object> factory = (DockFactory<DockElement, ?, Object>)control.intern().getDockFactory( factoryId ); if( factory == null ){ return; } layout.updateLayout( factory, placeholders ); DockLayout<?> data = layout.getLayout(); if( data == null ){ return; } if( children == null ){ factory.setLayout( element, data.getData(), placeholders ); } else{ factory.setLayout( element, data.getData(), children, placeholders ); } }
@SuppressWarnings("unchecked") public void setLayout( CommonDockStation<?, ?> element, CommonDockStationLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ){ String factoryId = element.getConverterID(); DockFactory<DockElement, ?, Object> factory = (DockFactory<DockElement, ?, Object>)control.intern().getDockFactory( factoryId ); if( factory == null ){ return; } layout.updateLayout( factory, placeholders ); DockLayout<?> data = layout.getLayout(); if( data == null ){ return; } if( children == null ){ factory.setLayout( element, data.getData(), placeholders ); } else{ factory.setLayout( element, data.getData(), children, placeholders ); } }
@SuppressWarnings("unchecked") public void estimateLocations( PredefinedLayout layout, LocationEstimationMap children ){ DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId ); if( factory != null ){ factory.estimateLocations( delegate.getDataLayout().getData(), children ); } } }
@SuppressWarnings("unchecked") public void estimateLocations( PredefinedLayout layout, LocationEstimationMap children ){ DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId ); if( factory != null ){ factory.estimateLocations( delegate.getDataLayout().getData(), children ); } } }
@SuppressWarnings("unchecked") public void estimateLocations( CommonDockStationLayout layout, LocationEstimationMap children ){ String factoryId = null; if( layout != null ){ factoryId = layout.getFactoryId(); } if( factoryId == null ){ return; } DockFactory<DockElement, ?, Object> factory = (DockFactory<DockElement, ?, Object>)control.intern().getDockFactory( factoryId ); if( factory == null ){ return; } layout.updateLayout( factory, null ); DockLayout<?> data = layout.getLayout(); if( data == null ){ return; } factory.estimateLocations( data.getData(), children ); }
@SuppressWarnings("unchecked") public void estimateLocations( CommonDockStationLayout layout, LocationEstimationMap children ){ String factoryId = null; if( layout != null ){ factoryId = layout.getFactoryId(); } if( factoryId == null ){ return; } DockFactory<DockElement, ?, Object> factory = (DockFactory<DockElement, ?, Object>)control.intern().getDockFactory( factoryId ); if( factory == null ){ return; } layout.updateLayout( factory, null ); DockLayout<?> data = layout.getLayout(); if( data == null ){ return; } factory.estimateLocations( data.getData(), children ); }
@SuppressWarnings("unchecked") public void layoutPerspective( PerspectiveElement element, PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){ DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element, perspective )){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory factory = getFactory( factoryId ); if( factory != null ){ factory.layoutPerspective( element, delegate.getDataLayout().getData(), children ); } } }
@SuppressWarnings("unchecked") public void layoutPerspective( PerspectiveElement element, PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){ DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element, perspective )){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory factory = getFactory( factoryId ); if( factory != null ){ factory.layoutPerspective( element, delegate.getDataLayout().getData(), children ); } } }
@SuppressWarnings("unchecked") public void layoutPerspective( CommonDockStationPerspective element, CommonDockStationLayout layout, Map<Integer, PerspectiveDockable> children ){ CStationPerspective station = element.getElement().asStation(); station.setRoot( layout.isRoot() ); DockFactory<?, PerspectiveElement, Object> factory = (DockFactory<?, PerspectiveElement, Object>)control.intern().getDockFactory( layout.getFactoryId() ); if( factory == null ){ return; } layout.updateLayout( factory, null ); DockLayout<?> data = layout.getLayout(); if( data == null ){ return; } factory.layoutPerspective( element, data.getData(), children ); }
@SuppressWarnings("unchecked") public void layoutPerspective( CommonDockStationPerspective element, CommonDockStationLayout layout, Map<Integer, PerspectiveDockable> children ){ CStationPerspective station = element.getElement().asStation(); station.setRoot( layout.isRoot() ); DockFactory<?, PerspectiveElement, Object> factory = (DockFactory<?, PerspectiveElement, Object>)control.intern().getDockFactory( layout.getFactoryId() ); if( factory == null ){ return; } layout.updateLayout( factory, null ); DockLayout<?> data = layout.getLayout(); if( data == null ){ return; } factory.layoutPerspective( element, data.getData(), children ); }
@Override protected DockLayoutInfo fillMissing( DockLayoutInfo info ) { DockLayout<?> layout = info.getDataLayout(); if( KNOWN.equals( layout.getFactoryID() )){ PredefinedLayout preloaded = (PredefinedLayout)layout.getData(); DockLayoutInfo delegate = preloaded.getDelegate(); DockLayoutInfo newDelegate = null; if( delegate.getKind() == DockLayoutInfo.Data.BYTE ){ newDelegate = fillMissingStream( preloaded ); } else if( delegate.getKind() == DockLayoutInfo.Data.XML ){ newDelegate = fillMissingXML( preloaded ); } if( newDelegate != null ){ info = new DockLayoutInfo( new DockLayout<PredefinedLayout>( KNOWN, new PredefinedLayout( preloaded.getPredefined(), newDelegate ))); } } return info; }
@Override protected DockLayoutInfo fillMissing( DockLayoutInfo info ) { DockLayout<?> layout = info.getDataLayout(); if( KNOWN.equals( layout.getFactoryID() )){ PredefinedLayout preloaded = (PredefinedLayout)layout.getData(); DockLayoutInfo delegate = preloaded.getDelegate(); DockLayoutInfo newDelegate = null; if( delegate.getKind() == DockLayoutInfo.Data.BYTE ){ newDelegate = fillMissingStream( preloaded ); } else if( delegate.getKind() == DockLayoutInfo.Data.XML ){ newDelegate = fillMissingXML( preloaded ); } if( newDelegate != null ){ info = new DockLayoutInfo( new DockLayout<PredefinedLayout>( KNOWN, new PredefinedLayout( preloaded.getPredefined(), newDelegate ))); } } return info; }
@SuppressWarnings("unchecked") public void setLayout( DockElement element, PredefinedLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) { DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId ); if( factory != null ){ DockController controller = element.getController(); try{ if( controller != null ) controller.freezeLayout(); factory.setLayout( element, delegate.getDataLayout().getData(), children, placeholders ); } finally{ if( controller != null ) controller.meltLayout(); } } } }
@SuppressWarnings("unchecked") public void setLayout( DockElement element, PredefinedLayout layout, Map<Integer, Dockable> children, PlaceholderStrategy placeholders ) { DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId ); if( factory != null ){ DockController controller = element.getController(); try{ if( controller != null ) controller.freezeLayout(); factory.setLayout( element, delegate.getDataLayout().getData(), children, placeholders ); } finally{ if( controller != null ) controller.meltLayout(); } } } }
@SuppressWarnings("unchecked") public void setLayout( DockElement element, PredefinedLayout layout, PlaceholderStrategy placeholders ) { DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId ); if( factory != null ){ DockController controller = element.getController(); try{ if( controller != null ) controller.freezeLayout(); factory.setLayout( element, delegate.getDataLayout().getData(), placeholders ); } finally{ if( controller != null ) controller.meltLayout(); } } } }
@SuppressWarnings("unchecked") public void setLayout( DockElement element, PredefinedLayout layout, PlaceholderStrategy placeholders ) { DockLayoutInfo delegate = layout.getDelegate(); if( delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT && shouldLayout( element )){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId ); if( factory != null ){ DockController controller = element.getController(); try{ if( controller != null ) controller.freezeLayout(); factory.setLayout( element, delegate.getDataLayout().getData(), placeholders ); } finally{ if( controller != null ) controller.meltLayout(); } } } }