return null; return new CommonDockStationLayout( id, root, factoryId, new DockLayout<Object>( factoryId, data ) );
@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 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; }
factory.write( data.getData(), new DataOutputStream( bout ) ); content = bout.toByteArray();
/** * Searches for the {@link DockLayout} whose factory is set to <code>factoryId</code>. * @param factoryId the name of some {@link AdjacentDockFactory}. * @return the matching layout or <code>null</code> if not found */ public DockLayout<?> getAdjacent( String factoryId ){ if( adjacent != null ){ for( DockLayout<?> layout : adjacent ){ if( layout.getFactoryID().equals( factoryId )){ return layout; } } } return null; }
@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; }
factory.write( data.getData(), new DataOutputStream( bout ) ); content = bout.toByteArray();
/** * Searches for the {@link DockLayout} whose factory is set to <code>factoryId</code>. * @param factoryId the name of some {@link AdjacentDockFactory}. * @return the matching layout or <code>null</code> if not found */ public DockLayout<?> getAdjacent( String factoryId ){ if( adjacent != null ){ for( DockLayout<?> layout : adjacent ){ if( layout.getFactoryID().equals( factoryId )){ return layout; } } } 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; }
return null; return new CommonDockStationLayout( id, root, factoryId, new DockLayout<Object>( factoryId, data ) );
@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 ); } }
return info.getDataLayout().getFactoryID();
String factoryId = layout.getFactoryID(); Object data = layout.getData();
info = new DockLayoutInfo( new DockLayout<Object>( factoryId, data )); info.setPlaceholder( placeholder ); info = new DockLayoutInfo( new DockLayout<Object>( factoryId, data ) ); info.setPlaceholder( placeholder );
@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 ); } }
String factoryId = layout.getFactoryID(); Object data = layout.getData();
BackupFactoryData<Object> data = (BackupFactoryData<Object>)backup.read( in, getPlaceholderStrategy() ); if( data != null && data.getData() != null ){ info = new DockLayoutInfo( new DockLayout<Object>( factoryId, data.getData() )); Object delegate = factory.read( in, getPlaceholderStrategy() ); if( delegate != null ){ info = new DockLayoutInfo( new DockLayout<Object>( factoryId, delegate ));
@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 ); }
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 ); } }
BackupFactoryData<Object> data = (BackupFactoryData<Object>)backup.read( in, getPlaceholderStrategy() ); if( data != null && data.getData() != null ){ info = new DockLayoutInfo( new DockLayout<Object>( factoryId, data.getData() )); Object delegate = factory.read( in, getPlaceholderStrategy() ); if( delegate != null ){ info = new DockLayoutInfo( new DockLayout<Object>( factoryId, delegate ));