analyze panel bug fixes
This commit is contained in:
parent
3f2d16d03d
commit
490101af81
|
@ -88,15 +88,16 @@ public class FileBotTree extends JTree implements TransferablePolicySupport {
|
|||
}
|
||||
|
||||
|
||||
private void walk(TreeModel model, Object o, LinkedList<File> list) {
|
||||
int cc = model.getChildCount(o);
|
||||
|
||||
for (int i = 0; i < cc; i++) {
|
||||
DefaultMutableTreeNode child = (DefaultMutableTreeNode) model.getChild(o, i);
|
||||
if (model.isLeaf(child))
|
||||
list.add((File) child.getUserObject());
|
||||
else
|
||||
private void walk(TreeModel model, Object node, LinkedList<File> list) {
|
||||
for (int i = 0; i < model.getChildCount(node); i++) {
|
||||
DefaultMutableTreeNode child = (DefaultMutableTreeNode) model.getChild(node, i);
|
||||
if (model.isLeaf(child)) {
|
||||
File file = (File) child.getUserObject();
|
||||
if (file.isFile())
|
||||
list.add(file);
|
||||
} else {
|
||||
walk(model, child, list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,18 +54,23 @@ public class FileFormat {
|
|||
}
|
||||
|
||||
|
||||
public static String getSuffix(File f, boolean dot) {
|
||||
public static String getSuffix(File f, boolean includeDot) {
|
||||
String name = f.getName();
|
||||
int dotIndex = name.lastIndexOf(".");
|
||||
|
||||
if (dotIndex > 1) {
|
||||
String suffix = name.substring(dotIndex + 1, name.length());
|
||||
if (dot)
|
||||
return "." + suffix;
|
||||
else
|
||||
return suffix;
|
||||
} else
|
||||
return "";
|
||||
// .config -> no suffix
|
||||
if (dotIndex >= 1) {
|
||||
int startIndex = dotIndex;
|
||||
|
||||
if (!includeDot)
|
||||
startIndex += 1;
|
||||
|
||||
if (startIndex <= name.length()) {
|
||||
return name.substring(dotIndex + 1, name.length());
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
package net.sourceforge.filebot.ui.panel.analyze;
|
||||
|
||||
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.io.File;
|
||||
|
@ -92,12 +91,6 @@ public class FileTree extends FileBotTree {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean handleTransferable(Transferable tr, boolean add) {
|
||||
return super.handleTransferable(tr, true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void clear() {
|
||||
FileTree.this.clear();
|
||||
|
|
|
@ -38,7 +38,7 @@ public class TypePanel extends ToolPanel {
|
|||
setLoadingOverlayPane(loadingOverlay);
|
||||
}
|
||||
|
||||
UpdateTask latestUpdateTask;
|
||||
private UpdateTask latestUpdateTask;
|
||||
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue