Added NewProjectDialog, fixed some error handling and general stability fixes
This commit is contained in:
parent
34cf5865fe
commit
223fe1f136
13 changed files with 336 additions and 54 deletions
13
src/com/coder/client/gui/newProject/NewProjectDialog.fxml
Normal file
13
src/com/coder/client/gui/newProject/NewProjectDialog.fxml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="159.0" prefWidth="319.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<Button fx:id="cancelButton" layoutX="60.0" layoutY="67.0" mnemonicParsing="false" onAction="#cancel" text="cancel" />
|
||||
<Button fx:id="createButton" defaultButton="true" disable="true" layoutX="195.0" layoutY="67.0" mnemonicParsing="false" onAction="#create" text="create" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
82
src/com/coder/client/gui/newProject/NewProjectDialog.java
Normal file
82
src/com/coder/client/gui/newProject/NewProjectDialog.java
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@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
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.coder.client.gui.newProject;
|
||||
|
||||
public interface NewProjectDialogListener {
|
||||
|
||||
public void willShow();
|
||||
|
||||
public void create(String projectName, String projectType);
|
||||
|
||||
public void cancel();
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue