Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- productionItem.onAction = new EventHandler[ActionEvent] {
- override def handle(event: ActionEvent): Unit = {
- val secondLayout = new StackPane
- val secondScene = new Scene(secondLayout, 300, 200) {
- val data = new ObservableBuffer[SimpleGrammarRule]()
- for (it <- grammar.GrammarRules) {
- for(it2 <- it.Productions){
- val temp = new SimpleGrammarRule
- temp.Name = it.Name
- temp.Production = it2
- data.+=(temp)
- }
- }
- val table = new TableView(data)
- val col1 = new TableColumn[SimpleGrammarRule, String]("Name")
- col1.cellValueFactory = cdf => StringProperty(cdf.value.Name)
- val col2 = new TableColumn[SimpleGrammarRule, String]("Production")
- col2.cellValueFactory = cdf => StringProperty(cdf.value.Production)
- table.columns.+=(col1, col2)
- root = table
- }
- val secondStage = new Stage()
- secondStage.title = "Transition List"
- secondStage.setScene(secondScene)
- secondStage.show()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement