analyze panel bug fixes

This commit is contained in:
Reinhard Pointner 2007-12-25 15:30:50 +00:00
parent 3f2d16d03d
commit 490101af81
4 changed files with 24 additions and 25 deletions

View File

@ -88,17 +88,18 @@ 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);
}
}
}
public void expandOrCollapseAll(boolean expand) {

View File

@ -54,17 +54,22 @@ 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
// .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 "";
}

View File

@ -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();

View File

@ -38,7 +38,7 @@ public class TypePanel extends ToolPanel {
setLoadingOverlayPane(loadingOverlay);
}
UpdateTask latestUpdateTask;
private UpdateTask latestUpdateTask;
@Override