Skip to content

Commit

Permalink
Add some testing code for #37
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Dec 13, 2015
1 parent c5b43ac commit daf25d7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/groovy/net/zomis/brainf/ui/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ public void initialize(URL url, ResourceBundle resource) {
e.consume();
}
});
tabs.getSelectionModel().selectedItemProperty().addListener(this::tabChange);
}

private void tabChange(ObservableValue<? extends Tab> observable, Tab oldValue, Tab newValue) {
tabMap.get(newValue).getCodeArea().requestFocus();
System.out.println("change tab to " + newValue.getText());
}

@FXML void close() {
Expand Down
24 changes: 24 additions & 0 deletions src/main/groovy/net/zomis/brainf/ui/MemoryListCell.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package net.zomis.brainf.ui

import javafx.scene.control.ListCell
import javafx.scene.control.TextField

/**
* Created by Simon on 12/5/2015.
*/
class MemoryListCell extends ListCell<String> {

private TextField textField

MemoryListCell() {
super()
textField = new TextField()
this.getChildren().add(textField)
}

@Override
protected void updateItem(String item, boolean empty) {
super.updateItem(item, empty)
textField.setText(item)
}
}

0 comments on commit daf25d7

Please sign in to comment.