Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
284,500
void (@Nullable Icon icon) { setIcon(icon, 0); }
setIcon
284,501
boolean () { for (Icon layer1 : getLayeredIcon().getAllLayers()) { if (layer1 != null) { return true; } } return false; }
hasIcons
284,502
void (@Nullable Icon icon, int layer) { LayeredIcon layeredIcon = getLayeredIcon(); layeredIcon.setIcon(icon, layer); if (hasIcons()) { myLabel.setIcon(layeredIcon); } else { myLabel.setIcon(null); } invalidateIfNeeded(); }
setIcon
284,503
LayeredIcon () { return new LayeredIcon(2) { @Override public int getIconWidth() { int iconWidth = super.getIconWidth(); int tabWidth = TabLabel.this.getWidth(); int minTabWidth = JBUI.scale(MIN_WIDTH_TO_CROP_ICON); if (isCompressionEnabled && tabWidth < minTabWidth) { return Math.max(iconWidth - (minTabWidth - tabWidth), iconWidth / 2); } else { return iconWidth; } } @Override public void paintIcon(Component c, Graphics g, int x, int y) { Graphics g2 = g.create(x, y, getIconWidth(), getIconHeight()); try { super.paintIcon(c, g2, 0, 0); } finally { g2.dispose(); } } }; }
createLayeredIcon
284,504
int () { int iconWidth = super.getIconWidth(); int tabWidth = TabLabel.this.getWidth(); int minTabWidth = JBUI.scale(MIN_WIDTH_TO_CROP_ICON); if (isCompressionEnabled && tabWidth < minTabWidth) { return Math.max(iconWidth - (minTabWidth - tabWidth), iconWidth / 2); } else { return iconWidth; } }
getIconWidth
284,505
void (Component c, Graphics g, int x, int y) { Graphics g2 = g.create(x, y, getIconWidth(), getIconHeight()); try { super.paintIcon(c, g2, 0, 0); } finally { g2.dispose(); } }
paintIcon
284,506
LayeredIcon () { return myIcon; }
getLayeredIcon
284,507
TabInfo () { return myInfo; }
getInfo
284,508
void (@NotNull UiDecorator.UiDecoration decoration) { if (decoration.getLabelFont() != null) { setFont(decoration.getLabelFont()); getLabelComponent().setFont(decoration.getLabelFont()); } MergedUiDecoration resultDec = mergeUiDecorations(decoration, JBTabsImpl.defaultDecorator.getDecoration()); setBorder(new EmptyBorder(resultDec.labelInsets())); myLabel.setIconTextGap(resultDec.iconTextGap()); Insets contentInsets = resultDec.contentInsetsSupplier().apply(getActionsPosition()); myLabelPlaceholder.setBorder(new EmptyBorder(contentInsets)); }
apply
284,509
MergedUiDecoration (@NotNull UiDecorator.UiDecoration customDec, @NotNull UiDecorator.UiDecoration defaultDec) { Function<ActionsPosition, Insets> contentInsetsSupplier = position -> { Insets def = Objects.requireNonNull(defaultDec.getContentInsetsSupplier()).apply(position); if (customDec.getContentInsetsSupplier() != null) { return mergeInsets(customDec.getContentInsetsSupplier().apply(position), def); } return def; }; return new MergedUiDecoration( mergeInsets(customDec.getLabelInsets(), Objects.requireNonNull(defaultDec.getLabelInsets())), contentInsetsSupplier, ObjectUtils.notNull(customDec.getIconTextGap(), Objects.requireNonNull(defaultDec.getIconTextGap())) ); }
mergeUiDecorations
284,510
Insets (@Nullable Insets custom, @NotNull Insets def) { if (custom != null) { return new Insets(getValue(def.top, custom.top), getValue(def.left, custom.left), getValue(def.bottom, custom.bottom), getValue(def.right, custom.right)); } return def; }
mergeInsets
284,511
int (int currentValue, int newValue) { return newValue != -1 ? newValue : currentValue; }
getValue
284,512
void (ActionGroup group) { removeOldActionPanel(); if (group == null) return; myActionPanel = new ActionPanel(myTabs, myInfo, e -> processMouseEvent(SwingUtilities.convertMouseEvent(e.getComponent(), e, this)), value -> setHovered(value)); toggleShowActions(false); add(myActionPanel, isTabActionsOnTheRight() ? BorderLayout.EAST : BorderLayout.WEST); myTabs.revalidateAndRepaint(false); }
setTabActions
284,513
int () { return !isTabActionsOnTheRight() || ExperimentalUI.isNewUI() ? 6 : 2; }
getActionsInset
284,514
boolean () { return true; }
isShowTabActions
284,515
boolean () { return true; }
isTabActionsOnTheRight
284,516
ActionsPosition () { return isShowTabActions() && myActionPanel != null ? isTabActionsOnTheRight() ? ActionsPosition.RIGHT : ActionsPosition.LEFT : ActionsPosition.NONE; }
getActionsPosition
284,517
void (boolean enabled) { isCompressionEnabled = enabled; }
enableCompressionMode
284,518
void () { if (myActionPanel != null) { myActionPanel.getParent().remove(myActionPanel); myActionPanel = null; } }
removeOldActionPanel
284,519
boolean () { return myActionPanel != null && myActionPanel.update(); }
updateTabActions
284,520
void (@Nullable Icon icon) { if (myIcon.getIcon(0) == null) { setIcon(null, 1); myOverlayedIcon = icon; } else { setIcon(icon, 1); myOverlayedIcon = null; } }
setAttractionIcon
284,521
boolean () { if (!myTabs.attractions.contains(myInfo)) { if (getLayeredIcon().isLayerEnabled(1)) { getLayeredIcon().setLayerEnabled(1, false); setAttractionIcon(null); invalidateIfNeeded(); return true; } return false; } boolean needsUpdate = false; if (getLayeredIcon().getIcon(1) != myInfo.getAlertIcon()) { setAttractionIcon(myInfo.getAlertIcon()); needsUpdate = true; } int maxInitialBlinkCount = 5; int maxRefireBlinkCount = maxInitialBlinkCount + 2; if (myInfo.getBlinkCount() < maxInitialBlinkCount && myInfo.isAlertRequested()) { getLayeredIcon().setLayerEnabled(1, !getLayeredIcon().isLayerEnabled(1)); if (myInfo.getBlinkCount() == 0) { needsUpdate = true; } myInfo.setBlinkCount(myInfo.getBlinkCount() + 1); if (myInfo.getBlinkCount() == maxInitialBlinkCount) { myInfo.resetAlertRequest(); } repaint(); } else { if (myInfo.getBlinkCount() < maxRefireBlinkCount && myInfo.isAlertRequested()) { getLayeredIcon().setLayerEnabled(1, !getLayeredIcon().isLayerEnabled(1)); myInfo.setBlinkCount(myInfo.getBlinkCount() + 1); if (myInfo.getBlinkCount() == maxRefireBlinkCount) { myInfo.setBlinkCount(maxInitialBlinkCount); myInfo.resetAlertRequest(); } repaint(); } else { needsUpdate = !getLayeredIcon().isLayerEnabled(1); getLayeredIcon().setLayerEnabled(1, true); } } invalidateIfNeeded(); return needsUpdate; }
repaintAttraction
284,522
void (Graphics g) { super.paintComponent(g); paintBackground(g); }
paintComponent
284,523
void (Graphics g) { myTabs.tabPainterAdapter.paintBackground(this, g, myTabs); }
paintBackground
284,524
Color () { Color bg = myTabs.getTabPainter().getBackgroundColor(); Color customBg = myTabs.getTabPainter().getCustomBackground(getInfo().getTabColor(), isSelected(), myTabs.isActiveTabs(getInfo()), isHovered()); return customBg != null ? ColorUtil.alphaBlending(customBg, bg) : bg; }
getEffectiveBackground
284,525
void (final Graphics g) { super.paintChildren(g); if (getLabelComponent().getParent() == null) { return; } final Rectangle textBounds = SwingUtilities.convertRectangle(getLabelComponent().getParent(), getLabelComponent().getBounds(), this); // Paint border around label if we got the focus if (isFocusOwner()) { g.setColor(UIUtil.getTreeSelectionBorderColor()); UIUtil.drawDottedRectangle(g, textBounds.x, textBounds.y, textBounds.x + textBounds.width - 1, textBounds.y + textBounds.height - 1); } if (myOverlayedIcon == null) { return; } if (getLayeredIcon().isLayerEnabled(1)) { final int top = (getSize().height - myOverlayedIcon.getIconHeight()) / 2; myOverlayedIcon.paintIcon(this, g, textBounds.x - myOverlayedIcon.getIconWidth() / 2, top); } }
paintChildren
284,526
void (final boolean autoHide) { if (myActionPanel == null || myActionPanel.isAutoHide() == autoHide) { return; } myActionPanel.setAutoHide(autoHide); }
setTabActionsAutoHide
284,527
void (boolean show) { if (myActionPanel != null) { myActionPanel.toggleShowActions(show); } }
toggleShowActions
284,528
void (boolean forcePaintBorders) { this.forcePaintBorders = forcePaintBorders; }
setForcePaintBorders
284,529
boolean () { return forcePaintBorders; }
isForcePaintBorders
284,530
String () { return myInfo.getText(); }
toString
284,531
void (boolean enabled) { getLabelComponent().setEnabled(enabled); }
setTabEnabled
284,532
JComponent () { return myLabel; }
getLabelComponent
284,533
String (MouseEvent event) { Point pointInLabel = new RelativePoint(event).getPoint(myLabel); Icon icon = myLabel.getIcon(); int iconWidth = (icon != null ? icon.getIconWidth() : JBUI.scale(16)); if ((myLabel.getVisibleRect().width >= iconWidth * 2 || !UISettings.getInstance().getShowTabsTooltips()) && myLabel.findFragmentAt(pointInLabel.x) == SimpleColoredComponent.FRAGMENT_ICON) { String toolTip = myIcon.getToolTip(false); if (toolTip != null) { return Strings.capitalize(toolTip); } } return super.getToolTipText(event); }
getToolTipText
284,534
record (@NotNull Insets labelInsets, @NotNull Function<ActionsPosition, Insets> contentInsetsSupplier, int iconTextGap) { }
MergedUiDecoration
284,535
AccessibleContext () { if (accessibleContext == null) { accessibleContext = new AccessibleTabLabel(); } return accessibleContext; }
getAccessibleContext
284,536
String () { String name = super.getAccessibleName(); if (name == null && myLabel != null) { name = myLabel.getAccessibleContext().getAccessibleName(); } return name; }
getAccessibleName
284,537
String () { String description = super.getAccessibleDescription(); if (description == null && myLabel != null) { description = myLabel.getAccessibleContext().getAccessibleDescription(); } return description; }
getAccessibleDescription
284,538
AccessibleRole () { return AccessibleRole.PAGE_TAB; }
getAccessibleRole
284,539
void (Component comp, Object constraints) { checkConstraints(constraints); super.addLayoutComponent(comp, constraints); }
addLayoutComponent
284,540
void (Object constraints) { if (NORTH.equals(constraints) || SOUTH.equals(constraints)) { LOG.warn(new IllegalArgumentException("constraints=" + constraints)); } }
checkConstraints
284,541
void (Container parent) { int prefWidth = parent.getPreferredSize().width; synchronized (parent.getTreeLock()) { if (!myInfo.isPinned() && myTabs != null && myTabs.getEffectiveLayout$intellij_platform_ide().isScrollable() && (ExperimentalUI.isNewUI() && !isHovered() || myTabs.isHorizontalTabs()) && isShowTabActions() && isTabActionsOnTheRight() && parent.getWidth() < prefWidth) { layoutScrollable(parent); } else if (!myInfo.isPinned() && isCompressionEnabled && !isHovered() && !isSelected() && parent.getWidth() < prefWidth) { layoutCompressible(parent); } else { super.layoutContainer(parent); } } }
layoutContainer
284,542
void (Container parent) { int spaceTop = parent.getInsets().top; int spaceLeft = parent.getInsets().left; int spaceBottom = parent.getHeight() - parent.getInsets().bottom; int spaceHeight = spaceBottom - spaceTop; int xOffset = spaceLeft; xOffset = layoutComponent(xOffset, getLayoutComponent(WEST), spaceTop, spaceHeight); xOffset = layoutComponent(xOffset, getLayoutComponent(CENTER), spaceTop, spaceHeight); layoutComponent(xOffset, getLayoutComponent(EAST), spaceTop, spaceHeight); }
layoutScrollable
284,543
int (int xOffset, Component component, int spaceTop, int spaceHeight) { if (component != null) { int prefWestWidth = component.getPreferredSize().width; component.setBounds(xOffset, spaceTop, prefWestWidth, spaceHeight); xOffset += prefWestWidth + getHgap(); } return xOffset; }
layoutComponent
284,544
void (Container parent) { Insets insets = parent.getInsets(); int height = parent.getHeight() - insets.bottom - insets.top; int curX = insets.left; int maxX = parent.getWidth() - insets.right; Component left = getLayoutComponent(WEST); Component center = getLayoutComponent(CENTER); Component right = getLayoutComponent(EAST); if (left != null) { left.setBounds(0, 0, 0, 0); int decreasedLen = parent.getPreferredSize().width - parent.getWidth(); int width = Math.max(left.getPreferredSize().width - decreasedLen, 0); curX += width; } if (center != null) { int width = Math.min(center.getPreferredSize().width, maxX - curX); center.setBounds(curX, insets.top, width, height); } if (right != null) { right.setBounds(0, 0, 0, 0); } }
layoutCompressible
284,545
Rectangle () { return myShapeRect; }
getShapeRect
284,546
int (int deltaX) { return deltaX * myXTransform; }
deltaX
284,547
int (int deltaY) { return deltaY * myYTransform; }
deltaY
284,548
int () { return Math.abs(getMaxX() - getX()); }
getWidth
284,549
int () { return Math.abs(getMaxY() - getY()); }
getHeight
284,550
ShapeTransform (int x, int y) { if (mySwap) { //noinspection SuspiciousNameCombination myPath.moveTo(y, x); } else { myPath.moveTo(x, y); } return this; }
moveTo
284,551
ShapeTransform (int x1, int y1, int x2, int y2) { if (mySwap) { //noinspection SuspiciousNameCombination myPath.quadTo(y1, x1, y2, x2); } else { myPath.quadTo(x1, y1, x2, y2); } return this; }
quadTo
284,552
ShapeTransform (int x, int y) { if (mySwap) { //noinspection SuspiciousNameCombination myPath.lineTo(y, x); } else { myPath.lineTo(x, y); } return this; }
lineTo
284,553
GeneralPath () { return myPath; }
getShape
284,554
ShapeTransform () { return reset(null); }
reset
284,555
ShapeTransform (Rectangle shapeRec) { myPath = new GeneralPath(); if (shapeRec != null) { myShapeRect = shapeRec; } return this; }
reset
284,556
ShapeTransform () { myPath.closePath(); return this; }
closePath
284,557
ShapeTransform (int x, int y, int width, int height) { if (width <= 0 || height <= 0) return this; return moveTo(x, y).lineTo(x + deltaX(width), y).lineTo(x + deltaX(width), y + deltaY(height)).lineTo(x, y + deltaY(height)).closePath(); }
doRect
284,558
int () { return getShapeRect().x; }
getX
284,559
int () { return getShapeRect().y; }
getY
284,560
int () { return (int)getShapeRect().getMaxX(); }
getMaxX
284,561
int () { return (int)getShapeRect().getMaxY(); }
getMaxY
284,562
ShapeTransform (Rectangle innerRec) { return new Top(innerRec); }
createTransform
284,563
Insets (Insets insets) { return new Insets(insets.top, insets.left, insets.bottom, insets.right); }
transformInsets
284,564
ShapeTransform () { return new Top((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); }
copy
284,565
int () { return getShapeRect().y; }
getX
284,566
int () { return getShapeRect().x; }
getY
284,567
int () { return (int)getShapeRect().getMaxY(); }
getMaxX
284,568
int () { return (int)getShapeRect().getMaxX(); }
getMaxY
284,569
ShapeTransform (Rectangle innerRec) { return new Left(innerRec); }
createTransform
284,570
Insets (Insets insets) { return new Insets(insets.left, insets.top, insets.right, insets.bottom); }
transformInsets
284,571
ShapeTransform () { return new Left((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); }
copy
284,572
int () { return getShapeRect().x; }
getX
284,573
int () { return (int)getShapeRect().getMaxY(); }
getY
284,574
int () { return (int)getShapeRect().getMaxX(); }
getMaxX
284,575
int () { return getShapeRect().y; }
getMaxY
284,576
ShapeTransform () { return new Bottom((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); }
copy
284,577
ShapeTransform (Rectangle innerRec) { return new Bottom(innerRec); }
createTransform
284,578
Insets (Insets insets) { return new Insets(insets.bottom, insets.right, insets.top, insets.left); }
transformInsets
284,579
int () { return getShapeRect().y; }
getX
284,580
int () { return (int)getShapeRect().getMaxX(); }
getY
284,581
int () { return (int)getShapeRect().getMaxY(); }
getMaxX
284,582
int () { return getShapeRect().x; }
getMaxY
284,583
ShapeTransform () { return new Right((Rectangle)getShapeRect().clone(), (GeneralPath)myPath.clone()); }
copy
284,584
Insets (Insets insets) { return new Insets(insets.right, insets.top, insets.left, insets.bottom); }
transformInsets
284,585
ShapeTransform (Rectangle innerRec) { return new Right(innerRec); }
createTransform
284,586
ShapeTransform (Dimension dimension) { return createShapeTransform(new Rectangle(0, 0, dimension.width, dimension.height)); }
createShapeTransform
284,587
ShapeTransform (Rectangle rectangle) { return new ShapeTransform.Top(rectangle); }
createShapeTransform
284,588
boolean (@NotNull TabLabel tabLabel, int deltaX, int deltaY) { return Math.abs(deltaY) > tabLabel.getHeight() * getDragOutMultiplier() || Math.abs(deltaX) > tabLabel.getWidth() * getDragOutMultiplier(); }
isDragOut
284,589
boolean () { return false; }
isSideComponentOnTabs
284,590
boolean () { return false; }
isScrollable
284,591
boolean () { return false; }
isWithScrollBar
284,592
int () { return 0; }
getScrollOffset
284,593
void (int units) { }
scroll
284,594
boolean (@NotNull TabInfo info) { return false; }
isTabHidden
284,595
double () { return Registry.doubleValue("ide.tabbedPane.dragOutMultiplier"); }
getDragOutMultiplier
284,596
int () { return JBUI.scale(Registry.intValue("ide.editor.max.pinned.tab.width", 2000)); }
getMaxPinnedTabWidth
284,597
int () { return JBUI.scale(50); }
getMinTabWidth
284,598
boolean () { return UISettings.getInstance().getState().getShowPinnedTabsInASeparateRow() && AdvancedSettings.getBoolean("editor.keep.pinned.tabs.on.left"); }
showPinnedTabsSeparately
284,599
float (boolean first) { return Math.min(.5F, (float)JBTabsImpl.MIN_TAB_WIDTH / Math.max(1, tabs.getWidth())); }
getMinProportion