Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
245,900
void (@NotNull TabInfo info) { PropertyChangeListener listener = (PropertyChangeListener)info.getComponent().getClientProperty(TITLE_LISTENER_KEY); ((IdeFrameImpl)info.getObject()).removePropertyChangeListener("title", listener); }
removeTitleListener
245,901
void () { myIndexes.clear(); for (int i = 0, count = getTabCount(); i < count; i++) { myIndexes.put((IdeFrameImpl)getTabAt(i).getObject(), i); } }
recalculateIndexes
245,902
void (Map<IdeFrameImpl, Integer> indexes) { sortTabs(Comparator.comparingInt(info -> indexes.get(info.getObject()))); recalculateIndexes(); }
reorderTabs
245,903
DefaultActionGroup (@NotNull IdeFrameImpl tabFrame) { DumbAwareAction closeAction = new DumbAwareAction(IdeBundle.message("mac.window.tabs.close.title")) { @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } @Override public void actionPerformed(@NotNull AnActionEvent...
createTabActions
245,904
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
245,905
void (@NotNull AnActionEvent e) { closeTab(tabFrame, (e.getModifiers() & ActionEvent.ALT_MASK) != 0); }
actionPerformed
245,906
void () { DefaultActionGroup group = new DefaultActionGroup(); group.add(new DumbAwareAction(IdeBundle.message("mac.window.tabs.close.tab")) { @Override public void actionPerformed(@NotNull AnActionEvent e) { closeTab(getPopupFrame(e), false); } }); group.add(new DumbAwareAction(IdeBundle.message("mac.window.tabs.close...
createTabActions
245,907
void (@NotNull AnActionEvent e) { closeTab(getPopupFrame(e), false); }
actionPerformed
245,908
void (@NotNull AnActionEvent e) { closeTab(getPopupFrame(e), true); }
actionPerformed
245,909
void (@NotNull AnActionEvent e) { moveTabToNewWindow(getPopupFrame(e)); }
actionPerformed
245,910
void (@NotNull AnActionEvent e) { IdeFrameImpl tabFrame = getPopupFrame(e); Foundation.executeOnMainThread(true, false, () -> { ID window = MacUtil.getWindowFromJavaWindow(tabFrame); ID tabs = Foundation.invoke(window, "tabbedWindows"); int count = Foundation.invoke(tabs, "count").intValue(); for (int i = 0; i < count;...
actionPerformed
245,911
IdeFrameImpl (@NotNull AnActionEvent e) { TabLabel label = (TabLabel)Objects.requireNonNull(e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT)); return (IdeFrameImpl)label.getInfo().getObject(); }
getPopupFrame
245,912
void (@NotNull IdeFrameImpl tabFrame, boolean closeOthers) { Foundation.executeOnMainThread(true, false, () -> { ID window = MacUtil.getWindowFromJavaWindow(tabFrame); Foundation.invoke(window, closeOthers ? "performCloseOtherTabs:" : "performClose:", ID.NIL); }); }
closeTab
245,913
void (@NotNull IdeFrameImpl tabFrame) { Foundation.executeOnMainThread(true, false, () -> { ID window = MacUtil.getWindowFromJavaWindow(tabFrame); ID tabGroup = Foundation.invoke(window, "tabGroup"); Foundation.invoke(tabGroup, "setSelectedWindow:", window); Foundation.invoke(window, "moveTabToNewWindow:", ID.NIL); App...
moveTabToNewWindow
245,914
void (@NotNull IdeFrameImpl tabFrame, @NotNull IdeFrameImpl target) { Foundation.executeOnMainThread(true, false, () -> { ID window = MacUtil.getWindowFromJavaWindow(target); ID tabGroup = Foundation.invoke(window, "tabGroup"); ID tab = MacUtil.getWindowFromJavaWindow(tabFrame); Foundation.invoke(tabGroup, "addWindow:"...
moveTabToWindow
245,915
void (@NotNull TabInfo info) { IdeFrameImpl movedFrame = (IdeFrameImpl)info.getObject(); int newIndex = getIndexOf(info); int oldIndex = myIndexes.get(movedFrame); if (oldIndex != newIndex) { recalculateIndexes(); moveTabToNewIndex(movedFrame, newIndex); } }
moveTabToNewIndex
245,916
void (@NotNull IdeFrameImpl movedFrame, int newIndex) { for (int i = 0, count = getTabCount(); i < count; i++) { IdeFrameImpl tabFrame = (IdeFrameImpl)getTabAt(i).getObject(); if (tabFrame != myNativeWindow) { WindowTabsComponent tabsComponent = Objects.requireNonNull(MacWinTabsHandlerV2.getTabsComponent(MacWinTabsHand...
moveTabToNewIndex
245,917
void (@NotNull TabInfo info, boolean movedFromOut) { IdeFrameImpl movedFrame = (IdeFrameImpl)info.getObject(); int newIndex = getDropInfoIndex(); assert newIndex != -1 : "Wrong Reordering"; if (movedFromOut) { Foundation.executeOnMainThread(true, false, () -> { ID window = MacUtil.getWindowFromJavaWindow(myNativeWindow...
moveTabToNewIndexOrWindow
245,918
void (@NotNull TabInfo info) { info.setDragOutDelegate(new TabInfo.DragOutDelegate() { private DragSession mySession; @Override public void dragOutStarted(@NotNull MouseEvent mouseEvent, @NotNull TabInfo info) { WindowFrameDockableContent content = new WindowFrameDockableContent(WindowTabsComponent.this, info, getInfoT...
installTabDnd
245,919
void (@NotNull MouseEvent mouseEvent, @NotNull TabInfo info) { WindowFrameDockableContent content = new WindowFrameDockableContent(WindowTabsComponent.this, info, getInfoToLabel().get(info)); info.setHidden(true); DockManagerImpl manager = getDockManager(); updateDockContainers(manager); mySession = manager.createDragS...
dragOutStarted
245,920
void (@NotNull MouseEvent event, @NotNull TabInfo source) { mySession.process(event); }
processDragOut
245,921
void (@NotNull MouseEvent event, TabInfo source) { mySession.process(event); mySession = null; }
dragOutFinished
245,922
void (TabInfo source) { mySession.cancel(); mySession = null; source.setHidden(false); if (getIndexOf(source) != -1) { moveTabToNewIndex(source); } }
dragOutCancelled
245,923
void (@NotNull MouseEvent mouseEvent) { WindowTabsComponent.this.setComponentZOrder(getTabLabel(info), 0); }
dragStarted
245,924
void () { WindowTabsComponent.this.setComponentZOrder(getTabLabel(getSelectedInfo()), 0); }
dragFinishedOrCanceled
245,925
void (@NotNull DockManagerImpl manager) { for (DockContainer _container : manager.getContainers()) { if (_container instanceof TabsDockContainer container) { container.checkEnabled(); } } }
updateDockContainers
245,926
DockManagerImpl () { if (myDockManager == null) { Project project = ProjectManager.getInstance().getDefaultProject(); //noinspection deprecation myDockManager = new DockManagerImpl(project, project.getCoroutineScope()); } return myDockManager; }
getDockManager
245,927
void () { setTabDraggingEnabled(true); addListener(new TabsListener() { @Override public void tabsMoved() { moveTabToNewIndex(getDragHelper().getDragSource()); } }); getDockManager().register(new TabsDockContainer(), myParentDisposable); }
installDnD
245,928
void () { moveTabToNewIndex(getDragHelper().getDragSource()); }
tabsMoved
245,929
void (@NotNull IdeFrameImpl frame, @NotNull CoroutineScope coroutineScope) { getDockManager().register(new DockContainer() { private Disposable myPaintDisposable; private AbstractPainter myDropPainter; @Override public @NotNull RelativeRectangle getAcceptArea() { return new RelativeRectangle(frame.getComponent()); } @O...
registerFrameDockContainer
245,930
RelativeRectangle () { return new RelativeRectangle(frame.getComponent()); }
getAcceptArea
245,931
ContentResponse (@NotNull DockableContent<?> _content, RelativePoint point) { return _content instanceof WindowFrameDockableContent content && !content.isInFullScreen() && MacWinTabsHandlerV2.isTabsNotVisible(frame) && !frame.isInFullScreen() ? ContentResponse.ACCEPT_MOVE : ContentResponse.DENY; }
getContentResponse
245,932
JComponent () { return frame.getComponent(); }
getContainerComponent
245,933
void (@NotNull DockableContent<?> content) { Disposer.dispose(myPaintDisposable); myPaintDisposable = null; myDropPainter = null; }
resetDropOver
245,934
void (@NotNull DockableContent<?> content, @Nullable RelativePoint dropTarget) { moveTabToWindow(((WindowFrameDockableContent)content).getKey(), frame); }
add
245,935
boolean () { return false; }
isEmpty
245,936
boolean () { return false; }
isDisposeWhenEmpty
245,937
RelativeRectangle () { return new RelativeRectangle(WindowTabsComponent.this); }
getAcceptArea
245,938
ContentResponse (@NotNull DockableContent<?> content, RelativePoint point) { return enabled && content instanceof WindowFrameDockableContent ? ContentResponse.ACCEPT_MOVE : ContentResponse.DENY; }
getContentResponse
245,939
JComponent () { return WindowTabsComponent.this; }
getContainerComponent
245,940
void (@NotNull DockableContent<?> content) { WindowTabsComponent.this.resetDropOver(myDropTab); myDropTab = null; myDropImage = null; }
resetDropOver
245,941
void (@NotNull DockableContent<?> _content, @Nullable RelativePoint dropTarget) { WindowFrameDockableContent content = (WindowFrameDockableContent)_content; moveTabToNewIndexOrWindow(content.myInfo, !isSameGroup(content.myTabsComponent)); }
add
245,942
boolean () { return false; }
isEmpty
245,943
boolean () { return false; }
isDisposeWhenEmpty
245,944
IdeFrameImpl () { return (IdeFrameImpl)myInfo.getObject(); }
getKey
245,945
boolean () { return getKey().isInFullScreen() || myTabsComponent.myNativeWindow.isInFullScreen(); }
isInFullScreen
245,946
Image () { return myImage; }
getPreviewImage
245,947
String () { return null; }
getDockContainerType
245,948
Dimension () { return mySize; }
getPreferredSize
245,949
void () { }
close
245,950
Presentation () { return myPresentation; }
getPresentation
245,951
void (@Nullable RelativePoint dropTarget) { moveTabToNewWindow(getKey()); }
add
245,952
boolean () { return true; }
needsRepaint
245,953
void (Component component, Graphics2D g) { GraphicsUtil.setupAAPainting(g); g.setColor(JBUI.CurrentTheme.DragAndDrop.Area.BACKGROUND); g.fill(myArea); }
executePaint
245,954
String () { return myItems + "_" + myNativePeer; }
toString
245,955
ID (@NotNull String uid) { // called from AppKit (when NSTouchBarDelegate create items) final long startNs = myStats != null ? System.nanoTime() : 0; final ID result = createItemImpl(uid); if (myStats != null) { myStats.incrementCounter(StatsCounters.itemsCreationDurationNs, System.nanoTime() - startNs); } return resul...
createItem
245,956
ID (@NotNull String uid) { final TBItem item; if (myCustomEsc != null && uid.equals(myCustomEsc.getUid())) { item = myCustomEsc; } else { item = myItems.findItem(uid); } if (item == null) { if (LOG.isDebugEnabled()) { // Theoretically possible when: // (1) EDT expand ActionGroup and call selectVisibleItemsToShow (that ...
createItemImpl
245,957
TBItemAnActionButton (@NotNull AnAction action) { TouchBarStats.AnActionStats stats; if (myStats == null) { stats = null; } else { stats = myStats.getActionStats(Helpers.getActionId(action)); } return new TBItemAnActionButton(myItemListener, action, stats); }
createActionButton
245,958
ID () { return ID.NIL; }
_createNativePeer
245,959
TBPanel (@NotNull ListPopupImpl listPopup) { final TBPanel result = new TBPanel("popup_scrubber_bar_" + listPopup.hashCode(), new TBPanel.CrossEscInfo(true, false), false); final ModalityState ms = LaterInvocator.getCurrentModalityState(); final TBItemScrubber scrub = result.addScrubber(); final @NotNull ListPopupStep<...
createScrubberBarFromPopup
245,960
void (ListDataEvent e) {}
intervalAdded
245,961
void (ListDataEvent e) {}
intervalRemoved
245,962
void (ListDataEvent e) { final List<Integer> visibleIndices = new ArrayList<>(); for (int c = 0; c < model.getSize(); ++c) { final Object visibleItem = model.getElementAt(c); final Integer itemId = obj2index.get(visibleItem); if (itemId != null) { visibleIndices.add(itemId); } } scrub.showItems(visibleIndices, true, tr...
contentsChanged
245,963
boolean () { return SystemInfoRt.isMac; }
isSupportedOS
245,964
void () { try { loadLibraryImpl(); } catch (Throwable e) { LOG.error("Failed to load nst library for touchbar: ", e); } if (nstLibrary != null) { // small check that loaded library works try { final ID test = nstLibrary.createTouchBar("test", (uid) -> ID.NIL, null); if (test == null || test.equals(ID.NIL)) { LOG.error(...
loadLibrary
245,965
NSTLibrary () { Path lib = PathManager.findBinFile("libnst64.dylib"); assert lib != null : "NST lib missing; bin=" + Arrays.toString(new File(PathManager.getBinPath()).list()); return nstLibrary = Native.load(lib.toString(), NSTLibrary.class, Collections.singletonMap("jna.encoding", "UTF8")); }
loadLibraryImpl
245,966
boolean () { return nstLibrary != null; }
isAvailable
245,967
ID (String name, NSTLibrary.ItemCreator creator, String escID) { return nstLibrary.createTouchBar(name, creator, escID); // creates autorelease-pool internally }
createTouchBar
245,968
void (ID nativePeer) { nstLibrary.releaseNativePeer(nativePeer); }
releaseNativePeer
245,969
void (@Nullable Window window, ID touchBarNativePeer) { long nsViewPtr = 0; if (window != null) { final ComponentPeer peer = AWTAccessor.getComponentAccessor().getPeer(window); // sun.lwawt.* isn't available outside of java.desktop => use reflection if (peer != null && peer.getClass().getName().equals("sun.lwawt.LWWind...
setTouchBar
245,970
void (ID tbObj, String[] ids, int count) { nstLibrary.selectItemsToShow(tbObj, ids, count); // creates autorelease-pool internally }
selectItemsToShow
245,971
void (ID tbObj, String uid) { nstLibrary.setPrincipal(tbObj, uid); // creates autorelease-pool internally }
setPrincipal
245,972
ID (String uid, int buttWidth, int buttFlags, String text, String hint, int isHintDisabled, @Nullable Pair<Pointer, Dimension> raster, NSTLibrary.Action action) { return nstLibrary.createButton( uid, buttWidth, buttFlags, text, hint, isHintDisabled, raster == null ? null : raster.getFirst(), raster == null ? 0 : raster...
createButton
245,973
ID ( String uid, int itemWidth, NSTLibrary.ScrubberDelegate delegate, NSTLibrary.ScrubberCacheUpdater updater, @NotNull List<TBItemScrubber.ItemData> items, int visibleItems, @Nullable TouchBarStats stats ) { final Pair<Pointer, Integer> mem = _packItems(items, visibleItems, false, true); return nstLibrary.createScrubb...
createScrubber
245,974
ID (String uid, ID[] items) { return nstLibrary.createGroupItem(uid, items == null || items.length == 0 ? null : items, items == null ? 0 : items.length); // called from AppKit, uses per-event autorelease-pool }
createGroupItem
245,975
void (ID buttonObj, int updateOptions, int buttWidth, int buttonFlags, String text, String hint, int isHintDisabled, @Nullable Pair<Pointer, Dimension> raster, NSTLibrary.Action action) { nstLibrary.updateButton( buttonObj, updateOptions, buttWidth, buttonFlags, text, hint, isHintDisabled, raster == null ? null : raste...
updateButton
245,976
void (ID buttObj, @Nullable Icon arrow) { final BufferedImage img = _getImg4ByteRGBA(arrow); final Pointer raster4ByteRGBA = _getRaster(img); final int w = _getImgW(img); final int h = _getImgH(img); nstLibrary.setArrowImage(buttObj, raster4ByteRGBA, w, h); // creates autorelease-pool internally }
setArrowImage
245,977
Pointer (Collection<Integer> indices) { if (indices == null || indices.isEmpty()) { return null; } final int step = Native.getNativeSize(Integer.class); final Pointer mem = new Pointer(Native.malloc((long)indices.size() * step)); int offset = 0; for (Integer i : indices) { mem.setInt(offset, i); offset += step; } retur...
_makeIndices
245,978
void ( TBItemScrubber scrubber, int fromIndex, int itemsCount, boolean withImages, boolean withText ) { final long startNs = withImages && scrubber.getStats() != null ? System.nanoTime() : 0; @NotNull List<TBItemScrubber.ItemData> items = scrubber.getItems(); final Pair<Pointer, Integer> mem = _packItems(items.subList(...
updateScrubberItems
245,979
void (ID scrubObj, Collection<Integer> indices, boolean enabled) { if (indices == null || indices.isEmpty() || scrubObj == ID.NIL || scrubObj == null) { return; } final Pointer mem = _makeIndices(indices); nstLibrary.enableScrubberItems(scrubObj, mem, indices.size(), enabled); }
enableScrubberItems
245,980
void (ID scrubObj, Collection<Integer> indices, boolean show, boolean inverseOthers) { if (scrubObj == ID.NIL || scrubObj == null) { return; } final Pointer mem = _makeIndices(indices); nstLibrary.showScrubberItems(scrubObj, mem, indices == null ? 0 : indices.size(), show, inverseOthers); }
showScrubberItem
245,981
Pointer (BufferedImage img) { if (img == null) { return null; } final DataBuffer db = img.getRaster().getDataBuffer(); DirectDataBufferInt dbb = (DirectDataBufferInt)db; return dbb.myMemory; }
_getRaster
245,982
int (BufferedImage img) { return img == null ? 0 : img.getWidth(); }
_getImgW
245,983
int (BufferedImage img) { return img == null ? 0 : img.getHeight(); }
_getImgH
245,984
BufferedImage (Icon icon, float scale) { if (icon == null || icon.getIconHeight() <= 0 || icon.getIconWidth() <= 0) { return null; } final int w = Math.round(icon.getIconWidth() * scale); final int h = Math.round(icon.getIconHeight() * scale); final int memLength = w * h * 4; Pointer memory = new Memory(memLength); ret...
_getImg4ByteRGBA
245,985
float (@NotNull Icon icon) { // according to https://developer.apple.com/macos/human-interface-guidelines/touch-bar/touch-bar-icons-and-images/ // icons, generally should not exceed 44px in height (36px for circular icons) // Ideal icon size 36px X 36px (18pt X 18pt @2x) // Maximum icon size 44px X 44px (22pt X 22pt @2...
getIconScaleForTouchbar
245,986
BufferedImage (@Nullable Icon icon) { if (icon == null || icon.getIconHeight() <= 0 || icon.getIconWidth() <= 0) { return null; } final float fMulX = getIconScaleForTouchbar(icon); return _getImg4ByteRGBA(icon, fMulX); }
_getImg4ByteRGBA
245,987
BufferedImage (@NotNull Icon icon, float scale, @NotNull Pointer memory, int offset) { int w = Math.round(icon.getIconWidth() * scale); int h = Math.round(icon.getIconHeight() * scale); int rasterSizeInBytes = w * h * 4; memory.setMemory(offset, rasterSizeInBytes, (byte)0); DataBuffer dataBuffer = new DirectDataBufferI...
_drawIconIntoMemory
245,988
int (int bank, int i) { return myMemory.getInt(myOffset + i * 4L); // same as: *((jint *)((char *)Pointer + offset)) }
getElem
245,989
void (int bank, int i, int val) { myMemory.setInt(myOffset + i * 4L, val); // same as: *((jint *)((char *)Pointer + offset)) = value }
setElem
245,990
String () { return myUid == null ? String.format("%s [null-uid]", myName) : myUid; }
toString
245,991
ID () { // called from AppKit (when NSTouchBarDelegate create items) if (myNativePeer == ID.NIL) myNativePeer = _createNativePeer(); return myNativePeer; }
createNativePeer
245,992
String () { return myName; }
toString
245,993
String (String desc) { return String.format("%s.%s.%d", myName, desc, myCounter++); }
_genNewID
245,994
void (@NotNull AnActionEvent e) { if (myAction == null || myIsActionDisabled) { Helpers.emulateKeyPress(KeyEvent.VK_F1 + myFN - 1); return; } myAction.actionPerformed(e); }
actionPerformed
245,995
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(true); // FN-keys are always enabled and visible e.getPresentation().setText(""); myIsActionDisabled = false; myAction = null; final String[] ids = getActionsIds(TouchBarsManager.getLastModifiersEx()); if (ids == null || ids.length < 1) { return...
update
245,996
ActionUpdateThread () { return myAction == null ? ActionUpdateThread.BGT : myAction.getActionUpdateThread(); }
getActionUpdateThread
245,997
void () { // 1. load default touchbar actions for all opened projects for (Project project : ProjectUtil.getOpenProjects()) { registerTouchbarActions(project); } // 2. listen for projects ourConnection = ApplicationManager.getApplication().getMessageBus().simpleConnect(); ourConnection.subscribe(ProjectManager.TOPIC, n...
initialize
245,998
void (@NotNull Project project) { registerTouchbarActions(project); }
projectOpened
245,999
void (@NotNull Project project) { LOG.debug("closed project: %s", project); final JFrame frame = WindowManager.getInstance().getFrame(project); if (frame == null) { // can be when frame is closing (and project is disposing) LOG.debug("null frame for project: %s", project); return; } TouchBarsManager.unregister(frame); ...
projectClosed