/** The “file name” textfield. */
private JTextField fileNameTextField;
+ /** The “file size” label. */
+ private I18nLabel fileSizeLabel;
+
+ /** The “file size” text field. */
+ private JTextField fileSizeTextField;
+
/**
* Creates a new file manager.
*
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));
+ fileSizeLabel = new I18nLabel("fileManager.label.fileSize");
+ fileSizeTextField = new JTextField();
+ fileSizeTextField.setEditable(false);
+ 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));
+
/* 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));
fileManager.label.fileName.name: File name
fileManager.label.fileName.mnemonic: VK_UNDEFINED
+fileManager.label.fileName.name: File size
+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
fileManager.label.fileName.name: Dateiname
fileManager.label.fileName.mnemonic: VK_UNDEFINED
+fileManager.label.fileName.name: Dateigr\u00f6\u00dfe
+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
import java.beans.PropertyChangeListener;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import net.pterodactylus.util.beans.AbstractBean;
return overrides;
}
+ /**
+ * Scans the base path for files and returns the {@link ProjectFile} for the
+ * base path. From this file it is possible to reach all files in the base
+ * path.
+ *
+ * This method is disk-intensive and may take some time on larger
+ * directories!
+ *
+ * @return The file for the base path
+ */
+ public ProjectFile getBaseFile() {
+
+ }
+
+ /**
+ * Implementation of a {@link ProjectFile}.
+ *
+ * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
+ */
+ private static class ProjectFileImpl implements ProjectFile {
+
+ /**
+ * @see net.pterodactylus.jsite.project.ProjectFile#getName()
+ */
+ public String getName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * @see net.pterodactylus.jsite.project.ProjectFile#getParents()
+ */
+ public List<ProjectFile> getParents() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * @see net.pterodactylus.jsite.project.ProjectFile#isFile()
+ */
+ public boolean isFile() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * @see net.pterodactylus.jsite.project.ProjectFile#isDirectory()
+ */
+ public boolean isDirectory() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * @see net.pterodactylus.jsite.project.ProjectFile#isHidden()
+ */
+ public boolean isHidden() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * @see net.pterodactylus.jsite.project.ProjectFile#getFiles()
+ */
+ public List<ProjectFile> getFiles() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ }
+
}
--- /dev/null
+/*
+ * jSite2 - ProjectFile.java -
+ * Copyright © 2008 David Roden
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+package net.pterodactylus.jsite.project;
+
+import java.util.List;
+
+import net.pterodactylus.jsite.core.Core;
+
+/**
+ * Abstraction for a that exists on the machine {@link Core} is being run on.
+ * This abstraction layer exists to make it possible to run jSite as a daemon
+ * and only connect to it via network.
+ *
+ * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
+ */
+public interface ProjectFile {
+
+ /**
+ * Returns the name of the file.
+ *
+ * @return The name of the file
+ */
+ public String getName();
+
+ /**
+ * Returns all parent files of this file. This file is the last file in the
+ * returned list.
+ *
+ * @return A list of all parents of this file and this file itself
+ */
+ public List<ProjectFile> getParents();
+
+ /**
+ * Returns whether this file is a directory.
+ *
+ * @return <code>true</code> if this file is a directory,
+ * <code>false</code> otherwise
+ */
+ public boolean isDirectory();
+
+ /**
+ * Returns whether this file is a file (as opposed to being a directory).
+ *
+ * @return <code>true</code> if this file is a file, <code>false</code>
+ * otherwise
+ */
+ public boolean isFile();
+
+ /**
+ * Returns whether this file is hidden.
+ *
+ * @return <code>true</code> if this file is hidden
+ */
+ public boolean isHidden();
+
+ /**
+ * If this file is a directory, returns all files in this directory.
+ *
+ * @see #isDirectory()
+ * @return All files in this directory if this file is a directory, or
+ * <code>null</code> if this file is not a directory
+ */
+ public List<ProjectFile> getFiles();
+
+}