use of com.kyj.fx.voeditor.visual.component.grid.AnnotateBizOptions 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;
}
Aggregations