/*
* Copyright 2012 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.uberfire.client.workbench;
import javax.enterprise.context.ApplicationScoped;
import org.uberfire.client.workbench.panels.WorkbenchPanelView;
import org.uberfire.client.workbench.panels.impl.HorizontalSplitterPanel;
import org.uberfire.client.workbench.panels.impl.VerticalSplitterPanel;
import org.uberfire.workbench.model.Position;
/**
* BeanFactory using Errai IOCBeanManager to instantiate (CDI) beans
*/
@ApplicationScoped
public class NSWEExtendedDefaultBeanFactory
extends DefaultBeanFactory implements NSWEExtendedBeanFactory {
@Override
public HorizontalSplitterPanel newHorizontalSplitterPanel( final WorkbenchPanelView eastPanel,
final WorkbenchPanelView westPanel,
final Position position,
final Integer preferredSize,
final Integer preferredMinSize ) {
final HorizontalSplitterPanel hsp = iocManager.lookupBean( HorizontalSplitterPanel.class ).getInstance();
hsp.setup( eastPanel,
westPanel,
position,
preferredSize,
preferredMinSize );
return hsp;
}
@Override
public VerticalSplitterPanel newVerticalSplitterPanel( final WorkbenchPanelView northPanel,
final WorkbenchPanelView southPanel,
final Position position,
final Integer preferredSize,
final Integer preferredMinSize ) {
final VerticalSplitterPanel vsp = iocManager.lookupBean( VerticalSplitterPanel.class ).getInstance();
vsp.setup( northPanel,
southPanel,
position,
preferredSize,
preferredMinSize );
return vsp;
}
}