1 7 8 package org.gjt.jclasslib.browser.detail.attributes; 9 10 import org.gjt.jclasslib.browser.AbstractDetailPane; 11 import org.gjt.jclasslib.browser.BrowserServices; 12 import org.gjt.jclasslib.browser.detail.attributes.code.*; 13 14 import javax.swing.*; 15 import javax.swing.tree.TreePath ; 16 import java.awt.*; 17 18 25 public class CodeAttributeDetailPane extends AbstractDetailPane { 26 27 private JTabbedPane tabbedPane; 28 29 private ExceptionTableDetailPane exceptionTablePane; 30 private ByteCodeDetailPane byteCodePane; 31 private MiscDetailPane miscPane; 32 33 37 public CodeAttributeDetailPane(BrowserServices services) { 38 super(services); 39 } 40 41 protected void setupComponent() { 42 setLayout(new BorderLayout()); 43 44 add(buildTabbedPane(), BorderLayout.CENTER); 45 } 46 47 52 public ByteCodeDetailPane getCodeAttributeByteCodeDetailPane() { 53 return byteCodePane; 54 } 55 56 60 public void selectByteCodeDetailPane() { 61 tabbedPane.setSelectedIndex(0); 62 } 63 64 private JTabbedPane buildTabbedPane() { 65 tabbedPane = new JTabbedPane(); 66 tabbedPane.addTab("Bytecode", buildByteCodePane()); 67 tabbedPane.addTab("Exception table", buildExceptionTablePane()); 68 tabbedPane.addTab("Misc", buildMiscPane()); 69 70 return tabbedPane; 71 } 72 73 private JPanel buildByteCodePane() { 74 byteCodePane = new ByteCodeDetailPane(services); 75 return byteCodePane; 76 } 77 78 private JPanel buildExceptionTablePane() { 79 exceptionTablePane = new ExceptionTableDetailPane(services); 80 return exceptionTablePane; 81 } 82 83 private JPanel buildMiscPane() { 84 miscPane = new MiscDetailPane(services); 85 return miscPane; 86 } 87 88 public void show(TreePath treePath) { 89 90 exceptionTablePane.show(treePath); 91 byteCodePane.show(treePath); 92 miscPane.show(treePath); 93 } 94 95 } 96 97 | Popular Tags |