Search in sources :

Example 1 with TreeItem

use of javafx.scene.control.TreeItem in project jphp by jphp-compiler.

the class UXTreeView method setSelectedItems.

@Setter
public void setSelectedItems(List<TreeItem> items) {
    MultipleSelectionModel selectionModel = getWrappedObject().getSelectionModel();
    selectionModel.clearSelection();
    for (TreeItem item : items) {
        selectionModel.select(item);
    }
}
Also used : TreeItem(javafx.scene.control.TreeItem) MultipleSelectionModel(javafx.scene.control.MultipleSelectionModel)

Example 2 with TreeItem

use of javafx.scene.control.TreeItem in project Gargoyle by callakrsos.

the class CustomSkinConfigView method initialize.

@FXML
public void initialize() {
    ttvIConfig.setRowFactory(new Callback<TreeTableView<ConfigurationTreeItem>, TreeTableRow<ConfigurationTreeItem>>() {

        @Override
        public TreeTableRow<ConfigurationTreeItem> call(TreeTableView<ConfigurationTreeItem> param) {
            TreeTableRow<ConfigurationTreeItem> treeTableRow = new TreeTableRow<>();
            treeTableRow.setOnMouseClicked(ev -> {
                ConfigurationTreeItem item = treeTableRow.getItem();
                selectedItem.set(item);
            });
            return treeTableRow;
        }
    });
    ttcConfig.setCellValueFactory(param -> param.getValue().getValue().itemNameProperty());
    ConfigurationTreeItem root = new ConfigurationTreeItem();
    root.setItemName("Basic");
    {
        ConfigurationLeafNodeItem fontConfigItem = new ConfigurationLeafNodeItem();
        fontConfigItem.setItemName("Font Management");
        fontConfigItem.setContentNode(FontViewComposite.class);
        ConfigurationLeafNodeItem backgroundConfigItem = new ConfigurationLeafNodeItem();
        backgroundConfigItem.setItemName("Color Management");
        backgroundConfigItem.setContentNode(SkinPreviewViewComposite.class);
        root.setChildrens(Arrays.asList(fontConfigItem, backgroundConfigItem));
    }
    TreeItem<ConfigurationTreeItem> createNode = new ConfigItemTreeItem().createNode(root);
    createNode.setExpanded(true);
    ttvIConfig.setRoot(createNode);
    ttvIConfig.setOnMouseClicked(ev -> {
        if (ev.getClickCount() == 2) {
            load(selectedItem.get());
        }
    });
    selectedItem.addListener((oba, o, n) -> {
        btnEdit.setDisable(true);
        if (n instanceof ConfigurationLeafNodeItem) {
            if (((ConfigurationLeafNodeItem) n).getContentNode() != null) {
                btnEdit.setDisable(false);
            }
        }
    });
}
Also used : Button(javafx.scene.control.Button) Arrays(java.util.Arrays) TreeItem(javafx.scene.control.TreeItem) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) TreeTableRow(javafx.scene.control.TreeTableRow) Parent(javafx.scene.Parent) TreeTableView(javafx.scene.control.TreeTableView) Callback(javafx.util.Callback) ObjectProperty(javafx.beans.property.ObjectProperty) Logger(org.slf4j.Logger) FontViewComposite(com.kyj.fx.voeditor.visual.component.font.FontViewComposite) FXMLController(com.kyj.fx.voeditor.visual.framework.annotation.FXMLController) ConfigItemTreeItem(com.kyj.fx.voeditor.visual.component.ConfigItemTreeItem) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) Consumer(java.util.function.Consumer) FXML(javafx.fxml.FXML) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) TreeTableColumn(javafx.scene.control.TreeTableColumn) ConfigurationLeafNodeItem(com.kyj.fx.voeditor.visual.main.model.vo.ConfigurationLeafNodeItem) ConfigurationGraphicsNodeItem(com.kyj.fx.voeditor.visual.main.model.vo.ConfigurationGraphicsNodeItem) ConfigurationTreeItem(com.kyj.fx.voeditor.visual.main.model.vo.ConfigurationTreeItem) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) SkinManager(com.kyj.fx.voeditor.visual.momory.SkinManager) BorderPane(javafx.scene.layout.BorderPane) FontViewComposite(com.kyj.fx.voeditor.visual.component.font.FontViewComposite) TreeTableView(javafx.scene.control.TreeTableView) ConfigurationLeafNodeItem(com.kyj.fx.voeditor.visual.main.model.vo.ConfigurationLeafNodeItem) TreeTableRow(javafx.scene.control.TreeTableRow) ConfigurationTreeItem(com.kyj.fx.voeditor.visual.main.model.vo.ConfigurationTreeItem) ConfigItemTreeItem(com.kyj.fx.voeditor.visual.component.ConfigItemTreeItem) FXML(javafx.fxml.FXML)

Example 3 with TreeItem

use of javafx.scene.control.TreeItem in project Gargoyle by callakrsos.

the class SVNTreeView method menuSVNGraphOnAction.

/**
	 * SVN Graph
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2016. 7. 21.
	 * @param e
	 * @throws Exception
	 */
public void menuSVNGraphOnAction(ActionEvent e) {
    final int selectedIndex = getSelectionModel().getSelectedIndex();
    ObservableList<TreeItem<SVNItem>> children = getRoot().getChildren();
    TreeItem<SVNItem> selectedItem = children.get(selectedIndex);
    if (selectedItem != null) {
        SVNItem value = selectedItem.getValue();
        if (value != null && value instanceof SVNRepository) {
            SVNRepository repo = (SVNRepository) value;
            TabPane createSVNGraph = null;
            try {
                createSVNGraph = FxUtil.createSVNGraph(repo.getManager());
            } catch (Exception e1) {
                LOGGER.error(ValueUtil.toString(e1));
            }
            if (createSVNGraph != null) {
                setSvnGraphProperty(createSVNGraph);
            }
        }
    }
}
Also used : TabPane(javafx.scene.control.TabPane) TreeItem(javafx.scene.control.TreeItem) SVNException(org.tmatesoft.svn.core.SVNException) IOException(java.io.IOException)

Example 4 with TreeItem

use of javafx.scene.control.TreeItem 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 5 with TreeItem

use of javafx.scene.control.TreeItem in project Gargoyle by callakrsos.

the class SqliteSchemaItemTree method applyChildren.

/**
	 * 커넥션으로부터 스키마 정보 출력
	 */
@Override
public ObservableList<TreeItem<DatabaseItemTree<String>>> applyChildren(Connection con, String... args) throws Exception {
    DatabaseMetaData metaData = con.getMetaData();
    ResultSet tables = metaData.getTables(null, null, "%", null);
    ObservableList<TreeItem<DatabaseItemTree<String>>> observableArrayList = FXCollections.observableArrayList();
    while (tables.next()) {
        String tableType = tables.getString(4);
        if ("TABLE".equals(tableType)) {
            LOGGER.debug("TABLE_CAT: {} TABLE_SCHEM:  {}  TABLE_NAME : {} TABLE_TYPE : {} ", tables.getString(1), tables.getString(2), tables.getString(3), tableType);
            SqliteTableItemTree mysqlSchemaItemTree = new SqliteTableItemTree(this, tables.getString(3));
            TreeItem<DatabaseItemTree<String>> treeItem = new TreeItem<>(mysqlSchemaItemTree);
            observableArrayList.add(treeItem);
        }
    }
    return observableArrayList;
}
Also used : TreeItem(javafx.scene.control.TreeItem) ResultSet(java.sql.ResultSet) DatabaseItemTree(com.kyj.fx.voeditor.visual.component.sql.dbtree.commons.DatabaseItemTree) DatabaseMetaData(java.sql.DatabaseMetaData)

Aggregations

TreeItem (javafx.scene.control.TreeItem)76 File (java.io.File)15 TreeView (javafx.scene.control.TreeView)11 ArrayList (java.util.ArrayList)10 List (java.util.List)10 ObjectProperty (javafx.beans.property.ObjectProperty)9 MenuItem (javafx.scene.control.MenuItem)9 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)8 Logger (org.slf4j.Logger)8 LoggerFactory (org.slf4j.LoggerFactory)8 ValueUtil (com.kyj.fx.voeditor.visual.util.ValueUtil)7 IOException (java.io.IOException)7 FXCollections (javafx.collections.FXCollections)7 ListChangeListener (javafx.collections.ListChangeListener)7 ObservableList (javafx.collections.ObservableList)7 ActionEvent (javafx.event.ActionEvent)7 ContextMenu (javafx.scene.control.ContextMenu)7 FxUtil (com.kyj.fx.voeditor.visual.util.FxUtil)6 FXML (javafx.fxml.FXML)6 Button (javafx.scene.control.Button)6