1 19 package org.netbeans.modules.xml.multiview.ui; 20 21 import javax.swing.*; 22 import java.awt.*; 23 24 27 public class BoxPanel extends SectionNodeInnerPanel { 28 29 34 public BoxPanel(SectionNodeView sectionNodeView) { 35 super(sectionNodeView); 36 initComponents(); 37 } 38 39 45 private void initComponents() { 47 setLayout(new javax.swing.BoxLayout (this, javax.swing.BoxLayout.Y_AXIS)); 48 49 } 51 52 55 public JComponent getErrorComponent(String errorId) { 56 final Component[] components = getComponents(); 57 for (int i = 0; i < components.length; i++) { 58 final Component component = components[i]; 59 if (component instanceof SectionInnerPanel) { 60 SectionInnerPanel panel = (SectionInnerPanel) component; 61 final JComponent errorComponent = panel.getErrorComponent(errorId); 62 if (errorComponent != null) { 63 return errorComponent; 64 } 65 } 66 } 67 return null; 68 } 69 70 public void setValue(JComponent source, Object value) { 71 72 } 73 74 public void linkButtonPressed(Object ddBean, String ddProperty) { 75 final Component[] components = getComponents(); 76 for (int i = 0; i < components.length; i++) { 77 final Component component = components[i]; 78 if (component instanceof SectionInnerPanel) { 79 SectionInnerPanel panel = (SectionInnerPanel) component; 80 panel.linkButtonPressed(ddBean, ddProperty); 81 } 82 } 83 } 84 85 public void setComponents(Component[] components) { 86 for (int i = 0; i < components.length; i++) { 87 Component component = components[i]; 88 if (i >= getComponentCount() || component != getComponent(i)) { 89 add(component, i); 90 } 91 } 92 int n = components.length; 93 while (getComponentCount() > n) { 94 remove(n); 95 } 96 } 97 99 protected void signalUIChange() { 100 } 101 } 102 | Popular Tags |