Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
290,600
JComponent () { return RunnerContentUi.this.getComponent(); }
getComponent
290,601
boolean () { return RunnerContentUi.this.isCycleRoot(); }
isCycleRoot
290,602
void () { super.addNotify(); if (ComponentUtil.findParentByCondition(this, it -> ClientProperty.isTrue(it, ToolWindowPane.TEMPORARY_ADDED)) != null) { return; } if (!myUiLastStateWasRestored && myOriginal == null) { myUiLastStateWasRestored = true; // [kirillk] this is done later since restoreUiState doesn't work properly in the addNotify call chain //todo to investigate and to fix (may cause extra flickering) //noinspection SSBasedInspection SwingUtilities.invokeLater(() -> restoreLastUiState().doWhenDone(() -> { if (!myWasEverAdded) { myWasEverAdded = true; attractOnStartup(); myInitialized.setDone(); } })); } }
addNotify
290,603
void () { super.removeNotify(); if (!ScreenUtil.isStandardAddRemoveNotify(this) || Disposer.isDisposed(RunnerContentUi.this)) { return; } if (myWasEverAdded) { saveUiState(); } }
removeNotify
290,604
void () { super.updateUI(); setBorder(); }
updateUI
290,605
void () { setBorder(JBUI.Borders.emptyTop(-1)); }
setBorder
290,606
void () { final int currentCount = myAttractionCount; SwingUtilities.invokeLater(() -> { if (currentCount < myAttractionCount) return; attractByCondition(LayoutViewOptions.STARTUP, false); }); }
attractOnStartup
290,607
void (Content content, boolean afterInitialized) { processAttraction(content.getUserData(ViewImpl.ID), null, new LayoutAttractionPolicy.Bounce(), afterInitialized, true); }
attract
290,608
void (@NotNull String condition, boolean afterInitialized, boolean activate) { processAttraction(myLayoutSettings.getToFocus(condition), condition, myLayoutSettings.getAttractionPolicy(condition), afterInitialized, activate); }
processAttractionByCondition
290,609
void (@Nullable String contentId, @Nullable String condition, @NotNull LayoutAttractionPolicy defaultPolicy, boolean afterInitialized, boolean activate) { if (contentId == null) return; IdeFocusManager.getInstance(getProject()).doWhenFocusSettlesDown(() -> myInitialized.processOnDone(() -> { Content content = findContent(contentId); if (content == null) return; LayoutAttractionPolicy policy = getOrCreatePolicyFor(contentId, condition, myAttractions, defaultPolicy); if (activate) { // See IDEA-93683, bounce attraction should not disable further focus attraction if (!(policy instanceof LayoutAttractionPolicy.Bounce)) { myAttractionCount++; } policy.attract(content, myRunnerUi); } else { policy.clearAttraction(content, myRunnerUi); } }, afterInitialized)); }
processAttraction
290,610
boolean (JComponent c) { if (c.getRootPane() == null) return false; Container eachParent = c.getParent(); while (eachParent != null && eachParent.isValid()) { eachParent = eachParent.getParent(); } if (eachParent == null) { eachParent = c.getRootPane(); } eachParent.validate(); return true; }
ensureValid
290,611
void (final Content content, final CellTransform.Restore restore) { getStateFor(content).setMinimizedInGrid(true); myManager.removeContent(content, false); saveUiState(); }
minimize
290,612
void (@NotNull Content content) { GridImpl grid = getGridFor(content, false); if (grid == null) { getStateFor(content).assignTab(myLayoutSettings.getOrCreateTab(-1)); } else { grid.getCellFor(content).restore(content); } getStateFor(content).setMinimizedInGrid(false); myManager.addContent(content); saveUiState(); }
restore
290,613
Project () { return myProject; }
getProject
290,614
ContentManager () { return myManager; }
getContentManager
290,615
ActionManager () { return myActionManager; }
getActionManager
290,616
RunnerLayout () { return myLayoutSettings; }
getLayoutSettings
290,617
View (final @NotNull Content content) { return myLayoutSettings.getStateFor(content); }
getStateFor
290,618
ActionCallback (final @NotNull Content content, final boolean requestFocus) { final TabInfo info = findTabInfoFor(content); if (info == null) return ActionCallback.DONE; final GridImpl grid = getGridFor(info); final ActionCallback result = new ActionCallback(); myTabs.select(info, false).doWhenDone(() -> grid.select(content, requestFocus).notifyWhenDone(result)); return result; }
select
290,619
void (Content content, final ActiveRunnable toRestore) { final TabInfo current = myTabs.getSelectedInfo(); myTabs.getPresentation().setPaintBlocked(true, true); select(content, false).doWhenDone(() -> { myTabs.getComponent().validate(); toRestore.run().doWhenDone(() -> { assert current != null; myTabs.select(current, true); myTabs.getPresentation().setPaintBlocked(false, true); }); }); }
validate
290,620
IdeFocusManager () { return myFocusManager; }
getFocusManager
290,621
RunnerLayoutUi () { return myRunnerUi; }
getRunnerLayoutUi
290,622
String () { return mySessionName; }
getName
290,623
List<AnAction> (boolean originalProvider) { ArrayList<AnAction> result = new ArrayList<>(); if (myLeftToolbarActions != null) { AnAction[] kids = myLeftToolbarActions.getChildren(null); ContainerUtil.addAll(result, kids); } if (myTopLeftActions != null && UIExperiment.isNewDebuggerUIEnabled()) { AnAction[] kids = myTopLeftActions.getChildren(null); ContainerUtil.addAll(result, kids); } return result; }
getActions
290,624
int () { int i; for (i = 1; i < Integer.MAX_VALUE; i++) { if (!isUsed(i)) { return i; } } return i; }
findFreeWindow
290,625
boolean (int i) { return myChildren.stream().anyMatch(child -> child.getWindow() == i); }
isUsed
290,626
DockManagerImpl () { return (DockManagerImpl)DockManager.getInstance(myProject); }
getDockManager
290,627
void (@NotNull MouseEvent mouseEvent, @NotNull TabInfo info) { JComponent component = info.getComponent(); Content[] data = CONTENT_KEY.getData((DataProvider)component); assert data != null; storeDefaultIndices(data); final Dimension size = info.getComponent().getSize(); final Image image = JBTabsImpl.getComponentImage(info); if (component instanceof Grid) { info.setHidden(true); } Presentation presentation = new Presentation(info.getText()); presentation.setIcon(info.getIcon()); mySession = getDockManager().createDragSession(mouseEvent, new DockableGrid(image, presentation, size, Arrays.asList(data), 0)); }
dragOutStarted
290,628
void (@NotNull MouseEvent event, @NotNull TabInfo source) { mySession.process(event); }
processDragOut
290,629
void (@NotNull MouseEvent event, TabInfo source) { mySession.process(event); mySession = null; }
dragOutFinished
290,630
void (TabInfo source) { source.setHidden(false); mySession.cancel(); mySession = null; }
dragOutCancelled
290,631
List<Content> () { return myContents; }
getKey
290,632
Image () { return myImg; }
getPreviewImage
290,633
Dimension () { return myPreferredSize; }
getPreferredSize
290,634
String () { return DockableGridContainerFactory.TYPE; }
getDockContainerType
290,635
Presentation () { return myPresentation; }
getPresentation
290,636
List<Content> () { return myContents; }
getContents
290,637
void () { }
close
290,638
int () { return myWindow; }
getWindow
290,639
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(myContentUi != null && myContentUi.getPopupContents().size() > 1); e.getPresentation().setText(ExecutionBundle.messagePointer("action.presentation.RunnerContentUi.text.show.list.of.tabs")); }
update
290,640
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
290,641
void (@NotNull AnActionEvent e) { myContentUi.toggleContentPopup(e.getData(JBTabsEx.NAVIGATION_ACTIONS_KEY)); }
actionPerformed
290,642
boolean (@NotNull AnActionEvent e) { boolean isSelected = delegate.isSelected(e); return myInverted ? !isSelected : isSelected; }
isSelected
290,643
ActionUpdateThread () { return delegate.getActionUpdateThread(); }
getActionUpdateThread
290,644
void (@NotNull AnActionEvent e, boolean state) { delegate.setSelected(e, myInverted ? !state : state); }
setSelected
290,645
void (@NotNull Content content) { for (Listener each : myDockingListeners) { each.contentAdded(content); } }
fireContentOpened
290,646
void (@Nullable Content content) { for (Listener each : myDockingListeners) { // dirty hack to not pass null here, listener implementation do not take this value into account each.contentRemoved(content != null ? content : new Object()); } }
fireContentClosed
290,647
JBRunnerTabsBase (@Nullable Project project, @NotNull Disposable parentDisposable) { return new JBRunnerTabs(project, parentDisposable); }
create
290,648
TabPainterAdapter () { return new DefaultTabPainterAdapter(JBTabPainter.getDEBUGGER()); }
createTabPainterAdapter
290,649
JBTabsBorder () { return new JBRunnerTabsBorder(this); }
createTabBorder
290,650
boolean () { return !ExperimentalUI.isNewUI(); }
useSmallLabels
290,651
int () { return 0; }
getToolbarInset
290,652
boolean (Point point) { final TabLabel label = getSelectedLabel(); if (label == null || point == null) { return true; } final Rectangle bounds = label.getBounds(); return point.y <= bounds.y + bounds.height; }
shouldAddToGlobal
290,653
void (@NotNull TabInfo over, RelativePoint relativePoint) { final Point point = relativePoint.getPoint(getComponent()); setShowDropLocation(shouldAddToGlobal(point)); super.processDropOver(over, relativePoint); for (Map.Entry<TabInfo, TabLabel> entry : getInfoToLabel().entrySet()) { final TabLabel label = entry.getValue(); if (label.getBounds().contains(point) && getDropInfo() != entry.getKey()) { select(entry.getKey(), false); break; } } }
processDropOver
290,654
int () { return ExperimentalUI.isNewUI() ? JBUI.scale(JBUI.CurrentTheme.DebuggerTabs.tabHeight()) : JBUI.scale(29); }
getTabLabelPreferredHeight
290,655
TabLabel (@NotNull TabInfo info) { return new SingleHeightLabel(this, info) { { updateFont(); } @Override public void updateUI() { super.updateUI(); updateFont(); } private void updateFont() { JComponent label = getLabelComponent(); // can be null at the first updateUI call during init if (label != null && ExperimentalUI.isNewUI()) { label.setFont(JBUI.CurrentTheme.DebuggerTabs.font()); } } @Override protected int getPreferredHeight() { return getTabLabelPreferredHeight(); } }; }
createTabLabel
290,656
void () { super.updateUI(); updateFont(); }
updateUI
290,657
void () { JComponent label = getLabelComponent(); // can be null at the first updateUI call during init if (label != null && ExperimentalUI.isNewUI()) { label.setFont(JBUI.CurrentTheme.DebuggerTabs.font()); } }
updateFont
290,658
int () { return getTabLabelPreferredHeight(); }
getPreferredHeight
290,659
Insets () { //noinspection UseDPIAwareInsets return new Insets(getBorderThickness(), (mySideMask & SideBorder.LEFT) != 0 ? getBorderThickness() : 0, 0, 0); }
getEffectiveBorder
290,660
void (@NotNull Component c, @NotNull Graphics g, int x, int y, int width, int height) { if (isEmptyVisible()) return; if ((mySideMask & SideBorder.LEFT) != 0) { getTabPainter().paintBorderLine((Graphics2D)g, getBorderThickness(), new Point(x, y), new Point(x, y + height)); } getTabPainter() .paintBorderLine((Graphics2D)g, getBorderThickness(), new Point(x, y + getHeaderFitSize().height), new Point(x + width, y + getHeaderFitSize().height)); }
paintBorder
290,661
void (@SideBorder.SideMask int mask) { mySideMask = mask; }
setSideMask
290,662
void (final MouseEvent e) { if (UIUtil.isCloseClick(e)) { // see RunnerContentUi tabMouseListener as well closeOrMinimize(e); } }
mousePressed
290,663
void (TabInfo oldSelection, TabInfo newSelection) { if (oldSelection != null && myContext.isStateBeingRestored()) { saveUiState(); } }
beforeSelectionChanged
290,664
void (final TabInfo oldSelection, final TabInfo newSelection) { updateSelection(myTabs.getComponent().isShowing()); if (!myTabs.getComponent().isShowing()) return; if (newSelection != null) { newSelection.stopAlerting(); } }
selectionChanged
290,665
void () { myTabs.setPopupGroup(myContext.getCellPopupGroup(ViewContext.CELL_POPUP_PLACE), ViewContext.CELL_POPUP_PLACE, true); }
rebuildPopupGroup
290,666
PlaceInGrid () { return myPlaceInGrid; }
getPlaceInGrid
290,667
void (Runnable contentAction) { if (myContents.size() == 0) { myPlaceholder.removeAll(); myTabs.removeAllTabs(); if (myPopup != null) { myPopup.cancel(); myPopup = null; } } else { if (myPlaceholder.isNull()) { myPlaceholder.setContent(myTabs.getComponent()); } contentAction.run(); } restoreProportions(); myTabs.getComponent().revalidate(); myTabs.getComponent().repaint(); }
revalidateCell
290,668
TabInfo (Content content) { final TabInfo tabInfo = updatePresentation(new TabInfo(new ProviderWrapper(content, myContext)), content) .setObject(content) .setPreferredFocusableComponent(content.getPreferredFocusableComponent()) .setActionsContextComponent(content.getActionsContextComponent()); myContents.remove(content); myContents.put(content, tabInfo); ActionGroup group = (ActionGroup)myContext.getActionManager().getAction(RunnerContentUi.VIEW_TOOLBAR); tabInfo.setTabLabelActions(group, ViewContext.CELL_TOOLBAR_PLACE); tabInfo.setDragOutDelegate(((RunnerContentUi)myContext).myDragOutDelegate); return tabInfo; }
createTabInfoFor
290,669
ActionCallback (final Content content, final boolean requestFocus) { final TabInfo tabInfo = myContents.getValue(content); return tabInfo != null ? myTabs.select(tabInfo, requestFocus) : ActionCallback.DONE; }
select
290,670
void (final Content content, final boolean activate) { if (myMinimizedContents.contains(content)) { content.fireAlert(); } TabInfo tab = getTabFor(content); if (tab == null) return; if (myTabs.getSelectedInfo() != tab) { if (activate) { tab.fireAlert(); } else { tab.stopAlerting(); } } }
processAlert
290,671
void (Content content) { updatePresentation(myTabs.findInfo(content), content); }
updateTabPresentation
290,672
boolean (Content content) { return myMinimizedContents.contains(content); }
isMinimized
290,673
boolean (Component c) { return myTabs.getComponent().isAncestorOf(c); }
contains
290,674
Content (TabInfo tab) { return myContents.getKey(tab); }
getContentFor
290,675
void (final boolean horizontal) { myTabs.getPresentation().setSideComponentVertical(!horizontal); }
setToolbarHorizontal
290,676
void (final boolean before) { myTabs.getPresentation().setSideComponentBefore(before); }
setToolbarBefore
290,677
ActionCallback () { final ActionCallback result = new ActionCallback(); restoreProportions(); final Content[] contents = getContents(); final List<Content> toMinimize = new SmartList<>(); int window = 0; for (final Content each : contents) { final View view = myContainer.getStateFor(each); if (view.isMinimizedInGrid()) { toMinimize.add(each); } window = view.getWindow(); } minimize(toMinimize.toArray(new Content[0])); final Tab tab = myContainer.getTab(); final boolean detached = (tab != null && tab.isDetached(myPlaceInGrid)) || window != myContext.getWindow(); if (detached && contents.length > 0) { if (tab != null) { tab.setDetached(myPlaceInGrid, false); } myContext.detachTo(window, this).notifyWhenDone(result); } else { result.setDone(); } return result; }
restoreLastUiState
290,678
int () { return myContents.size(); }
getContentCount
290,679
void () { saveProportions(); for (Content each : myContents.getKeys()) { saveState(each, false); } for (Content each : myMinimizedContents) { saveState(each, true); } final DimensionService service = DimensionService.getInstance(); final Dimension size = myContext.getContentManager().getComponent().getSize(); service.setSize(getDimensionKey(), size, myContext.getProject()); if (myContext.getWindow() != 0) { final Window frame = SwingUtilities.getWindowAncestor(myPlaceholder); if (frame != null && frame.isShowing()) { service.setLocation(getDimensionKey(), frame.getLocationOnScreen()); } } }
saveUiState
290,680
void () { myContainer.saveSplitterProportions(myPlaceInGrid); }
saveProportions
290,681
void (Content content, boolean minimized) { View state = myContext.getStateFor(content); state.setMinimizedInGrid(minimized); state.setPlaceInGrid(myPlaceInGrid); final List<Content> contents = myContainer.getContents(); final Tab tab = myContainer.getTabIndex(); if (minimized && contents.size() == 1 && contents.get(0).equals(content)) { state.setTabIndex(-1); if (tab instanceof TabImpl) { ((TabImpl)tab).setIndex(-1); } } state.assignTab(tab); state.setWindow(myContext.getWindow()); }
saveState
290,682
void () { myContainer.restoreLastSplitterProportions(myPlaceInGrid); }
restoreProportions
290,683
void (final boolean isShowing) { ContentManager contentManager = myContext.getContentManager(); if (contentManager.isDisposed()) return; for (Content each : myContents.getKeys()) { final TabInfo eachTab = getTabFor(each); boolean isSelected = eachTab != null && myTabs.getSelectedInfo() == eachTab; if (isSelected && isShowing) { contentManager.addSelectedContent(each); } else { contentManager.removeFromSelection(each); } } for (Content each : myMinimizedContents) { contentManager.removeFromSelection(each); } }
updateSelection
290,684
void (Content[] contents) { if (contents.length == 0) return; myContext.saveUiState(); for (final Content each : contents) { myMinimizedContents.add(each); remove(each); saveState(each, true); boolean isShowing = myTabs.getComponent().getRootPane() != null; myContainer.minimize(each, new CellTransform.Restore() { @Override public ActionCallback restoreInGrid() { restore(each); return ActionCallback.DONE; } }); updateSelection(isShowing); } }
minimize
290,685
ActionCallback () { restore(each); return ActionCallback.DONE; }
restoreInGrid
290,686
String () { return "GridCell.Tab." + myContainer.getTab().getIndex() + "." + myPlaceInGrid.name(); }
getDimensionKey
290,687
boolean () { return getContentCount() > 0; }
isValidForCalculateProportions
290,688
void (Content content) { minimize(new Content[]{content}); }
minimize
290,689
void (MouseEvent e) { TabInfo tabInfo = myTabs.findInfo(e); if (tabInfo == null) return; Content content = getContentFor(tabInfo); if (CloseViewAction.isEnabled(new Content[]{content})) { CloseViewAction.perform(myContext, content); } else if (MinimizeViewAction.isEnabled(myContext, getContents(), ViewContext.CELL_TOOLBAR_PLACE)) { minimize(content); } }
closeOrMinimize
290,690
TabPainterAdapter () { return new DefaultTabPainterAdapter(JBTabPainter.getDEBUGGER()); }
createTabPainterAdapter
290,691
DragHelper (@NotNull JBTabsImpl tabs, @NotNull Disposable parentDisposable) { return new DragHelper(tabs, parentDisposable) { @Override protected boolean canFinishDragging(@NotNull MouseEvent me) { return true; } }; }
createDragHelper
290,692
boolean (@NotNull MouseEvent me) { return true; }
canFinishDragging
290,693
boolean () { return true; }
useSmallLabels
290,694
void (@NotNull TabInfo over, @NotNull RelativePoint point) { ((RunnerContentUi)myContext).myTabs.processDropOver(over, point); }
processDropOver
290,695
Image (@NotNull TabInfo tabInfo, @NotNull RelativePoint point) { return ((RunnerContentUi)myContext).myTabs.startDropOver(tabInfo, point); }
startDropOver
290,696
void (@NotNull TabInfo tabInfo) { ((RunnerContentUi)myContext).myTabs.resetDropOver(tabInfo); }
resetDropOver
290,697
TabLabel (@NotNull TabInfo info) { return new SingleHeightLabel(this, info) { @Override public void setAlignmentToCenter(boolean toCenter) { super.setAlignmentToCenter(false); } }; }
createTabLabel
290,698
void (boolean toCenter) { super.setAlignmentToCenter(false); }
setAlignmentToCenter
290,699
int () { return myIndex; }
getIndex