use of javafx.scene.control.ContextMenu in project Gargoyle by callakrsos.
the class DatabaseTableView method initialize.
@FXML
void initialize() {
contextMenuTbModelMst = new ContextMenu();
txtTableName.setOnKeyReleased(event -> {
if (KeyCode.ENTER == event.getCode()) {
String tableName = txtTableName.getText();
requestTables(tableName);
}
});
btnSearch.setOnMouseClicked(event -> {
String name = txtTableName.getText();
String selectedItem = choType.getSelectionModel().getSelectedItem();
switch(selectedItem) {
case TYPE_TABLE:
requestTables(name);
break;
case TYPE_VIEW:
requestViews(name);
}
});
tbMaster.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
tbModelMst.getItems().clear();
TableMasterDVO selectedItem = tbMaster.getSelectionModel().getSelectedItem();
try {
if (selectedItem == null)
return;
List<TableModelDVO> list = listColumns(selectedItem);
tbModelMst.getItems().addAll(list);
} catch (Exception e) {
DialogUtil.showExceptionDailog(e, "데이터베이스 처리 에러");
}
}
});
btnSelect.setOnMouseClicked(event -> {
if (tbMaster.getItems().isEmpty() || tbModelMst.getItems().isEmpty()) {
return;
}
TableMasterDVO selectedItem = tbMaster.getSelectionModel().getSelectedItem();
ObservableList<TableModelDVO> items = tbModelMst.getItems();
tableDVO = new TableDVO(selectedItem, items);
close();
});
MenuItem menuDelete = new MenuItem("삭제");
menuDelete.setOnAction(event -> {
TableViewSelectionModel<TableModelDVO> selectionModel = tbModelMst.getSelectionModel();
int selectedIndex = selectionModel.getSelectedIndex();
if (selectedIndex >= 0) {
tbModelMst.getItems().remove(selectedIndex);
selectionModel.clearSelection();
}
});
// MenuItem menuDistinct = new MenuItem("중복제거");
// menuDistinct.setOnAction(event -> {
// ObservableList<TableModelDVO> items = tbModelMst.getItems();
// items.stream().filter(distinctByKey(new Function<TableModelDVO,
// ObservableList<TableModelDVO>>(){
//
// @Override
// public ObservableList<TableModelDVO> apply(TableModelDVO t) {
// // TODO Auto-generated method stub
// return null;
// }));
contextMenuTbModelMst.getItems().add(menuDelete);
tbModelMst.setContextMenu(contextMenuTbModelMst);
}
use of javafx.scene.control.ContextMenu in project Gargoyle by callakrsos.
the class ProxyServerController method initRemote.
private void initRemote() {
MenuItem miClear = new MenuItem("Clear All");
lvRemoteData.setContextMenu(new ContextMenu(miClear));
miClear.setOnAction(ev -> {
lvRemoteData.getItems().clear();
});
}
use of javafx.scene.control.ContextMenu in project Gargoyle by callakrsos.
the class ProxyServerController method initLocal.
private void initLocal() {
MenuItem miClear = new MenuItem("Clear All");
lvLocalData.setContextMenu(new ContextMenu(miClear));
miClear.setOnAction(ev -> {
lvLocalData.getItems().clear();
});
}
use of javafx.scene.control.ContextMenu in project Gargoyle by callakrsos.
the class SVNTreeView method addContextMenus.
/***********************************************************************************/
/***********************************************************************************/
/* 일반API 구현 */
/**
* 컨텍스트 메뉴 등록
*
* @작성자 : KYJ
* @작성일 : 2016. 4. 4.
*/
void addContextMenus() {
menuNew = new Menu("New");
menuAddNewLocation = new MenuItem("Repository Location");
menuDiscardLocation = new MenuItem("Discard Location");
menuReflesh = new MenuItem("Reflesh");
menuCheckout = new MenuItem("Checkout");
menuSvnGraph = new MenuItem("SVN Graph");
menuProperties = new MenuItem("Properties");
menuNew.getItems().add(menuAddNewLocation);
menuAddNewLocation.setOnAction(this::menuAddNewLocationOnAction);
menuDiscardLocation.setOnAction(this::menuDiscardLocationOnAction);
menuCheckout.setOnAction(this::menuCheckoutOnAction);
menuSvnGraph.setOnAction(this::menuSVNGraphOnAction);
menuProperties.setOnAction(this::menuPropertiesOnAction);
contextMenu = new ContextMenu(menuNew, new SeparatorMenuItem(), menuCheckout, new SeparatorMenuItem(), menuSvnGraph, new SeparatorMenuItem(), menuDiscardLocation, menuReflesh, new SeparatorMenuItem(), menuProperties);
// setContextMenu(contextMenu);
setCellFactory(treeItem -> {
TextFieldTreeCell<SVNItem> textFieldTreeCell = new TextFieldTreeCell<>();
textFieldTreeCell.setContextMenu(contextMenu);
return textFieldTreeCell;
});
// 특정 조건에 따른 메뉴 VISIBLE 처리를 정의함.
contextMenu.setOnShown(contextMenuVisibleEvent);
}
use of javafx.scene.control.ContextMenu in project Gargoyle by callakrsos.
the class SVNViewer method initialize.
@FXML
public void initialize() {
tvSvnView = new SVNTreeView();
tvSvnView.setOnAction(this::svnTreeViewOnAction);
tvSvnView.setOnKeyPressed(this::svnTreeVoewOnKeyPressed);
tvSvnView.load();
anTreePane.getChildren().set(0, tvSvnView);
AnchorPane.setLeftAnchor(tvSvnView, 0.0);
AnchorPane.setRightAnchor(tvSvnView, 0.0);
AnchorPane.setBottomAnchor(tvSvnView, 0.0);
AnchorPane.setTopAnchor(tvSvnView, 0.0);
colRevision.setCellValueFactory(v -> new SimpleObjectProperty<Long>(v.getValue().getRevision()));
colUser.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getAuthor()));
colComment.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getMessage()));
colDate.setCellValueFactory(v -> new SimpleStringProperty(DateUtil.getDateString(v.getValue().getDate().getTime(), "yyyy-MM-dd")));
javaTextAre = new JavaTextArea();
borSource.setCenter(javaTextAre);
lineHist = new LineChart<>(new CategoryAxis(), new CategoryAxis());
borChart.setCenter(lineHist);
tbRevision.getSelectionModel().setCellSelectionEnabled(true);
tbRevision.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
// FxClipboardUtil.installCopyPasteHandler(tbRevision);
// FxTableViewUtil.
FxUtil.installClipboardKeyEvent(tbRevision);
MenuItem menuDiff = new MenuItem("Diff");
menuDiff.setOnAction(this::menuDiffOnAction);
tbRevision.setContextMenu(new ContextMenu(menuDiff));
tvSvnView.svnGraphPropertyProperty().addListener((oba, oldView, newView) -> {
if (newView != null) {
Tab tabSvnGraph = new Tab("SVN Graph", newView);
if (tabPaneSVN.getTabs().size() <= TAB_INDEX_SVN_GRAPH) {
tabPaneSVN.getTabs().add(tabSvnGraph);
} else {
tabPaneSVN.getTabs().add(TAB_INDEX_SVN_GRAPH, tabSvnGraph);
}
}
});
displayLatestRevision();
}
Aggregations