From 79e957d90cf47fdedbbd2892c312ccb406ac2f22 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 28 May 2008 16:35:13 +0200 Subject: [PATCH] remove file manager for now --- src/net/pterodactylus/jsite/gui/ProjectPanel.java | 37 +++++------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/src/net/pterodactylus/jsite/gui/ProjectPanel.java b/src/net/pterodactylus/jsite/gui/ProjectPanel.java index 73d901f..4b534ea 100644 --- a/src/net/pterodactylus/jsite/gui/ProjectPanel.java +++ b/src/net/pterodactylus/jsite/gui/ProjectPanel.java @@ -25,14 +25,12 @@ import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; -import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFileChooser; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.event.DocumentEvent; @@ -43,14 +41,13 @@ 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.project.Entry; import net.pterodactylus.jsite.project.Project; import net.pterodactylus.util.logging.Logging; /** * A panel that contains all information about a project and lets the user edit * the properties of the project. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ public class ProjectPanel extends JPanel implements DocumentListener, I18nable { @@ -89,12 +86,9 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable { /** The “base path” textfield. */ private JTextField basePathTextField; - /** The “base path information” label. */ - private JLabel basePathInformationLabel; - /** * Creates a new project panel. - * + * * @param swingInterface * The Swing interface * @param project @@ -115,7 +109,7 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable { /** * Returns the project that is displayed in this panel. - * + * * @return The project of this panel */ public Project getProject() { @@ -167,7 +161,7 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable { /** * Creates the properties panel. - * + * * @return The properties panel */ private JPanel createPropertiesPanel() { @@ -188,23 +182,21 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable { basePathTextField = new JTextField(project.getBasePath()); basePathTextField.setEditable(false); basePathLabel = new I18nLabel("projectPanel.label.basePath"); - basePathInformationLabel = new JLabel(I18n.get("projectPanel.basePathInformation.fileCount", project.getBasePathEntries().size())); JButton changeBasePathButton = new JButton(changeBasePathAction); JButton editFilesButton = new JButton(editFilesAction); propertiesPanel.add(basePathLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 0, 0, 0), 0, 0)); propertiesPanel.add(basePathTextField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0)); propertiesPanel.add(changeBasePathButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0)); propertiesPanel.add(editFilesButton, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(6, 6, 0, 0), 0, 0)); - propertiesPanel.add(basePathInformationLabel, new GridBagConstraints(1, 3, 3, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0)); - propertiesPanel.add(new JPanel(), new GridBagConstraints(0, 4, 4, 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, 3, 4, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); return propertiesPanel; } /** * Creates the button panel. - * + * * @return The button panel */ private JPanel createButtonPanel() { @@ -219,7 +211,7 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable { /** * Updates the project from changes in the text fields. - * + * * @param document * The document that was changed */ @@ -246,22 +238,7 @@ public class ProjectPanel extends JPanel implements DocumentListener, I18nable { if (chooseAction == JFileChooser.APPROVE_OPTION) { String newBasePath = fileChooser.getSelectedFile().getPath(); basePathTextField.setText(newBasePath); - basePathInformationLabel.setText(I18n.get("projectPanel.basePathInformation.scanning")); project.setBasePath(newBasePath); - changeBasePathAction.setEnabled(false); - swingInterface.getThreadPool().execute(new Runnable() { - - /** - * {@inheritDoc} - */ - @SuppressWarnings("synthetic-access") - public void run() { - project.rescanBasePath(); - List projectEntries = project.getBasePathEntries(); - basePathInformationLabel.setText(I18n.get("projectPanel.basePathInformation.fileCount", projectEntries.size())); - changeBasePathAction.setEnabled(true); - } - }); } } -- 2.7.4