From a8d74c96261e44e35779b619543bbb6ec47f075d Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 29 May 2008 14:46:57 +0200 Subject: [PATCH] remove old gui create file properties panel --- src/net/pterodactylus/jsite/gui/FileManager.java | 75 +++++++++------------- src/net/pterodactylus/jsite/i18n/jSite.properties | 9 +++ .../pterodactylus/jsite/i18n/jSite_de.properties | 9 +++ 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/src/net/pterodactylus/jsite/gui/FileManager.java b/src/net/pterodactylus/jsite/gui/FileManager.java index 26b6e14..b3d3755 100644 --- a/src/net/pterodactylus/jsite/gui/FileManager.java +++ b/src/net/pterodactylus/jsite/gui/FileManager.java @@ -38,13 +38,12 @@ import java.util.logging.Logger; import javax.swing.BorderFactory; import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JTextField; import javax.swing.JTree; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; @@ -57,7 +56,6 @@ import net.pterodactylus.jsite.i18n.I18nable; import net.pterodactylus.jsite.i18n.gui.I18nAction; import net.pterodactylus.jsite.i18n.gui.I18nLabel; import net.pterodactylus.jsite.project.Project; -import net.pterodactylus.util.io.MimeTypes; import net.pterodactylus.util.logging.Logging; import net.pterodactylus.util.swing.SortableTreeNode; import net.pterodactylus.util.swing.SwingUtils; @@ -105,20 +103,20 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr /** The scroll pane that holds the file tree. */ private JScrollPane fileScrollPane; - /** The “insert” action. */ - private I18nAction insertAction; + /** The “file properties” label. */ + private I18nLabel filePropertiesLabel; - /** The “insert” checkbox. */ - private JCheckBox insertCheckBox; + /** The “file path” label. */ + private I18nLabel filePathLabel; - /** The “use custom mime type” action. */ - private I18nAction useCustomMimeTypeAction; + /** The “file path” textfield. */ + private JTextField filePathTextField; - /** The “use custom mime type” checkbox. */ - private JCheckBox useCustomMimeTypeCheckBox; + /** The “file name” label. */ + private I18nLabel fileNameLabel; - /** The “mime type” combo box. */ - private JComboBox mimeTypeComboBox; + /** The “file name” textfield. */ + private JTextField fileNameTextField; /** * Creates a new file manager. @@ -184,28 +182,6 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr initiateFileScan(); } }; - insertAction = new I18nAction("fileManager.checkbox.insertFile") { - - /** - * {@inheritDoc} - */ - @SuppressWarnings("synthetic-access") - public void actionPerformed(ActionEvent actionEvent) { - /* TODO */ - } - }; - insertAction.setEnabled(false); - useCustomMimeTypeAction = new I18nAction("fileManager.checkbox.useCustomMimeType") { - - /** - * {@inheritDoc} - */ - @SuppressWarnings("synthetic-access") - public void actionPerformed(ActionEvent actionEvent) { - /* TODO */ - } - }; - useCustomMimeTypeAction.setEnabled(false); } /** @@ -254,18 +230,24 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr rightPanel.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)); + filePropertiesLabel = new I18nLabel("fileManager.label.fileProperties"); + filePropertiesLabel.setFont(filePropertiesLabel.getFont().deriveFont(Font.BOLD)); + propertiesPanel.add(filePropertiesLabel, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); + + filePathLabel = new I18nLabel("fileManager.label.filePath"); + filePathTextField = new JTextField(); + filePathTextField.setEditable(false); + propertiesPanel.add(filePathLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(12, 24, 0, 0), 0, 0)); + propertiesPanel.add(filePathTextField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(12, 12, 0, 0), 0, 0)); - useCustomMimeTypeCheckBox = new JCheckBox(useCustomMimeTypeAction); - List allMimeTypes = MimeTypes.getAllMimeTypes(); - mimeTypeComboBox = new JComboBox(allMimeTypes.toArray(new String[0])); - mimeTypeComboBox.setEnabled(false); - mimeTypeComboBox.addActionListener(this); - propertiesPanel.add(useCustomMimeTypeCheckBox, 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)); + fileNameLabel = new I18nLabel("fileManager.label.fileName"); + fileNameTextField = new JTextField(); + fileNameTextField.setEditable(false); + propertiesPanel.add(fileNameLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(12, 24, 0, 0), 0, 0)); + propertiesPanel.add(fileNameTextField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(12, 12, 0, 0), 0, 0)); - propertiesPanel.add(new JPanel(), new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); + /* glue panel. */ + propertiesPanel.add(new JPanel(), new GridBagConstraints(0, 3, 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)); @@ -350,6 +332,9 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr */ public void updateI18n() { setTitle(I18n.get("fileManager.title", project.getName())); + projectFilesLabel.updateI18n(); + filePropertiesLabel.updateI18n(); + filePathLabel.updateI18n(); } // diff --git a/src/net/pterodactylus/jsite/i18n/jSite.properties b/src/net/pterodactylus/jsite/i18n/jSite.properties index 46af14e..3d84880 100644 --- a/src/net/pterodactylus/jsite/i18n/jSite.properties +++ b/src/net/pterodactylus/jsite/i18n/jSite.properties @@ -343,6 +343,15 @@ fileManager.button.rescan.longDescription: Rescans the project\u2019s directory fileManager.label.projectFiles.name: Project Files fileManager.label.projectFiles.mnemonic: VK_F +fileManager.label.fileProperties.name: File properties +fileManager.label.fileProperties.mnemonic: VK_UNDEFINED + +fileManager.label.filePath.name: File path +fileManager.label.filePath.mnemonic: VK_UNDEFINED + +fileManager.label.fileName.name: File name +fileManager.label.fileName.mnemonic: VK_UNDEFINED + fileManager.checkbox.insertFile.name: Insert file fileManager.checkbox.insertFile.mnemonic: VK_I fileManager.checkbox.insertFile.accelerator: Ctrl-VK_I diff --git a/src/net/pterodactylus/jsite/i18n/jSite_de.properties b/src/net/pterodactylus/jsite/i18n/jSite_de.properties index c951efe..361fe72 100644 --- a/src/net/pterodactylus/jsite/i18n/jSite_de.properties +++ b/src/net/pterodactylus/jsite/i18n/jSite_de.properties @@ -343,6 +343,15 @@ fileManager.button.rescan.longDescription: Liest die Projektdateien neu ein fileManager.label.projectFiles.name: Projektdateien fileManager.label.projectFiles.mnemonic: VK_D +fileManager.label.fileProperties.name: Dateieigenschaften +fileManager.label.fileProperties.mnemonic: VK_UNDEFINED + +fileManager.label.filePath.name: Dateipfad +fileManager.label.filePath.mnemonic: VK_UNDEFINED + +fileManager.label.fileName.name: Dateiname +fileManager.label.fileName.mnemonic: VK_UNDEFINED + fileManager.checkbox.insertFile.name: Datei einf\u00fcgen fileManager.checkbox.insertFile.mnemonic: VK_E fileManager.checkbox.insertFile.accelerator: Ctrl-VK_E -- 2.7.4