⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 generaldetailpane.java

📁 Java Bytecode Editor 是一个 JAVA 的字节码反汇编和修改器。它可以很方便的修改已经编译成 Class 文件的 JAVA 文件。
💻 JAVA
字号:
/*
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
    License as published by the Free Software Foundation; either
    version 2 of the license, or (at your option) any later version.
*/

package ee.ioc.cs.jbe.browser.detail;

import org.gjt.jclasslib.structures.ClassFile;
import org.gjt.jclasslib.util.ExtendedJLabel;

import ee.ioc.cs.jbe.browser.BrowserServices;


import javax.swing.tree.TreePath;

/**
    Detail pane showing general information on the class file structure.
    All fields in the <tt>ClassFile</tt> structure without substructure 
    are incorporated in theis pane.
 
    @author <a href="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
    @version $Revision: 1.4 $ $Date: 2006/09/25 16:00:58 $
*/
public class GeneralDetailPane extends FixedListDetailPane {
    
    // Visual components
    
    private ExtendedJLabel lblMinorVersion;
    private ExtendedJLabel lblMajorVersion;
    private ExtendedJLabel lblConstantPoolCount;
    private ExtendedJLabel lblAccessFlags;
    private ExtendedJLabel lblAccessFlagsVerbose;
    private ExtendedJLabel lblThisClass;
    private ExtendedJLabel lblThisClassVerbose;
    private ExtendedJLabel lblSuperClass;
    private ExtendedJLabel lblSuperClassVerbose;
    private ExtendedJLabel lblInterfacesCount;
    private ExtendedJLabel lblFieldsCount;
    private ExtendedJLabel lblMethodsCount;
    private ExtendedJLabel lblAttributesCount;

    /**
        Constructor.
        @param services the associated browser services.
     */
    public GeneralDetailPane(BrowserServices services) {
        super(services);
    }
    
    protected void setupLabels() {
        
        addDetailPaneEntry(normalLabel("Minor version:"),
                           lblMinorVersion = highlightLabel());

        addDetailPaneEntry(normalLabel("Major version:"),
                           lblMajorVersion = highlightLabel());
        
        addDetailPaneEntry(normalLabel("Constant pool count:"),
                           lblConstantPoolCount = highlightLabel());
        
        addDetailPaneEntry(normalLabel("Access flags:"),
                           lblAccessFlags = highlightLabel(), 
                           lblAccessFlagsVerbose = highlightLabel());
        
        addDetailPaneEntry(normalLabel("This class:"),
                           lblThisClass = linkLabel(),
                           lblThisClassVerbose = highlightLabel());
        
        addDetailPaneEntry(normalLabel("Super class:"),
                           lblSuperClass = linkLabel(),
                           lblSuperClassVerbose = highlightLabel());
        
        addDetailPaneEntry(normalLabel("Interfaces count:"),
                           lblInterfacesCount = highlightLabel());
        
        addDetailPaneEntry(normalLabel("Fields count:"),
                           lblFieldsCount = highlightLabel());
        
        addDetailPaneEntry(normalLabel("Methods count:"),
                           lblMethodsCount = highlightLabel());
        
        addDetailPaneEntry(normalLabel("Attributes count:"),
                           lblAttributesCount = highlightLabel());

    }

    public void show(TreePath treePath) {
        
        ClassFile classFile = services.getClassFile();
        
        lblMinorVersion.setText(classFile.getMinorVersion());
        lblMajorVersion.setText(classFile.getMajorVersion());
        lblConstantPoolCount.setText(classFile.getConstantPool().length);

        lblAccessFlags.setText(classFile.getFormattedAccessFlags());
        lblAccessFlagsVerbose.setText("[" + classFile.getAccessFlagsVerbose() + "]");

        constantPoolHyperlink(lblThisClass,
                              lblThisClassVerbose,
                              classFile.getThisClass());

        constantPoolHyperlink(lblSuperClass,
                              lblSuperClassVerbose,
                              classFile.getSuperClass());
        
        lblInterfacesCount.setText(classFile.getInterfaces().length);
        lblFieldsCount.setText(classFile.getFields().length);
        lblMethodsCount.setText(classFile.getMethods().length);
        lblAttributesCount.setText(classFile.getAttributes().length);

        super.show(treePath);
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -