Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
284,600 | void (float proportion) { int width = tabs.getWidth(); if (tabs.getTabsPosition() == JBTabsPosition.left) { setSideTabsLimit((int)Math.max(JBTabsImpl.MIN_TAB_WIDTH, proportion * width)); } else if (tabs.getTabsPosition() == JBTabsPosition.right) { setSideTabsLimit(width - (int)Math.max(JBTabsImpl.MIN_TAB_WIDTH, proportion * width)); } } | setProportion |
284,601 | boolean () { return false; } | getOrientation |
284,602 | void (boolean verticalSplit) { //ignore } | setOrientation |
284,603 | void (boolean dragging) { // ignore } | setDragging |
284,604 | Component () { return tabs; } | asComponent |
284,605 | void (PropertyChangeEvent event) { if (event.getSource() != tabs) { return; } Integer limit = ClientProperty.get(tabs, JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY); if (limit == null) { limit = JBTabsImpl.DEFAULT_MAX_TAB_WIDTH; } setSideTabsLimit(limit); } | propertyChange |
284,606 | Color () { return UIUtil.getPanelBackground(); } | getEmptySpaceColor |
284,607 | void (Color color) { myDefaultTabColor = color; } | setDefaultTabColor |
284,608 | boolean (@NotNull MouseEvent event, @NotNull Point dragToScreenPoint, @NotNull Point startScreenPoint) { if (myDragSource == null || !myDragSource.canBeDraggedOut()) { return false; } TabLabel label = myTabs.getInfoToLabel().get(myDragSource); if (label == null) { return false; } int dX = dragToScreenPoint.x - startScreenPoint.x; int dY = dragToScreenPoint.y - startScreenPoint.y; return myTabs.isDragOut(label, dX, dY); } | isDragOut |
284,609 | void (@NotNull MouseEvent event, @NotNull Point dragToScreenPoint, @NotNull Point startScreenPoint, boolean justStarted) { if (!MouseDragHelper.checkModifiers(event)) { if (myDragOutSource != null) { processDragOutCancel(); } return; } TabInfo.DragOutDelegate delegate = myDragOutSource.getDragOutDelegate(); if (justStarted) { delegate.dragOutStarted(event, myDragOutSource); } delegate.processDragOut(event, myDragOutSource); event.consume(); } | processDragOut |
284,610 | void (@NotNull MouseEvent event) { if (!MouseDragHelper.checkModifiers(event)) { if (myDragOutSource != null) { processDragOutCancel(); } return; } super.processDragOutFinish(event); boolean wasSorted = prepareDisableSorting(); try { myDragOutSource.getDragOutDelegate().dragOutFinished(event, myDragOutSource); } finally { disableSortingIfNeed(event, wasSorted); myDragOutSource = null; } } | processDragOutFinish |
284,611 | boolean () { boolean wasSorted = UISettings.getInstance().getSortTabsAlphabetically() /*&& myTabs.isAlphabeticalMode()*/; if (wasSorted && !UISettings.getInstance().getAlwaysKeepTabsAlphabeticallySorted()) { UISettings.getInstance().setSortTabsAlphabetically(false); } return wasSorted; } | prepareDisableSorting |
284,612 | void (@NotNull MouseEvent event, boolean wasSorted) { if (!wasSorted) return; if (event.isConsumed() || UISettings.getInstance().getAlwaysKeepTabsAlphabeticallySorted()) {//new container for separate window was created, see DockManagerImpl.MyDragSession UISettings.getInstance().setSortTabsAlphabetically(true); } else { UISettings.getInstance().fireUISettingsChanged(); ApplicationManager.getApplication().invokeLater(() -> { Notification notification = new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, IdeBundle.message("alphabetical.mode.is.on.notification"), "", NotificationType.INFORMATION); notification.addAction( DumbAwareAction.create(IdeBundle.message("editor.tabs.enable.sorting"), e -> { UISettings.getInstance().setSortTabsAlphabetically(true); UISettings.getInstance().fireUISettingsChanged(); notification.expire(); })) .addAction( DumbAwareAction.create(IdeBundle.message("editor.tabs.always.keep.sorting"), e -> { UISettings.getInstance().setAlwaysKeepTabsAlphabeticallySorted(true); UISettings.getInstance().setSortTabsAlphabetically(true); UISettings.getInstance().fireUISettingsChanged(); notification.expire(); })); Notifications.Bus.notify(notification); }); } } | disableSortingIfNeed |
284,613 | void () { myDragOutSource.getDragOutDelegate().dragOutCancelled(myDragOutSource); myDragOutSource = null; } | processDragOutCancel |
284,614 | void (@NotNull MouseEvent event) { // since selection change can cause tabs to be reordered, we need to remember the tab on which the mouse was pressed, otherwise // we'll end up dragging the wrong tab (IDEA-65073) TabLabel label = findLabel(new RelativePoint(event).getPoint(myTabs)); myPressedTabLabel = label == null ? null : new WeakReference<>(label); } | processMousePressed |
284,615 | void (@NotNull MouseEvent event, @NotNull Point targetScreenPoint, @NotNull Point startPointScreen) { if (!myTabs.isTabDraggingEnabled() || !isDragSource(event) || !MouseDragHelper.checkModifiers(event)) return; SwingUtilities.convertPointFromScreen(startPointScreen, myTabs); if (isDragJustStarted()) { TabLabel pressedTabLabel = SoftReference.dereference(myPressedTabLabel); if (pressedTabLabel == null) return; final Rectangle labelBounds = pressedTabLabel.getBounds(); myHoldDelta = new Dimension(startPointScreen.x - labelBounds.x, startPointScreen.y - labelBounds.y); myDragSource = pressedTabLabel.getInfo(); dragRec = new Rectangle(startPointScreen, labelBounds.getSize()); myDragOriginalRec = (Rectangle)dragRec.clone(); myDragOriginalRec.x -= myHoldDelta.width; myDragOriginalRec.y -= myHoldDelta.height; TabInfo.DragDelegate delegate = myDragSource.getDragDelegate(); if (delegate != null) { delegate.dragStarted(event); } } else { if (dragRec == null) return; final Point toPoint = SwingUtilities.convertPoint(event.getComponent(), event.getPoint(), myTabs); dragRec.x = toPoint.x; dragRec.y = toPoint.y; } dragRec.x -= myHoldDelta.width; dragRec.y -= myHoldDelta.height; final Rectangle headerRec = myTabs.getLastLayoutPass().getHeaderRectangle(); ScreenUtil.moveToFit(dragRec, headerRec, null); int deadZoneX = 0; int deadZoneY = 0; final TabLabel top = findLabel(new Point(dragRec.x + dragRec.width / 2, dragRec.y + deadZoneY)); final TabLabel bottom = findLabel(new Point(dragRec.x + dragRec.width / 2, dragRec.y + dragRec.height - deadZoneY)); final TabLabel left = findLabel(new Point(dragRec.x + deadZoneX, dragRec.y + dragRec.height / 2)); final TabLabel right = findLabel(new Point(dragRec.x + dragRec.width - deadZoneX, dragRec.y + dragRec.height / 2)); TabLabel targetLabel; if (myTabs.isHorizontalTabs()) { targetLabel = findMostOverlapping(Axis.X, left, right); if (targetLabel == null) { targetLabel = findMostOverlapping(Axis.Y, top, bottom); } } else { targetLabel = findMostOverlapping(Axis.Y, top, bottom); if (targetLabel == null) { targetLabel = findMostOverlapping(Axis.X, left, right); } } if (targetLabel != null) { Rectangle saved = dragRec; dragRec = null; myTabs.reallocate(myDragSource, targetLabel.getInfo()); myDragOriginalRec = myTabs.getInfoToLabel().get(myDragSource).getBounds(); dragRec = saved; myTabs.moveDraggedTabLabel(); } else { myTabs.moveDraggedTabLabel(); final int border = myTabs.getBorderThickness(); headerRec.x -= border; headerRec.y -= border; headerRec.width += border * 2; headerRec.height += border * 2; myTabs.repaint(headerRec); } event.consume(); } | processDrag |
284,616 | boolean (MouseEvent event) { final Object source = event.getSource(); if (source instanceof Component) { return SwingUtilities.windowForComponent(myTabs) == SwingUtilities.windowForComponent((Component)source); } return false; } | isDragSource |
284,617 | TabLabel (Axis measurer, TabLabel... labels) { double freeSpace; if (measurer.getMinValue(dragRec) < measurer.getMinValue(myDragOriginalRec)) { freeSpace = measurer.getMaxValue(myDragOriginalRec) - measurer.getMaxValue(dragRec); } else { freeSpace = measurer.getMinValue(dragRec) - measurer.getMinValue(myDragOriginalRec); } int max = -1; TabLabel maxLabel = null; for (TabLabel each : labels) { if (each == null) continue; final Rectangle eachBounds = each.getBounds(); if (measurer.getSize(eachBounds) > freeSpace + freeSpace *0.3) continue; Rectangle intersection = dragRec.intersection(eachBounds); int size = intersection.width * intersection.height; if (size > max) { max = size; maxLabel = each; } } return maxLabel; } | findMostOverlapping |
284,618 | boolean (@NotNull JComponent dragComponent, @NotNull Point dragComponentPoint) { return findLabel(dragComponentPoint) != null; } | canStartDragging |
284,619 | boolean (@NotNull JComponent component, @NotNull RelativePoint point) { Component realDropTarget = UIUtil.getDeepestComponentAt(point.getOriginalComponent(), point.getOriginalPoint().x, point.getOriginalPoint().y); if (realDropTarget == null) realDropTarget = SwingUtilities.getDeepestComponentAt(point.getOriginalComponent(), point.getOriginalPoint().x, point.getOriginalPoint().y); if (myTabs.getVisibleInfos().isEmpty() && realDropTarget != null ) { JBTabsImpl tabs = UIUtil.getParentOfType(JBTabsImpl.class, realDropTarget); if (tabs == null || !tabs.isEditorTabs()) return false; } return !myTabs.contains(point.getPoint(myTabs)) || !myTabs.getVisibleInfos().isEmpty(); } | canFinishDragging |
284,620 | void (@NotNull MouseEvent event, boolean willDragOutStart) { boolean checkModifiers = MouseDragHelper.checkModifiers(event); if (!checkModifiers && myDragSource == null) { return; } super.processDragFinish(event, willDragOutStart); boolean wasSorted = !willDragOutStart && prepareDisableSorting(); try { endDrag(willDragOutStart && checkModifiers); } finally { disableSortingIfNeed(event, wasSorted); } } | processDragFinish |
284,621 | void (boolean willDragOutStart) { if (willDragOutStart) { myDragOutSource = myDragSource; } myTabs.resetTabsCache(); if (!willDragOutStart) { myTabs.fireTabsMoved(); } myTabs.relayout(true, false); myTabs.revalidate(); if (myDragSource != null) { TabInfo.DragDelegate delegate = myDragSource.getDragDelegate(); if (delegate != null) { delegate.dragFinishedOrCanceled(); } } myDragSource = null; dragRec = null; } | endDrag |
284,622 | void () { endDrag(false); } | processDragCancel |
284,623 | TabInfo () { return myDragSource; } | getDragSource |
284,624 | void (@NotNull UISettings uiSettings) { resetTabsCache(); relayout(true, false); super.uiSettingsChanged(uiSettings); } | uiSettingsChanged |
284,625 | boolean () { return true; } | isEditorTabs |
284,626 | boolean () { return UISettings.getInstance().getUseSmallLabelsOnTabs() && !ExperimentalUI.isNewUI(); } | useSmallLabels |
284,627 | boolean () { if (myAlphabeticalModeChanged) { return super.isAlphabeticalMode(); } return UISettings.getInstance().getSortTabsAlphabetically(); } | isAlphabeticalMode |
284,628 | JBTabsPresentation (boolean alphabeticalMode) { myAlphabeticalModeChanged = true; return super.setAlphabeticalMode(alphabeticalMode); } | setAlphabeticalMode |
284,629 | boolean () { return true; } | shouldPaintBottomBorder |
284,630 | void (MouseEvent e) { hover.accept(true); } | mouseEntered |
284,631 | void (MouseEvent e) { hover.accept(false); } | mouseExited |
284,632 | void (Component c) { repaintComponent(c); } | doRepaintComponent |
284,633 | void () { super.addNotify(); myInplaceButton.addMouseListener(myListener); } | addNotify |
284,634 | void () { super.removeNotify(); myInplaceButton.removeMouseListener(myListener); } | removeNotify |
284,635 | InplaceButton () { return myInplaceButton; } | getComponent |
284,636 | Presentation () { return myPrevPresentation; } | getPrevPresentation |
284,637 | void (Component c) { c.repaint(); } | repaintComponent |
284,638 | void (TimedDeadzone.Length deadZone) { myInplaceButton.setMouseDeadzone(deadZone); } | setMouseDeadZone |
284,639 | boolean () { AnActionEvent event = createAnEvent(null, 0); myAction.update(event); Presentation p = event.getPresentation(); boolean changed = !areEqual(p, myPrevPresentation); myIconButton.setIcons(p.getIcon(), p.getDisabledIcon(), p.getHoveredIcon()); if (changed) { myInplaceButton.setIcons(myIconButton); String tooltipText = KeymapUtil.createTooltipText(p.getText(), myAction); myInplaceButton.setToolTipText(tooltipText.length() > 0 ? tooltipText : null); myInplaceButton.setVisible(p.isEnabled() && p.isVisible()); } myPrevPresentation = p; return changed; } | update |
284,640 | boolean (Presentation p1, Presentation p2) { if (p1 == null || p2 == null) return false; return Objects.equals(p1.getText(), p2.getText()) && Comparing.equal(p1.getIcon(), p2.getIcon()) && Comparing.equal(p1.getHoveredIcon(), p2.getHoveredIcon()) && p1.isEnabled() == p2.isEnabled() && p1.isVisible() == p2.isVisible(); } | areEqual |
284,641 | void (final ActionEvent e) { AnActionEvent event = createAnEvent(e); if (ActionUtil.lastUpdateAndCheckDumb(myAction, event, true)) { ActionUtil.performActionDumbAwareWithCallbacks(myAction, event); } } | actionPerformed |
284,642 | AnActionEvent (final @NotNull ActionEvent e) { Object source = e.getSource(); InputEvent inputEvent = null; if (source instanceof InputEvent) { inputEvent = (InputEvent)source; } return createAnEvent(inputEvent, e.getModifiers()); } | createAnEvent |
284,643 | AnActionEvent (InputEvent inputEvent, int modifiers) { Presentation presentation = myAction.getTemplatePresentation().clone(); DataContext parent = DataManager.getInstance().getDataContext(myInplaceButton); DataContext dataContext = CustomizedDataContext.create(parent, dataId -> { if (CommonDataKeys.VIRTUAL_FILE.is(dataId)) { Object object = myTabInfo.getObject(); if (object instanceof VirtualFile) return object; } return null; }); return new AnActionEvent(inputEvent, dataContext, myPlace != null ? myPlace : ActionPlaces.UNKNOWN, presentation, ActionManager.getInstance(), modifiers); } | createAnEvent |
284,644 | void (final boolean autoHide) { myAutoHide = autoHide; if (!myToShow) { toggleShowActions(false); } } | setAutoHide |
284,645 | void (boolean show) { if (myAutoHide) { myInplaceButton.setPainting(show); } else { myInplaceButton.setPainting(true); } myToShow = show; } | toggleShowActions |
284,646 | void (Graphics2D g2d, Rectangle effectiveBounds, int x, int y, int w, int h, Color tabColor, int row, int column, boolean vertical) { g2d.setColor(tabColor != null ? tabColor : getDefaultTabColor()); g2d.fillRect(x, y, w, h); g2d.setColor(getInactiveMaskColor()); g2d.fillRect(x, y, w, h); } | doPaintInactive |
284,647 | void (Graphics2D g, Rectangle clip, boolean vertical, Rectangle rectangle) { g.setColor(getBackgroundColor()); g.fill(clip); } | doPaintBackground |
284,648 | Color () { return BORDER_COLOR; } | getBackgroundColor |
284,649 | Color () { if (myDefaultTabColor != null) { return myDefaultTabColor; } return DEFAULT_TAB_COLOR; } | getDefaultTabColor |
284,650 | Color () { return INACTIVE_MASK_COLOR; } | getInactiveMaskColor |
284,651 | TablePassInfo (List<TabInfo> visibleInfos) { final TablePassInfo data = new TablePassInfo(this, visibleInfos); if (myTabs.isHideTabs()) { return data; } doScrollToSelectedTab(lastTableLayout); boolean singleRow = myTabs.isSingleRow(); boolean showPinnedTabsSeparately = showPinnedTabsSeparately(); boolean scrollable = UISettings.getInstance().getHideTabsIfNeeded() && singleRow; int titleWidth = myTabs.getTitleWrapper().getPreferredSize().width; data.titleRect.setBounds(data.toFitRec.x, data.toFitRec.y, titleWidth, myTabs.getHeaderFitSize().height); data.entryPointRect.setBounds(data.toFitRec.x + data.toFitRec.width - myTabs.getEntryPointPreferredSize().width - myTabs.getActionsInsets().right, data.toFitRec.y, myTabs.getEntryPointPreferredSize().width, myTabs.getHeaderFitSize().height); data.moreRect.setBounds(data.toFitRec.x + data.toFitRec.width - myTabs.getEntryPointPreferredSize().width - myTabs.getActionsInsets().right, data.toFitRec.y, 0, myTabs.getHeaderFitSize().height); calculateLengths(data); int eachX = data.titleRect.x + data.titleRect.width; Insets insets = myTabs.getLayoutInsets(); int eachY = insets.top; int requiredRowsPinned = 0; int requiredRowsUnpinned = 0; int maxX = data.moreRect.x - (singleRow ? myTabs.getActionsInsets().left : 0); if (!singleRow && showPinnedTabsSeparately && ContainerUtil.all(visibleInfos, info -> !info.isPinned())) { maxX += myTabs.getEntryPointPreferredSize().width; } int hGap = myTabs.getTabHGap(); int entryPointMargin = scrollable ? 0 : myTabs.getEntryPointPreferredSize().width; for (TabInfo eachInfo : data.myVisibleInfos) { TabLabel eachLabel = myTabs.getTabLabel(eachInfo); boolean pinned = eachLabel.isPinned(); int width = data.lengths.get(eachInfo); if (!pinned || !showPinnedTabsSeparately) { data.requiredLength += width; } if (pinned && showPinnedTabsSeparately) { if (requiredRowsPinned == 0) { requiredRowsPinned = 1; } myTabs.layout(eachLabel, eachX, eachY, width, myTabs.getHeaderFitSize().height); data.bounds.put(eachInfo, eachLabel.getBounds()); } else { if ((!scrollable && eachX + width + hGap > maxX - entryPointMargin && !singleRow) || (showPinnedTabsSeparately && eachLabel.isNextToLastPinned())) { requiredRowsUnpinned++; eachY += myTabs.getHeaderFitSize().height; eachX = data.toFitRec.x; } else if (requiredRowsUnpinned == 0) { requiredRowsUnpinned = 1; } if (scrollable) { if (eachX - getScrollOffset() + width + hGap > maxX - entryPointMargin) { width = Math.max(0, maxX - eachX + getScrollOffset()); data.invisible.add(eachInfo); } } myTabs.layout(eachLabel, eachX - getScrollOffset(), eachY, width == 1 ? 0 : width, myTabs.getHeaderFitSize().height); Rectangle rectangle = new Rectangle(myTabs.getHeaderFitSize()); data.bounds.put(eachInfo, eachLabel.getBounds()); int intersection = eachLabel.getBounds().intersection(rectangle).width; if (scrollable && intersection < eachLabel.getBounds().width) { data.invisible.add(eachInfo); } } eachX += width + hGap; if (requiredRowsPinned + requiredRowsUnpinned > 1) { entryPointMargin = singleRow ? 0 : - data.moreRect.width; } } if (requiredRowsPinned > 0 && requiredRowsUnpinned > 0) data.moreRect.y += myTabs.getHeaderFitSize().height /*+ myTabs.getSeparatorWidth()*/; if (data.invisible.isEmpty()) { data.moreRect.setBounds(0, 0, 0, 0); } eachY = -1; TableRow eachTableRow = new TableRow(data); for (TabInfo eachInfo : data.myVisibleInfos) { final TabLabel eachLabel = myTabs.getTabLabel(eachInfo); if (eachY == -1 || eachY != eachLabel.getY()) { if (eachY != -1) { eachTableRow = new TableRow(data); } eachY = eachLabel.getY(); data.table.add(eachTableRow); } eachTableRow.add(eachInfo, eachLabel.getWidth()); } doScrollToSelectedTab(data); clampScrollOffsetToBounds(data); return data; } | computeLayoutTable |
284,652 | void (TablePassInfo data) { boolean compressible = isCompressible(); boolean showPinnedTabsSeparately = showPinnedTabsSeparately(); int standardLengthToFit = data.moreRect.x - (data.titleRect.x + data.titleRect.width) - myTabs.getActionsInsets().left; if (compressible || showPinnedTabsSeparately) { if (showPinnedTabsSeparately) { List<TabInfo> pinned = ContainerUtil.filter(data.myVisibleInfos, info -> info.isPinned()); calculateCompressibleLengths(pinned, data, standardLengthToFit); List<TabInfo> unpinned = ContainerUtil.filter(data.myVisibleInfos, info -> !info.isPinned()); if (compressible) { Insets insets = myTabs.getActionsInsets(); calculateCompressibleLengths(unpinned, data, pinned.isEmpty() ? standardLengthToFit : standardLengthToFit + data.titleRect.width + myTabs.getEntryPointPreferredSize().width + insets.left + insets.right); } else { calculateRawLengths(unpinned, data); if (getTotalLength(unpinned, data) > standardLengthToFit) { int moreWidth = getMoreRectAxisSize(); int entryPointsWidth = pinned.isEmpty() ? myTabs.getEntryPointPreferredSize().width : 0; data.moreRect.setBounds(data.toFitRec.x + data.toFitRec.width - moreWidth - entryPointsWidth - myTabs.getActionsInsets().right, myTabs.getLayoutInsets().top, moreWidth, myTabs.getHeaderFitSize().height); calculateRawLengths(unpinned, data); } } } else { calculateCompressibleLengths(data.myVisibleInfos, data, standardLengthToFit); } } else {//both scrollable and multi-row calculateRawLengths(data.myVisibleInfos, data); if (getTotalLength(data.myVisibleInfos, data) > standardLengthToFit) { int moreWidth = getMoreRectAxisSize(); data.moreRect.setBounds(data.toFitRec.x + data.toFitRec.width - moreWidth, data.toFitRec.y, moreWidth, myTabs.getHeaderFitSize().height); calculateRawLengths(data.myVisibleInfos, data); } } } | calculateLengths |
284,653 | int () { return myTabs.isSingleRow() ? myTabs.getMoreToolbarPreferredSize().width : 0; } | getMoreRectAxisSize |
284,654 | int (@NotNull List<TabInfo> list, @NotNull TablePassInfo data) { int total = 0; for (TabInfo info : list) { total += data.lengths.get(info); } return total; } | getTotalLength |
284,655 | boolean () { return myTabs.isSingleRow() && !UISettings.getInstance().getHideTabsIfNeeded() && myTabs.supportCompression(); } | isCompressible |
284,656 | void (List<TabInfo> list, TablePassInfo data, int toFitLength) { if (list.isEmpty()) return; int spentLength = 0; int lengthEstimation = 0; for (TabInfo tabInfo : list) { lengthEstimation += Math.max(getMinTabWidth(), myTabs.getInfoToLabel().get(tabInfo).getPreferredSize().width); } final int extraWidth = toFitLength - lengthEstimation; for (Iterator<TabInfo> iterator = list.iterator(); iterator.hasNext(); ) { TabInfo tabInfo = iterator.next(); final TabLabel label = myTabs.getInfoToLabel().get(tabInfo); int length; int lengthIncrement = label.getPreferredSize().width; if (!iterator.hasNext()) { length = Math.min(toFitLength - spentLength, lengthIncrement); } else if (extraWidth <= 0) {//need compress length = (int)(lengthIncrement * (float)toFitLength / lengthEstimation); } else { length = lengthIncrement; } if (tabInfo.isPinned()) { length = Math.min(getMaxPinnedTabWidth(), length); } length = Math.max(getMinTabWidth(), length); data.lengths.put(tabInfo, length); spentLength += length + myTabs.getTabHGap(); } } | calculateCompressibleLengths |
284,657 | void (List<TabInfo> list, TablePassInfo data) { for (TabInfo info : list) { TabLabel eachLabel = myTabs.getTabLabel(info); Dimension size = eachLabel.isPinned() && showPinnedTabsSeparately() ? eachLabel.getNotStrictPreferredSize() : eachLabel.getPreferredSize(); data.lengths.put(info, Math.max(getMinTabWidth(), size.width + myTabs.getTabHGap())); } } | calculateRawLengths |
284,658 | LayoutPassInfo (List<TabInfo> visibleInfos) { myTabs.resetLayout(true); Rectangle unitedTabArea = null; TablePassInfo data = computeLayoutTable(visibleInfos); Rectangle rect = new Rectangle(data.moreRect); rect.y += myTabs.getBorderThickness(); myTabs.getMoreToolbar().getComponent().setBounds(rect); ActionToolbar entryPointToolbar = myTabs.getEntryPointToolbar(); if (entryPointToolbar != null) { entryPointToolbar.getComponent().setBounds(data.entryPointRect); } myTabs.getTitleWrapper().setBounds(data.titleRect); Insets insets = myTabs.getLayoutInsets(); int eachY = insets.top; for (TabInfo info : visibleInfos) { Rectangle bounds = data.bounds.get(info); if (unitedTabArea == null) { unitedTabArea = bounds; } else { unitedTabArea = unitedTabArea.union(bounds); } } if (myTabs.getSelectedInfo() != null) { final JBTabsImpl.Toolbar selectedToolbar = myTabs.getInfoToToolbar().get(myTabs.getSelectedInfo()); final int componentY = (unitedTabArea != null ? unitedTabArea.y + unitedTabArea.height : eachY) + (myTabs.isEditorTabs() ? 0 : 2) - myTabs.getLayoutInsets().top; if (!myTabs.getHorizontalSide() && selectedToolbar != null && !selectedToolbar.isEmpty()) { final int toolbarWidth = selectedToolbar.getPreferredSize().width; final int vSeparatorWidth = toolbarWidth > 0 ? myTabs.separatorWidth : 0; if (myTabs.isSideComponentBefore()) { Rectangle compRect = myTabs.layoutComp(toolbarWidth + vSeparatorWidth, componentY, myTabs.getSelectedInfo().getComponent(), 0, 0); myTabs.layout(selectedToolbar, compRect.x - toolbarWidth - vSeparatorWidth, compRect.y, toolbarWidth, compRect.height); } else { final int width = myTabs.getWidth() - toolbarWidth - vSeparatorWidth; Rectangle compRect = myTabs.layoutComp(new Rectangle(0, componentY, width, myTabs.getHeight()), myTabs.getSelectedInfo().getComponent(), 0, 0); myTabs.layout(selectedToolbar, compRect.x + compRect.width + vSeparatorWidth, compRect.y, toolbarWidth, compRect.height); } } else { myTabs.layoutComp(0, componentY, myTabs.getSelectedInfo().getComponent(), 0, 0); } } if (unitedTabArea != null) { data.tabRectangle.setBounds(unitedTabArea); } lastTableLayout = data; return data; } | layoutTable |
284,659 | boolean (@NotNull TabInfo info) { TabLabel label = myTabs.getInfoToLabel().get(info); Rectangle bounds = label.getBounds(); int deadzone = JBUI.scale(DEADZONE_FOR_DECLARE_TAB_HIDDEN); return bounds.x < -deadzone || bounds.width < label.getPreferredSize().width - deadzone; } | isTabHidden |
284,660 | boolean (@NotNull TabLabel tabLabel, int deltaX, int deltaY) { if (lastTableLayout == null) { return super.isDragOut(tabLabel, deltaX, deltaY); } Rectangle area = new Rectangle(lastTableLayout.toFitRec.width, tabLabel.getBounds().height); for (int i = 0; i < lastTableLayout.myVisibleInfos.size(); i++) { area = area.union(myTabs.getInfoToLabel().get(lastTableLayout.myVisibleInfos.get(i)).getBounds()); } return Math.abs(deltaY) > area.height * getDragOutMultiplier(); } | isDragOut |
284,661 | int (Point point) { if (lastTableLayout == null) return -1; int result = -1; Component c = myTabs.getComponentAt(point); Set<TabInfo> lastInRow = new HashSet<>(); for (int i = 0; i < lastTableLayout.table.size(); i++) { List<TabInfo> columns = lastTableLayout.table.get(i).myColumns; if (!columns.isEmpty()) { lastInRow.add(columns.get(columns.size() - 1)); } } if (c instanceof JBTabsImpl) { for (int i = 0; i < lastTableLayout.myVisibleInfos.size() - 1; i++) { TabInfo firstInfo = lastTableLayout.myVisibleInfos.get(i); TabInfo secondInfo = lastTableLayout.myVisibleInfos.get(i + 1); TabLabel first = myTabs.getInfoToLabel().get(firstInfo); TabLabel second = myTabs.getInfoToLabel().get(secondInfo); Rectangle firstBounds = first.getBounds(); Rectangle secondBounds = second.getBounds(); final boolean between = firstBounds.getMaxX() < point.x && secondBounds.getX() > point.x && firstBounds.y < point.y && secondBounds.getMaxY() > point.y; if (between) { c = first; break; } if (lastInRow.contains(firstInfo) && firstBounds.y <= point.y && firstBounds.getMaxY() >= point.y && firstBounds.getMaxX() <= point.x) { c = second; break; } } } if (c instanceof TabLabel) { TabInfo info = ((TabLabel)c).getInfo(); int index = lastTableLayout.myVisibleInfos.indexOf(info); boolean isDropTarget = myTabs.isDropTarget(info); if (!isDropTarget) { for (int i = 0; i <= index; i++) { if (myTabs.isDropTarget(lastTableLayout.myVisibleInfos.get(i))) { index -= 1; break; } } result = index; } else if (index < lastTableLayout.myVisibleInfos.size()) { result = index; } } return result; } | getDropIndexFor |
284,662 | int (@NotNull Point point) { return TabsUtil.getDropSideFor(point, myTabs); } | getDropSideFor |
284,663 | int () { return myScrollOffset; } | getScrollOffset |
284,664 | void (int units) { if (!myTabs.isSingleRow()) { myScrollOffset = 0; return; } myScrollOffset += units; clampScrollOffsetToBounds(lastTableLayout); } | scroll |
284,665 | void (@Nullable TablePassInfo data) { if (data == null) { return; } if (data.requiredLength < data.toFitRec.width) { myScrollOffset = 0; } else { int entryPointsWidth = data.moreRect.y == data.entryPointRect.y ? data.entryPointRect.width + 1 : 0; myScrollOffset = Math.max(0, Math.min(myScrollOffset, data.requiredLength - data.toFitRec.width + data.moreRect.width + entryPointsWidth /*+ (1 + myTabs.getIndexOf(myTabs.getSelectedInfo())) * myTabs.getBorderThickness()*/+ data.titleRect.width)); } } | clampScrollOffsetToBounds |
284,666 | boolean () { return myWithScrollBar; } | isWithScrollBar |
284,667 | int () { return 10; } | getScrollUnitIncrement |
284,668 | void (TablePassInfo data) { if (myTabs.isMouseInsideTabsArea() || data == null || data.lengths.isEmpty() || myTabs.isHideTabs() || !showPinnedTabsSeparately()) { return; } int offset = -myScrollOffset; for (TabInfo info : data.myVisibleInfos) { if (info.isPinned()) continue; final int length = data.lengths.get(info); if (info == myTabs.getSelectedInfo()) { if (offset < 0) { scroll(offset); } else { final int maxLength = data.moreRect.x; if (offset + length > maxLength) { // left side should be always visible if (length < maxLength) { scroll(offset + length - maxLength); } else { scroll(offset); } } } break; } offset += length; } } | doScrollToSelectedTab |
284,669 | boolean (final TabInfo tabInfo) { final TableRow row = myInfo2Row.get(tabInfo); final int index = table.indexOf(row); return index != -1 && index == table.size() - 1; } | isInSelectionRow |
284,670 | int () { return table.size(); } | getRowCount |
284,671 | Rectangle () { return (Rectangle)tabRectangle.clone(); } | getHeaderRectangle |
284,672 | int () { return requiredLength; } | getRequiredLength |
284,673 | int () { return !moreRect.isEmpty() ? moreRect.x - toFitRec.x - myTabs.getActionsInsets().left : table.size() > 1 || entryPointRect.isEmpty() ? toFitRec.width : entryPointRect.x - toFitRec.x - myTabs.getActionsInsets().left; } | getScrollExtent |
284,674 | boolean () { return getStrategy().isSideComponentOnTabs(); } | isSideComponentOnTabs |
284,675 | ShapeTransform (Rectangle labelRec) { return getStrategy().createShapeTransform(labelRec); } | createShapeTransform |
284,676 | boolean (@NotNull TabLabel tabLabel, int deltaX, int deltaY) { return getStrategy().isDragOut(tabLabel, deltaX, deltaY); } | isDragOut |
284,677 | boolean (SingleRowPassInfo data) { boolean layoutLabels = true; if (!myTabs.getForcedRelayout$intellij_platform_ide() && lastSingRowLayout != null && lastSingRowLayout.contentCount == myTabs.getTabCount() && lastSingRowLayout.layoutSize.equals(myTabs.getSize()) && lastSingRowLayout.scrollOffset == getScrollOffset()) { for (TabInfo each : data.myVisibleInfos) { final TabLabel eachLabel = myTabs.getInfoToLabel().get(each); if (!eachLabel.isValid()) { layoutLabels = true; break; } if (myTabs.getSelectedInfo() == each) { if (eachLabel.getBounds().width != 0) { layoutLabels = false; } } } } return layoutLabels; } | checkLayoutLabels |
284,678 | LayoutPassInfo (List<TabInfo> visibleInfos) { SingleRowPassInfo data = new SingleRowPassInfo(this, visibleInfos); final boolean shouldLayoutLabels = checkLayoutLabels(data); if (!shouldLayoutLabels) { data = lastSingRowLayout; } final TabInfo selected = myTabs.getSelectedInfo(); prepareLayoutPassInfo(data, selected); myTabs.resetLayout(shouldLayoutLabels || myTabs.isHideTabs()); if (shouldLayoutLabels && !myTabs.isHideTabs()) { recomputeToLayout(data); data.position = getStrategy().getStartPosition(data) - getScrollOffset(); layoutTitle(data); if (ExperimentalUI.isNewUI() && myTabs.getTabsPosition().isSide()) { // Layout buttons first because their position will be used to calculate label positions layoutEntryPointButton(data); layoutMoreButton(data); layoutLabels(data); } else { layoutLabels(data); layoutEntryPointButton(data); layoutMoreButton(data); } } if (selected != null) { data.component = new WeakReference<>(selected.getComponent()); getStrategy().layoutComp(data); } data.tabRectangle = new Rectangle(); if (!data.toLayout.isEmpty()) { final TabLabel firstLabel = myTabs.getInfoToLabel().get(data.toLayout.get(0)); final TabLabel lastLabel = findLastVisibleLabel(data); if (firstLabel != null && lastLabel != null) { data.tabRectangle.x = firstLabel.getBounds().x; data.tabRectangle.y = firstLabel.getBounds().y; data.tabRectangle.width = ExperimentalUI.isNewUI() ? (int)data.entryPointRect.getMaxX() + myTabs.getActionsInsets().right - data.tabRectangle.x : (int)lastLabel.getBounds().getMaxX() - data.tabRectangle.x; data.tabRectangle.height = (int)lastLabel.getBounds().getMaxY() - data.tabRectangle.y; } } lastSingRowLayout = data; return data; } | layoutSingleRow |
284,679 | void (SingleRowPassInfo data, TabInfo selected) { data.insets = myTabs.getLayoutInsets(); if (myTabs.isHorizontalTabs()) { data.insets.left += myTabs.getFirstTabOffset(); } final JBTabsImpl.Toolbar selectedToolbar = myTabs.getInfoToToolbar().get(selected); data.hToolbar = new WeakReference<>(selectedToolbar != null && myTabs.getHorizontalSide() && !selectedToolbar.isEmpty() ? selectedToolbar : null); data.vToolbar = new WeakReference<>(selectedToolbar != null && !myTabs.getHorizontalSide() && !selectedToolbar.isEmpty() ? selectedToolbar : null); data.toFitLength = getStrategy().getToFitLength(data); } | prepareLayoutPassInfo |
284,680 | void (SingleRowPassInfo data) { data.titleRect = getStrategy().getTitleRect(data); data.position += myTabs.isHorizontalTabs() ? data.titleRect.width : data.titleRect.height; } | layoutTitle |
284,681 | void (SingleRowPassInfo data) { if (!data.toDrop.isEmpty()) { data.moreRect = getStrategy().getMoreRect(data); } } | layoutMoreButton |
284,682 | void (SingleRowPassInfo data) { data.entryPointRect = getStrategy().getEntryPointRect(data); } | layoutEntryPointButton |
284,683 | void (final SingleRowPassInfo data) { boolean layoutStopped = false; for (TabInfo eachInfo : data.toLayout) { final TabLabel label = myTabs.getInfoToLabel().get(eachInfo); if (layoutStopped) { final Rectangle rec = getStrategy().getLayoutRect(data, 0, 0); myTabs.layout(label, rec); continue; } final Dimension eachSize = label.getPreferredSize(); int length = getStrategy().getLengthIncrement(eachSize); boolean continueLayout = applyTabLayout(data, label, length); data.position = getStrategy().getMaxPosition(label.getBounds()); data.position += myTabs.getTabHGap(); if (!continueLayout) { layoutStopped = true; } } for (TabInfo eachInfo : data.toDrop) { JBTabsImpl.Companion.resetLayout(myTabs.getInfoToLabel().get(eachInfo)); } } | layoutLabels |
284,684 | boolean (SingleRowPassInfo data, TabLabel label, int length) { final Rectangle rec = getStrategy().getLayoutRect(data, data.position, length); myTabs.layout(label, rec); label.setAlignmentToCenter(myTabs.isEditorTabs() && getStrategy().isToCenterTextWhenStretched()); return true; } | applyTabLayout |
284,685 | void (SingleRowPassInfo data) { data.requiredLength += myTabs.isHorizontalTabs() ? data.insets.left + data.insets.right : data.insets.top + data.insets.bottom; for (TabInfo eachInfo : data.myVisibleInfos) { data.requiredLength += getRequiredLength(eachInfo); data.toLayout.add(eachInfo); } data.requiredLength += getStrategy().getAdditionalLength(); } | calculateRequiredLength |
284,686 | int (TabInfo eachInfo) { TabLabel label = myTabs.getInfoToLabel().get(eachInfo); return getStrategy().getLengthIncrement(label != null ? label.getPreferredSize() : new Dimension()) + (myTabs.isEditorTabs() ? myTabs.getTabHGap() : 0); } | getRequiredLength |
284,687 | boolean (@NotNull TabInfo info) { return lastSingRowLayout != null && lastSingRowLayout.toDrop.contains(info); } | isTabHidden |
284,688 | int (Point point) { if (lastSingRowLayout == null) return -1; int result = -1; Component c = myTabs.getComponentAt(point); if (c instanceof JBTabsImpl) { for (int i = 0; i < lastSingRowLayout.myVisibleInfos.size() - 1; i++) { TabLabel first = myTabs.getInfoToLabel().get(lastSingRowLayout.myVisibleInfos.get(i)); TabLabel second = myTabs.getInfoToLabel().get(lastSingRowLayout.myVisibleInfos.get(i + 1)); Rectangle firstBounds = first.getBounds(); Rectangle secondBounds = second.getBounds(); final boolean between; boolean horizontal = getStrategy() instanceof SingleRowLayoutStrategy.Horizontal; if (horizontal) { between = firstBounds.getMaxX() < point.x && secondBounds.getX() > point.x && firstBounds.y < point.y && secondBounds.getMaxY() > point.y; } else { between = firstBounds.getMaxY() < point.y && secondBounds.getY() > point.y && firstBounds.x < point.x && secondBounds.getMaxX() > point.x; } if (between) { c = first; break; } } } if (c instanceof TabLabel) { TabInfo info = ((TabLabel)c).getInfo(); int index = lastSingRowLayout.myVisibleInfos.indexOf(info); boolean isDropTarget = myTabs.isDropTarget(info); if (!isDropTarget) { for (int i = 0; i <= index; i++) { if (myTabs.isDropTarget(lastSingRowLayout.myVisibleInfos.get(i))) { index -= 1; break; } } result = index; } else if (index < lastSingRowLayout.myVisibleInfos.size()) { result = index; } } return result; } | getDropIndexFor |
284,689 | int (@NotNull Point point) { return TabsUtil.getDropSideFor(point, myTabs); } | getDropSideFor |
284,690 | int () { return 1; } | getRowCount |
284,691 | Rectangle () { return (Rectangle)tabRectangle.clone(); } | getHeaderRectangle |
284,692 | int () { return requiredLength; } | getRequiredLength |
284,693 | int () { if (tabs.isHorizontalTabs()) { return !moreRect.isEmpty() ? moreRect.x - tabs.getActionsInsets().left : !entryPointRect.isEmpty() ? entryPointRect.x - tabs.getActionsInsets().left : layoutSize.width; } else { if (ExperimentalUI.isNewUI()) { return layoutSize.height; } return !moreRect.isEmpty() ? moreRect.y - tabs.getActionsInsets().top : !entryPointRect.isEmpty() ? entryPointRect.y - tabs.getActionsInsets().top : layoutSize.height; } } | getScrollExtent |
284,694 | int () { return myScrollOffset; } | getScrollOffset |
284,695 | void (int units) { myScrollOffset += units; clampScrollOffsetToBounds(lastSingRowLayout); } | scroll |
284,696 | boolean (SingleRowPassInfo data) { return true; } | checkLayoutLabels |
284,697 | void (@Nullable SingleRowPassInfo data) { if (data == null) { return; } if (data.requiredLength < data.toFitLength) { myScrollOffset = 0; } else { int max = data.requiredLength - data.toFitLength + getMoreRectAxisSize(); Insets actionInsets = myTabs.getActionsInsets(); max += myTabs.isHorizontalTabs() ? actionInsets.left + actionInsets.right : actionInsets.top + actionInsets.bottom; if (!ExperimentalUI.isNewUI() && getStrategy() instanceof SingleRowLayoutStrategy.Vertical) { max += data.entryPointAxisSize; } myScrollOffset = Math.max(0, Math.min(myScrollOffset, max)); } } | clampScrollOffsetToBounds |
284,698 | void (SingleRowPassInfo passInfo) { if (myTabs.isMouseInsideTabsArea()) { return; } int offset = -myScrollOffset; for (TabInfo info : passInfo.myVisibleInfos) { final int length = getRequiredLength(info); if (info == myTabs.getSelectedInfo()) { if (offset < 0) { scroll(offset); } else { int maxLength = passInfo.toFitLength - getMoreRectAxisSize(); Insets actionInsets = myTabs.getActionsInsets(); if (myTabs.getEntryPointPreferredSize().width == 0) { maxLength -= myTabs.isHorizontalTabs() ? actionInsets.left + actionInsets.right : actionInsets.top + actionInsets.bottom; } if (!ExperimentalUI.isNewUI() && getStrategy() instanceof SingleRowLayoutStrategy.Vertical) { maxLength -= passInfo.entryPointAxisSize; } if (offset + length > maxLength) { // a left side should always be visible if (length < maxLength) { scroll(offset + length - maxLength); } else { scroll(offset); } } } break; } offset += length; } } | doScrollToSelectedTab |
284,699 | void (SingleRowPassInfo data) { calculateRequiredLength(data); clampScrollOffsetToBounds(data); doScrollToSelectedTab(data); clampScrollOffsetToBounds(data); } | recomputeToLayout |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.