1 7 8 package org.gjt.jclasslib.browser.detail.constants; 9 10 import org.gjt.jclasslib.browser.BrowserServices; 11 import org.gjt.jclasslib.structures.InvalidByteCodeException; 12 import org.gjt.jclasslib.structures.constants.ConstantLongInfo; 13 import org.gjt.jclasslib.util.ExtendedJLabel; 14 15 import javax.swing.tree.TreePath ; 16 17 23 public class ConstantLongInfoDetailPane extends AbstractConstantInfoDetailPane { 24 25 27 private ExtendedJLabel lblHighBytes; 28 private ExtendedJLabel lblLowBytes; 29 private ExtendedJLabel lblLong; 30 private ExtendedJLabel lblComment; 31 32 36 public ConstantLongInfoDetailPane(BrowserServices services) { 37 super(services); 38 } 39 40 protected void setupLabels() { 41 42 addDetailPaneEntry(normalLabel("High bytes:"), 43 lblHighBytes = highlightLabel()); 44 45 addDetailPaneEntry(normalLabel("Low bytes:"), 46 lblLowBytes = highlightLabel()); 47 48 addDetailPaneEntry(normalLabel("Long:"), 49 lblLong = highlightLabel(), 50 lblComment = highlightLabel()); 51 52 } 53 54 public void show(TreePath treePath) { 55 56 int constantPoolIndex = constantPoolIndex(treePath); 57 58 try { 59 ConstantLongInfo entry = (ConstantLongInfo)services.getClassFile().getConstantPoolEntry(constantPoolIndex, ConstantLongInfo.class); 60 lblHighBytes.setText(entry.getFormattedHighBytes()); 61 lblLowBytes.setText(entry.getFormattedLowBytes()); 62 lblLong.setText(entry.getLong()); 63 } catch (InvalidByteCodeException ex) { 64 lblComment.setText(MESSAGE_INVALID_CONSTANT_POOL_ENTRY); 65 } 66 67 super.show(treePath); 68 } 69 70 } 71 72 | Popular Tags |