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);
}
}
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);
}
}
});
}
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);
}
}
}
}
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);
}
}
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;
}
Aggregations