use of com.kyj.fx.voeditor.visual.component.FileWrapper in project Gargoyle by callakrsos.
the class SystemLayoutViewController method menuItemOpenWithSceneBuilderOnAction.
/********************************
* 작성일 : 2016. 6. 19. 작성자 : KYJ
*
* 씬빌더 open하기 위한 이벤트.
*
* SceneBuilderOpenEvent로 넘겨받은 항목만 호출됨.
*
* @param e
********************************/
public void menuItemOpenWithSceneBuilderOnAction(ActionEvent event) {
TreeItem<FileWrapper> selectedTreeItem = this.treeProjectFile.getSelectionModel().getSelectedItem();
if (selectedTreeItem != null) {
File selectedTree = selectedTreeItem.getValue().getFile();
if (FileUtil.isFXML(selectedTree)) {
String sceneLocation = ResourceLoader.getInstance().get(ResourceLoader.SCENEBUILDER_LOCATION);
if (ValueUtil.isEmpty(sceneLocation) || !(new File(sceneLocation).exists())) {
DialogUtil.showMessageDialog("You have to set up SceneBuilder Location.");
lblConfigonMouseClick(null);
return;
}
List<String> args = Arrays.asList(sceneLocation, selectedTree.getAbsolutePath());
try {
RuntimeClassUtil.simpleExec(args);
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
}
}
}
}
use of com.kyj.fx.voeditor.visual.component.FileWrapper 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);
}
}
use of com.kyj.fx.voeditor.visual.component.FileWrapper in project Gargoyle by callakrsos.
the class SystemLayoutViewController method newDirOnAction.
/********************************
* 작성일 : 2016. 8. 29. 작성자 : KYJ
*
* 디렉토리를 새로 생성한다.
*
* @param e
********************************/
public void newDirOnAction(ActionEvent e) {
TreeItem<FileWrapper> selectedItem = treeProjectFile.getSelectionModel().getSelectedItem();
if (selectedItem != null) {
FileWrapper value = selectedItem.getValue();
File file = value.getFile();
if (file.isDirectory()) {
Optional<Pair<String, String>> showInputDialog = DialogUtil.showInputDialog("Directory Name", "Input New Dir Name");
showInputDialog.ifPresent(v -> {
String newFileName = v.getValue();
File createdNewFile = new File(file, newFileName);
boolean mkdir = createdNewFile.mkdir();
if (mkdir) {
TreeItem<FileWrapper> createDefaultNode = projectFileTreeCreator.createDefaultNode(new FileWrapper(createdNewFile));
createDefaultNode.setExpanded(true);
selectedItem.getChildren().add(createDefaultNode);
}
});
}
}
}
use of com.kyj.fx.voeditor.visual.component.FileWrapper in project Gargoyle by callakrsos.
the class SystemLayoutViewController method voEditorMenuItemOnAction.
/********************************
* 작성일 : 2016. 7. 3. 작성자 : KYJ
*
* 파일로부터 VO Editor를 오픈함.
*
* @param e
********************************/
public void voEditorMenuItemOnAction(ActionEvent e) {
TreeItem<FileWrapper> selectedItem = this.treeProjectFile.getSelectionModel().getSelectedItem();
if (selectedItem != null) {
FileWrapper value = selectedItem.getValue();
File file = value.getFile();
try {
Parent parent = FxUtil.load(VoEditorController.class, null, null, c -> {
c.setFromFile(file);
});
loadNewSystemTab("VoEditor", parent);
} catch (Exception e1) {
LOGGER.error(ValueUtil.toString(e1));
}
}
}
use of com.kyj.fx.voeditor.visual.component.FileWrapper in project Gargoyle by callakrsos.
the class SystemLayoutViewController method menuPropertiesOnAction.
/********************************
* 작성일 : 2016. 5. 12. 작성자 : KYJ
*
* 속성을 조회하는 팝업을 로드한다.
*
* @param e
********************************/
public void menuPropertiesOnAction(ActionEvent e) {
TreeItem<FileWrapper> selectedItem = treeProjectFile.getSelectionModel().getSelectedItem();
NullExpresion.ifNotNullDo(selectedItem, item -> {
File file = item.getValue().getFile();
if (file.exists()) {
FilePropertiesComposite composite = new FilePropertiesComposite(file);
FxUtil.createStageAndShow(composite, stage -> {
stage.setTitle(FilePropertiesComposite.TITLE);
stage.initOwner(SharedMemory.getPrimaryStage());
});
}
});
}
Aggregations