forked from nus-cs2103-AY1819S1/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from iMarbles/dev
Manage Command part 1
- Loading branch information
Showing
7 changed files
with
115 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/seedu/address/commons/events/ui/RecordChangeEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package seedu.address.commons.events.ui; | ||
|
||
import seedu.address.commons.core.index.Index; | ||
import seedu.address.commons.events.BaseEvent; | ||
|
||
/** | ||
* Indicates a request to jump to the list of persons | ||
*/ | ||
public class RecordChangeEvent extends BaseEvent { | ||
|
||
public final int targetIndex; | ||
|
||
public RecordChangeEvent(Index targetIndex) { | ||
this.targetIndex = targetIndex.getZeroBased(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getClass().getSimpleName(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package seedu.address.ui; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import com.google.common.eventbus.Subscribe; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.control.TableView; | ||
import javafx.scene.layout.Region; | ||
import seedu.address.commons.core.LogsCenter; | ||
import seedu.address.commons.events.ui.RecordChangeEvent; | ||
|
||
/** | ||
* Panel containing the list of persons. | ||
*/ | ||
public class RecordEventPanel extends UiPart<Region> { | ||
private static final String FXML = "RecordEventPanel.fxml"; | ||
private final Logger logger = LogsCenter.getLogger(RecordEventPanel.class); | ||
|
||
@FXML | ||
private Label eventNameLabel; | ||
@FXML | ||
private Label numOfVolunteersLabel; | ||
@FXML | ||
private TableView volunteerRecordTableView; | ||
|
||
public RecordEventPanel() { | ||
super(FXML); | ||
registerAsAnEventHandler(this); | ||
} | ||
|
||
@Subscribe | ||
private void handleRecordChangeEvent(RecordChangeEvent event) { | ||
logger.info(LogsCenter.getEventHandlingLogMessage(event)); | ||
eventNameLabel.setText("EVENT!"); | ||
numOfVolunteersLabel.setText("0"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.TableColumn?> | ||
<?import javafx.scene.control.TableView?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.layout.VBox?> | ||
|
||
<VBox xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1"> | ||
<VBox alignment="CENTER_LEFT"> | ||
<Label fx:id="eventNameLabel" text="Event Name"> | ||
</Label> | ||
</VBox> | ||
<HBox alignment="CENTER_LEFT"> | ||
<Label>Total Number of Volunteers:</Label> | ||
<Label fx:id="numOfVolunteersLabel">0</Label> | ||
</HBox> | ||
<VBox VBox.vgrow="ALWAYS"> | ||
<TableView fx:id="volunteerRecordTableView" prefWidth="900" VBox.vgrow="ALWAYS"> | ||
<columns> | ||
<TableColumn prefWidth="50" text="#"/> | ||
<TableColumn prefWidth="450" text="Name"/> | ||
<TableColumn prefWidth="300" text="Contact Number"/> | ||
<TableColumn prefWidth="100" text="Hours"/> | ||
</columns> | ||
<columnResizePolicy> | ||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/> | ||
</columnResizePolicy> | ||
</TableView> | ||
</VBox> | ||
</VBox> |