Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
246,800
void (boolean autoHandle) { myAutoHandleBeforeShow = autoHandle; }
setHandleAutoSelectionBeforeShow
246,801
boolean () { return true; }
isModalContext
246,802
void (boolean showSubmenuOnHover) { myShowSubmenuOnHover = showSubmenuOnHover; }
setShowSubmenuOnHover
246,803
void (boolean executeExpandedItemOnClick) { myExecuteExpandedItemOnClick = executeExpandedItemOnClick; }
setExecuteExpandedItemOnClick
246,804
void (@NotNull Editor editor) { if (UiInterceptors.tryIntercept(this)) return; if (ApplicationManager.getApplication().isUnitTestMode()) { handleSelect(true); if (!Disposer.isDisposed(this)) { Disposer.dispose(this); } } else { super.showInBestPositionFor(editor); } }
showInBestPositionFor
246,805
void () { if (myStep.isSpeedSearchEnabled()) { getList().getActionMap().put(TransferHandler.getPasteAction().getValue(Action.NAME), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { getSpeedSearch().type(CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor)); getSpeedSearch().u...
replacePasteAction
246,806
void (ActionEvent e) { getSpeedSearch().type(CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor)); getSpeedSearch().update(); }
actionPerformed
246,807
boolean (@Nullable Object value) { // it is possible to use null elements in list model try { return getListStep().isSelectable(value); } catch (Exception exception) { LOG.error(getListStep().getClass().getName(), exception); return false; } }
isSelectable
246,808
boolean (int index) { if (0 <= index && index < myListModel.getSize()) { Object value = myListModel.getElementAt(index); if (isSelectable(value)) return true; } return false; }
isSelectableAt
246,809
Insets () { return PopupUtil.getListInsets(StringUtil.isNotEmpty(getStep().getTitle()), isAdVisible()); }
getListInsets
246,810
void () { context.onPopupStepCancelled(); }
canceled
246,811
void () { //mouse may be under the expandable item, sub-popup would be shown, //this popup could grow/shrink making the sub-popup mispositioned, //while probability is not high, we just hide child popups disposeChildren(); //noinspection unchecked,rawtypes MyBasePopupState<T> step = (MyBasePopupState)getStep(); List<T>...
syncWithModelChange
246,812
WizardPopup (WizardPopup parent, PopupStep step, Object parentValue) { if (step instanceof MyBasePopupState) { //noinspection unchecked return new ComboBoxPopup<>(myContext, parent, (MyBasePopupState<T>)step, parentValue); } throw new IllegalArgumentException(step.getClass().toString()); }
createPopup
246,813
JComponent (JComponent content) { final var component = super.createPopupComponent(content); final var renderer = ((MyBasePopupState<?>)myStep).myGetRenderer.get(); if (component instanceof JScrollPane scrollPane && isRendererWithInsets(renderer)) { scrollPane.getVerticalScrollBar().setBackground(UIManager.getColor("Co...
createPopupComponent
246,814
JList<T> () { //noinspection unchecked return super.getList(); }
getList
246,815
ListCellRenderer<T> () { // we set the correct renderer explicitly // to ensure getComponent().getPreferredSize() is computed // correctly. Fixes the sub-popup jump's to the left on mac return new MyDelegateRenderer(); }
getListElementRenderer
246,816
boolean (ListCellRenderer<?> comboRenderer) { return comboRenderer instanceof ExperimentalUI.NewUIComboBoxRenderer || comboRenderer instanceof ComboBoxWithWidePopup<?>.AdjustingListCellRenderer r && r.delegate instanceof ExperimentalUI.NewUIComboBoxRenderer; }
isRendererWithInsets
246,817
void () { setMaxRowCount(myContext.getMaximumRowCount()); setRequestFocus(false); JList<T> list = getList(); myContext.configureList(list); list.setSelectionForeground(UIManager.getColor("ComboBox.selectionForeground")); list.setSelectionBackground(UIManager.getColor("ComboBox.selectionBackground")); list.setBorder(nul...
configurePopup
246,818
Component (JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { //noinspection unchecked Component component = myContext.getRenderer().getListCellRendererComponent(list, (T)value, index, isSelected, cellHasFocus); if (component instanceof JComponent jComponent && !(component instanceof JSepa...
getListCellRendererComponent
246,819
boolean (T selectedValue) { ListModel<T> model = myGetComboboxModel.get(); if (model instanceof ComboBoxPopupState) { //noinspection unchecked return ((ComboBoxPopupState<T>)model).hasSubstep(selectedValue); } return super.hasSubstep(selectedValue); }
hasSubstep
246,820
boolean () { return true; }
isSpeedSearchEnabled
246,821
String (T value) { final ListCellRenderer<? super T> cellRenderer = myGetRenderer.get(); Component component = cellRenderer.getListCellRendererComponent(myProxyList, value, -1, false, false); String componentText = component instanceof TitledSeparator || component instanceof JSeparator ? "" : component instanceof JLabe...
getTextFor
246,822
boolean (T value) { Component component = myGetRenderer.get().getListCellRendererComponent(myProxyList, value, -1, false, false); return !((component instanceof ComboBox.SelectableItem selectableItem && !selectableItem.isSelectable()) || component instanceof JSeparator); }
isSelectable
246,823
int (int filteredIndex) { return myIndices.getInt(filteredIndex); }
getOriginalIndex
246,824
void () { myOriginalList.clear(); myOriginalList.addAll(myStep.getValues()); rebuildLists(); fireContentsChanged(this, 0, myFilteredList.size()); }
syncModel
246,825
void (Object item) { final int i = myOriginalList.indexOf(item); if (i >= 0) { myOriginalList.remove(i); rebuildLists(); fireContentsChanged(this, 0, myFilteredList.size()); } }
deleteItem
246,826
void () { myFilteredList.clear(); mySeparators.clear(); myIndices.clear(); myFullMatchIndex = -1; myStartsWithIndex = -1; ListSeparator lastSeparator = null; for (int i = 0; i < myOriginalList.size(); i++) { T each = myOriginalList.get(i); lastSeparator = ObjectUtils.chooseNotNull(myStep.getSeparatorAbove(each), lastSe...
rebuildLists
246,827
void (T each) { myFilteredList.add(each); if (!mySpeedSearch.isHoldingFilter()) return; String filterString = StringUtil.toUpperCase(mySpeedSearch.getFilter()); String candidateString = StringUtil.toUpperCase(myStep.getTextFor(each)); int index = myFilteredList.size() - 1; if (myFullMatchIndex == -1 && filterString.equ...
addToFiltered
246,828
int () { return myFilteredList.size(); }
getSize
246,829
T (int index) { if (index >= myFilteredList.size()) { return null; } return myFilteredList.get(index); }
getElementAt
246,830
boolean (Object aValue) { return getSeparatorAbove(aValue) != null; }
isSeparatorAboveOf
246,831
ListSeparator (Object value) { return mySeparators.get(value); }
getSeparatorAbove
246,832
void () { rebuildLists(); if (myFilteredList.isEmpty() && !myOriginalList.isEmpty()) { mySpeedSearch.noHits(); } fireContentsChanged(this, 0, myFilteredList.size()); }
refilter
246,833
boolean (Object object) { return myFilteredList.contains(object); }
isVisible
246,834
int () { return myFullMatchIndex != -1 ? myFullMatchIndex : myStartsWithIndex; }
getClosestMatchIndex
246,835
void () { myOriginalList.clear(); myOriginalList.addAll(myStep.getValues()); refilter(); }
updateOriginalList
246,836
TreePath (TreePath parent, @NotNull Object component) { return parent != null ? parent.pathByAddingChild(component) : new CachingTreePath(component); }
createTreePath
246,837
String[] (@NotNull TreePath path) { return convertTreePathToArray(path, Object::toString, String.class); }
convertTreePathToStrings
246,838
Object[] (@NotNull TreePath path) { return convertTreePathToArray(path, object -> object, Object.class); }
convertTreePathToArray
246,839
Object[] (@NotNull TreePath path, @NotNull Function<Object, Object> converter) { return convertTreePathToArray(path, converter, Object.class); }
convertTreePathToArray
246,840
TreePath (@NotNull TreeNode node) { return pathToTreeNode(node, object -> object); }
pathToTreeNode
246,841
TreePath (@NotNull TreeNode node, @NotNull Function<? super TreeNode, Object> converter) { return pathToCustomNode(node, TreeNode::getParent, converter); }
pathToTreeNode
246,842
TreeNode (TreePath path) { Object component = path == null ? null : path.getLastPathComponent(); return component instanceof TreeNode ? (TreeNode)component : null; }
toTreeNode
246,843
TreeNode[] (TreePath... paths) { return paths == null ? null : Stream.of(paths).map(TreePathUtil::toTreeNode).filter(Objects::nonNull).toArray(TreeNode[]::new); }
toTreeNodes
246,844
TreePath (TreeNode node) { return node == null ? null : pathToTreeNode(node); }
toTreePath
246,845
TreePath[] (TreeNode... nodes) { return nodes == null ? null : Stream.of(nodes).map(TreePathUtil::toTreePath).filter(Objects::nonNull).toArray(TreePath[]::new); }
toTreePaths
246,846
TreePath (TreePath path, @NotNull Predicate<? super TreePath> predicate) { while (path != null) { if (predicate.test(path)) return path; path = path.getParentPath(); } return null; }
findAncestor
246,847
TreePath (TreePath... paths) { if (ArrayUtil.isEmpty(paths)) return null; if (paths.length == 1) return paths[0]; return findCommonAncestor(Arrays.asList(paths)); }
findCommonAncestor
246,848
TreePath (@NotNull Iterable<? extends TreePath> paths) { TreePath ancestor = null; for (int i = 0; i < Integer.MAX_VALUE; i++) { TreePath first = null; for (TreePath path : paths) { int count = path.getPathCount(); if (count <= i) return ancestor; // a path is too short while (--count > i) path = path.getParentPath(); ...
findCommonAncestor
246,849
void () { if (root != null) root.invalidate(); map.values().forEach(entry -> entry.invalidate()); }
invalidate
246,850
void (@NotNull Consumer<? super N> consumer) { Consumer old = nodeRemoved; nodeRemoved = old == null ? consumer : old.andThen(consumer); }
onRemove
246,851
void (@NotNull Consumer<? super N> consumer) { Consumer old = nodeInserted; nodeInserted = old == null ? consumer : old.andThen(consumer); }
onInsert
246,852
Entry<N> (K key) { return key == null ? null : map.get(key); }
findEntry
246,853
N (K key) { Entry<N> entry = findEntry(key); return entry == null ? null : entry.node; }
findNode
246,854
Entry<N> (N node) { K key = getKey(node); Entry<N> entry = findEntry(key); return entry == null || entry.node == node ? entry : null; }
getEntry
246,855
Entry<N> () { return root; }
getRootEntry
246,856
K (N node) { if (node == null) return null; K key = keyFunction.apply(node); if (key != null) return key; LOG.warn("MapBasedTree: key function provides null"); return null; }
getKey
246,857
boolean (Pair<? extends N, Boolean> pair) { N node = Pair.getFirst(pair); if (root == null ? node == null : root.node == node) return false; if (root != null) { remove(root, keyFunction.apply(root.node)); root = null; } if (!map.isEmpty()) { map.clear(); LOG.warn("MapBasedTree: clear lost entries"); } if (node != null)...
updateRoot
246,858
UpdateResult<N> (@NotNull Entry<N> parent, List<? extends Pair<N, Boolean>> children) { List<Entry<N>> newChildren = new ArrayList<>(children == null ? 0 : children.size()); List<Entry<N>> oldChildren = parent.children; Map<Entry<N>, K> mapInserted = new IdentityHashMap<>(); Map<Entry<N>, K> mapContained = new Identity...
update
246,859
void (Entry<N> parent, List<Entry<N>> children) { if (children != null) { for (Entry<N> entry : children) { if (parent.loading == entry.node) { parent.loading = null; } else { remove(entry, getKey(entry.node)); } } } }
removeChildren
246,860
void (Entry<N> entry, K key) { if (key != null) { Entry<N> removed = map.remove(key); if (removed == null) { LOG.warn("MapBasedTree: expected entry is not found"); } else if (removed != entry) { LOG.warn("MapBasedTree: do not remove unexpected entry"); map.put(key, removed); return; } } removeChildren(entry, entry.chil...
remove
246,861
void (Entry<N> entry, K key) { if (key != null) { Entry<N> removed = map.put(key, entry); if (removed != null) { LOG.warn("MapBasedTree: do not replace unexpected entry"); map.put(key, removed); return; } } Consumer<? super N> consumer = nodeInserted; if (consumer != null) consumer.accept(entry.node); }
insert
246,862
void () { valid = leaf; }
invalidate
246,863
N () { return node; }
getNode
246,864
N () { return parent; }
getParent
246,865
boolean () { return leaf; }
isLeaf
246,866
boolean () { return !valid || children == null; }
isLoadingRequired
246,867
int () { return children == null ? 0 : children.size(); }
getChildCount
246,868
Entry<N> (int index) { if (children != null && 0 <= index && index < children.size()) { return children.get(index); } return null; }
getChildEntry
246,869
N (int index) { Entry<N> entry = getChildEntry(index); return entry == null ? null : entry.getNode(); }
getChild
246,870
int (N child) { if (children != null) { for (int i = 0; i < children.size(); i++) { if (child == children.get(i).getNode()) return i; } } return -1; }
getIndexOf
246,871
TreeModelEvent (@NotNull Object source, TreePath path, @NotNull List<Entry<N>> list) { int size = list.size(); int[] indices = new int[size]; Object[] nodes = new Object[size]; int index = 0; for (Entry<N> entry : list) { indices[index] = entry.index; nodes[index++] = entry.node; } return new TreeModelEvent(source, pat...
getEvent
246,872
List<Entry<N>> () { return removed; }
getRemoved
246,873
List<Entry<N>> () { return inserted; }
getInserted
246,874
List<Entry<N>> () { return contained; }
getContained
246,875
TreePath (@NotNull Object child) { return new CachingTreePath(this, child); }
pathByAddingChild
246,876
int () { return myPathCount; }
getPathCount
246,877
void (@NotNull Collection<? extends N> children) { boolean paused = state.compareAndSet(State.PAUSED, State.STARTED); if (!paused && !state.compareAndSet(State.REQUESTED, State.STARTED)) throw new IllegalStateException(); stack.push(new ArrayDeque<>(children)); if (paused) processNextPath(); }
setChildren
246,878
Promise<TreePath> () { return promise; }
promise
246,879
void (@NotNull Throwable error) { state.set(State.FAILED); promise.setError(error); }
setError
246,880
void (N node) { start(null, node); }
start
246,881
void (TreePath parent, N node) { TreePath result = null; if (node != null) { try { TreePath path = TreePathUtil.createTreePath(parent, converter.apply(node)); switch (visitor.visit(path)) { case CONTINUE -> { update(null, State.REQUESTED); if (processChildren(path, node)) processNextPath(); return; } case INTERRUPT -> ...
start
246,882
boolean (@NotNull TreePath path, @NotNull N node) { current = path; Collection<N> children = getChildren(node); if (children == null) return !state.compareAndSet(State.REQUESTED, State.PAUSED); update(State.REQUESTED, State.STARTED); stack.push(new ArrayDeque<>(children)); return true; }
processChildren
246,883
void () { try { while (State.STARTED == state.get()) { ArrayDeque<N> siblings = stack.peek(); if (siblings == null) { update(State.STARTED, State.FINISHED); current = null; promise.setResult(null); return; // nothing to process } N node = siblings.poll(); if (node == null) { TreePath path = current; if (path == null) t...
processNextPath
246,884
void (State expected, @NotNull State replacement) { if (!state.compareAndSet(expected, replacement)) throw new IllegalStateException(); }
update
246,885
VisitThread () { return VisitThread.BGT; }
visitThread
246,886
Action (@NotNull TreePath path) { if (LOG.isTraceEnabled()) LOG.debug("process ", path); T element = getElement(); if (element == null) return Action.SKIP_SIBLINGS; Object component = path.getLastPathComponent(); if (component instanceof AbstractTreeNode) { return visit(path, (AbstractTreeNode)component, element); } if...
visit
246,887
Action (@NotNull TreePath path, @NotNull AbstractTreeNode node, @NotNull T element) { if (matches(node, element)) { LOG.debug("found ", path); if (predicate == null) return Action.INTERRUPT; if (predicate.test(path)) return Action.CONTINUE; } else if (contains(node, element)) { LOG.debug("visit ", path); return Action....
visit
246,888
boolean (@NotNull AbstractTreeNode<?> node, @NotNull T element) { return node.canRepresent(element); }
matches
246,889
boolean (@NotNull AbstractTreeNode<?> node, @NotNull T element) { T content = getContent(node); return content != null && isAncestor(content, element); }
contains
246,890
T (@NotNull AbstractTreeNode node) { return null; }
getContent
246,891
boolean (@NotNull T content, @NotNull T element) { return false; }
isAncestor
246,892
void (TreeSelectionEvent event) { if (null == event.getNewLeadSelectionPath()) { TreePath path = event.getOldLeadSelectionPath(); if (path != null && null != path.getParentPath()) { Object source = event.getSource(); if (source instanceof JTree tree) { if (tree.getSelectionModel().isSelectionEmpty()) { invokeLater(() -...
valueChanged
246,893
Action (@NotNull TreePath path, Object component) { Action action = super.visit(path, component); if (action == Action.CONTINUE || action == Action.INTERRUPT) reference.set(path); return action; }
visit
246,894
void (JTree tree) { TreePath anchor = getAnchor(tree); if (anchor == null) return; // not found for (TreePath parent = anchor; parent != null; parent = parent.getParentPath()) { if (acceptDescendants(tree, parent, path -> !tree.isPathSelected(path), tree::addSelectionPaths)) { setAnchor(tree, anchor); return; // interr...
increaseSelection
246,895
void (JTree tree) { TreePath anchor = getAnchor(tree); if (anchor == null) return; // not found if (!tree.isPathSelected(anchor)) return; // not selected TreePath lower = anchor; for (TreePath upper = anchor.getParentPath(); upper != null; lower = upper, upper = upper.getParentPath()) { if (testDescendants(tree, upper,...
decreaseSelection
246,896
boolean (JTree tree) { return tree != null && SINGLE_TREE_SELECTION != tree.getSelectionModel().getSelectionMode(); }
canIncreaseSelection
246,897
boolean (JTree tree) { return tree != null && tree.getSelectionModel().getSelectionCount() > 1; }
canDecreaseSelection
246,898
void (@NotNull JTree tree, @NotNull TreePath path) { tree.setAnchorSelectionPath(path); }
setAnchor
246,899
boolean (@NotNull JTree tree, @NotNull TreePath parent, @NotNull Predicate<? super TreePath> predicate) { boolean tested = false; for (int row = Math.max(0, 1 + tree.getRowForPath(parent)); row < tree.getRowCount(); row++) { TreePath path = tree.getPathForRow(row); if (!parent.isDescendant(path)) break; if (!predicate....
testDescendants