Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
282,200 | ToolbarDecorator (AnActionButton @NotNull ... actions) { for (AnActionButton action : actions) { if (action != null) { addExtraAction(action); } } return this; } | addExtraActions |
282,201 | ToolbarDecorator (ActionToolbarPosition position) { myToolbarPosition = position; return this; } | setToolbarPosition |
282,202 | ToolbarDecorator (AnActionButtonRunnable action) { myAddActionEnabled = action != null; myAddAction = action; return this; } | setAddAction |
282,203 | ToolbarDecorator (AnActionButtonRunnable action) { myEditActionEnabled = action != null; myEditAction = action; return this; } | setEditAction |
282,204 | ToolbarDecorator (AnActionButtonRunnable action) { myRemoveActionEnabled = action != null; myRemoveAction = action; return this; } | setRemoveAction |
282,205 | ToolbarDecorator (AnActionButtonRunnable action) { myUpActionEnabled = action != null; myUpAction = action; return this; } | setMoveUpAction |
282,206 | ToolbarDecorator (AnActionButtonRunnable action) { myDownActionEnabled = action != null; myDownAction = action; return this; } | setMoveDownAction |
282,207 | ToolbarDecorator (@ActionText String name) { myAddName = name; return this; } | setAddActionName |
282,208 | ToolbarDecorator (@ActionText String name) { myEditName = name; return this; } | setEditActionName |
282,209 | ToolbarDecorator (@ActionText String name) { myRemoveName = name; return this; } | setRemoveActionName |
282,210 | ToolbarDecorator (@ActionText String name) { myMoveUpName = name; return this; } | setMoveUpActionName |
282,211 | ToolbarDecorator (@ActionText String name) { myMoveDownName = name; return this; } | setMoveDownActionName |
282,212 | ToolbarDecorator (AnActionButtonUpdater updater) { myAddActionUpdater = updater; return this; } | setAddActionUpdater |
282,213 | ToolbarDecorator (AnActionButtonUpdater updater) { myRemoveActionUpdater = updater; return this; } | setRemoveActionUpdater |
282,214 | ToolbarDecorator (AnActionButtonUpdater updater) { myEditActionUpdater = updater; return this; } | setEditActionUpdater |
282,215 | ToolbarDecorator (AnActionButtonUpdater updater) { myMoveUpActionUpdater = updater; return this; } | setMoveUpActionUpdater |
282,216 | ToolbarDecorator (AnActionButtonUpdater updater) { myMoveDownActionUpdater = updater; return this; } | setMoveDownActionUpdater |
282,217 | ToolbarDecorator () { myForcedDnD = true; return this; } | setForcedDnD |
282,218 | ToolbarDecorator (@NotNull ActionGroup actionGroup) { AnAction[] actions = actionGroup.getChildren(null); for (AnAction action : actions) { if (!(action instanceof Separator)) { addExtraAction(AnActionButton.fromAction(action)); } } return this; } | setActionGroup |
282,219 | ToolbarDecorator (Dimension size) { myPreferredSize = size; return this; } | setPreferredSize |
282,220 | ToolbarDecorator (Dimension size) { myMinimumSize = size; return this; } | setMinimumSize |
282,221 | ToolbarDecorator (int rowCount) { return this;//do nothing by default } | setVisibleRowCount |
282,222 | ToolbarDecorator (Icon addIcon) { myAddIcon = addIcon; return this; } | setAddIcon |
282,223 | JPanel () { CommonActionsPanel.Buttons[] buttons = getButtons(); JComponent contextComponent = getComponent(); UIUtil.putClientProperty(contextComponent, JBViewport.FORCE_VISIBLE_ROW_COUNT_KEY, true); myActionsPanel = new CommonActionsPanel(this, contextComponent, myToolbarPosition, myExtraActions.toArray(AnAction.EMPT... | createPanel |
282,224 | Dimension () { Dimension preferredSize = super.getPreferredSize(); if (!isPreferredSizeSet()) { setPreferredSize(new Dimension(0, preferredSize.height)); } return preferredSize; } | getPreferredSize |
282,225 | void () { super.addNotify(); updateButtons(); } | addNotify |
282,226 | void (boolean enabled) { super.setEnabled(enabled); contextComponent.setEnabled(enabled); } | setEnabled |
282,227 | void () { installUpdater(myAddActionEnabled, myAddAction, myAddActionUpdater, CommonActionsPanel.Buttons.ADD); installUpdater(myEditActionEnabled, myEditAction, myEditActionUpdater, CommonActionsPanel.Buttons.EDIT); installUpdater(myRemoveActionEnabled, myRemoveAction, myRemoveActionUpdater, CommonActionsPanel.Buttons.... | installUpdaters |
282,228 | void ( boolean isEnabled, @Nullable AnActionButtonRunnable anActionButtonRunnable, @Nullable AnActionButtonUpdater updater, CommonActionsPanel.Buttons button ) { if (isEnabled && anActionButtonRunnable != null && updater != null) { final var anActionButton = myActionsPanel.getAnActionButton(button); if (anActionButton ... | installUpdater |
282,229 | void () { if ((myForcedDnD || (myUpAction != null && myUpActionEnabled && myDownAction != null && myDownActionEnabled)) && !ApplicationManager.getApplication().isHeadlessEnvironment() && isModelEditable()) { installDnDSupport(); } } | installDnD |
282,230 | Object (@NotNull ActionToolbarPosition position) { return switch (position) { case TOP -> BorderLayout.NORTH; case LEFT -> BorderLayout.WEST; case BOTTOM -> BorderLayout.SOUTH; case RIGHT -> BorderLayout.EAST; }; } | getPlacement |
282,231 | void () { if (myAddAction != null) { myAddAction.run(panel.getAnActionButton(CommonActionsPanel.Buttons.ADD)); } } | doAdd |
282,232 | void () { if (myEditAction != null) { myEditAction.run(panel.getAnActionButton(CommonActionsPanel.Buttons.EDIT)); } } | doEdit |
282,233 | void () { if (myRemoveAction != null) { myRemoveAction.run(panel.getAnActionButton(CommonActionsPanel.Buttons.REMOVE)); } } | doRemove |
282,234 | void () { if (myUpAction != null) { myUpAction.run(panel.getAnActionButton(CommonActionsPanel.Buttons.UP)); } } | doUp |
282,235 | void () { if (myDownAction != null) { myDownAction.run(panel.getAnActionButton(CommonActionsPanel.Buttons.DOWN)); } } | doDown |
282,236 | void (final @NotNull Tree tree, JComponent mainComponent, CheckboxTreeBase.CheckboxTreeCellRendererBase cellRenderer) { removeTreeListeners(mainComponent); tree.setCellRenderer(cellRenderer); tree.setRootVisible(false); tree.setShowsRootHandles(true); TreeUtil.installActions(tree); KeyListener keyListener = setupKeyLis... | initTree |
282,237 | void (Tree tree, CheckedTreeNode node, boolean checked) { changeNodeState(node, checked); adjustParentsAndChildren(node, checked); tree.repaint(); // notify model listeners about model change final TreeModel model = tree.getModel(); model.valueForPathChanged(new TreePath(node.getPath()), node.getUserObject()); } | setNodeState |
282,238 | void (Tree tree, CheckedTreeNode node) { setNodeState(tree, node, !node.isChecked()); } | toggleNode |
282,239 | void (final CheckedTreeNode node, final boolean checked) { if (!checked) { if (myCheckPolicy.uncheckParentWithUncheckedChild) { TreeNode parent = node.getParent(); while (parent != null) { if (parent instanceof CheckedTreeNode) { changeNodeState((CheckedTreeNode)parent, false); } parent = parent.getParent(); } } if (my... | adjustParentsAndChildren |
282,240 | void (final CheckedTreeNode node, final boolean checked) { if (node.isChecked() != checked) { myEventDispatcher.getMulticaster().beforeNodeStateChanged(node); node.setChecked(checked); myEventDispatcher.getMulticaster().nodeStateChanged(node); } } | changeNodeState |
282,241 | void (final CheckedTreeNode node) { final Enumeration children = node.children(); while (children.hasMoreElements()) { final Object o = children.nextElement(); if (!(o instanceof CheckedTreeNode child)) continue; changeNodeState(child, false); uncheckChildren(child); } } | uncheckChildren |
282,242 | void (final CheckedTreeNode node) { final Enumeration children = node.children(); while (children.hasMoreElements()) { final Object o = children.nextElement(); if (!(o instanceof CheckedTreeNode child)) continue; changeNodeState(child, true); checkChildren(child); } } | checkChildren |
282,243 | KeyListener (final Tree tree, final JComponent mainComponent) { KeyListener listener = new KeyAdapter() { @Override public void keyPressed(@NotNull KeyEvent e) { if (isToggleEvent(e, mainComponent)) { TreePath treePath = tree.getLeadSelectionPath(); if (treePath == null) return; final Object o = treePath.getLastPathCom... | setupKeyListener |
282,244 | void (@NotNull KeyEvent e) { if (isToggleEvent(e, mainComponent)) { TreePath treePath = tree.getLeadSelectionPath(); if (treePath == null) return; final Object o = treePath.getLastPathComponent(); if (!(o instanceof CheckedTreeNode firstNode)) return; if (!firstNode.isEnabled()) return; toggleNode(tree, firstNode); boo... | keyPressed |
282,245 | boolean (KeyEvent e, JComponent mainComponent) { return e.getKeyCode() == KeyEvent.VK_SPACE && SpeedSearchSupply.getSupply(mainComponent) == null; } | isToggleEvent |
282,246 | ClickListener (final Tree tree, JComponent mainComponent, final CheckboxTreeBase.CheckboxTreeCellRendererBase cellRenderer) { ClickListener listener = new ClickListener() { @Override public boolean onClick(@NotNull MouseEvent e, int clickCount) { int row = tree.getRowForLocation(e.getX(), e.getY()); if (row < 0) return... | setupMouseListener |
282,247 | boolean (@NotNull MouseEvent e, int clickCount) { int row = tree.getRowForLocation(e.getX(), e.getY()); if (row < 0) return false; final Object o = tree.getPathForRow(row).getLastPathComponent(); if (!(o instanceof CheckedTreeNode node)) return false; Rectangle rowBounds = tree.getRowBounds(row); cellRenderer.setBounds... | onClick |
282,248 | void (JComponent mainComponent) { Runnable remover = ComponentUtil.getClientProperty(mainComponent, TREE_LISTENERS_REMOVER); if (remover != null) remover.run(); } | removeTreeListeners |
282,249 | void (CheckedTreeNode node) { if (node.isLeaf()) { Object userObject = node.getUserObject(); if (node.isChecked() && userObject != null && nodeType.isAssignableFrom(userObject.getClass())) { //noinspection unchecked final T value = (T)userObject; if (filter != null && !filter.accept(value)) return; nodes.add(value); } ... | collect |
282,250 | void (ActionEvent e) { if (getCheckboxColumn() == -1) return; int[] selectedRows = myEntryTable.getSelectedRows(); boolean currentlyMarked = true; for (int selectedRow : selectedRows) { if (selectedRow < 0 || !myEntryTable.isCellEditable(selectedRow, getCheckboxColumn())) { return; } currentlyMarked &= ((Boolean)myEntr... | actionPerformed |
282,251 | void () { TableColumnModel columnModel = myEntryTable.getColumnModel(); TableColumn checkboxColumn = columnModel.getColumn(getCheckboxColumn()); if (myCheckboxColumnName.isEmpty()) { TableUtil.setupCheckboxColumn(checkboxColumn, columnModel.getColumnMargin()); } else { int width = myEntryTable.getFontMetrics(myEntryTab... | setCheckboxColumnWidth |
282,252 | JTable () { return myEntryTable; } | getEntryTable |
282,253 | void () { while (myModel.getRowCount() > 0) { myModel.removeRow(0); } } | clear |
282,254 | void (T orderEntry) { int rowCount = myModel.getRowCount(); for (int i = 0; i < rowCount; i++) { if (myModel.getValueAt(i) == orderEntry) { myModel.removeRow(i); return; } } } | remove |
282,255 | void (@NotNull T orderEntry) { Object[] row = getCheckboxColumn() == -1 ? new Object[]{orderEntry} : new Object[]{Boolean.valueOf(isChecked(orderEntry)), orderEntry}; myModel.addRow(row); } | add |
282,256 | void (@NotNull Collection<? extends T> orderEntries) { for (T orderEntry : orderEntries) { add(orderEntry); } } | addAll |
282,257 | int () { return myModel.myEntryColumn; } | getEntryColumn |
282,258 | int () { return myModel.myCheckboxColumn; } | getCheckboxColumn |
282,259 | int () { return myColumnCount; } | getColumnCount |
282,260 | boolean (int row, int column) { return column == myCheckboxColumn && isCheckable(getValueAt(row)); } | isCellEditable |
282,261 | void (Object value, int row, int column) { super.setValueAt(value, row, column); if (column == myCheckboxColumn) { setChecked(getValueAt(row), ((Boolean)value).booleanValue()); } } | setValueAt |
282,262 | T (int row) { return (T) getValueAt(row, myEntryColumn); } | getValueAt |
282,263 | T (int row) { return myModel.getValueAt(row); } | getValueAt |
282,264 | void (TreeSelectionEvent e) { updateButtons(); } | valueChanged |
282,265 | void (PropertyChangeEvent evt) { updateButtons(); } | propertyChange |
282,266 | void () { final EditableTreeModel model = (EditableTreeModel)myTree.getModel(); myAddAction = new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { final TreePath path = myTree.getSelectionPath(); final DefaultMutableTreeNode selected = path == null ? (DefaultMutableTreeNode)myTree.getModel(... | createDefaultTreeActions |
282,267 | void (AnActionButton button) { final TreePath path = myTree.getSelectionPath(); final DefaultMutableTreeNode selected = path == null ? (DefaultMutableTreeNode)myTree.getModel().getRoot() : (DefaultMutableTreeNode)path.getLastPathComponent(); final Object selectedNode = selected.getUserObject(); myTree.stopEditing(); Ob... | run |
282,268 | void (AnActionButton button) { myTree.stopEditing(); if (myTree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { final TreePath path = myTree.getSelectionPath(); if (path != null) { model.removeNode(path); } } else { final TreePath[] paths = myTree.getSelectionPaths(); if (paths != ... | run |
282,269 | JComponent () { return myComponent; } | getComponent |
282,270 | void () { getActionsPanel().setEnabled(CommonActionsPanel.Buttons.REMOVE, myTree.getSelectionPath() != null); } | updateButtons |
282,271 | ToolbarDecorator (int rowCount) { myTree.setVisibleRowCount(rowCount); return this; } | setVisibleRowCount |
282,272 | boolean () { return myTree.getModel() instanceof EditableModel; } | isModelEditable |
282,273 | void () { RowsDnDSupport.install(myTree, (EditableModel)myTree.getModel()); } | installDnDSupport |
282,274 | void (@NotNull JList<?> list, int index) { LOG.assertTrue(index >= 0); LOG.assertTrue(index < list.getModel().getSize()); ensureIndexIsVisible(list, index, 0); list.setSelectedIndex(index); } | selectItem |
282,275 | void (@NotNull JList<?> list) { int size = list.getModel().getSize(); if (size == 0) { list.clearSelection(); return; } int selectedIndex = list.getSelectedIndex(); if (selectedIndex < 0 || selectedIndex >= size) { // fit index to [0, size-1] range selectedIndex = 0; } selectItem(list, selectedIndex); } | ensureSelectionExists |
282,276 | void (JList<?> list) { int visible = getVisibleRowCount(list); ListSelectionModel selectionModel = list.getSelectionModel(); if (visible <= 0) { moveHome(list); return; } int size = list.getModel().getSize(); int decrement = visible - 1; int index = Math.max(list.getSelectedIndex() - decrement, 0); int top = list.getFi... | movePageUp |
282,277 | void (@NotNull JList<?> list) { int visible = getVisibleRowCount(list); if (visible <= 0) { moveEnd(list); return; } int size = list.getModel().getSize(); int increment = visible - 1; int index = Math.min(list.getSelectedIndex() + increment, size - 1); int top = list.getFirstVisibleIndex() + increment; int bottom = top... | movePageDown |
282,278 | void (@NotNull JList<?> list) { list.setSelectedIndex(0); list.ensureIndexIsVisible(0); } | moveHome |
282,279 | void (@NotNull JList<?> list) { int index = list.getModel().getSize() - 1; list.setSelectedIndex(index); list.ensureIndexIsVisible(index); } | moveEnd |
282,280 | void (@NotNull JList<?> list, int index, int moveDirection) { _ensureIndexIsVisible(list, index, moveDirection, list.getModel().getSize()); } | ensureIndexIsVisible |
282,281 | void (@NotNull JTable table, int index, int moveDirection) { _ensureIndexIsVisible(table, index, moveDirection, table.getRowCount()); } | ensureIndexIsVisible |
282,282 | void (@NotNull JComponent c, int index, int moveDirection, int size) { int visible = visibleRowCount(c); int top; int bottom; if (moveDirection == 0) { top = index - (visible - 1) / ROW_PADDING; bottom = top + visible - 1; } else if (moveDirection < 0) { top = index - ROW_PADDING; bottom = index; } else { top = index; ... | _ensureIndexIsVisible |
282,283 | void (@NotNull JList<?> list, int top, int bottom) { int size = list.getModel().getSize(); if (top < 0) { top = 0; } if (bottom >= size) { bottom = size - 1; } Rectangle cellBounds = list.getCellBounds(top, bottom); if (cellBounds != null) { cellBounds.x = 0; list.scrollRectToVisible(cellBounds); } } | ensureRangeIsVisible |
282,284 | void (@NotNull JComponent c, int top, int bottom) { if (c instanceof JList) { ensureRangeIsVisible((JList<?>)c, top, bottom); } else if (c instanceof JTable table) { Rectangle cellBounds = getCellBounds(table, top, bottom); cellBounds.x = 0; table.scrollRectToVisible(cellBounds); } } | _ensureRangeIsVisible |
282,285 | boolean (@NotNull JList<?> list, int index) { int first = list.getFirstVisibleIndex(); int last = list.getLastVisibleIndex(); if (first < 0 || last < 0 || index < first || index > last) { return false; } if (index > first && index < last) { return true; } return list.getVisibleRect().contains(list.getCellBounds(index, ... | isIndexFullyVisible |
282,286 | int (@NotNull JList<?> list) { return list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1; } | getVisibleRowCount |
282,287 | void (@NotNull JList<?> list, @JdkConstants.InputEventMask int modifiers) { moveDown(list, modifiers, UISettings.getInstance().getCycleScrolling()); } | moveDown |
282,288 | void (@NotNull JList<?> list, @JdkConstants.InputEventMask int modifiers, boolean cycleScrolling) { _moveDown(list, list.getSelectionModel(), modifiers, list.getModel().getSize(), cycleScrolling); } | moveDown |
282,289 | void (@NotNull ListSelectionModel selectionModel, int indexToSelect, @JdkConstants.InputEventMask int modifiers) { if (selectionModel.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) { selectionModel.setSelectionInterval(indexToSelect,indexToSelect); } else { if ((modifiers & InputEvent.SHIFT_DOWN_MASK) == 0)... | selectOrAddSelection |
282,290 | void (@NotNull JList<?> list) { installActions(list, null); } | installActions |
282,291 | void (@NotNull JList<?> list, @Nullable JComponent focusParent) { installActions(list, focusParent, UISettings.getInstance().getCycleScrolling()); } | installActions |
282,292 | void (final @NotNull JList<?> list, @Nullable JComponent focusParent, boolean cycleScrolling) { ActionMap actionMap = list.getActionMap(); setupScrollingActions(list, actionMap, cycleScrolling); actionMap.put(MOVE_HOME_ID, new MoveAction(MOVE_HOME_ID, list)); actionMap.put(MOVE_END_ID, new MoveAction(MOVE_END_ID, list)... | installActions |
282,293 | void (@NotNull JComponent list, ActionMap actionMap, boolean cycleScrolling) { actionMap.put(SCROLL_UP_ACTION_ID, new MoveAction(SCROLL_UP_ACTION_ID, list, cycleScrolling)); actionMap.put(SCROLL_DOWN_ACTION_ID, new MoveAction(SCROLL_DOWN_ACTION_ID, list, cycleScrolling)); actionMap.put(SELECT_PREVIOUS_ROW_ACTION_ID, ne... | setupScrollingActions |
282,294 | void (@NotNull JList<?> list, @Nullable JComponent focusParent) { if (focusParent != null && focusParent != list) { focusParent.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.isShiftDown()) { if (e.getKeyCode() == KeyEvent.VK_DOWN) { list.dispatchEvent(e); e.consume(); } if (e.ge... | redirectExpandSelection |
282,295 | void (KeyEvent e) { if (e.isShiftDown()) { if (e.getKeyCode() == KeyEvent.VK_DOWN) { list.dispatchEvent(e); e.consume(); } if (e.getKeyCode() == KeyEvent.VK_UP) { list.dispatchEvent(e); e.consume(); } } } | keyPressed |
282,296 | void (@NotNull JList<?> list, @Nullable JComponent focusParent) { new ListMoveEndAction(focusParent, list); } | installMoveEndAction |
282,297 | void (@NotNull JList<?> list, @Nullable JComponent focusParent) { new ListMoveHomeAction(focusParent, list); } | installMoveHomeAction |
282,298 | void (@NotNull JList<?> list, @Nullable JComponent focusParent) { new ListMovePageDownAction(focusParent, list); } | installMovePageDownAction |
282,299 | void (@NotNull JList<?> list, @Nullable JComponent focusParent) { new ListMovePageUpAction(focusParent, list); } | installMovePageUpAction |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.