use of com.android.tools.idea.apk.viewer.ApkEntry in project android by JetBrains.
the class ApkDiffPanel method setRootNode.
private void setRootNode(@NotNull DefaultMutableTreeNode root) {
myTreeModel = new DefaultTreeModel(root);
ApkEntry entry = ApkEntry.fromNode(root);
assert entry != null;
myTree.setPaintBusy(false);
myTree.setRootVisible(false);
myTree.setModel(myTreeModel);
}
use of com.android.tools.idea.apk.viewer.ApkEntry in project android by JetBrains.
the class ApkDiffPanel method createUIComponents.
private void createUIComponents() {
myTreeModel = new DefaultTreeModel(new LoadingNode());
myTree = new Tree(myTreeModel);
myTree.setShowsRootHandles(true);
// show root node only when showing LoadingNode
myTree.setRootVisible(true);
myTree.setPaintBusy(true);
Convertor<TreePath, String> convertor = new Convertor<TreePath, String>() {
@Override
public String convert(TreePath path) {
ApkEntry e = ApkEntry.fromNode(path.getLastPathComponent());
if (e == null) {
return null;
}
return e.getPath();
}
};
TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(myTree, convertor, true);
ColumnTreeBuilder builder = new ColumnTreeBuilder(myTree).addColumn(new ColumnTreeBuilder.ColumnBuilder().setName("File").setPreferredWidth(600).setHeaderAlignment(SwingConstants.LEADING).setRenderer(new NameRenderer(treeSpeedSearch))).addColumn(new ColumnTreeBuilder.ColumnBuilder().setName("Old Size").setPreferredWidth(150).setHeaderAlignment(SwingConstants.TRAILING).setRenderer(new SizeRenderer(ApkDiffEntry::getOldSize))).addColumn(new ColumnTreeBuilder.ColumnBuilder().setName("New Size").setPreferredWidth(150).setHeaderAlignment(SwingConstants.TRAILING).setRenderer(new SizeRenderer(ApkDiffEntry::getNewSize))).addColumn(new ColumnTreeBuilder.ColumnBuilder().setName("Diff Size").setPreferredWidth(150).setHeaderAlignment(SwingConstants.TRAILING).setRenderer(new SizeRenderer(ApkEntry::getSize)));
myColumnTreePane = (JScrollPane) builder.build();
}
Aggregations