Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
245,700
void (Graphics g, Rectangle t, Dimension d) { g.setColor(getFocusColor()); UIUtil.drawDottedRectangle(g, t.x - 2, t.y - 1, t.x + t.width + 1, t.y + t.height); }
paintFocus
245,701
ComponentUI (JComponent c) { return new BegTreeUI(); }
createUI
245,702
boolean (MouseEvent e) { return SwingUtilities.isLeftMouseButton(e) && e.isControlDown() && !e.isPopupTrigger(); }
isToggleSelectionEvent
245,703
ComponentUI (JComponent component) { return new IdeaMenuUI(); }
createUI
245,704
void (Graphics g, Component c, int width, int height) { GraphicsConfig config = GraphicsUtil.setupAAPainting(g); int radius; JBInsets outerInsets; if (IdeaPopupMenuUI.isPartOfPopupMenu(c)) { radius = JBUI.CurrentTheme.PopupMenu.Selection.ARC.get(); outerInsets = JBUI.CurrentTheme.PopupMenu.Selection.outerInsets(); } el...
paintRoundSelection
245,705
Dimension (Component c, Dimension preferredSize) { if (ExperimentalUI.isNewUI() && !IdeaPopupMenuUI.isMenuBarItem(c)) { JBInsets outerInsets = IdeaPopupMenuUI.isPartOfPopupMenu(c) ? JBUI.CurrentTheme.PopupMenu.Selection.outerInsets() : JBUI.CurrentTheme.Menu.Selection.outerInsets(); return new Dimension(preferredSize.w...
patchPreferredSize
245,706
void () { super.installDefaults(); Integer integer = UIUtil.getPropertyMaxGutterIconWidth(getPropertyPrefix()); if (integer != null){ myMaxGutterIconWidth2 = myMaxGutterIconWidth = integer.intValue(); } selectionBackground = getDefaultSelectionBackground(); if (isHeaderMenu()) { menuItem.setBackground(getMenuBackground...
installDefaults
245,707
Color () { return JBColor.namedColor("Menu.selectionBackground", UIUtil.getListSelectionBackground(true)); }
getDefaultSelectionBackground
245,708
void (Color selectionBackground) { this.selectionBackground = selectionBackground; }
setSelectionBackground
245,709
Color () { return JBColor.namedColor("MainMenu.background", UIManager.getColor("Menu.background")); }
getMenuBackgroundColor
245,710
boolean () { return menuItem instanceof ActionMenu actionMenu && actionMenu.isHeaderMenuItem(); }
isHeaderMenu
245,711
void (JComponent comp) { myMaxGutterIconWidth = getAllowedIcon() == null && IdeaPopupMenuUI.hideEmptyIcon(comp) ? 0 : myMaxGutterIconWidth2; }
checkEmptyIcon
245,712
void (Graphics g, JComponent comp) { UISettings.setupAntialiasing(g); JMenu jMenu = (JMenu)comp; ButtonModel buttonmodel = jMenu.getModel(); int mnemonicIndex = jMenu.getDisplayedMnemonicIndex(); Icon icon = getIcon(); Icon allowedIcon = getAllowedIcon(); checkEmptyIcon(comp); Insets insets = comp.getInsets(); resetRec...
paint
245,713
void (Graphics g, JComponent comp, JMenu jMenu, ButtonModel buttonmodel, Icon allowedIcon) { if (comp.isOpaque()) { g.setColor(jMenu.getBackground()); g.fillRect(0, 0, jMenu.getWidth(), jMenu.getHeight()); } if (buttonmodel.isArmed() || buttonmodel.isSelected()){ paintHover(g, comp, jMenu, allowedIcon); } }
fillBackground
245,714
void (Graphics g, JComponent comp, JMenu jMenu, Icon allowedIcon) { g.setColor(selectionBackground); if (allowedIcon != null && !(UIUtil.isUnderIntelliJLaF() || StartupUiUtil.isUnderDarcula())) { g.fillRect(k, 0, jMenu.getWidth() - k, jMenu.getHeight()); } else if (ExperimentalUI.isNewUI() || IdeaPopupMenuUI.isRoundBor...
paintHover
245,715
boolean () { return !((JMenu)menuItem).isTopLevelMenu(); }
useCheckAndArrow
245,716
MenuElement[] () { MenuSelectionManager menuselectionmanager = MenuSelectionManager.defaultManager(); MenuElement[] amenuelement = menuselectionmanager.getSelectedPath(); int i1 = amenuelement.length; if (i1 == 0){ return new MenuElement[0]; } Container container = menuItem.getParent(); MenuElement[] amenuelement1; if ...
getPath
245,717
String ( FontMetrics fontmetrics, @Nls String text, Icon icon, Icon checkIcon, Icon arrowIcon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewRect, Rectangle iconRect, Rectangle textRect, Rectangle acceleratorRect, Rectangle checkIconRect, Rectangle a...
layoutMenuItem
245,718
Icon () { Icon icon = menuItem.getIcon(); if (icon != null && getAllowedIcon() != null){ icon = null; } return icon; }
getIcon
245,719
Dimension ( JComponent comp, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap ) { JMenu jMenu = (JMenu)comp; Icon icon1 = getIcon(); Icon icon2 = getAllowedIcon(); checkEmptyIcon(comp); String text = jMenu.getText(); Font font = jMenu.getFont(); FontMetrics fontmetrics = jMenu.getToolkit().getFontMetrics(font); r...
getPreferredMenuItemSize
245,720
void (Graphics g) { int i1 = a - 1; int j1 = e - 2; int k1 = i1 + myMaxGutterIconWidth + 1; int l1 = j1 + myMaxGutterIconWidth + 4; g.setColor(BegResources.m); LinePainter2D.paint((Graphics2D)g, i1, j1, i1, l1); LinePainter2D.paint((Graphics2D)g, i1, j1, k1, j1); g.setColor(BegResources.j); LinePainter2D.paint((Graphic...
drawIconBorder
245,721
void () { ourIconRect.setBounds(ourZeroRect); ourTextRect.setBounds(ourZeroRect); ourAcceleratorRect.setBounds(ourZeroRect); ourCheckIconRect.setBounds(ourZeroRect); ourArrowIconRect.setBounds(ourZeroRect); ourViewRect.setBounds(0, 0, Short.MAX_VALUE, Short.MAX_VALUE); }
resetRects
245,722
Icon () { Icon icon = menuItem.isEnabled() ? menuItem.getIcon() : menuItem.getDisabledIcon(); if (menuItem.isEnabled() && isSelected(menuItem) && menuItem.getSelectedIcon() != null) { icon = menuItem.getSelectedIcon(); } if (icon != null && icon.getIconWidth() > myMaxGutterIconWidth){ icon = null; } return icon; }
getAllowedIcon
245,723
void (Graphics g, JComponent comp) { paint(g, comp); }
update
245,724
void (JComponent c) { super.installUI(c); Object clientProperty = UIUtil.getTabbedPanePaintContentBorder(c); if (clientProperty instanceof Boolean aBoolean) { myPaintContentBorder = aBoolean.booleanValue(); } }
installUI
245,725
Insets (int tabPlacement) { if (tabPlacement == TOP && !myPaintContentBorder) { return JBUI.insetsTop(1); } if (tabPlacement == BOTTOM && !myPaintContentBorder) { return JBUI.insetsBottom(1); } if (tabPlacement == LEFT && !myPaintContentBorder) { return JBUI.insetsLeft(1); } if (tabPlacement == RIGHT && !myPaintContent...
getContentBorderInsets
245,726
void (Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { g.setColor(darkShadow); switch (tabPlacement) { case TOP -> { if (isSelected) { // left LinePainter2D.paint((Graphics2D)g, x, y + 1, x, y + h - 1); // top LinePainter2D.paint((Graphics2D)g, x + 1, y, x + w - 3, y); // ri...
paintTabBorder
245,727
void (Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) { if (isSelected) { font = font.isBold()? font : font.deriveFont(Font.BOLD); metrics = metrics.getFont().isBold()? metrics : g.getFontMetrics(font); } else { font = font.isPlain()? fon...
paintText
245,728
void (Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { if (isSelected) { g.setColor(LIGHT); } else { g.setColor(DARK); } switch (tabPlacement) { case LEFT -> g.fillRect(x + 1, y + 2, w - 2, h - 3); case RIGHT -> g.fillRect(x, y + 2, w - 1, h - 3); case BOTTOM -> g.fillRect(x...
paintTabBackground
245,729
void (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { if (tabPlacement == TOP || myPaintContentBorder) { boolean leftToRight = isLeftToRight(tabPane); int right = x + w - 1; Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect); g.setColor(darkShadow); // Dr...
paintContentBorderTopEdge
245,730
void (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { if (tabPlacement == BOTTOM || myPaintContentBorder) { boolean leftToRight = isLeftToRight(tabPane); int bottom = y + h - 1; int right = x + w - 1; Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect); g....
paintContentBorderBottomEdge
245,731
void (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { if (tabPlacement == LEFT || myPaintContentBorder) { Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect); g.setColor(darkShadow); // Draw unbroken line if tabs are not on LEFT, OR // selected tab is not ...
paintContentBorderLeftEdge
245,732
void (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { if (tabPlacement == RIGHT || myPaintContentBorder) { Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect); g.setColor(darkShadow); // Draw unbroken line if tabs are not on RIGHT, OR // selected tab is no...
paintContentBorderRightEdge
245,733
boolean (int tabIndex) { int run = getRunForTab(tabPane.getTabCount(), tabIndex); int lastIndex = lastTabInRun(tabPane.getTabCount(), run); return tabIndex == lastIndex; }
isLastInRun
245,734
boolean (Component c) { return c.getComponentOrientation().isLeftToRight(); }
isLeftToRight
245,735
int (int tabPlacement, int tabIndex, int fontHeight) { return (int)(super.calculateTabHeight(tabPlacement, tabIndex, fontHeight) * 1.0); }
calculateTabHeight
245,736
int (int tabPlacement) { FontMetrics metrics = getFontMetrics(); int tabCount = tabPane.getTabCount(); int result = 0; int fontHeight = metrics.getHeight(); for (int i = 0; i < tabCount; i++) { result = Math.max(calculateTabHeight(tabPlacement, i, fontHeight), result); } return result; }
calculateMaxTabHeight
245,737
ComponentUI (JComponent c) { return new BegTabbedPaneUI(); }
createUI
245,738
int (int tabPlacement, int tabIndex, FontMetrics metrics) { final Font font = metrics.getFont(); final FontMetrics plainMetrics = font.isPlain()? metrics : tabPane.getFontMetrics(font.deriveFont(Font.PLAIN)); final int widthPlain = super.calculateTabWidth(tabPlacement, tabIndex, plainMetrics); final FontMetrics boldMet...
calculateTabWidth
245,739
void (int tabPlacement, FontMetrics metrics, int tabIndex, @NlsContexts.TabTitle String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) { metrics = (myLayoutMetrics != null)? myLayoutMetrics : metrics; textRect.x = textRect.y = iconRect.x = iconRect.y = 0; View v = getTe...
layoutLabel
245,740
void (boolean noIconSpace) { myNoIconSpace = noIconSpace; }
setNoIconSpace
245,741
void (boolean paintContentBorder) { myPaintContentBorder = paintContentBorder; }
setPaintContentBorder
245,742
int (int tabPlacement, int horizRunCount, int maxTabHeight) { for (int i = 0; i < tabPane.getTabCount(); i++) { Component component = tabPane.getComponentAt(i); if (component != null) { return super.calculateTabAreaHeight(tabPlacement, horizRunCount, maxTabHeight); } } return maxTabHeight + tabRunOverlay; }
calculateTabAreaHeight
245,743
void (Component c, Graphics g, int x, int y, int w, int h) { g.translate(x, y); g.setColor(color1); LinePainter2D.paint((Graphics2D)g, 0, 0, w - 2, 0); LinePainter2D.paint((Graphics2D)g, 0, 0, 0, h - 2); g.setColor(color2); LinePainter2D.paint((Graphics2D)g, 1, 1, w - 3, 1); LinePainter2D.paint((Graphics2D)g, 1, 1, 1, ...
paintBorder
245,744
Insets (Component c) { return (Insets)borderInsets.clone(); }
getBorderInsets
245,745
void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { if (table.isEditing()) { e.consume(); table.removeEditor(); if (e.getSource() != table) { ((JComponent)e.getSource()).removeKeyListener(this); } } } }
keyPressed
245,746
ComponentUI (JComponent c) { return new BegTableUI(); }
createUI
245,747
void (JComponent c) { super.installUI(c); c.getActionMap().put(START_EDITING_ACTION_KEY, new StartEditingAction()); // fix missing escape shortcut c.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("pressed ESCAPE"), "cancel"); }
installUI
245,748
void () { super.installDefaults(); int rowHeight = UIManager.getInt("Table.rowHeight"); if (rowHeight > 0) { LookAndFeel.installProperty(table, "rowHeight", rowHeight); } }
installDefaults
245,749
KeyListener () { return myAdapter; }
createKeyListener
245,750
void (ActionEvent e) { JTable table = (JTable)e.getSource(); if (!table.hasFocus()) { CellEditor cellEditor = table.getCellEditor(); if (cellEditor != null && !cellEditor.stopCellEditing()) { return; } IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(tabl...
actionPerformed
245,751
Border () { if (ourTextFieldBorder == null) { ourTextFieldBorder = new BorderUIResource.CompoundBorderUIResource( new TextFieldBorder(), BorderFactory.createEmptyBorder(2, 2, 2, 2)); } return ourTextFieldBorder; }
getTextFieldBorder
245,752
Border () { if (ourScrollPaneBorder == null) { ourScrollPaneBorder = new BorderUIResource.LineBorderUIResource(MetalLookAndFeel.getControlDarkShadow()); } return ourScrollPaneBorder; }
getScrollPaneBorder
245,753
boolean () { return false; }
isBorderOpaque
245,754
void (Component c, Graphics g, int x, int y, int w, int h) { if (!(c instanceof JTextComponent)) { // special case for non-text components (bug ID 4144840) if (c.isEnabled()) { drawFlush3DBorder(g, x, y, w, h); } else { drawDisabledBorder(g, x, y, w, h); } return; } if (c.isEnabled() && ((JTextComponent)c).isEditable()...
paintBorder
245,755
void (Graphics g, int x, int y, int w, int h) { g.translate(x, y); g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawRect(0, 0, w - 1, h - 1); g.translate(-x, -y); }
drawLineBorder
245,756
void (Graphics g, int x, int y, int w, int h) { g.translate(x, y); g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawRect(1, 1, w - 2, h - 2); g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawRect(0, 0, w - 2, h - 2); g.translate(-x, -y); }
drawFlush3DBorder
245,757
void (Graphics g, int x, int y, int w, int h) { g.translate(x, y); g.setColor(MetalLookAndFeel.getControlShadow()); g.drawRect(0, 0, w - 1, h - 1); g.translate(-x, -y); }
drawDisabledBorder
245,758
JComponent () { JPanel result = new JPanel(new BorderLayout()); JPanel icon = new JPanel(new BorderLayout()); icon.add(myIcon, BorderLayout.NORTH); result.add(icon, BorderLayout.WEST); JPanel header = new JPanel(); header.setLayout(new BoxLayout(header, BoxLayout.Y_AXIS)); header.add(myHeader); header.add(Box.createVer...
createCenterPanel
245,759
Dimension () { Dimension custom = getWindowPreferredSize(); Dimension superSize = super.getPreferredSize(); if (custom != null) { custom.width = custom.width > 0 ? custom.width : superSize.width; custom.height = custom.height > 0 ? custom.height : superSize.height; } else { custom = superSize; } return custom; }
getPreferredSize
245,760
void () { setTitle(myModel.getTitle()); initHelpButton(); myModel.setCallback(this); super.init(); initCurrentStep(); }
init
245,761
void () { myHelp.setText(IdeBundle.message("button.help")); myHelp.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onHelp(); } }); getRootPane().registerKeyboardAction( new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { onHelp(); } }, KeyS...
initHelpButton
245,762
void (ActionEvent e) { onHelp(); }
actionPerformed
245,763
void (final ActionEvent e) { onHelp(); }
actionPerformed
245,764
void (final ActionEvent e) { onHelp(); }
actionPerformed
245,765
void () { HelpManager.getInstance().invokeHelp(myModel.getCurrentStep().getHelpId()); }
onHelp
245,766
void () { WizardStep current = myModel.getCurrentStep(); myIcon.setIcon(current.getIcon()); myHeader.setFont(myHeader.getFont().deriveFont(Font.BOLD, 14)); myHeader.setText(current.getTitle()); myExplanation.setText(current.getExplanation()); @NonNls String stepName = myStepCardNames.get(current); if (stepName == null)...
initCurrentStep
245,767
JComponent () { final JPanel southPanel = new JPanel(new BorderLayout()); final JPanel panel = new JPanel(new GridLayout(1, 0, 5, 0)); panel.add(myPrevious); panel.add(myNext); panel.add(myFinish); panel.add(myCancel); if (ApplicationManager.getApplication() != null) { // we won't be able to show help if there's no Hel...
createSouthPanel
245,768
void () { initCurrentStep(); }
onStepChanged
245,769
void () { doCancelAction(); }
onWizardGoalDropped
245,770
void () { doOKAction(); }
onWizardGoalAchieved
245,771
boolean () { return isOK(); }
isWizardGoalAchieved
245,772
Dimension () { return null; }
getWindowPreferredSize
245,773
JComponent () { return myModel.getCurrentStep().getPreferredFocusedComponent(); }
getPreferredFocusedComponent
245,774
WizardStep (WizardStep step) { mySteps.add(step); return step; }
add
245,775
WizardStep (WizardStep beforeWhat, WizardStep toAdd) { int i = mySteps.indexOf(beforeWhat); mySteps.add(i, toAdd); return toAdd; }
addBefore
245,776
WizardStep (WizardStep afterWhat, WizardStep toAdd) { int i = mySteps.indexOf(afterWhat); mySteps.add(i + 1, toAdd); return toAdd; }
addAfter
245,777
void () { checkModel(); WizardStep nextStep = getCurrentStep().onNext(this); if (nextStep == WizardStep.FORCED_GOAL_DROPPED) { cancel(); return; } if (nextStep == WizardStep.FORCED_GOAL_ACHIEVED) { finish(); return; } if (nextStep == null) { nextStep = getNextFor(getCurrentStep()); } changeToStep(nextStep); }
next
245,778
void () { checkModel(); WizardStep previousStep = getCurrentStep().onPrevious(this); if (previousStep == null) { previousStep = getPreviousFor(getCurrentStep()); } changeToStep(previousStep); }
previous
245,779
void (WizardStep step) { prepareCurrentStep(step); getCallback().onStepChanged(); }
changeToStep
245,780
void () { checkModel(); setFinishedAs(getCurrentStep().onFinish()); if (isWizardGoalAchieved()) { getCallback().onWizardGoalAchieved(); } else { getCallback().onWizardGoalDropped(); } }
finish
245,781
void () { checkModel(); boolean canCancel = getCurrentStep().onCancel(); if (!canCancel) return; getCallback().onWizardGoalDropped(); setFinishedAs(false); }
cancel
245,782
WizardStep () { checkModel(); if (myCurrentStep == null) { prepareCurrentStep(mySteps.get(0)); } return myCurrentStep; }
getCurrentStep
245,783
JComponent () { checkModel(); getCurrentStep(); return myCurrentComponent; }
getCurrentComponent
245,784
WizardNavigationState () { checkModel(); getCurrentStep(); return myCurrentState; }
getCurrentNavigationState
245,785
boolean (WizardStep step) { return mySteps.indexOf(step) == 0; }
isFirst
245,786
boolean (WizardStep step) { return mySteps.indexOf(step) == mySteps.size() - 1; }
isLast
245,787
WizardStep (WizardStep wizardStep) { return mySteps.get(mySteps.indexOf(wizardStep) + 1); }
getNextFor
245,788
WizardStep (WizardStep wizardStep) { return mySteps.get(mySteps.indexOf(wizardStep) - 1); }
getPreviousFor
245,789
void () { if (mySteps.size() == 0) { throw new IllegalStateException("Not steps were added"); } }
checkModel
245,790
void (WizardStep currentStep) { myCurrentStep = currentStep; if (myCurrentState == null) { myCurrentState = new WizardNavigationState(this); } myCurrentState.NEXT.setEnabled(!isLast(myCurrentStep)); myCurrentState.PREVIOUS.setEnabled(!isFirst(myCurrentStep)); myCurrentState.FINISH.setEnabled(isLast(myCurrentStep)); myC...
prepareCurrentStep
245,791
WizardCallback () { return myCallback != null ? myCallback : WizardCallback.EMPTY; }
getCallback
245,792
boolean () { return myDropped; }
isWizardGoalDropped
245,793
boolean () { return myAchieved; }
isWizardGoalAchieved
245,794
void (boolean goalAchieved) { myAchieved = goalAchieved; myDropped = !goalAchieved; }
setFinishedAs
245,795
boolean () { return myAchieved || myDropped; }
isDone
245,796
int (WizardStep step) { return mySteps.indexOf(step); }
getStepIndex
245,797
void () { }
onStepChanged
245,798
void () { }
onWizardGoalDropped
245,799
void () { }
onWizardGoalAchieved