import java.awt.event.KeyEvent;
import java.io.IOException;
import java.text.MessageFormat;
+import java.util.List;
import java.util.Map.Entry;
import javax.swing.AbstractAction;
* @param projects
* The list of projects
*/
- public void setProjects(Project[] projects) {
+ public void setProjects(List<Project> projects) {
projectListModel.clear();
for (Project project : projects) {
projectListModel.add(project);
*
* @return The list of projects
*/
- public Project[] getProjects() {
- return projectListModel.toArray(new Project[projectListModel.size()]);
+ public List<Project> getProjects() {
+ return projectListModel;
}
/**
package de.todesbaum.jsite.main;
import java.io.PrintWriter;
+import java.util.List;
import net.pterodactylus.util.io.StreamCopier.ProgressListener;
import de.todesbaum.jsite.application.Freenet7Interface;
private Node[] nodes;
/** The projects. */
- private Project[] projects;
+ private List<Project> projects;
/** Whether the insert has finished. */
private boolean finished = false;
*
* @return A list of all projects
*/
- public Project[] getProjects() {
+ public List<Project> getProjects() {
List<Project> projects = new ArrayList<Project>();
SimpleXML projectsNode = rootNode.getNode("project-list");
if (projectsNode != null) {
}
}
}
- return projects.toArray(new Project[projects.size()]);
+ return projects;
}
/**
* @param projects
* The list of all projects
*/
- public void setProjects(Project[] projects) {
+ public void setProjects(List<Project> projects) {
SimpleXML projectsNode = new SimpleXML("project-list");
for (Project project : projects) {
SimpleXML projectNode = projectsNode.append("project");