Search in sources :

Example 1 with PagedSimpleTextView

use of com.kyj.fx.voeditor.visual.component.text.PagedSimpleTextView 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

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 Node (javafx.scene.Node)1 Pagination (javafx.scene.control.Pagination)1