Search in sources :

Example 1 with JTreeZipFile

use of org.freeinternals.javaclassviewer.ui.JTreeZipFile in project selenium_java by sergueik.

the class Main method open_JarFile.

private void open_JarFile(final File file) {
    try {
        this.zftree = new JTreeZipFile(new JarFile(file, false, JarFile.OPEN_READ));
        this.zftree.addMouseListener(new MouseAdapter() {

            @Override
            public void mousePressed(final MouseEvent e) {
                if (e.getClickCount() != 2) {
                    return;
                }
                if (zftree.getRowForLocation(e.getX(), e.getY()) == -1) {
                    return;
                }
                zftree_DoubleClick(zftree.getPathForLocation(e.getX(), e.getY()));
            }
        });
    } catch (IOException ex) {
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        JOptionPane.showMessageDialog(this, ex.toString(), this.getTitle(), JOptionPane.ERROR_MESSAGE);
    }
    if (this.zftree != null) {
        this.zftreeContainer = new JPanelForTree(this.zftree, this);
        this.add(this.zftreeContainer, BorderLayout.CENTER);
        this.resizeForContent();
    }
}
Also used : MouseEvent(java.awt.event.MouseEvent) MouseAdapter(java.awt.event.MouseAdapter) JPanelForTree(org.freeinternals.commonlib.ui.JPanelForTree) IOException(java.io.IOException) JarFile(java.util.jar.JarFile) JTreeZipFile(org.freeinternals.javaclassviewer.ui.JTreeZipFile)

Aggregations

MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 IOException (java.io.IOException)1 JarFile (java.util.jar.JarFile)1 JPanelForTree (org.freeinternals.commonlib.ui.JPanelForTree)1 JTreeZipFile (org.freeinternals.javaclassviewer.ui.JTreeZipFile)1