Archived
0

add context menu to stations screen

This commit is contained in:
iMoHax
2015-11-05 16:56:33 +03:00
parent 70b9faab78
commit 3dd007f453
2 changed files with 18 additions and 3 deletions

View File

@@ -189,12 +189,18 @@ public class OffersController {
@FXML @FXML
private void addStation() { private void addStation() {
Screeners.showAddStation(getSystem()); SystemModel s = getSystem();
if (!ModelFabric.isFake(s)){
Screeners.showAddStation(s);
}
} }
@FXML @FXML
private void editStation() { private void editStation() {
Screeners.showEditStation(getStation()); StationModel s = getStation();
if (!ModelFabric.isFake(s)){
Screeners.showEditStation(s);
}
} }

View File

@@ -22,7 +22,16 @@
<TextField fx:id="systemText" /> <TextField fx:id="systemText" />
</TitledPane> </TitledPane>
<TitledPane VBox.vgrow="ALWAYS" text="%market.stations" collapsible="false"> <TitledPane VBox.vgrow="ALWAYS" text="%market.stations" collapsible="false">
<ListView fx:id="stationsList"/> <ListView fx:id="stationsList">
<contextMenu>
<ContextMenu>
<items>
<MenuItem text="%main.menu.edit.addStation" onAction="#addStation" />
<MenuItem text="%main.menu.edit.editStation" onAction="#editStation" />
</items>
</ContextMenu>
</contextMenu>
</ListView>
</TitledPane> </TitledPane>
</VBox> </VBox>
<TitledPane fx:id="stationPane" GridPane.columnIndex="1" maxHeight="60" collapsible="false"> <TitledPane fx:id="stationPane" GridPane.columnIndex="1" maxHeight="60" collapsible="false">