From a5ebacd3beea5b83347f66cc8b8dac79d3f66e14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 31 May 2008 16:12:08 +0200 Subject: [PATCH] start multiple file override --- src/net/pterodactylus/jsite/gui/FileManager.java | 34 ++++++++++++++++++++++ src/net/pterodactylus/jsite/i18n/jSite.properties | 18 ++++++++++++ .../pterodactylus/jsite/i18n/jSite_de.properties | 24 +++++++++++++-- 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/src/net/pterodactylus/jsite/gui/FileManager.java b/src/net/pterodactylus/jsite/gui/FileManager.java index 77df538..ad4d0ab 100644 --- a/src/net/pterodactylus/jsite/gui/FileManager.java +++ b/src/net/pterodactylus/jsite/gui/FileManager.java @@ -68,6 +68,7 @@ import net.pterodactylus.jsite.i18n.I18n; import net.pterodactylus.jsite.i18n.I18nable; import net.pterodactylus.jsite.i18n.gui.I18nAction; import net.pterodactylus.jsite.i18n.gui.I18nLabel; +import net.pterodactylus.jsite.i18n.gui.I18nMenu; import net.pterodactylus.jsite.project.FileOverride; import net.pterodactylus.jsite.project.Project; import net.pterodactylus.jsite.project.ProjectFile; @@ -150,6 +151,15 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr /** The context menu for the tree. */ private JPopupMenu treeContextMenu; + /** The “apply override” menu. */ + private I18nMenu overrideMenu; + + /** The “apply insert override” action. */ + private I18nAction applyInsertOverrideAction; + + /** The “apply mime type override” action. */ + private I18nAction applyMimeTypeOverrideAction; + /** The “insert” checkbox. */ private JCheckBoxMenuItem insertCheckBoxMenuItem; @@ -274,6 +284,22 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr /* TODO */ } }; + applyInsertOverrideAction = new I18nAction("fileManager.menu.item.applyInsertOverride") { + /** + * {@inheritDoc} + */ + public void actionPerformed(ActionEvent actionEvent) { + /* TODO */ + } + }; + applyMimeTypeOverrideAction = new I18nAction("fileManager.menu.item.applyMimeTypeOverride") { + /** + * {@inheritDoc} + */ + public void actionPerformed(ActionEvent actionEvent) { + /* TODO */ + } + }; } /** @@ -284,6 +310,12 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr treeContextMenu.add(setDefaultFileAction); insertCheckBoxMenuItem = new JCheckBoxMenuItem(insertAction); treeContextMenu.add(insertCheckBoxMenuItem); + + overrideMenu = new I18nMenu("fileManager.menu.override"); + treeContextMenu.add(overrideMenu); + + overrideMenu.add(applyInsertOverrideAction); + overrideMenu.add(applyMimeTypeOverrideAction); JPanel contentPanel = new JPanel(new BorderLayout(12, 12)); contentPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); @@ -497,6 +529,8 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr fileNameTextField.setText(projectFile.getName()); fileSizeTextField.setText(String.valueOf(projectFile.getSize())); } + } else if ((selectedPaths != null) && (selectedPaths.length > 1)) { + /* TODO */ } } diff --git a/src/net/pterodactylus/jsite/i18n/jSite.properties b/src/net/pterodactylus/jsite/i18n/jSite.properties index 7ed7c3e..b1615b2 100644 --- a/src/net/pterodactylus/jsite/i18n/jSite.properties +++ b/src/net/pterodactylus/jsite/i18n/jSite.properties @@ -387,3 +387,21 @@ fileManager.menu.item.insert.mnemonic: VK_I fileManager.menu.item.insert.accelerator: VK_UNDEFINED fileManager.menu.item.insert.shortDescription: Toggles the insert state of this file fileManager.menu.item.insert.longDescription Toggles the insert state of this file + +fileManager.menu.override.name: Override +fileManager.menu.override.mnemonic: VK_O +fileManager.menu.override.accelerator: VK_UNDEFINED +fileManager.menu.override.shortDescription: Overrides certain settings +fileManager.menu.override.longDescription: Overrides ceratin settings + +fileManager.menu.item.applyInsertOverride.name: Insert +fileManager.menu.item.applyInsertOverride.mnemonic: VK_I +fileManager.menu.item.applyInsertOverride.accelerator: Ctrl-VK_I +fileManager.menu.item.applyInsertOverride.shortDescription: Overrides default \u201cInsert\u201d setting +fileManager.menu.item.applyInsertOverride.longDescription: Overrides default \u201cInsert\u201d setting + +fileManager.menu.item.applyMimeTypeOverride.name: Content Type +fileManager.menu.item.applyMimeTypeOverride.mnemonic: VK_C +fileManager.menu.item.applyMimeTypeOverride.accelerator: Ctrl-VK_C +fileManager.menu.item.applyMimeTypeOverride.shortDescription: Overrides default \u201cContent Type\u201d setting +fileManager.menu.item.applyMimeTypeOverride.longDescription: Overrides default \u201cContent Type\u201d setting diff --git a/src/net/pterodactylus/jsite/i18n/jSite_de.properties b/src/net/pterodactylus/jsite/i18n/jSite_de.properties index 11cfc6a..ef346a2 100644 --- a/src/net/pterodactylus/jsite/i18n/jSite_de.properties +++ b/src/net/pterodactylus/jsite/i18n/jSite_de.properties @@ -382,8 +382,26 @@ fileManager.menu.item.setDefaultFile.accelerator: VK_UNDEFINED fileManager.menu.item.setDefaultFile.shortDescription: Macht diese Datei zur Indexdatei fileManager.menu.item.setDefaultFile.longDescription: Macht diese Datei zur Indexdatei -fileManager.menu.item.insert.name: Datei einfügen +fileManager.menu.item.insert.name: Datei einf\u00fcgen fileManager.menu.item.insert.mnemonic: VK_E fileManager.menu.item.insert.accelerator: VK_UNDEFINED -fileManager.menu.item.insert.shortDescription: Wechselt den Einfügestatus dieser Datei -fileManager.menu.item.insert.longDescription Wechselt den Einfügestatus dieser Datei +fileManager.menu.item.insert.shortDescription: Wechselt den Einf\u00fcgestatus dieser Datei +fileManager.menu.item.insert.longDescription Wechselt den Einf\u00fcgestatus dieser Datei + +fileManager.menu.override.name: Vorgaben +fileManager.menu.override.mnemonic: VK_V +fileManager.menu.override.accelerator: VK_UNDEFINED +fileManager.menu.override.shortDescription: \u00dcberschreibt bestimmte Einstellungen +fileManager.menu.override.longDescription: \u00dcberschreibt bestimmte Einstellungen + +fileManager.menu.item.applyInsertOverride.name: Einf\u00fcgen +fileManager.menu.item.applyInsertOverride.mnemonic: VK_E +fileManager.menu.item.applyInsertOverride.accelerator: Ctrl-VK_E +fileManager.menu.item.applyInsertOverride.shortDescription: \u00dcberschreibt die \u201eEinf\u00fcgen\u201c-Einstellung +fileManager.menu.item.applyInsertOverride.longDescription: \u00dcberschreibt die \u201eEinf\u00fcgen\u201c-Einstellung + +fileManager.menu.item.applyMimeTypeOverride.name: MIME-Typ +fileManager.menu.item.applyMimeTypeOverride.mnemonic: VK_M +fileManager.menu.item.applyMimeTypeOverride.accelerator: Ctrl-VK_M +fileManager.menu.item.applyMimeTypeOverride.shortDescription: \u00dcberschreibt die \u201eMIME-Typ\u201c-Einstellung +fileManager.menu.item.applyMimeTypeOverride.longDescription: \u00dcberschreibt die \u201eMIME-Typ\u201c-Einstellung -- 2.7.4