1 19 20 package org.netbeans.modules.xml.multiview.ui; 21 22 import java.awt.*; 23 import javax.swing.*; 24 25 import org.openide.explorer.view.BeanTreeView; 26 import org.openide.windows.*; 27 28 35 36 public class TreePanelDesignEditor extends AbstractDesignEditor { 37 38 public static final int CONTENT_RIGHT = 0; 39 public static final int CONTENT_LEFT = 1; 40 41 42 public static final int DEFAULT_STRUCTURE_WIDTH = 170; 43 44 public static final int DEFAULT_STRUCTURE_HEIGHT = 300; 45 46 47 private static final String EMPTY_INSPECTOR_ICON_BASE = 48 "/org/netbeans/modules/form/resources/emptyInspector"; 50 protected JSplitPane split; 51 protected int panelOrientation; 52 53 58 public TreePanelDesignEditor(PanelView panel) { 59 super(panel); 60 initComponents(); 61 panelOrientation=CONTENT_RIGHT; 62 } 63 64 70 public TreePanelDesignEditor(PanelView panel, int orientation){ 71 this(panel); 72 panelOrientation = orientation; 73 } 74 75 protected void initComponents() { 76 add(BorderLayout.CENTER,createDesignPanel()); 77 }; 78 79 protected JComponent createDesignPanel() { 80 if (panelOrientation == CONTENT_LEFT) { 81 split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,getContentView(), getStructureView()); 82 } else { 83 split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,getStructureView(), getContentView()); 84 } 85 split.setOneTouchExpandable(true); 86 return split; 87 88 } 89 90 94 public JComponent getStructureView(){ 95 if (structureView ==null){ 96 structureView = createStructureComponent(); 97 structureView.getAccessibleContext().setAccessibleName("ACS_StructureView"); 98 structureView.getAccessibleContext().setAccessibleDescription("ACSD_StructureView"); 99 } 100 return structureView; 101 } 102 106 public JComponent createStructureComponent() { 107 return new BeanTreeView(); 108 } 109 110 114 public JComponent createPropertiesComponent(){ 115 return null; 116 } 117 118 public ErrorPanel getErrorPanel() { 119 return getContentView().getErrorPanel(); 120 } 121 122 } 123 | Popular Tags |