Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
280,300 | void () { myState.getProportions().saveSplitterProportions(myWholePanel); myAutoScrollHandler.cancelAllRequests(); myDetails.disposeUIResources(); myInitializedConfigurables.clear(); clearChildren(); final String key = getComponentStateKey(); final MasterDetailsStateService stateService = getStateService(); if (key != null && stateService != null) { stateService.setComponentState(key, getState()); } myCurrentConfigurable = null; } | disposeUIResources |
280,301 | void () { for (MyNode node : TreeUtil.treeNodeTraverser(myRoot).filter(MyNode.class)) { node.getConfigurable().disposeUIResources(); if (!(node instanceof MyRootNode)) { node.setUserObject(null); } } myRoot.removeAllChildren(); } | clearChildren |
280,302 | void () { ((DefaultTreeModel)myTree.getModel()).setRoot(myRoot); myTree.setRootVisible(false); myTree.setShowsRootHandles(true); TreeUtil.installActions(myTree); myTree.setCellRenderer(new MyColoredTreeCellRenderer()); List<AnAction> actions = createActions(true); if (actions != null) { final DefaultActionGroup group = new DefaultActionGroup(); for (AnAction action : actions) { group.add(action); } actions = getAdditionalActions(); if (actions != null) { group.addSeparator(); for (AnAction action : actions) { group.add(action); } } PopupHandler.installPopupMenu(myTree, group, "MasterDetailsTreePopup"); } } | initTree |
280,303 | void (final Object editableObject) { for (ItemsChangeListener listener : myListeners) { listener.itemChanged(editableObject); } } | fireItemsChangeListener |
280,304 | void () { for (ItemsChangeListener listener : myListeners) { listener.itemsExternallyChanged(); } } | fireItemsChangedExternally |
280,305 | void () { myTree = new Tree() { @Override public JToolTip createToolTip() { final JToolTip toolTip = new JToolTip() { { setUI(new MultiLineTooltipUI()); } }; toolTip.setComponent(this); return toolTip; } }; } | createUIComponents |
280,306 | JToolTip () { final JToolTip toolTip = new JToolTip() { { setUI(new MultiLineTooltipUI()); } }; toolTip.setComponent(this); return toolTip; } | createToolTip |
280,307 | void (MyNode nodeToAdd, MyNode parent) { int i = TreeUtil.indexedBinarySearch(parent, nodeToAdd, getNodeComparator()); int insertionPoint = i >= 0 ? i : -i - 1; ((DefaultTreeModel)myTree.getModel()).insertNodeInto(nodeToAdd, parent, insertionPoint); } | addNode |
280,308 | void (MyNode root) { TreeUtil.sortRecursively(root, getNodeComparator()); ((DefaultTreeModel)myTree.getModel()).reload(root); } | sortDescendants |
280,309 | Comparator<MyNode> () { return (o1, o2) -> StringUtil.naturalCompare(o1.getDisplayName(), o2.getDisplayName()); } | getNodeComparator |
280,310 | ActionCallback (final DefaultMutableTreeNode nodeToSelect) { return selectNodeInTree(nodeToSelect, true, false); } | selectNodeInTree |
280,311 | ActionCallback (final DefaultMutableTreeNode nodeToSelect, boolean requestFocus) { return selectNodeInTree(nodeToSelect, true, requestFocus); } | selectNodeInTree |
280,312 | ActionCallback (final DefaultMutableTreeNode nodeToSelect, boolean center, final boolean requestFocus) { if (requestFocus) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myTree, true)); } if (nodeToSelect != null) { return TreeUtil.selectInTree(nodeToSelect, requestFocus, myTree, center); } return TreeUtil.selectFirstNode(myTree); } | selectNodeInTree |
280,313 | MyNode () { TreePath path = myTree.getSelectionPath(); return path != null ? (MyNode)path.getLastPathComponent() : null; } | getSelectedNode |
280,314 | void (@NlsSafe String displayName) { final MyNode nodeByName = findNodeByName(myRoot, displayName); selectNodeInTree(nodeByName, true); } | selectNodeInTree |
280,315 | void (final Object object) { selectNodeInTree(findNodeByObject(myRoot, object), true); } | selectNodeInTree |
280,316 | MyNode (final TreeNode root, final Condition<? super NamedConfigurable> condition) { return TreeUtil.treeNodeTraverser(root) .filter(MyNode.class) .filter(node -> condition.value(node.getConfigurable())) .first(); } | findNodeByCondition |
280,317 | void (@Nullable MyNode node) { if (node != null) { myState.setLastEditedConfigurable(getNodePathString(node)); } updateSelection(node != null ? node.getConfigurable() : null); } | setSelectedNode |
280,318 | void (@Nullable NamedConfigurable configurable) { myDetails.setText(configurable != null ? configurable.getBannerSlogan() : null); myCurrentConfigurable = configurable; if (configurable != null) { final JComponent comp = configurable.createComponent(); if (comp == null) { setEmpty(); LOG.error("createComponent() returned null. configurable=" + configurable); } else { myDetails.setContent(comp); ensureInitialized(configurable); myHistory.pushPlaceForElement(TREE_OBJECT, configurable.getEditableObject()); } } else { setEmpty(); } } | updateSelection |
280,319 | void (NamedConfigurable configurable) { if (!isInitialized(configurable)) { configurable.reset(); initializeConfigurable(configurable); } } | ensureInitialized |
280,320 | void () { myDetails.setContent(null); myDetails.setEmptyContentText(getEmptySelectionString()); } | setEmpty |
280,321 | String () { if (myCurrentConfigurable != null) { return myCurrentConfigurable.getHelpTopic(); } return null; } | getHelpTopic |
280,322 | void (final NamedConfigurable configurable) { myInitializedConfigurables.add(configurable); } | initializeConfigurable |
280,323 | Tree () { return myTree; } | getTree |
280,324 | void (final TreePath... paths) { List<MyNode> nodes = new ArrayList<>(); for (TreePath path : paths) { nodes.add((MyNode)path.getLastPathComponent()); } removeNodes(nodes); } | removePaths |
280,325 | void (final List<? extends MyNode> nodes) { MyNode parentNode = null; int idx = -1; for (MyNode node : nodes) { final NamedConfigurable namedConfigurable = node.getConfigurable(); final Object editableObject = namedConfigurable.getEditableObject(); parentNode = (MyNode)node.getParent(); if (parentNode == null) continue; idx = parentNode.getIndex(node); ((DefaultTreeModel)myTree.getModel()).removeNodeFromParent(node); myHasDeletedItems |= wasObjectStored(editableObject); fireItemsChangeListener(editableObject); onItemDeleted(editableObject); namedConfigurable.disposeUIResources(); } if (!nodes.isEmpty()) { if (parentNode != null && idx != -1) { DefaultMutableTreeNode toSelect = null; if (idx < parentNode.getChildCount()) { toSelect = (DefaultMutableTreeNode) parentNode.getChildAt(idx); } else { if (idx > 0 && parentNode.getChildCount() > 0) { if (idx - 1 < parentNode.getChildCount()) { toSelect = (DefaultMutableTreeNode) parentNode.getChildAt(idx - 1); } else { toSelect = (DefaultMutableTreeNode) parentNode.getFirstChild(); } } else { if (parentNode.isRoot() && myTree.isRootVisible()) { toSelect = parentNode; } else if (parentNode.getChildCount() > 0) { toSelect = (DefaultMutableTreeNode) parentNode.getFirstChild(); } } } if (toSelect != null) { TreeUtil.selectInTree(toSelect, true, myTree); } } else { TreeUtil.promiseSelectFirst(myTree); } } } | removeNodes |
280,326 | void (Object item) { } | onItemDeleted |
280,327 | void (@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (value instanceof MyNode node) { renderIcon(node, expanded); renderName(node); } } | customizeCellRenderer |
280,328 | void (@NotNull MyNode node, boolean expanded) { setIcon(node.getIcon(expanded)); } | renderIcon |
280,329 | void (@NotNull MyNode node) { final Font font = UIUtil.getTreeFont(); if (node.isDisplayInBold()) { setFont(font.deriveFont(Font.BOLD)); } else { setFont(font.deriveFont(Font.PLAIN)); } SimpleTextAttributes attributes = node.isDisplayInBold() ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES; append(node.getDisplayName(), SimpleTextAttributes.merge(getAdditionalAttributes(node), attributes)); } | renderName |
280,330 | SimpleTextAttributes (@NotNull MyNode node) { return SimpleTextAttributes.REGULAR_ATTRIBUTES; } | getAdditionalAttributes |
280,331 | void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); presentation.setEnabled(false); final TreePath[] selectionPath = myTree.getSelectionPaths(); if (selectionPath == null) { return; } if (myCondition != null) { Object[] result = new Object[selectionPath.length]; for (int i = 0; i < selectionPath.length; i++) { result[i] = selectionPath[i].getLastPathComponent(); } if (!myCondition.test(result)) { return; } } presentation.setEnabled(true); } | update |
280,332 | ActionUpdateThread () { return ActionUpdateThread.EDT; } | getActionUpdateThread |
280,333 | void (@NotNull AnActionEvent e) { removePaths(myTree.getSelectionPaths()); } | actionPerformed |
280,334 | Predicate<Object[]> (@NotNull Predicate<Object> condition) { return objects -> { for (Object object : objects) { if (!condition.test(object)) { return false; } } return true; }; } | forAll |
280,335 | NamedConfigurable () { return (NamedConfigurable)getUserObject(); } | getConfigurable |
280,336 | boolean () { return myDisplayInBold; } | isDisplayInBold |
280,337 | void (boolean displayInBold) { myDisplayInBold = displayInBold; } | setDisplayInBold |
280,338 | void (DefaultTreeModel treeModel) { treeModel.reload(this); } | reloadNode |
280,339 | void (String name) { } | setDisplayName |
280,340 | Object () { return null; } | getEditableObject |
280,341 | String () { return null; } | getBannerSlogan |
280,342 | String () { return ""; } | getDisplayName |
280,343 | JComponent () { return null; } | createOptionsPanel |
280,344 | boolean () { return false; } | isModified |
280,345 | void () { } | apply |
280,346 | void (@NotNull AnActionEvent e) { JBPopupFactory popupFactory = JBPopupFactory.getInstance(); DataContext dataContext = e.getDataContext(); ListPopupStep step = popupFactory.createActionsStep( myActionGroup, dataContext, null, false, false, myActionGroup.getTemplatePresentation().getText(), myTree, true, myPreselection != null ? myPreselection.getDefaultIndex() : 0, true); final ListPopup listPopup = popupFactory.createListPopup(step); listPopup.setHandleAutoSelectionBeforeShow(true); if (e instanceof AnActionButton.AnActionEventWrapper) { ((AnActionButton.AnActionEventWrapper)e).showPopup(listPopup); } else { listPopup.showInBestPositionFor(dataContext); } } | actionPerformed |
280,347 | JComponent () { myToReInitWholePanel = true; return myNorthPanel; } | getToolbar |
280,348 | JComponent () { myToReInitWholePanel = true; return myMaster; } | getMaster |
280,349 | DetailsComponent () { myToReInitWholePanel = true; return myDetails; } | getDetails |
280,350 | void () { createComponent(); } | initUi |
280,351 | JTextComponent () { return new JTextArea(7, 50); } | createTextFieldComponent |
280,352 | JComponent () { return new JBScrollPane(myField); } | createScrollableTextComponent |
280,353 | JComponent () { return null; } | createNorthPanel |
280,354 | JComponent () { JPanel messagePanel = new JPanel(new BorderLayout()); if (myMessage != null) { JComponent textComponent = createTextComponent(); messagePanel.add(textComponent, BorderLayout.NORTH); } myField = createTextFieldComponent(); messagePanel.add(createScrollableTextComponent(), BorderLayout.CENTER); return messagePanel; } | createCenterPanel |
280,355 | void (@Nullable @NlsContexts.DialogTitle String title, @Nullable @NlsContexts.Label String description, @Nullable Project project, FileChooserDescriptor fileChooserDescriptor) { addBrowseFolderListener(title, description, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT); installPathCompletion(fileChooserDescriptor); } | addBrowseFolderListener |
280,356 | void (@NotNull TextBrowseFolderListener listener) { listener.setOwnerComponent(this); addActionListener(listener); installPathCompletion(listener.getFileChooserDescriptor()); } | addBrowseFolderListener |
280,357 | void (@NotNull DocumentListener listener) { getTextField().getDocument().addDocumentListener(listener); } | addDocumentListener |
280,358 | void (FileChooserDescriptor fileChooserDescriptor) { installPathCompletion(fileChooserDescriptor, null); } | installPathCompletion |
280,359 | void (FileChooserDescriptor fileChooserDescriptor, @Nullable Disposable parent) { Application application = ApplicationManager.getApplication(); if (application == null || application.isUnitTestMode() || application.isHeadlessEnvironment()) return; FileChooserFactory instance = FileChooserFactory.getInstance(); if (instance != null) { instance.installFileCompletion(getChildComponent(), fileChooserDescriptor, true, parent); } } | installPathCompletion |
280,360 | JTextField () { return getChildComponent(); } | getTextField |
280,361 | String () { var text = Strings.notNullize(getTextField().getText()); if (!(this instanceof NoPathCompletion)) { text = FileUtil.expandUserHome(text); } return text; } | getText |
280,362 | void (@NlsSafe @Nullable String text) { getTextField().setText(text); } | setText |
280,363 | boolean () { return getTextField().isEditable(); } | isEditable |
280,364 | void (boolean b) { getTextField().setEditable(b); getButton().setFocusable(!b); } | setEditable |
280,365 | void (FileChooserDescriptor fileChooserDescriptor, @Nullable Disposable parent) { } | installPathCompletion |
280,366 | void (Graphics g) { GraphicsUtil.setupAntialiasing(g); super.paint(g); } | paint |
280,367 | void (Graphics g) { GraphicsUtil.setupAntialiasing(g); super.paint(g); } | paint |
280,368 | Object[] () { return ArrayUtilRt.EMPTY_OBJECT_ARRAY; } | getCurrentModalEntities |
280,369 | String (TextFieldWithHistory textField) { return textField.getText(); } | getText |
280,370 | void (TextFieldWithHistory textField, @NotNull String text) { textField.setText(text); } | setText |
280,371 | String (TextFieldWithStoredHistory textField) { return textField.getText(); } | getText |
280,372 | void (TextFieldWithStoredHistory textField, @NotNull String text) { textField.setText(text); } | setText |
280,373 | void (MouseWheelEvent e) { if (!isShowing()) return; int rotation = e.getWheelRotation(); if (rotation == 0) return; if (e.getComponent() != this) { e = (MouseWheelEvent)SwingUtilities.convertMouseEvent(e.getComponent(), e, this); } Point p = e.getPoint(); SwingUtilities.convertPointToScreen(p, this); Point tPoint = getLocationOnScreen(); if (p.x >= tPoint.x && p.x <= tPoint.x + getWidth() && p.y >= tPoint.y && p.y <= tPoint.y + getHeight()) { myLayout.updateShift(rotation * 10); } } | processMouseWheelEvent |
280,374 | void (LayoutManager mgr) { if (!(mgr instanceof MyLayout)) return; super.setLayout(mgr); } | setLayout |
280,375 | void (Graphics g) { GraphicsUtil.setupAntialiasing(g); super.paint(g); LayoutManager layout = getLayout(); if (layout instanceof MyLayout) { ((MyLayout)layout).paintIfNeeded(g); } } | paint |
280,376 | void (@NotNull Component component, @NotNull JPopupMenu menu) { // We need `menu.show(component, 0, -menu.getHeight());`, but `menu.getHeight()` will return 0 if the menu hasn't been shown yet. // Let's show it somewhere, and once it's shown, move it to the desired location. menu.show(component, 0, 0); UiNotifyConnector.doWhenFirstShown(menu, () -> { Window window = ComponentUtil.getWindow(menu); if (window == null) { LOG.error("Cannot find window for menu popup " + menu + ", " + menu.isShowing()); } else { Point diff = SwingUtilities.convertPoint(component, 0, 0, window); window.setLocation(window.getX(), window.getY() + diff.y - window.getHeight()); } }); } | showAbove |
280,377 | void (@NotNull Component component, @NotNull JPopupMenu menu) { menu.show(component, component.getWidth(), 0); } | showAtRight |
280,378 | void (@NotNull Component component, @NotNull JPopupMenu menu) { menu.show(component, 0, component.getHeight()); } | showBelow |
280,379 | void (@NotNull Component component, @NonNls @NotNull String place, @NotNull ActionGroup group) { showBelow(component, ActionManager.getInstance().createActionPopupMenu(place, group).getComponent()); } | showBelow |
280,380 | void (@NotNull MouseEvent event, @NotNull JPopupMenu menu) { menu.show(event.getComponent(), event.getX(), event.getY()); } | showByEvent |
280,381 | void (@NotNull Editor editor, @NotNull JPopupMenu menu) { Component invoker = editor.getContentComponent(); Point caretPoint = editor.visualPositionToXY(editor.getCaretModel().getVisualPosition()); menu.show(invoker, caretPoint.x, caretPoint.y); } | showByEditor |
280,382 | void (@NotNull MouseEvent event, @NonNls @NotNull String place, @NotNull ActionGroup group) { showByEvent(event, ActionManager.getInstance().createActionPopupMenu(place, group).getComponent()); } | showByEvent |
280,383 | void (@NotNull RelativePoint point, @NotNull JPopupMenu menu) { menu.show(point.getComponent(), point.getPoint().x, point.getPoint().y); } | showAt |
280,384 | void (PopupMenuEvent e) { switchTimer(true); } | popupMenuWillBecomeVisible |
280,385 | void (PopupMenuEvent e) { switchTimer(false); JRootPane rootPane = SwingUtilities.getRootPane(target); if (rootPane != null) { rootPane.putClientProperty("apple.awt._windowFadeDelegate", null); } } | popupMenuWillBecomeInvisible |
280,386 | void (PopupMenuEvent e) { switchTimer(false); } | popupMenuCanceled |
280,387 | void (boolean on) { if (on && !myTimer.isRunning()) { myTimer.start(); } if (!on && myTimer.isRunning()) { myTimer.stop(); } } | switchTimer |
280,388 | void (ActionEvent e) { if (!myTarget.isShowing()) return; PointerInfo info = MouseInfo.getPointerInfo(); if (info == null) return; Point mouseLocation = info.getLocation(); Point targetLocation = myTarget.getLocationOnScreen(); if (mouseLocation.x < targetLocation.x || mouseLocation.x > targetLocation.x + myTarget.getWidth()) { return; } if (Math.abs(mouseLocation.y - targetLocation.y - getMaxHeight()) < 10) { myScrollDirection = 1; } else if (Math.abs(mouseLocation.y - targetLocation.y) < 10) { myScrollDirection = -1; } else { return; } SwingUtilities.convertPointFromScreen(mouseLocation, myTarget); myTarget.dispatchEvent( new MouseEvent(myTarget, MouseEvent.MOUSE_ENTERED, System.currentTimeMillis(), 0, mouseLocation.x, mouseLocation.y, 0, false)); updateShift(5 * myScrollDirection); } | actionPerformed |
280,389 | void (int increment) { int maxHeight = super.preferredLayoutSize(myTarget).height - getMaxHeight(); int newShift = Math.max(0, Math.min(maxHeight, myShift + increment)); if (newShift != myShift) { myShift = newShift; myTarget.revalidate(); myTarget.repaint(); Window w = ComponentUtil.getWindow(myTarget.getComponent()); if (w != null) { for (Window window : w.getOwnedWindows()) { window.dispose(); } } } } | updateShift |
280,390 | void (Graphics g) { if (myShift > 0) { for (int i = 0; i < dim.length; i++) { g.setColor(dim[i]); g.drawLine(0, i, myTarget.getWidth(), i); } AllIcons.General.ArrowUp.paintIcon(myTarget, g, myTarget.getWidth() / 2 - AllIcons.General.ArrowUp.getIconWidth() / 2, 0); } if (super.preferredLayoutSize(myTarget).height - getMaxHeight() - myShift > 0) { for (int i = 0; i < dim.length; i++) { g.setColor(dim[i]); g.drawLine(0, myTarget.getHeight() - i, myTarget.getWidth(), myTarget.getHeight() - i); } AllIcons.General.ArrowDown.paintIcon(myTarget, g, myTarget.getWidth() / 2 - AllIcons.General.ArrowDown.getIconWidth() / 2, myTarget.getHeight() - AllIcons.General.ArrowDown.getIconHeight()); } } | paintIfNeeded |
280,391 | void (Container target) { Insets insets = target.getInsets(); int width = target.getWidth() - insets.left - insets.right; Component[] components = target.getComponents(); int y = -myShift + insets.top; for (Component component : components) { if (!component.isVisible()) { String place = target instanceof PlaceProvider ? ((PlaceProvider)target).getPlace() : null; String itemText = component instanceof AbstractButton ? "\"" + ((AbstractButton)component).getText() + "\"" : component.getClass().getName(); LOG.error("Invisible menu item " + itemText + (place != null ? " in '" + place + "'" : "") + " (" + component.getClass().getName() + " in " + target.getClass().getName() + ")"); continue; } int height = component.getPreferredSize().height; component.setBounds(insets.left, y, width, height); y += height; } } | layoutContainer |
280,392 | int () { GraphicsConfiguration configuration = myTarget.getGraphicsConfiguration(); if (configuration == null && myTarget.getInvoker() != null) { configuration = myTarget.getInvoker().getGraphicsConfiguration(); } if (configuration == null) return Short.MAX_VALUE; Rectangle screenRectangle = ScreenUtil.getScreenRectangle(configuration); return screenRectangle.height; } | getMaxHeight |
280,393 | Dimension (Container target) { Dimension dimension = super.preferredLayoutSize(target); int maxHeight = getMaxHeight(); switchTimer(dimension.height > maxHeight); dimension.height = Math.min(maxHeight, dimension.height); return dimension; } | preferredLayoutSize |
280,394 | void (final @NotNull TreeModel model, final boolean showRootNode) { myTreeModel = model; setModel(new TreeModelWrapper(model, showRootNode)); } | setTreeModel |
280,395 | TreeModel () { return myTreeModel; } | getTreeModel |
280,396 | JTree () { final JTree tree = new JTree(getTreeModel()); tree.setRootVisible(myShowRootNode); return tree; } | createFakeTree |
280,397 | Icon (final Object value, final int index) { if (value instanceof CustomPresentation) { return ((CustomPresentation)value).getIcon(index, 0); } if (value instanceof Iconable) { return ((Iconable)value).getIcon(0); } return null; } | getValueIcon |
280,398 | TreeModelWrapper () { return (TreeModelWrapper)myComboBox.getModel(); } | getTreeModelWrapper |
280,399 | Component (final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { clear(); myInList = index >= 0; if (index >= 0) { Object obj1 = myComboBox.getItemAt(index); myChecked = obj1 != null && obj1.equals(myComboBox.getSelectedItem()); } else { myChecked = false; } int indent = 0; if (myInList) { final TreePath path = getTreeModelWrapper().getPathForRow(index); indent = (path.getPathCount() - 1 - (myShowRootNode ? 0 : 1)) * INDENT; } setIpad(new Insets(1, !myInList || myEditable ? 5 : 5 + indent, 1, 5)); setIcon(getValueIcon(value, index)); setIconOpaque(true); myEditable = myComboBox.isEditable(); setForeground(isSelected ? list.getSelectionForeground() : list.getForeground()); setBackground(isSelected ? list.getSelectionBackground() : list.getBackground()); if (value instanceof CustomPresentation) { ((CustomPresentation)value).append(this, index); } else { if (value == null) { if (index == -1 && myDefaultText != null) { append(myDefaultText, SimpleTextAttributes.GRAY_ATTRIBUTES); } else { append(""); } } else { //noinspection HardCodedStringLiteral append(value.toString()); } } setSelected(isSelected); setFont(list.getFont()); return this; } | getListCellRendererComponent |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.