import java.awt.event.MouseListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
*/
public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
TreePath[] selectedPaths = fileTree.getSelectionPaths();
+ filePathTextField.setText("");
+ fileNameTextField.setText("");
+ fileSizeTextField.setText("");
if ((selectedPaths != null) && (selectedPaths.length == 1)) {
Object lastPathComponent = selectedPaths[0].getLastPathComponent();
if (!(lastPathComponent instanceof ProjectFileWrapper)) {
ProjectFileWrapper projectFileWrapper = (ProjectFileWrapper) lastPathComponent;
ProjectFile projectFile = projectFileWrapper.getProjectFile();
if (projectFile.isFile()) {
+ String completePath = projectFile.getCompletePath();
+ int lastSeparator = completePath.lastIndexOf(File.separatorChar);
+ if (lastSeparator == -1) {
+ filePathTextField.setText("");
+ } else {
+ filePathTextField.setText(completePath.substring(0, lastSeparator));
+ }
fileNameTextField.setText(projectFile.getName());
fileSizeTextField.setText(String.valueOf(projectFile.getSize()));
}