Codota Logo
CheckBoxTreeItem$TreeModificationEvent.getTreeItem
Code IndexAdd Codota to your IDE (free)

How to use
getTreeItem
method
in
javafx.scene.control.CheckBoxTreeItem$TreeModificationEvent

Best Java code snippets using javafx.scene.control.CheckBoxTreeItem$TreeModificationEvent.getTreeItem (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: org.controlsfx/controlsfx

/***********************************************************************
 *                                                                     *
 * Constructors                                                        *
 *                                                                     *
 **********************************************************************/

CheckTreeViewCheckModel(final CheckTreeView<T> treeView) {
  this.treeView = treeView;
  this.root = treeView.getRoot();
  this.root.addEventHandler(CheckBoxTreeItem.<T>checkBoxSelectionChangedEvent(), e -> {
    CheckBoxTreeItem<T> treeItem = e.getTreeItem();
    
    if (treeItem.isSelected()) { // && ! treeItem.isIndeterminate()) {
      check(treeItem);
    } else { 
      clearCheck(treeItem);
    }
  });
  
  // we should reset the check model and then update the checked items
  // based on the currently checked items in the tree view
  clearChecks();
  for (int i = 0; i < treeView.getExpandedItemCount(); i++) {
    CheckBoxTreeItem<T> treeItem = (CheckBoxTreeItem<T>) treeView.getTreeItem(i);
    if (treeItem.isSelected() && ! treeItem.isIndeterminate()) {
      check(treeItem);
    }
  }
}
 
origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

/**
 * @param root
 *            The "checked" state of all the descendants, including the root
 *            itself, will be monitored
 */
public CheckedTreeItemCollector(CheckBoxTreeItem<T> root) {
  this.root = root;
  root.addEventHandler(TreeModificationEvent.ANY, event -> {
    @SuppressWarnings("unchecked")
    TreeModificationEvent<T> mod = (TreeModificationEvent<T>) event;
    T value = mod.getTreeItem().getValue();
    boolean checked = mod.getTreeItem().isSelected();
    synchronized (this.checkedItems) {
      if (checked && !this.checkedItems.contains(value)) {
        this.checkedItems.add(value);
      } else if (!checked && this.checkedItems.contains(value)) {
        this.checkedItems.remove(value);
      }
    }
  });
  this.checkedItems.addListener((SetChangeListener<T>) change -> {
    if (change.getElementAdded() != null) {
      setCheckedStateForValue(root, change.getElementAdded(), true);
    }
    if (change.getElementRemoved() != null) {
      setCheckedStateForValue(root, change.getElementRemoved(), false);
    }
  });
}
origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

/**
 * @param root
 *            The "checked" state of all the descendants, including the root
 *            itself, will be monitored
 */
public CheckedTreeItemCollector(CheckBoxTreeItem<T> root) {
  this.root = root;
  root.addEventHandler(TreeModificationEvent.ANY, event -> {
    @SuppressWarnings("unchecked")
    TreeModificationEvent<T> mod = (TreeModificationEvent<T>) event;
    T value = mod.getTreeItem().getValue();
    boolean checked = mod.getTreeItem().isSelected();
    synchronized (this.checkedItems) {
      if (checked && !this.checkedItems.contains(value)) {
        this.checkedItems.add(value);
      } else if (!checked && this.checkedItems.contains(value)) {
        this.checkedItems.remove(value);
      }
    }
  });
  this.checkedItems.addListener((SetChangeListener<T>) change -> {
    if (change.getElementAdded() != null) {
      setCheckedStateForValue(root, change.getElementAdded(), true);
    }
    if (change.getElementRemoved() != null) {
      setCheckedStateForValue(root, change.getElementRemoved(), false);
    }
  });
}
javafx.scene.controlCheckBoxTreeItem$TreeModificationEventgetTreeItem

Popular methods of CheckBoxTreeItem$TreeModificationEvent

    Popular in Java

    • Making http requests using okhttp
    • onCreateOptionsMenu (Activity)
    • compareTo (BigDecimal)
      Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
    • getApplicationContext (Context)
    • Color (java.awt)
      The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
    • Component (java.awt)
      A component is an object having a graphical representation that can be displayed on the screen and t
    • Font (java.awt)
      The Font class represents fonts, which are used to render text in a visible way. A font provides the
    • ConnectException (java.net)
      A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
    • MessageFormat (java.text)
      MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
    • Annotation (javassist.bytecode.annotation)
      The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now