use of com.kyj.fx.voeditor.visual.component.popup.GagoyleWorkspaceOpenResourceView in project Gargoyle by callakrsos.
the class SystemLayoutViewController method treeProjectFileOnKeyPressed.
/********************************
* 작성일 : 2016. 6. 11. 작성자 : KYJ
*
* 트리 키 클릭 이벤트
*
* @param event
********************************/
public void treeProjectFileOnKeyPressed(KeyEvent event) {
if (event.getCode() == KeyCode.R && event.isControlDown() && event.isShiftDown() && !event.isAltDown()) {
try {
GagoyleWorkspaceOpenResourceView resourceView = new GagoyleWorkspaceOpenResourceView();
ResultDialog<File> show = resourceView.show();
File data = show.getData();
if (data != null && data.exists()) {
TreeItem<FileWrapper> search = search(data);
treeProjectFile.getSelectionModel().select(search);
treeProjectFile.getFocusModel().focus(treeProjectFile.getSelectionModel().getSelectedIndex());
treeProjectFile.scrollTo(treeProjectFile.getSelectionModel().getSelectedIndex());
openFile(data);
}
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
}
} else if (event.getCode() == KeyCode.DELETE && !event.isControlDown() && !event.isShiftDown() && !event.isAltDown()) {
//이벤트 발생시킴.
ActionEvent.fireEvent(tail -> tail.append((event1, tail1) -> {
deleteFileMenuItemOnAction((ActionEvent) event1);
return event1;
}), new ActionEvent());
} else if (KeyCode.F5 == event.getCode()) {
TreeItem<FileWrapper> selectedItem = treeProjectFile.getSelectionModel().getSelectedItem();
if (selectedItem != null)
refleshWorkspaceTreeItem(selectedItem);
}
}
Aggregations