Search in sources :

Example 1 with BaseInfoComposite

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.skin.BaseInfoComposite in project Gargoyle by callakrsos.

the class ProjectInfoBaseInfoTab method supplyNode.

@Override
public BorderPane supplyNode() throws Exception {
    BorderPane root = new BorderPane();
    try {
        /* BaseInfo */
        baseInfoController = new BaseInfoComposite(this);
        //			FXMLLoader loader = new FXMLLoader();
        //			loader.setLocation(BaseInfoComposite.class.getResource("BaseInfoApp.fxml"));
        //			BorderPane supplyNode = loader.load();
        //			supplyNode.setPrefWidth(BorderPane.USE_COMPUTED_SIZE);
        //			BaseInfoComposite baseInfoController = loader.getController();
        /* 버튼박스 */
        HBox hboxButton = new HBox(5);
        hboxButton.setPrefHeight(HBox.USE_COMPUTED_SIZE);
        HBox.setHgrow(hboxButton, Priority.NEVER);
        btnGenerate = new Button("사양서 생성");
        btnGenerate.setOnMouseClicked(this::btnGenerateOnMouseClick);
        btnGenerate.setPrefWidth(120);
        hboxButton.getChildren().add(btnGenerate);
        /* TableInfo */
        gv = new CrudBaseGridView<MethodDVO>(MethodDVO.class, new AnnotateBizOptions<MethodDVO>(MethodDVO.class) {

            @Override
            public boolean isCreateColumn(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                //						return false;
                return super.isCreateColumn(columnName);
            }

            @Override
            public boolean visible(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                return super.visible(columnName);
            }
        });
        //이벤트 리스너로 그리드에 추가되는 항목이 존재하면 추가.
        ObservableList<MethodDVO> methodData = baseInfoController.getMethodData();
        methodData.addListener(new ListChangeListener<MethodDVO>() {

            @Override
            public void onChanged(javafx.collections.ListChangeListener.Change<? extends MethodDVO> c) {
                if (c.next()) {
                    if (c.wasAdded()) {
                        gv.getItems().addAll(c.getAddedSubList());
                    } else if (c.wasRemoved()) {
                        gv.getItems().removeAll(c.getRemoved());
                    }
                }
            }
        });
        //			ObservableList<MethodDVO> items = gv.getItems();
        //			gv.getItems().addAll(methodData);
        baseInfoController.setBottom(hboxButton);
        root.setTop(baseInfoController);
        root.setCenter(gv);
        baseInfoController.start();
    } catch (IOException | NullPointerException e) {
        LOGGER.error(ValueUtil.toString(e));
    }
    root.setPrefSize(BorderPane.USE_COMPUTED_SIZE, BorderPane.USE_COMPUTED_SIZE);
    root.setPadding(new Insets(5, 5, 5, 5));
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) BaseInfoComposite(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.skin.BaseInfoComposite) IOException(java.io.IOException) ListChangeListener(javafx.collections.ListChangeListener) AnnotateBizOptions(com.kyj.fx.voeditor.visual.component.grid.AnnotateBizOptions) Button(javafx.scene.control.Button) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Aggregations

AnnotateBizOptions (com.kyj.fx.voeditor.visual.component.grid.AnnotateBizOptions)1 BaseInfoComposite (com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.skin.BaseInfoComposite)1 MethodDVO (com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)1 IOException (java.io.IOException)1 ListChangeListener (javafx.collections.ListChangeListener)1 Insets (javafx.geometry.Insets)1 Button (javafx.scene.control.Button)1 BorderPane (javafx.scene.layout.BorderPane)1 HBox (javafx.scene.layout.HBox)1