@SuppressWarnings("unchecked") public PerspectiveElement layoutPerspective( PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){ if( perspective == null ){ throw new IllegalStateException( "the perspective of this factory is not set, meaning this factory cannot be used handling perspective dependent tasks" ); } DockLayoutInfo delegate = layout.getDelegate(); boolean isLayout = delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT; boolean isNull = delegate.getKind() == DockLayoutInfo.Data.NULL; if( !isLayout && !isNull ){ return null; } PerspectiveElement element = perspective.get( layout.getPredefined() ); if( element == null && isLayout ){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory factory = getBackup( factoryId ); if( factory != null ){ return factory.layoutPerspective(new BackupFactoryData<Object>( layout.getPredefined(), delegate.getDataLayout().getData()), children ); } return null; } layoutPerspective( element, layout, children ); return element; }
@SuppressWarnings("unchecked") public PerspectiveElement layoutPerspective( PredefinedLayout layout, Map<Integer, PerspectiveDockable> children ){ if( perspective == null ){ throw new IllegalStateException( "the perspective of this factory is not set, meaning this factory cannot be used handling perspective dependent tasks" ); } DockLayoutInfo delegate = layout.getDelegate(); boolean isLayout = delegate.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT; boolean isNull = delegate.getKind() == DockLayoutInfo.Data.NULL; if( !isLayout && !isNull ){ return null; } PerspectiveElement element = perspective.get( layout.getPredefined() ); if( element == null && isLayout ){ String factoryId = delegate.getDataLayout().getFactoryID(); DockFactory factory = getBackup( factoryId ); if( factory != null ){ return factory.layoutPerspective(new BackupFactoryData<Object>( layout.getPredefined(), delegate.getDataLayout().getData()), children ); } return null; } layoutPerspective( element, layout, children ); return element; }