Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
275,500
String () { return VCS_STRUCTURE_CHOOSER_KEY; }
getDimensionServiceKey
275,501
JComponent () { return myTree; }
getPreferredFocusedComponent
275,502
JComponent () { myTree = new Tree(); myTree.setBorder(BORDER); myTree.setShowsRootHandles(true); myTree.setRootVisible(false); myTree.setExpandableItemsEnabled(false); FileChooserDescriptor descriptor = new FileChooserDescriptor(true, true, true, true, false, true) { @Override public boolean isFileVisible(VirtualFile f...
createCenterPanel
275,503
boolean (VirtualFile file, boolean showHiddenFiles) { if (!super.isFileVisible(file, showHiddenFiles)) return false; if (myRoots.contains(file)) return false; ChangeListManager changeListManager = ChangeListManager.getInstance(myProject); return !changeListManager.isIgnoredFile(file) && !changeListManager.isUnversioned...
isFileVisible
275,504
boolean (@NotNull MouseEvent e, int clickCount) { int row = myTree.getRowForLocation(e.getX(), e.getY()); if (row < 0) return false; Object o = myTree.getPathForRow(row).getLastPathComponent(); if (getTreeRoot() == o || getFile(o) == null) return false; Rectangle rowBounds = myTree.getRowBounds(row); cellRenderer.setBo...
onClick
275,505
void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SPACE) { TreePath[] paths = myTree.getSelectionPaths(); if (paths == null) return; for (TreePath path : paths) { if (path == null) continue; Object o = path.getLastPathComponent(); if (getTreeRoot() == o || getFile(o) == null) return; mySelectionManager.toggleSelect...
keyPressed
275,506
void (VirtualFile virtualFile) { mySelectedFiles.add(virtualFile); recalculateErrorText(); }
plus
275,507
void () { checkEmpty(); if (mySelectionManager.canAddSelection()) { selectedLabel.setText(""); } else { HtmlChunk.Element errorText = HtmlChunk.text("(" + VcsLogBundle.message("vcs.log.filters.structure.max.selected.error.message", MAX_FOLDERS) + ")") .wrapWith(HtmlChunk.tag("font").attr("color", "red")); selectedLabel...
recalculateErrorText
275,508
void (VirtualFile virtualFile) { mySelectedFiles.remove(virtualFile); recalculateErrorText(); }
minus
275,509
DefaultMutableTreeNode () { return (DefaultMutableTreeNode)myTree.getModel().getRoot(); }
getTreeRoot
275,510
void (@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { //noinspection HardCodedStringLiteral append(value.toString()); }
customizeCellRenderer
275,511
void (Object value, FilePath path, FilePath self) { if (myRoots.contains(self.getVirtualFile())) { super.putParentPath(value, path, self); } }
putParentPath
275,512
Component (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { invalidate(); if (value == null) return myEmpty; VirtualFile file = getFile(value); DefaultMutableTreeNode node = (DefaultMutableTreeNode)value; if (file == null) { Object uo = node.getUserObject(); if (u...
getTreeCellRendererComponent
275,513
MyNodeConverter () { return ourInstance; }
getInstance
275,514
VirtualFile (DefaultMutableTreeNode o) { return ((FileNodeDescriptor)o.getUserObject()).getElement().getFile(); }
convert
275,515
String (@NotNull FilePath path) { String module = myModules.get(path.getVirtualFile()); if (module != null) { return module; } return super.getName(path); }
getName
275,516
void (@NotNull FilePath path) { String module = myModules.get(path.getVirtualFile()); if (module != null) { setIcon(PlatformIcons.CONTENT_ROOT_ICON_CLOSED); } else { if (path.isDirectory()) { setIcon(PlatformIcons.FOLDER_ICON); } else { setIcon(VcsUtil.getIcon(myProject, path)); } } }
renderIcon
275,517
void (@NotNull Object value, @NotNull String parentPath, @NotNull FilePath self) { append(self.getPath(), SimpleTextAttributes.GRAYED_ATTRIBUTES); }
putParentPathImpl
275,518
void (@NotNull AnActionEvent e) { unregisterCustomShortcutSet(popup.getContent()); popup.closeOk(e.getInputEvent()); }
actionPerformed
275,519
String (char[] separators) { StringBuilder s = new StringBuilder(); for (char c : separators) { String separator = c == '\n' ? VcsLogBundle.message("vcs.log.filter.popup.advertisement.text.new.lines") : Character.toString(c); if (s.isEmpty()) { s.append(separator); } else { s.append(" ").append(VcsLogBundle.message("vc...
getSeparatorsText
275,520
void (@NotNull EditorTextField textField) { textField.addSettingsProvider(editor -> SoftWrapsEditorCustomization.ENABLED.customize(editor)); textField.setBorder(new CompoundBorder(JBUI.Borders.empty(2), textField.getBorder())); }
setupTextField
275,521
ActionGroup () { List<AnAction> group = new ArrayList<>(); group.add(createSelectMultipleValuesAction()); if (!myLogData.getCurrentUser().isEmpty()) { group.add(new PredefinedValueAction(Collections.singletonList(VcsLogFilterObject.ME), () -> me(), true)); } group.addAll(createRecentItemsActionGroup()); return new Defa...
createActionGroup
275,522
ActionGroup () { List<AnAction> group = new ArrayList<>(); group.add(new SpeedsearchPredefinedValueAction(VcsLogFilterObject.ME, () -> me())); group.add(Separator.getInstance()); for (String user : collectUsers(myLogData)) { group.add(new SpeedsearchPredefinedValueAction(user, () -> user)); } return new DefaultActionGr...
createSpeedSearchActionGroup
275,523
List<String> () { return ContainerUtil.concat(Collections.singletonList(me()), collectUsers(myLogData)); }
getAllValues
275,524
ListPopup () { ActionGroup actionGroup = createActionGroup(); ActionGroup speedsearchGroup = createSpeedSearchActionGroup(); return new UserLogSpeedSearchPopup(new DefaultActionGroup(actionGroup, speedsearchGroup), DataManager.getInstance().getDataContext(this)); }
createPopupMenu
275,525
List<String> (@NotNull VcsLogUserFilter filter) { return myFilterModel.getFilterValues(filter); }
getFilterValues
275,526
List<String> (@NotNull Collection<String> values) { return ContainerUtil.map(values, user -> user.equals(me()) ? VcsLogFilterObject.ME : user); }
parseLocalizedValues
275,527
List<String> (@NotNull Collection<String> values) { return ContainerUtil.map(values, user -> user.equals(VcsLogFilterObject.ME) ? me() : user); }
getLocalizedValues
275,528
String () { return VcsLogBundle.message("vcs.log.user.filter.me"); }
me
275,529
List<String> (@NotNull VcsLogData logData) { List<String> users = ContainerUtil.map(logData.getAllUsers(), user -> { String shortPresentation = VcsUserUtil.getShortPresentation(user); Couple<String> firstAndLastName = VcsUserUtil.getFirstAndLastName(shortPresentation); if (firstAndLastName == null) return shortPresenta...
collectUsers
275,530
boolean (@NotNull AnAction action) { if (!super.shouldBeShowing(action)) return false; if (getSpeedSearch().isHoldingFilter()) { if (action instanceof MultipleValueFilterPopupComponent.PredefinedValueAction) { return action instanceof SpeedsearchAction || ((MultipleValueFilterPopupComponent.PredefinedValueAction)action...
shouldBeShowing
275,531
void () { FontMetrics metrics = myComponent.getFontMetrics(getReferenceFont()); myHeight = metrics.getHeight() + TOP_TEXT_PADDING.get() + BOTTOM_TEXT_PADDING.get(); }
updateHeight
275,532
void (@NotNull Color background, @NotNull Color foreground, boolean isSelected, int availableWidth, @NotNull List<? extends RefGroup> refGroups) { myBackground = background; myForeground = foreground; updateHeight(); FontMetrics metrics = myComponent.getFontMetrics(getReferenceFont()); myGreyBackground = ExperimentalUI...
customizePainter
275,533
LabelIcon (int height, @NotNull Color background, @NotNull List<? extends Color> colors) { return myIconCache.getIcon(myComponent, height, background, colors); }
getIcon
275,534
List<Color> (@NotNull Collection<? extends RefGroup> groups) { LinkedHashMap<Color, Integer> usedColors = new LinkedHashMap<>(); for (RefGroup group : groups) { List<Color> colors = group.getColors(); for (Color color : colors) { Integer count = usedColors.get(color); if (count == null) count = 0; usedColors.put(color,...
getColors
275,535
String (@NotNull RefGroup group, @NotNull FontMetrics fontMetrics, int availableWidth) { if (!group.isExpanded()) { return shortenRefName(group.getName(), fontMetrics, availableWidth); } StringBuilder text = new StringBuilder(); String remainder = ", ..."; String separator = ", "; int remainderWidth = fontMetrics.strin...
getGroupText
275,536
String (@NotNull @NlsSafe String refName, @NotNull FontMetrics fontMetrics, int availableWidth) { if (fontMetrics.stringWidth(refName) > availableWidth && refName.length() > MAX_LENGTH) { int separatorIndex = refName.indexOf(SEPARATOR); if (separatorIndex > TWO_DOTS.length()) { refName = TWO_DOTS + refName.substring(se...
shortenRefName
275,537
void (@NotNull Graphics2D g2, int x, int y, int height) { if (myLabels.isEmpty()) return; GraphicsConfig config = GraphicsUtil.setupAAPainting(g2) .setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, getFractionalMetricsValue()) .setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, getTextAntiAliasingValue()); g2....
paint
275,538
int () { return ExperimentalUI.isNewUI() ? ICON_TEXT_PADDING.get() : 0; }
getIconTextPadding
275,539
Object () { return Objects.requireNonNullElse(myComponent.getClientProperty(RenderingHints.KEY_TEXT_ANTIALIASING), AntialiasingType.getKeyForCurrentScope(false)); }
getTextAntiAliasingValue
275,540
Object () { return Objects.requireNonNullElse(myComponent.getClientProperty(RenderingHints.KEY_FRACTIONALMETRICS), UISettings.Companion.getPreferredFractionalMetricsValue()); }
getFractionalMetricsValue
275,541
Dimension () { if (myLabels.isEmpty()) return new Dimension(); myUpdateScaleHelper.saveScaleAndRunIfChanged(this::updateHeight); return new Dimension(myWidth, myHeight); }
getSize
275,542
boolean () { return myLeftAligned; }
isLeftAligned
275,543
Font () { Font font = GraphCommitCellRenderer.getLabelFont(); return font.deriveFont(font.getSize() - 1f); }
getReferenceFont
275,544
boolean () { return myCompact; }
isCompact
275,545
void (boolean compact) { myCompact = compact; }
setCompact
275,546
void (boolean leftAligned) { myLeftAligned = leftAligned; }
setLeftAligned
275,547
SimpleColoredComponent (@NotNull JTable table, @NotNull GraphCommitCell value, boolean isSelected, boolean hasFocus, int row, int column) { myComponent.customize(value, isSelected, hasFocus, row, column); return myComponent; }
getTableCellRendererComponentImpl
275,548
int (int row) { GraphCommitCell cell = getValue(myGraphTable.getModel().getValueAt(row, Commit.INSTANCE)); if (cell.getRefsToThisCommit().isEmpty()) return getColumnWidth() / 2; prepareTemplateComponent(row, cell); int referencesWidth = myTemplateComponent.getReferencesWidth(); if (myTemplateComponent.getReferencePaint...
getTooltipXCoordinate
275,549
void (int row, @NotNull GraphCommitCell cell) { myTemplateComponent.customize(cell, myGraphTable.isRowSelected(row), myGraphTable.hasFocus(), row, VcsLogColumnManager.getInstance().getModelIndex(Commit.INSTANCE)); }
prepareTemplateComponent
275,550
int () { return myGraphTable.getCommitColumn().getWidth(); }
getColumnWidth
275,551
int () { return myComponent.getPreferredHeight(); }
getPreferredHeight
275,552
void (boolean compact) { myComponent.getReferencePainter().setCompact(compact); myTemplateComponent.getReferencePainter().setCompact(compact); }
setCompactReferencesView
275,553
void (boolean showTagNames) { myComponent.getReferencePainter().setShowTagNames(showTagNames); myTemplateComponent.getReferencePainter().setShowTagNames(showTagNames); }
setShowTagsNames
275,554
void (boolean leftAligned) { myComponent.getReferencePainter().setLeftAligned(leftAligned); myTemplateComponent.getReferencePainter().setLeftAligned(leftAligned); }
setLeftAligned
275,555
GraphCommitCellController () { return new GraphCommitCellController(myLogData, myGraphTable, myComponent.myPainter) { @Override protected int getTooltipXCoordinate(int row) { return GraphCommitCellRenderer.this.getTooltipXCoordinate(row); } @Override protected @Nullable JComponent getTooltip(@NotNull Object value, @Not...
getCellController
275,556
int (int row) { return GraphCommitCellRenderer.this.getTooltipXCoordinate(row); }
getTooltipXCoordinate
275,557
Font () { return StartupUiUtil.getLabelFont(); }
getLabelFont
275,558
Dimension () { Dimension preferredSize = super.getPreferredSize(); int referencesSize = myReferencePainter.isLeftAligned() ? 0 : myReferencePainter.getSize().width; return new Dimension(preferredSize.width + referencesSize, getPreferredHeight()); }
getPreferredSize
275,559
void (Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; if (!myReferencePainter.isLeftAligned()) { int start = Math.max(myGraphWidth, getWidth() - myReferencePainter.getSize().width); myReferencePainter.paint(g2d, start, 0, getHeight()); } else { myReferencePainter.paint(g2d, myGraphWidth, 0, getHe...
paintComponent
275,560
void (@NotNull GraphCommitCell cell, boolean isSelected, boolean hasFocus, int row, int column) { clear(); setPaintFocusBorder(false); acquireState(myGraphTable, isSelected, hasFocus, row, column); getCellState().updateRenderer(this); myPrintElements = cell.getPrintElements(); myGraphWidth = getGraphWidth(myGraphTable,...
customize
275,561
void (@NotNull GraphCommitCell cell, @NotNull SimpleTextAttributes style, boolean isSelected) { myIssueLinkRenderer.appendTextWithLinks(StringUtil.replace(cell.getText(), "\t", " ").trim(), style); SpeedSearchUtil.applySpeedSearchHighlighting(myGraphTable, this, false, isSelected); }
appendText
275,562
int (int column, int graphWidth) { int textAndLabelsWidth = myGraphTable.getColumnModel().getColumn(column).getWidth() - graphWidth; int freeSpace = textAndLabelsWidth - super.getPreferredSize().width; int allowedSpace; if (myReferencePainter.isCompact()) { allowedSpace = Math.min(freeSpace, textAndLabelsWidth / 3); } ...
getAvailableWidth
275,563
int () { int rowContentHeight = calculateRowContentHeight(); return ExperimentalUI.isNewUI() ? Math.max(rowContentHeight, JBUI.CurrentTheme.VersionControl.Log.rowHeight()) : rowContentHeight; }
calculateHeight
275,564
int () { return Math.max(myReferencePainter.getSize().height, getFontMetrics(myFont).getHeight() + JBUI.scale(JBUI.CurrentTheme.VersionControl.Log.verticalPadding())); }
calculateRowContentHeight
275,565
int () { Font font = getLabelFont(); GraphicsConfiguration configuration = myGraphTable.getGraphicsConfiguration(); if (myFont != font || (configuration != null && !Objects.equals(myAffineTransform, configuration.getDefaultTransform()))) { myFont = font; myAffineTransform = configuration != null ? configuration.getDefa...
getPreferredHeight
275,566
VcsLogLabelPainter () { return myReferencePainter; }
getReferencePainter
275,567
FontMetrics (Font font) { return myGraphTable.getFontMetrics(font); }
getFontMetrics
275,568
int () { return myGraphWidth; }
getGraphWidth
275,569
int () { return myReferencePainter.getSize().width; }
getReferencesWidth
275,570
int (@NotNull VcsLogGraphTable table, @NotNull Collection<? extends PrintElement> printElements) { if (printElements.isEmpty()) return 0; double maxIndex = 0; for (PrintElement printElement : printElements) { maxIndex = Math.max(maxIndex, printElement.getPositionInCurrentRow()); if (printElement instanceof EdgePrintEle...
getGraphWidth
275,571
Color (JTable table, boolean isSelected) { if (!isSelected) return super.getSelectionForeground(table, isSelected); return VcsLogGraphTable.getSelectionForeground(RenderingUtil.isFocused(table)); }
getSelectionForeground
275,572
Object (@NotNull MouseEvent e, @NotNull JTable table, int row, int column, @NotNull TableCellRenderer cellRenderer) { Component component = cellRenderer.getTableCellRendererComponent(table, table.getValueAt(row, column), false, false, row, column); if (component instanceof SimpleColoredComponent) { Rectangle rc = table...
tryGetTag
275,573
BufferedImage (Component c, Graphics2D g) { BufferedImage image = c != null ? ImageUtil.createImage(c.getGraphicsConfiguration(), getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB) : ImageUtil.createImage(g, getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB); paintIcon(image.createGraphics()); ret...
createImage
275,574
void (Component c, Graphics g, int x, int y) { if (ImageUtil.getImageScale(myImage) != JBUIScale.sysScale((Graphics2D)g)) { myImage = createImage(null, (Graphics2D)g); } StartupUiUtil.drawImage(g, myImage, x, y, null); }
paintIcon
275,575
void (@NotNull Graphics2D g2) { GraphicsConfig config = GraphicsUtil.setupAAPainting(g2); if (ExperimentalUI.isNewUI()) { paintTagsForNewUi(g2); } else { paintTagsForClassicUi(g2); } config.restore(); }
paintIcon
275,576
void (@NotNull Graphics2D g2) { float scale = mySize / SIZE; for (int i = myColors.size() - 1; i >= 0; i--) { if (i != myColors.size() - 1) { g2.setColor(myBgColor); paintTag(g2, scale, scale * 2 * i + 1, 0); } g2.setColor(myColors.get(i)); paintTag(g2, scale, scale * 2 * i, 0); } }
paintTagsForClassicUi
275,577
void (@NotNull Graphics2D g2) { float scale = mySize / SIZE; int tagCount = myColors.size(); for (int i = 0; i < tagCount; i++) { Color color = myColors.get(tagCount - 1 - i); TagPainter.paintTag(g2, scale * 2 * i, i == tagCount - 1, myBgColor, color, mySize); if (i != tagCount - 1) { float x0 = scale * 2 * i + 2 * sca...
paintTagsForNewUi
275,578
void (Graphics2D g2, float scale, float x, float y) { Path2D.Float path = new Path2D.Float(); x += scale * 0.25; y += scale; path.moveTo(x, y); path.lineTo(x + 2 * scale, y); path.lineTo(x + 5 * scale, y + 3 * scale); path.lineTo(x + 3 * scale, y + 5 * scale); path.lineTo(x, y + 2 * scale); path.lineTo(x, y); path.clos...
paintTag
275,579
int () { return getWidth(myColors.size()); }
getIconWidth
275,580
int (int labelsCount) { return getWidth(mySize, labelsCount); }
getWidth
275,581
int (int height, int labelsCount) { float scale = height / SIZE; return Math.round((SIZE + 2 * (labelsCount - 1)) * scale); }
getWidth
275,582
int () { return mySize; }
getIconHeight
275,583
void () { myHasGroupWithMultipleRefs = false; for (Map.Entry<VcsRefType, Collection<VcsRef>> typeAndRefs : myGroupedVisibleReferences.entrySet()) { if (typeAndRefs.getValue().size() > 1) { myHasGroupWithMultipleRefs = true; break; } } super.update(); }
update
275,584
Font () { return LabelPainter.getReferenceFont(); }
getLabelsFont
275,585
int () { return getWidth(myHasGroupWithMultipleRefs ? 2 : 1); }
getIconWidth
275,586
Icon (int height) { return EmptyIcon.create(LabelIcon.getWidth(height, 2), height); }
createEmptyIcon
275,587
JBLabel (@Nls @NotNull String text, @Nullable Icon icon) { JBLabel label = super.createLabel(text, icon); label.setForeground(UIUtil.getToolTipForeground()); return label; }
createLabel
275,588
JBLabel (int restSize) { String gray = ColorUtil.toHex(UIManager.getColor("Button.disabledText")); String labelText = VcsLogBundle.message("vcs.log.references.more.tooltip", restSize); String html = HtmlChunk.text(labelText).wrapWith("font").attr("color", "#" + gray).wrapWith(HtmlChunk.html()).toString(); return create...
createRestLabel
275,589
Component (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return getTableCellRendererComponentImpl(table, getValue(Objects.requireNonNull(value)), isSelected, hasFocus, row, column); }
getTableCellRendererComponent
275,590
T (@NotNull Object value) { //noinspection unchecked return (T)value; }
getValue
275,591
Collection<VcsRef> () { return myRefsToThisCommit; }
getRefsToThisCommit
275,592
String () { return myText; }
toString
275,593
void (@NotNull List<VcsRef> references) { if (myReferences.equals(references)) return; myReferences = references; List<VcsRef> visibleReferences = (myRefsLimit > 0) ? ContainerUtil.getFirstItems(myReferences, myRefsLimit) : myReferences; myGroupedVisibleReferences = ContainerUtil.groupBy(visibleReferences, VcsRef::getT...
setReferences
275,594
void () { removeAll(); int height = getIconHeight(); JBLabel firstLabel = null; for (Map.Entry<VcsRefType, Collection<VcsRef>> typeAndRefs : myGroupedVisibleReferences.entrySet()) { VcsRefType type = typeAndRefs.getKey(); Collection<VcsRef> refs = typeAndRefs.getValue(); int refIndex = 0; for (VcsRef reference : refs) ...
update
275,595
int () { return (myRefsLimit > 0) ? myReferences.size() - Math.min(myReferences.size(), myRefsLimit) : 0; }
getHiddenReferencesSize
275,596
int () { return getFontMetrics(getLabelsFont()).getHeight(); }
getIconHeight
275,597
JBLabel (int restSize) { return createLabel(VcsLogBundle.message("vcs.log.details.references.more.label", restSize), null); }
createRestLabel
275,598
void (@NotNull JBLabel label, @NotNull JBLabel referent) { Wrapper wrapper = new Wrapper(label); wrapper.setVerticalSizeReferent(referent); add(wrapper); }
addWrapped
275,599
JBLabel (@Nls @NotNull String text, @Nullable Icon icon) { JBLabel label = new JBLabel(text, icon, SwingConstants.LEFT); label.setFont(getLabelsFont()); label.setIconTextGap(0); label.setHorizontalAlignment(SwingConstants.LEFT); label.setVerticalTextPosition(SwingConstants.CENTER); label.setCopyable(true); return label...
createLabel