use of javafx.scene.control.Pagination in project Gargoyle by callakrsos.
the class PagingGridPaneExam method start.
/*
* (non-Javadoc)
*
* @see javafx.application.Application#start(javafx.stage.Stage)
*/
@Override
public void start(Stage primaryStage) throws Exception {
Pagination pagination = new Pagination(100);
pagination.setPageFactory(new Callback<Integer, Node>() {
@Override
public Node call(Integer param) {
return new ListView<>();
}
});
primaryStage.setScene(new Scene(pagination));
primaryStage.show();
}
use of javafx.scene.control.Pagination in project Gargoyle by callakrsos.
the class BigTextView method initialize.
@FXML
public void initialize() {
// javaTextArea = new TextArea();
// javaTextArea.setPrefSize(TextArea.USE_COMPUTED_SIZE, Double.MAX_VALUE);
hboxButtons.setVisible(showButtons);
pagination = new Pagination(TOTAL_PAGE);
pagination.setCache(true);
pagination.setPageFactory(new Callback<Integer, Node>() {
@Override
public Node call(Integer param) {
if (isUsePageCache && pageCache.containsValue(param)) {
return pageCache.get(param);
}
String readContent = readPage(param);
//new PagedSimpleTextView(BigTextView.this, readContent, false);
SimpleTextView simpleTextView = new SimpleTextView(readContent, false);
simpleTextView.setPrefSize(TextArea.USE_COMPUTED_SIZE, Double.MAX_VALUE);
if (isUsePageCache)
pageCache.put(param, simpleTextView);
return simpleTextView;
}
});
pagination.setPrefSize(Pagination.USE_COMPUTED_SIZE, Pagination.USE_COMPUTED_SIZE);
this.setCenter(pagination);
}
Aggregations