本文整理汇总了Java中com.trollworks.toolkit.ui.widget.tree.TreeRow类的典型用法代码示例。如果您正苦于以下问题:Java TreeRow类的具体用法?Java TreeRow怎么用?Java TreeRow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TreeRow类属于com.trollworks.toolkit.ui.widget.tree包,在下文中一共展示了TreeRow类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openSelection
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
@Override
public void openSelection() {
List<TreeContainerRow> containers = new ArrayList<>();
boolean hadFile = false;
for (TreeRow row : mTreePanel.getExplicitlySelectedRows()) {
if (row instanceof TreeContainerRow) {
containers.add((TreeContainerRow) row);
} else {
open(((LibraryFileRow) row).getPath());
hadFile = true;
}
}
if (!hadFile) {
for (TreeContainerRow container : containers) {
mTreePanel.setOpen(!mTreePanel.isOpen(container), container);
}
}
}
示例2: collectRowsToOpen
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
private List<TreeContainerRow> collectRowsToOpen(TreeContainerRow parent, Set<String> selectors, List<TreeContainerRow> list) {
if (list == null) {
list = new ArrayList<>();
}
for (TreeRow row : parent.getChildren()) {
if (row instanceof TreeContainerRow) {
TreeContainerRow container = (TreeContainerRow) row;
if (selectors.contains(((LibraryExplorerRow) row).getSelectionKey())) {
list.add(container);
}
collectRowsToOpen(container, selectors, list);
}
}
return list;
}
示例3: collectRows
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
private List<TreeRow> collectRows(TreeContainerRow parent, Set<String> selectors, List<TreeRow> list) {
if (list == null) {
list = new ArrayList<>();
}
for (TreeRow row : parent.getChildren()) {
if (selectors.contains(((LibraryExplorerRow) row).getSelectionKey())) {
list.add(row);
}
if (row instanceof TreeContainerRow) {
collectRows((TreeContainerRow) row, selectors, list);
}
}
return list;
}
示例4: collect
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
private static void collect(TreeRow row, String text, ArrayList<Object> list) {
if (row instanceof LibraryExplorerRow) {
if (((LibraryExplorerRow) row).getName().toLowerCase().contains(text)) {
list.add(row);
}
}
if (row instanceof TreeContainerRow) {
for (TreeRow child : ((TreeContainerRow) row).getChildren()) {
collect(child, text, list);
}
}
}
示例5: searchSelect
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
@Override
public void searchSelect(List<Object> selection) {
List<TreeRow> list = new ArrayList<>();
for (Object one : selection) {
if (one instanceof TreeRow) {
list.add((TreeRow) one);
}
}
mTreePanel.setParentsOpen(list);
mTreePanel.select(list);
mTreePanel.requestFocus();
}
示例6: getField
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
@Override
public String getField(TreeRow row) {
return ((LibraryExplorerRow) row).getName();
}
示例7: getIcon
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
@Override
public StdImage getIcon(TreeRow row) {
return ((LibraryExplorerRow) row).getIcon();
}
示例8: getName
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
public static String getName(TreeRow row) {
if (row instanceof TreeRowWithName) {
return ((TreeRowWithName) row).getName();
}
return null;
}
示例9: getSecond
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
public static String getSecond(TreeRow row) {
if (row instanceof TreeRowWithName) {
return ((TreeRowWithName) row).getSecond();
}
return null;
}
示例10: getIcon
import com.trollworks.toolkit.ui.widget.tree.TreeRow; //导入依赖的package包/类
public static StdImage getIcon(TreeRow row) {
if (row instanceof TreeRowWithIcon) {
return ((TreeRowWithIcon) row).getIcon();
}
return null;
}