import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.event.TreeModelListener;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
*
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
-public class FileManager extends JDialog implements I18nable {
+public class FileManager extends JDialog implements I18nable, TreeSelectionListener {
/** Logger. */
private static final Logger logger = Logging.getLogger(FileManager.class.getName());
/** The “close” action. */
private I18nAction closeAction;
+ /** The “project files” label. */
+ private I18nLabel projectFilesLabel;
+
/** The tree that shows the files. */
private JTree fileTree;
*/
private Component createFileManagerPanel() {
JPanel fileManagerPanel = new JPanel(new BorderLayout(12, 12));
- fileManagerPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(12, 12, 12, 12)));
+ JPanel fileTreePanel = new JPanel(new BorderLayout(12, 12));
+ fileManagerPanel.add(fileTreePanel, BorderLayout.LINE_START);
+
fileTree = new JTree(fileTreeModel);
- fileManagerPanel.add(new JScrollPane(fileTree), BorderLayout.LINE_START);
fileTree.setShowsRootHandles(false);
+ fileTreePanel.add(new JScrollPane(fileTree), BorderLayout.CENTER);
+
+ projectFilesLabel = new I18nLabel("fileManager.label.projectFiles", fileTree);
+ JPanel projectFilesLabelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
+ fileTreePanel.add(projectFilesLabelPanel, BorderLayout.NORTH);
+ projectFilesLabelPanel.add(projectFilesLabel);
JPanel propertiesPanel = new JPanel(new GridBagLayout());
fileManagerPanel.add(propertiesPanel, BorderLayout.CENTER);
+ propertiesPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(12, 12, 12, 12)));
insertCheckBox = new JCheckBox(insertAction);
propertiesPanel.add(insertCheckBox, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- mimeTypeComboBox = new JComboBox(MimeTypes.getAllMimeTypes().toArray(new String[0]));
+ List<String> allMimeTypes = MimeTypes.getAllMimeTypes();
+ allMimeTypes.add(0, "auto-detect");
+ mimeTypeComboBox = new JComboBox(allMimeTypes.toArray(new String[0]));
mimeTypeLabel = new I18nLabel("fileManager.label.mimeType", mimeTypeComboBox);
propertiesPanel.add(mimeTypeLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 0, 0, 0), 0, 0));
propertiesPanel.add(mimeTypeComboBox, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0));
setTitle(I18n.get("fileManager.title", project.getName()));
}
+ //
+ // INTERFACE TreeSelectionListener
+ //
+
+ /**
+ * {@inheritDoc}
+ */
+ public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
+ /* TODO - implement */
+ }
+
/**
* Model for the tree of files.
*
projectPanel.button.changeBasePath.shortDescription: \u00c4ndert den Basispfad, aus dem die Dateien gelesen werden
projectPanel.button.changeBasePath.longDescription: \u00c4ndert den Basispfad, aus dem die Dateien gelesen werden
-projectPanel.button.editFiles.name: Edit Files
-projectPanel.button.editFiles.mnemonic: VK_E
-projectPanel.button.editFiles.accelerator: Ctrl-VK_E
-projectPanel.button.editFiles.shortDescription: Edit physical and virtual files
-projectPanel.button.editFiles.longDescription: Edit physical and virtual files
+projectPanel.button.editFiles.name: Verwalten
+projectPanel.button.editFiles.mnemonic: VK_V
+projectPanel.button.editFiles.accelerator: Ctrl-VK_V
+projectPanel.button.editFiles.shortDescription: Verwaltet physikalische und virtuelle Dateien
+projectPanel.button.editFiles.longDescription: Verwaltet physikalische und virtuelle Dateien
# the "edit node" dialog
editNodeDialog.title: Edit Node
fileManager.label.mimeType.name: MIME Type
fileManager.label.mimeType.mnemonic: VK_M
+fileManager.label.projectFiles.name: Projektdateien
+fileManager.label.projectFiles.mnemonic: VK_D
+
fileManager.checkbox.insertFile.name: Datei einf\u00fcgen
fileManager.checkbox.insertFile.mnemonic: VK_E
fileManager.checkbox.insertFile.accelerator: Ctrl-VK_E