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;
import javax.swing.BorderFactory;
import javax.swing.JButton;
+import javax.swing.JCheckBox;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JDialog;
import javax.swing.JLabel;
/** The “file size” text field. */
private JTextField fileSizeTextField;
+ /** The “override” label. */
+ private I18nLabel overrideLabel;
+
+ /** The “override active” action. */
+ private I18nAction overrideAction;
+
+ /** The “override action” checkbox. */
+ private JCheckBox overrideCheckBox;
+
/** The context menu for the tree. */
private JPopupMenu treeContextMenu;
/* TODO */
}
};
+ overrideAction = new I18nAction("fileManager.checkbox.overrideActive") {
+ /**
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ public void actionPerformed(ActionEvent actionEvent) {
+ /* TODO */
+ }
+ };
}
/**
propertiesPanel.add(fileSizeLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(12, 24, 0, 0), 0, 0));
propertiesPanel.add(fileSizeTextField, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(12, 12, 0, 0), 0, 0));
+ /* override settings. */
+ overrideLabel = new I18nLabel("fileManager.label.override");
+ overrideLabel.setFont(overrideLabel.getFont().deriveFont(Font.BOLD));
+ propertiesPanel.add(overrideLabel, new GridBagConstraints(0, 4, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(24, 0, 0, 0), 0, 0));
+
+ overrideCheckBox = new JCheckBox(overrideAction);
+ propertiesPanel.add(overrideCheckBox, new GridBagConstraints(0, 5, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(12, 24, 0, 0), 0, 0));
+
/* glue panel. */
- propertiesPanel.add(new JPanel(), new GridBagConstraints(0, 4, 2, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
+ propertiesPanel.add(new JPanel(), new GridBagConstraints(0, 6, 2, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
/* action button panel */
JPanel actionButtonPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 12, 12));
*/
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()));
}