2015-10-23 13:44:11 +00:00
|
|
|
package com.coder.client.gui.newProject;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.ResourceBundle;
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
|
|
import javafx.event.ActionEvent;
|
|
|
|
|
import javafx.fxml.FXML;
|
|
|
|
|
import javafx.scene.control.Button;
|
|
|
|
|
|
|
|
|
|
import zutil.log.LogUtil;
|
|
|
|
|
|
|
|
|
|
import com.coder.client.gui.GuiWindow;
|
|
|
|
|
import com.coder.server.message.ConfigData;
|
|
|
|
|
|
|
|
|
|
public class NewProjectDialog extends GuiWindow {
|
|
|
|
|
public static final Logger logger = LogUtil.getLogger();
|
|
|
|
|
private HashSet<NewProjectDialogListener> listeners;
|
|
|
|
|
|
|
|
|
|
@FXML private Button createButton;
|
|
|
|
|
@FXML private Button cancelButton;
|
|
|
|
|
|
|
|
|
|
public NewProjectDialog() throws IOException {
|
|
|
|
|
super(NewProjectDialog.class.getResource("NewProjectDialog.fxml"));
|
|
|
|
|
listeners = new HashSet<NewProjectDialogListener>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void willShow() {
|
|
|
|
|
for(NewProjectDialogListener listener : this.listeners){
|
|
|
|
|
listener.willShow();
|
|
|
|
|
}
|
2015-10-27 12:18:22 +01:00
|
|
|
//TODO: if(errorMessage == null || errorMessage.isEmpty()){project = ""; type = "";} //keep field data if there is an error
|
2015-10-23 13:44:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
protected void create(ActionEvent event){
|
|
|
|
|
for(NewProjectDialogListener listener : this.listeners){
|
|
|
|
|
listener.create("Project Name", "Project Type");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
|
protected void cancel(ActionEvent event){
|
|
|
|
|
for(NewProjectDialogListener listener : this.listeners){
|
|
|
|
|
listener.cancel();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected String getTitle() {
|
|
|
|
|
return "New Project";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addNewProjectDialogListener(NewProjectDialogListener newProjectDialogListener) {
|
|
|
|
|
this.listeners.add(newProjectDialogListener);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void addProjectTypeToList(String typeName, ConfigData typeData) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void clearProjectTypeList() {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setErrorMessage(String errorMsg) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|