当前位置: 首页>>代码示例>>Java>>正文


Java TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION属性代码示例

本文整理汇总了Java中javax.swing.tree.TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION属性的典型用法代码示例。如果您正苦于以下问题:Java TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION属性的具体用法?Java TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION怎么用?Java TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.tree.TreeSelectionModel的用法示例。


在下文中一共展示了TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CheckoutWizard

public CheckoutWizard(final Project project) {
  super(CvsBundle.message("dialog.tittle.check.out.from.cvs.repository"), project);
  mySelectCVSConfigurationStep = new SelectCVSConfigurationStep(project, this);
  mySelectCvsElementStep = new SelectCvsElementStep(CvsBundle.message("dialog.title.select.cvs.element.to.check.out"),
                                                    this, project, mySelectCVSConfigurationStep, false,
                                                    TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION, true, true);

  mySelectLocationStep = new MySelectLocationStep(project);
  myChooseModeStep = new ChooseCheckoutMode(project, this);

  addStep(mySelectCVSConfigurationStep);
  addStep(mySelectCvsElementStep);
  addStep(mySelectLocationStep);
  addStep(myChooseModeStep);

  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CheckoutWizard.java

示例2: ModuleChooser

public ModuleChooser(Project project, 
                     boolean allowFileSelection,
                     boolean allowMultipleSelection,
                     boolean allowRootSelection,
                     String expertTitle,
                     String selectModulePageTitle) {
  super(expertTitle, project);
  mySelectCVSConfigurationStep = new SelectCVSConfigurationStep(project, this);
  mySelectCvsElementStep = new SelectCvsElementStep(selectModulePageTitle,
                                                    this,
                                                    project,
                                                    mySelectCVSConfigurationStep, allowRootSelection, allowMultipleSelection ?
                                                                        TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION :
                                                                        TreeSelectionModel.SINGLE_TREE_SELECTION, true,
                                                    allowFileSelection);

  addStep(mySelectCVSConfigurationStep);
  addStep(mySelectCvsElementStep);

  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ModuleChooser.java

示例3: isSelectionModeBroken

/** Check if selection of the nodes could break the selection mode set in TreeSelectionModel.
 * @param nodes the nodes for selection
 * @return true if the selection mode is broken */
private boolean isSelectionModeBroken(Node[] nodes) {
    // if nodes are empty or single the everthing is ok
    // or if discontiguous selection then everthing ok
    if ((nodes.length <= 1) || (getSelectionMode() == TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION)) {
        return false;
    }

    // if many nodes
    // brakes single selection mode
    if (getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) {
        return true;
    }

    // check the contiguous selection mode
    TreePath[] paths = new TreePath[nodes.length];
    RowMapper rowMapper = tree.getSelectionModel().getRowMapper();

    // if rowMapper is null then tree bahaves as discontiguous selection mode is set
    if (rowMapper == null) {
        return false;
    }

    ArrayList<Node> toBeExpaned = new ArrayList<Node>(3);

    for (int i = 0; i < nodes.length; i++) {
        toBeExpaned.clear();

        Node n = nodes[i];

        while (n.getParentNode() != null) {
            if (!isExpanded(n)) {
                toBeExpaned.add(n);
            }

            n = n.getParentNode();
        }

        for (int j = toBeExpaned.size() - 1; j >= 0; j--) {
            expandNode(toBeExpaned.get(j));
        }
        paths[i] = getTreePath(nodes[i]);
    }

    int[] rows = rowMapper.getRowsForPaths(paths);

    // check selection's rows
    Arrays.sort(rows);

    for (int i = 1; i < rows.length; i++) {
        if (rows[i] != (rows[i - 1] + 1)) {
            return true;
        }
    }

    // all is ok
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:60,代码来源:TreeView.java

示例4: setSingleSelectionOnly

@Override
public void setSingleSelectionOnly(boolean b)
{
	int mode = b ? TreeSelectionModel.SINGLE_TREE_SELECTION : TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION;
	tree.getSelectionModel().setSelectionMode(mode);
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:BrowseFinder.java

示例5: setMultiSelect

@Override
public void setMultiSelect(boolean multiselect) {
    int mode = multiselect ?
            TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION : TreeSelectionModel.SINGLE_TREE_SELECTION;
    impl.getSelectionModel().setSelectionMode(mode);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:6,代码来源:DesktopTree.java

示例6: getSelectionMode

@Override
protected int getSelectionMode() {
  return TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JavaAwareTestConsoleProperties.java


注:本文中的javax.swing.tree.TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。