1 19 package org.netbeans.modules.xml.multiview.test; 20 21 import org.netbeans.modules.xml.multiview.ui.SectionView; 22 import org.netbeans.modules.xml.multiview.ui.ToolBarDesignEditor; 23 import org.netbeans.modules.xml.multiview.ui.SectionInnerPanel; 24 import org.netbeans.modules.xml.multiview.test.bookmodel.*; 25 26 30 public class PanelFactory implements org.netbeans.modules.xml.multiview.ui.InnerPanelFactory { 31 private BookDataObject dObj; 32 ToolBarDesignEditor editor; 33 34 35 PanelFactory(ToolBarDesignEditor editor, BookDataObject dObj) { 36 this.dObj=dObj; 37 this.editor=editor; 38 } 39 40 public SectionInnerPanel createInnerPanel(Object key) { 41 if (key instanceof Book) return new BookPanel((SectionView)editor.getContentView(), dObj, (Book)key); 42 else return new ChapterPanel((SectionView)editor.getContentView(), dObj, (Chapter)key); 43 } 44 } 45 | Popular Tags |