Search in sources :

Example 1 with ResultDialog

use of com.kyj.fx.voeditor.visual.component.ResultDialog in project Gargoyle by callakrsos.

the class SelectWorkspaceView method btnOkOnMouseClick.

@FXML
public void btnOkOnMouseClick(MouseEvent e) {
    String workspaceDir = txtWorkspace.getText();
    if (workspaceDir == null || workspaceDir.isEmpty()) {
        DialogUtil.showMessageDialog("경로가 비어있습니다.");
        return;
    }
    File workspaceFile = new File(workspaceDir);
    if (workspaceFile.isFile()) {
        DialogUtil.showMessageDialog("파일의 유형이 잘못되었습니다. 디렉토리를 선택하세요.");
        return;
    }
    if (!workspaceFile.exists()) {
        try {
            FileUtils.forceMkdir(workspaceFile);
        } catch (IOException e1) {
            DialogUtil.showMessageDialog("디렉토리 생성에 실패하였습니다.");
            return;
        }
    }
    ResourceLoader.getInstance().put(ResourceLoader.BASE_DIR, workspaceFile.getAbsolutePath());
    result = new ResultDialog();
    result.setStatus(ResultDialog.OK);
    close();
}
Also used : ResultDialog(com.kyj.fx.voeditor.visual.component.ResultDialog) IOException(java.io.IOException) File(java.io.File) FXML(javafx.fxml.FXML)

Example 2 with ResultDialog

use of com.kyj.fx.voeditor.visual.component.ResultDialog 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);
    }
}
Also used : Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) MultipleSelectionModel(javafx.scene.control.MultipleSelectionModel) ListChangeListener(javafx.collections.ListChangeListener) JavaProjectFileTreeItem(com.kyj.fx.voeditor.visual.component.JavaProjectFileTreeItem) FileUtil(com.kyj.fx.voeditor.visual.util.FileUtil) Path(java.nio.file.Path) SystemUtils(org.apache.commons.lang.SystemUtils) SplitPane(javafx.scene.control.SplitPane) Pair(javafx.util.Pair) Event(javafx.event.Event) KeyEvent(javafx.scene.input.KeyEvent) PluginLoader(com.kyj.fx.voeditor.visual.loder.PluginLoader) Platform(javafx.application.Platform) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) ResourceLoader(com.kyj.fx.voeditor.visual.momory.ResourceLoader) XMLTextView(com.kyj.fx.voeditor.visual.component.popup.XMLTextView) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) CodeAnalysisJavaTextArea(com.kyj.fx.voeditor.visual.component.text.CodeAnalysisJavaTextArea) DbExecListener(com.kyj.fx.voeditor.visual.util.DbExecListener) SVNViewer(com.kyj.fx.voeditor.visual.component.scm.SVNViewer) TreeItem(javafx.scene.control.TreeItem) FXCollections(javafx.collections.FXCollections) DialogUtil(com.kyj.fx.voeditor.visual.util.DialogUtil) FilePropertiesComposite(com.kyj.fx.voeditor.visual.component.file.FilePropertiesComposite) FXMLLoader(javafx.fxml.FXMLLoader) SpecResource(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource) UtubeDownloaderComposite(com.kyj.fx.voeditor.visual.component.utube.UtubeDownloaderComposite) Properties(java.util.Properties) ImageViewPane(com.kyj.fx.voeditor.visual.component.ImageViewPane) TitledPane(javafx.scene.control.TitledPane) Node(javafx.scene.Node) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) RuntimeClassUtil(com.kyj.fx.voeditor.visual.util.RuntimeClassUtil) File(java.io.File) ReadOnlySingletonConsole(com.kyj.fx.voeditor.visual.component.console.ReadOnlySingletonConsole) GoogleTrendComposite(com.kyj.fx.voeditor.visual.component.google.trend.GoogleTrendComposite) Menu(javafx.scene.control.Menu) ContextMenuEvent(javafx.scene.input.ContextMenuEvent) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) NrchRealtimeSrchFlowComposite(com.kyj.fx.voeditor.visual.component.nrch.realtime.NrchRealtimeSrchFlowComposite) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) Tab(javafx.scene.control.Tab) ImageView(javafx.scene.image.ImageView) ResultDialog(com.kyj.fx.voeditor.visual.component.ResultDialog) SkinManager(com.kyj.fx.voeditor.visual.momory.SkinManager) Image(javafx.scene.image.Image) EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) DbUtil(com.kyj.fx.voeditor.visual.util.DbUtil) LoggerFactory(org.slf4j.LoggerFactory) NullExpresion(com.kyj.fx.voeditor.visual.util.NullExpresion) JavaSVNManager(com.kyj.scm.manager.svn.java.JavaSVNManager) SVNWcDbClient(com.kyj.scm.manager.svn.java.SVNWcDbClient) PDFImageBasePane(com.kyj.fx.voeditor.visual.component.PDFImageBasePane) VBox(javafx.scene.layout.VBox) SelectWorkspaceView(com.kyj.fx.voeditor.visual.component.popup.SelectWorkspaceView) PMDCheckedListComposite(com.kyj.fx.voeditor.visual.component.pmd.PMDCheckedListComposite) Parent(javafx.scene.Parent) JavaProjectMemberFileTreeItem(com.kyj.fx.voeditor.visual.component.JavaProjectMemberFileTreeItem) ContextMenu(javafx.scene.control.ContextMenu) GargoyleExtensionFilters(com.kyj.fx.voeditor.visual.util.GargoyleExtensionFilters) CommonsSqllPan(com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan) WindowEvent(javafx.stage.WindowEvent) FXMLTextView(com.kyj.fx.voeditor.visual.component.popup.FXMLTextView) GagoyleWorkspaceOpenResourceView(com.kyj.fx.voeditor.visual.component.popup.GagoyleWorkspaceOpenResourceView) TextField(javafx.scene.control.TextField) Main(com.kyj.fx.voeditor.visual.main.Main) MenuItem(javafx.scene.control.MenuItem) PMDUtil(com.kyj.fx.voeditor.visual.util.PMDUtil) SimpleTextView(com.kyj.fx.voeditor.visual.component.text.SimpleTextView) ConfigResourceLoader(com.kyj.fx.voeditor.visual.momory.ConfigResourceLoader) DockTab(com.kyj.fx.voeditor.visual.component.dock.tab.DockTab) TreeView(javafx.scene.control.TreeView) JarWrapper(com.kyj.fx.voeditor.visual.loder.JarWrapper) FXML(javafx.fxml.FXML) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) Priority(javafx.scene.layout.Priority) List(java.util.List) GagoyleParentBeforeLoad(com.kyj.fx.voeditor.visual.framework.GagoyleParentBeforeLoad) SpecTabPane(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane) GagoyleParentOnLoaded(com.kyj.fx.voeditor.visual.framework.GagoyleParentOnLoaded) Optional(java.util.Optional) LogViewComposite(com.kyj.fx.voeditor.visual.component.text.LogViewComposite) DateUtil(com.kyj.fx.voeditor.visual.util.DateUtil) ReadOnlyConsole(com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole) Scene(javafx.scene.Scene) DockTabPane(com.kyj.fx.voeditor.visual.component.dock.tab.DockTabPane) DesignerFxComposite(com.kyj.fx.voeditor.visual.component.pmd.DesignerFxComposite) BigTextView(com.kyj.fx.voeditor.visual.component.popup.BigTextView) JavaProcessMonitor(com.kyj.fx.voeditor.visual.component.bci.view.JavaProcessMonitor) MouseEvent(javafx.scene.input.MouseEvent) WebViewConsole(com.kyj.fx.voeditor.visual.component.console.WebViewConsole) FileWrapper(com.kyj.fx.voeditor.visual.component.FileWrapper) ProgramSpecUtil(com.kyj.fx.voeditor.visual.words.spec.auto.msword.util.ProgramSpecUtil) JavaTextView(com.kyj.fx.voeditor.visual.component.popup.JavaTextView) Tooltip(javafx.scene.control.Tooltip) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException) KeyCode(javafx.scene.input.KeyCode) WebView(javafx.scene.web.WebView) ObjectProperty(javafx.beans.property.ObjectProperty) Logger(org.slf4j.Logger) CaptureScreenComposite(com.kyj.fx.voeditor.visual.component.capture.CaptureScreenComposite) ProxyServerComposite(com.kyj.fx.voeditor.visual.component.proxy.ProxyServerComposite) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) FileInputStream(java.io.FileInputStream) ProjectFileTreeItemCreator(com.kyj.fx.voeditor.visual.component.ProjectFileTreeItemCreator) ActionEvent(javafx.event.ActionEvent) SystemConsole(com.kyj.fx.voeditor.visual.component.console.SystemConsole) Stage(javafx.stage.Stage) Closeable(java.io.Closeable) ExtensionFilter(javafx.stage.FileChooser.ExtensionFilter) InputStream(java.io.InputStream) SharedMemory(com.kyj.fx.voeditor.visual.momory.SharedMemory) GagoyleWorkspaceOpenResourceView(com.kyj.fx.voeditor.visual.component.popup.GagoyleWorkspaceOpenResourceView) ActionEvent(javafx.event.ActionEvent) FileWrapper(com.kyj.fx.voeditor.visual.component.FileWrapper) File(java.io.File) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException)

Example 3 with ResultDialog

use of com.kyj.fx.voeditor.visual.component.ResultDialog in project Gargoyle by callakrsos.

the class Main method start.

// public Main() {
//
//
// }
@Override
public void start(Stage primaryStage) throws IOException {
    // 초기화 처리
    callInitializers();
    // setApplicationUncaughtExceptionHandler();
    // 어플리케이션 타이틀 지정
    primaryStage.setTitle(APPLICATION_TITLE);
    // 화면 중앙 위치.
    primaryStage.centerOnScreen();
    // 메인 스테이지 클로즈 이벤트 구현.
    primaryStage.setOnCloseRequest(onPrimaryStageCloseRequest);
    /* [시작 ]초기 워크스페이스 선택 지정. */
    String baseDir = ResourceLoader.getInstance().get(ResourceLoader.BASE_DIR);
    if (baseDir == null || baseDir.isEmpty() || !new File(baseDir).exists()) {
        SelectWorkspaceView selectWorkspaceView = new SelectWorkspaceView();
        @SuppressWarnings("rawtypes") ResultDialog show = selectWorkspaceView.showAndWait();
        if (ResultDialog.CANCEL == show.getStatus()) {
            Platform.exit();
            return;
        }
    }
    try {
        // 예상치 못한 에외에 대한 대비 로직구현.
        setApplicationUncaughtExceptionHandler();
        // 클래스 로딩같은 어플리케이션이 메모리에 로딩됨과 동기에 무거운 처리를 비동기로 로딩하는 로직이 구현되있음.
        SharedMemory.init();
        // PrimaryStage를 공유변수로 지정하기 위한 로직 처리.
        SharedMemory.setPrimaryStage(primaryStage);
        // Main Application을 로드
        BorderPane mainParent = setNewRootView();
        Scene scene = new Scene(mainParent, 1280, 900);
        //			SkinManager.getInstance().resetSkin();
        scene.getStylesheets().add(SkinManager.getInstance().getSkin());
        scene.getStylesheets().add(SkinManager.getInstance().getButtonSkin());
        primaryStage.setScene(scene);
        primaryStage.show();
    } catch (Exception e) {
        LOGGER.error(ValueUtil.toString(e));
    }
}
Also used : BorderPane(javafx.scene.layout.BorderPane) ResultDialog(com.kyj.fx.voeditor.visual.component.ResultDialog) SelectWorkspaceView(com.kyj.fx.voeditor.visual.component.popup.SelectWorkspaceView) Scene(javafx.scene.Scene) File(java.io.File) IOException(java.io.IOException)

Example 4 with ResultDialog

use of com.kyj.fx.voeditor.visual.component.ResultDialog in project Gargoyle by callakrsos.

the class SelectWorkspaceView method btnCancelOnMouseClick.

/**
	 * 취소버튼 클릭 이벤트
	 *
	 * @Date 2015. 10. 17.
	 * @param e
	 * @User KYJ
	 */
@FXML
public void btnCancelOnMouseClick(MouseEvent e) {
    result = new ResultDialog();
    result.setStatus(ResultDialog.CANCEL);
    close();
}
Also used : ResultDialog(com.kyj.fx.voeditor.visual.component.ResultDialog) FXML(javafx.fxml.FXML)

Aggregations

ResultDialog (com.kyj.fx.voeditor.visual.component.ResultDialog)4 File (java.io.File)3 IOException (java.io.IOException)3 FXML (javafx.fxml.FXML)3 SelectWorkspaceView (com.kyj.fx.voeditor.visual.component.popup.SelectWorkspaceView)2 Scene (javafx.scene.Scene)2 BorderPane (javafx.scene.layout.BorderPane)2 FileWrapper (com.kyj.fx.voeditor.visual.component.FileWrapper)1 ImageViewPane (com.kyj.fx.voeditor.visual.component.ImageViewPane)1 JavaProjectFileTreeItem (com.kyj.fx.voeditor.visual.component.JavaProjectFileTreeItem)1 JavaProjectMemberFileTreeItem (com.kyj.fx.voeditor.visual.component.JavaProjectMemberFileTreeItem)1 PDFImageBasePane (com.kyj.fx.voeditor.visual.component.PDFImageBasePane)1 ProjectFileTreeItemCreator (com.kyj.fx.voeditor.visual.component.ProjectFileTreeItemCreator)1 JavaProcessMonitor (com.kyj.fx.voeditor.visual.component.bci.view.JavaProcessMonitor)1 CaptureScreenComposite (com.kyj.fx.voeditor.visual.component.capture.CaptureScreenComposite)1 ReadOnlyConsole (com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole)1 ReadOnlySingletonConsole (com.kyj.fx.voeditor.visual.component.console.ReadOnlySingletonConsole)1 SystemConsole (com.kyj.fx.voeditor.visual.component.console.SystemConsole)1 WebViewConsole (com.kyj.fx.voeditor.visual.component.console.WebViewConsole)1 DockTab (com.kyj.fx.voeditor.visual.component.dock.tab.DockTab)1