當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。