mirror of
https://github.com/java-decompiler/jd-gui.git
synced 2024-11-23 12:39:52 +00:00
Update tooltip on tabs
This commit is contained in:
parent
cb8de5579d
commit
cb553926d7
@ -41,8 +41,8 @@ public class ClassFileTreeNodeFactoryProvider extends AbstractTypeFileTreeNodeFa
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf('/');
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new FileTreeNode(entry, new TreeNodeBean(name, CLASS_FILE_ICON), FACTORY);
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new FileTreeNode(entry, new TreeNodeBean(label, CLASS_FILE_ICON), FACTORY);
|
||||
}
|
||||
|
||||
protected static class Factory implements AbstractTypeFileTreeNodeFactoryProvider.PageAndTipFactory {
|
||||
@ -54,10 +54,10 @@ public class ClassFileTreeNodeFactoryProvider extends AbstractTypeFileTreeNodeFa
|
||||
|
||||
@Override
|
||||
public String makeTip(API api, Container.Entry entry) {
|
||||
File file = new File(entry.getContainer().getRoot().getUri());
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
StringBuilder tip = new StringBuilder("<html>Location: ");
|
||||
|
||||
tip.append(file.getPath());
|
||||
tip.append(location);
|
||||
tip.append("<br>Java compiler version: ");
|
||||
|
||||
try (InputStream is = entry.getInputStream()) {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class CssFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/css_obj.png"));
|
||||
@ -26,8 +27,9 @@ public class CssFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvi
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -18,6 +18,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.util.Collection;
|
||||
|
||||
@ -42,15 +43,16 @@ public class DirectoryTreeNodeFactoryProvider extends AbstractTreeNodeFactoryPro
|
||||
}
|
||||
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
TreeNode node = new TreeNode(entry, new TreeNodeBean(label, getIcon(), getOpenIcon()));
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
TreeNode node = new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, getIcon(), getOpenIcon()));
|
||||
|
||||
if (entries.size() > 0) {
|
||||
// Add dummy node
|
||||
node.add(new DefaultMutableTreeNode());
|
||||
}
|
||||
|
||||
return (T)node;
|
||||
}
|
||||
return (T)node;
|
||||
}
|
||||
|
||||
public ImageIcon getIcon() { return ICON; }
|
||||
public ImageIcon getOpenIcon() { return OPEN_ICON; }
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class DtdFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(DtdFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/dtd_obj.gif"));
|
||||
@ -26,8 +27,9 @@ public class DtdFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvi
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -15,6 +15,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class EarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(JarFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/ear_obj.gif"));
|
||||
@ -25,8 +26,9 @@ public class EarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvid
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
T node = (T)new TreeNode(entry, "ear", new TreeNodeBean(name, ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
T node = (T)new TreeNode(entry, "ear", new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
// Add dummy node
|
||||
node.add(new DefaultMutableTreeNode());
|
||||
return node;
|
||||
|
@ -17,6 +17,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class EjbJarXmlFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(ManifestFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/xml_obj.gif"));
|
||||
@ -26,7 +27,8 @@ public class EjbJarXmlFileTreeNodeFactoryProvider extends FileTreeNodeFactoryPro
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
return (T)new TreeNode(entry, new TreeNodeBean("ejb-jar.xml", "Location: " + entry.getUri().getPath(), ICON));
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean("ejb-jar.xml", "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
|
||||
|
@ -15,10 +15,11 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
|
||||
public class FileTreeNodeFactoryProvider extends AbstractTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(FileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/file_plain_obj.png"));
|
||||
protected static final ImageIcon ICON = new ImageIcon(FileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/file_plain_obj.png"));
|
||||
|
||||
@Override public String[] getSelectors() { return appendSelectors("*:file:*"); }
|
||||
|
||||
@ -26,9 +27,10 @@ public class FileTreeNodeFactoryProvider extends AbstractTreeNodeFactoryProvider
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf('/');
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, ICON));
|
||||
}
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends DefaultMutableTreeNode implements ContainerEntryGettable, UriGettable {
|
||||
protected Container.Entry entry;
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class HtmlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/html_obj.gif"));
|
||||
@ -26,8 +27,9 @@ public class HtmlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProv
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -17,6 +17,7 @@ import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
@ -30,8 +31,9 @@ public class ImageFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvide
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
public class JarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvider {
|
||||
@ -28,13 +29,14 @@ public class JarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvid
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
ImageIcon icon = isAEjbModule(entry) ? EJB_FILE_ICON : JAR_FILE_ICON;
|
||||
T node = (T)new TreeNode(entry, "jar", new TreeNodeBean(name, icon));
|
||||
T node = (T)new TreeNode(entry, "jar", new TreeNodeBean(label, "Location: " + location, icon));
|
||||
// Add dummy node
|
||||
node.add(new DefaultMutableTreeNode());
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean isAEjbModule(Container.Entry entry) {
|
||||
Collection<Container.Entry> children = entry.getChildren();
|
||||
|
@ -28,9 +28,9 @@ public class JavaFileTreeNodeFactoryProvider extends AbstractTypeFileTreeNodeFac
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf('/');
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
|
||||
return (T)new FileTreeNode(entry, new TreeNodeBean(name, JAVA_FILE_ICON), FACTORY);
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new FileTreeNode(entry, new TreeNodeBean(label, "Location: " + location, JAVA_FILE_ICON), FACTORY);
|
||||
}
|
||||
|
||||
protected static class Factory implements AbstractTypeFileTreeNodeFactoryProvider.PageAndTipFactory {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class JavascriptFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(JavascriptFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/js_obj.png"));
|
||||
@ -25,8 +26,9 @@ public class JavascriptFileTreeNodeFactoryProvider extends TextFileTreeNodeFacto
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -11,11 +11,10 @@ import org.jd.gui.api.API;
|
||||
import org.jd.gui.api.feature.ContainerEntryGettable;
|
||||
import org.jd.gui.api.feature.UriGettable;
|
||||
import org.jd.gui.api.model.Container;
|
||||
import org.jd.gui.spi.TreeNodeFactory;
|
||||
import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class JmodFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvider {
|
||||
@Override public String[] getSelectors() { return appendSelectors("*:file:*.jmod"); }
|
||||
@ -24,19 +23,11 @@ public class JmodFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvi
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
|
||||
|
||||
|
||||
T node = (T)new TreeNode(entry, "generic", new TreeNodeBean(name, ICON));
|
||||
|
||||
|
||||
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
T node = (T)new TreeNode(entry, "generic", new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
// Add dummy node
|
||||
node.add(new DefaultMutableTreeNode());
|
||||
|
||||
|
||||
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class JsonFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(JsonFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/ascii_obj.png"));
|
||||
@ -26,8 +27,9 @@ public class JsonFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProv
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class JspFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/html_obj.gif"));
|
||||
@ -26,8 +27,9 @@ public class JspFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvi
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -17,6 +17,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class ManifestFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(ManifestFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/manifest_obj.png"));
|
||||
@ -26,7 +27,8 @@ public class ManifestFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProv
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
return (T)new TreeNode(entry, new TreeNodeBean("MANIFEST.MF", "Location: " + entry.getUri().getPath(), ICON));
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean("MANIFEST.MF", "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
|
||||
|
@ -17,6 +17,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class MetainfServiceFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvider {
|
||||
@ -36,8 +37,9 @@ public class MetainfServiceFileTreeNodeFactoryProvider extends FileTreeNodeFacto
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
public class PackageTreeNodeFactoryProvider extends DirectoryTreeNodeFactoryProvider {
|
||||
@ -38,7 +39,8 @@ public class PackageTreeNodeFactoryProvider extends DirectoryTreeNodeFactoryProv
|
||||
}
|
||||
|
||||
String label = entry.getPath().substring(lastSlashIndex+1).replace("/", ".");
|
||||
T node = (T)new TreeNode(entry, new TreeNodeBean(label, getIcon(), getOpenIcon()));
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
T node = (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, getIcon(), getOpenIcon()));
|
||||
|
||||
if (entries.size() > 0) {
|
||||
// Add dummy node
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class PropertiesFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(PropertiesFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/ascii_obj.png"));
|
||||
@ -26,8 +27,9 @@ public class PropertiesFileTreeNodeFactoryProvider extends TextFileTreeNodeFacto
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class SqlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(SqlFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/sql_obj.png"));
|
||||
@ -26,8 +27,9 @@ public class SqlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvi
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -22,6 +22,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
||||
@ -46,8 +47,9 @@ public class TextFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvider
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
|
||||
|
@ -15,6 +15,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class WarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(JarFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/war_obj.gif"));
|
||||
@ -25,8 +26,9 @@ public class WarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvid
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
T node = (T)new TreeNode(entry, "war", new TreeNodeBean(name, ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
T node = (T)new TreeNode(entry, "war", new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
// Add dummy node
|
||||
node.add(new DefaultMutableTreeNode());
|
||||
return node;
|
||||
|
@ -17,6 +17,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class WebXmlFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(ManifestFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/xml_obj.gif"));
|
||||
@ -26,7 +27,8 @@ public class WebXmlFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvid
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
return (T)new TreeNode(entry, new TreeNodeBean("web.xml", "Location: " + entry.getUri().getPath(), ICON));
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean("web.xml", "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class XmlBasedFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(XmlBasedFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/xml_obj.gif"));
|
||||
@ -26,8 +27,9 @@ public class XmlBasedFileTreeNodeFactoryProvider extends TextFileTreeNodeFactory
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class XmlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(XmlFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/xml_obj.gif"));
|
||||
@ -26,8 +27,9 @@ public class XmlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvi
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(name, "Location: " + entry.getUri().getPath(), ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
return (T)new TreeNode(entry, new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
}
|
||||
|
||||
protected static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
|
||||
|
@ -16,6 +16,7 @@ import org.jd.gui.view.data.TreeNodeBean;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
|
||||
public class ZipFileTreeNodeFactoryProvider extends DirectoryTreeNodeFactoryProvider {
|
||||
protected static final ImageIcon ICON = new ImageIcon(ZipFileTreeNodeFactoryProvider.class.getClassLoader().getResource("org/jd/gui/images/zip_obj.png"));
|
||||
@ -26,8 +27,9 @@ public class ZipFileTreeNodeFactoryProvider extends DirectoryTreeNodeFactoryProv
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry) {
|
||||
int lastSlashIndex = entry.getPath().lastIndexOf("/");
|
||||
String name = entry.getPath().substring(lastSlashIndex+1);
|
||||
T node = (T)new TreeNode(entry, "generic", new TreeNodeBean(name, ICON));
|
||||
String label = entry.getPath().substring(lastSlashIndex+1);
|
||||
String location = new File(entry.getUri()).getPath();
|
||||
T node = (T)new TreeNode(entry, "generic", new TreeNodeBean(label, "Location: " + location, ICON));
|
||||
// Add dummy node
|
||||
node.add(new DefaultMutableTreeNode());
|
||||
return node;
|
||||
|
Loading…
Reference in New Issue
Block a user