Search in sources :

Example 1 with Pagination

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();
}
Also used : Pagination(javafx.scene.control.Pagination) Node(javafx.scene.Node) Scene(javafx.scene.Scene)

Example 2 with Pagination

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);
}
Also used : Pagination(javafx.scene.control.Pagination) Node(javafx.scene.Node) PagedSimpleTextView(com.kyj.fx.voeditor.visual.component.text.PagedSimpleTextView) SimpleTextView(com.kyj.fx.voeditor.visual.component.text.SimpleTextView) FXML(javafx.fxml.FXML)

Aggregations

Node (javafx.scene.Node)2 Pagination (javafx.scene.control.Pagination)2 PagedSimpleTextView (com.kyj.fx.voeditor.visual.component.text.PagedSimpleTextView)1 SimpleTextView (com.kyj.fx.voeditor.visual.component.text.SimpleTextView)1 FXML (javafx.fxml.FXML)1 Scene (javafx.scene.Scene)1