Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
280,700
void (@NotNull Point p) { myUserBounds.setLocation(p); myUserLocationSet = true; myPeer.setLocation(p); }
setLocation
280,701
void (int x, int y) { myUserBounds.setLocation(x, y); myUserLocationSet = true; myPeer.setLocation(x, y); }
setLocation
280,702
void (Rectangle rect) { Rectangle before = null; if (LOG.isDebugEnabled()) { before = new Rectangle(rect); } ScreenUtil.fitToScreen(rect); if (LOG.isDebugEnabled() && !Objects.equals(before, rect)) { LOG.debug("Fitted these bounds to the screen: " + before + " -> " + rect); } }
fitToScreen
280,703
void () { myPeer.centerInParent(); }
centerRelativeToParent
280,704
void () { if (LoadingState.APP_STARTED.isOccurred()) { logShowDialogEvent(); } doShow(); }
show
280,705
boolean () { if (!isModal()) { throw new IllegalStateException("The showAndGet() method is for modal dialogs only"); } show(); return isOK(); }
showAndGet
280,706
AsyncResult<Boolean> () { if (isModal()) { throw new IllegalStateException("The showAndGetOk() method is for modeless dialogs only"); } AsyncResult<Boolean> result = new AsyncResult<>(); Disposer.register(myDisposable, () -> result.setDone(isOK())); doShow(); return result; }
showAndGetOk
280,707
void () { if (UiInterceptors.tryIntercept(this)) { return; } ensureEventDispatchThread(); registerKeyboardShortcuts(); Disposable uiParent = ClientDisposableProvider.getCurrentDisposable(); // may be null if no app yet (license agreement) if (uiParent != null) { // ensure everything is disposed on app quit Disposer.register(uiParent, myDisposable); } Window window = myPeer.getWindow(); if (window != null) { ClientProperty.put(window, KEEP_POPUPS_OPEN, myKeepPopupsOpen); } myPeer.show(); }
doShow
280,708
void (@NotNull Computable<? extends Point> callback) { myInitialLocationCallback = callback; }
setInitialLocationCallback
280,709
void () { }
beforeShowCallback
280,710
void () { JRootPane rootPane = getRootPane(); if (rootPane == null) return; ActionListener cancelKeyboardAction = createCancelAction(); if (cancelKeyboardAction != null) { rootPane.registerKeyboardAction(cancelKeyboardAction, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), WHEN_IN_FOCUSED_WINDOW); ActionUtil.registerForEveryKeyboardShortcut(getRootPane(), cancelKeyboardAction, CommonShortcuts.getCloseActiveWindow()); } if (!(isRemoveHelpButton() || isProgressDialog())) { ActionListener helpAction = e -> doHelpAction(); ActionUtil.registerForEveryKeyboardShortcut(getRootPane(), helpAction, CommonShortcuts.getContextHelp()); rootPane.registerKeyboardAction(helpAction, KeyStroke.getKeyStroke(KeyEvent.VK_HELP, 0), WHEN_IN_FOCUSED_WINDOW); } rootPane.registerKeyboardAction(e -> focusButton(false), KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); rootPane.registerKeyboardAction(e -> focusButton(true), KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); if (myYesAction != null) { rootPane.registerKeyboardAction(myYesAction, KeyStroke.getKeyStroke(KeyEvent.VK_Y, 0), WHEN_IN_FOCUSED_WINDOW); } if (myNoAction != null) { rootPane.registerKeyboardAction(myNoAction, KeyStroke.getKeyStroke(KeyEvent.VK_N, 0), WHEN_IN_FOCUSED_WINDOW); } }
registerKeyboardShortcuts
280,711
void (boolean next) { List<JButton> buttons = new ArrayList<>(myButtonMap.values()); int focusedIndex = ContainerUtil.indexOf(buttons, (Condition<? super Component>)Component::hasFocus); if (focusedIndex >= 0) { getEnabledIndexCyclic(buttons, focusedIndex, next).ifPresent(i -> buttons.get(i).requestFocus()); } }
focusButton
280,712
OptionalInt (@NotNull List<? extends Component> components, int currentIndex, boolean next) { assert -1 <= currentIndex && currentIndex <= components.size(); int start = !next && currentIndex == -1 ? components.size() : currentIndex; return IntStream.range(0, components.size()) .map(i -> (next ? start + i + 1 : start + components.size() - i - 1) % components.size()) .filter(i -> components.get(i).isEnabled()) .findFirst(); }
getEnabledIndexCyclic
280,713
void (int exitCode) { boolean canRecord = canRecordDialogId(); if (canRecord) { FeatureUsageUiEventsKt.getUiEventLogger().logCloseDialog(getClass(), exitCode); } }
logCloseDialogEvent
280,714
void () { boolean canRecord = canRecordDialogId(); if (canRecord) { FeatureUsageUiEventsKt.getUiEventLogger().logShowDialog(getClass()); } }
logShowDialogEvent
280,715
void () { if (!canRecordDialogId()) return; FeatureUsageUiEventsKt.getUiEventLogger().logClickOnHelpDialog(getClass()); }
logClickOnHelpDialogEvent
280,716
boolean () { return true; }
canRecordDialogId
280,717
void (ActionEvent e) { if (myClosed) return; if (myPerformAction) return; myPerformAction = true; try (AccessToken ignore = SlowOperations.startSection(SlowOperations.ACTION_PERFORM)) { doAction(e); } finally { myPerformAction = false; } }
actionPerformed
280,718
void (ActionEvent e) { recordAction("DialogOkAction", EventQueue.getCurrentEvent()); List<ValidationInfo> infoList = doValidateAll(); if (!infoList.isEmpty()) { ValidationInfo info = infoList.get(0); if (info.component != null && info.component.isVisible()) { IdeFocusManager.getInstance(null).requestFocus(info.component, true); } updateErrorInfo(infoList); startTrackingValidation(); for (ValidationInfo t : infoList) { if (!t.okEnabled) { return; } } } doOKAction(); }
doAction
280,719
void (String name, AWTEvent event) { if (event instanceof KeyEvent && ApplicationManager.getApplication() != null && LoadingState.COMPONENTS_REGISTERED.isOccurred()) { // noinspection removal ActionsCollector.getInstance().record(name, (KeyEvent)event, getClass()); } }
recordAction
280,720
void (ActionEvent e) { doCancelAction(e); }
doAction
280,721
void (ActionEvent e) { if (isEnabled()) { close(myExitCode); } }
doAction
280,722
void (ActionEvent e) { myHelpActionPerformed.run(); }
actionPerformed
280,723
void (@NlsContexts.DialogMessage @Nullable String text) { setErrorText(text, null); }
setErrorText
280,724
void (@Nullable HtmlChunk errorHtml) { setErrorInfoAll(errorHtml == null ? List.of() : List.of(new ValidationInfo(errorHtml, null))); }
setErrorHtml
280,725
void (@Nullable HtmlChunk errorHtml, @Nullable JComponent component) { setErrorInfoAll(errorHtml == null ? List.of() : List.of(new ValidationInfo(errorHtml, component))); }
setErrorHtml
280,726
void (@NlsContexts.DialogMessage @Nullable String text, @Nullable JComponent component) { setErrorInfoAll(text == null ? List.of() : List.of(new ValidationInfo(text, component))); }
setErrorText
280,727
void (@NotNull List<ValidationInfo> info) { if (myInfo.equals(info)) return; updateErrorText(info); updateComponentErrors(info); myInfo = info; }
setErrorInfoAll
280,728
void (@NotNull List<ValidationInfo> info) { // clear current component errors myInfo.stream() .filter(vi -> !info.contains(vi)) .filter(vi -> vi.component != null) .map(vi -> ComponentValidator.getInstance(vi.component)) .forEach(c -> c.ifPresent(vi -> vi.updateInfo(null))); // show current errors for (ValidationInfo vi : info) { JComponent component = vi.component; if (component == null) continue; ComponentValidator validator = ComponentValidator.getInstance(component) .orElseGet(() -> new ComponentValidator(getDisposable()).installOn(component)); validator.updateInfo(vi); } }
updateComponentErrors
280,729
void (@NotNull List<ValidationInfo> infos) { //init was not called - there's nothing to update ErrorText errorText = myErrorText; if (errorText == null) return; Runnable updateRunnable = () -> { if (!myDisposed) doUpdateErrorText(errorText, infos); }; Application application = ApplicationManager.getApplication(); boolean headless = application != null && application.isHeadlessEnvironment(); if (headless) { updateRunnable.run(); } else { SwingUtilities.invokeLater(updateRunnable); } }
updateErrorText
280,730
void (@NotNull ErrorText errorText, @NotNull List<ValidationInfo> infos) { HtmlBuilder htmlBuilder = new HtmlBuilder(); for (ValidationInfo info : infos) { if (info.component != null || Strings.isEmptyOrSpaces(info.message)) { continue; } Color color = info.warning ? MessageType.WARNING.getTitleForeground() : NamedColorUtil.getErrorForeground(); htmlBuilder .append( HtmlChunk.raw(info.message) .wrapWith("left") .wrapWith(HtmlChunk.font(ColorUtil.toHex(color))) ) .br(); } // avoid updating size unnecessarily boolean needsSizeUpdate = true; if (htmlBuilder.isEmpty()) { needsSizeUpdate = errorText.clear(); } else { errorText.setText(htmlBuilder.wrapWithHtmlBody().toString()); } if (needsSizeUpdate) updateSize(); }
doUpdateErrorText
280,731
boolean (@NotNull JComponent component) { return ContainerUtil.exists(myInfo, i -> component.equals(i.component) && !i.warning); }
hasErrors
280,732
void () { if (myActualSize == null && !myErrorText.isVisible()) { myActualSize = getSize(); } }
updateSize
280,733
void (@NotNull @Nls String errorText) { myLabel.setText(errorText); setVisible(true); }
setText
280,734
boolean () { boolean isCurrentlyVisible = isVisible(); myLabel.setBounds(0, 0, 0, 0); myLabel.setText(""); setVisible(false); return isCurrentlyVisible; }
clear
280,735
Border (@Nullable Border contentBorder) { Insets contentInsets = contentBorder != null ? contentBorder.getBorderInsets(null) : JBInsets.emptyInsets(); Insets baseInsets = JBInsets.create(16, 13); //noinspection UseDPIAwareBorders: Insets are already scaled, so use raw version. return new EmptyBorder(baseInsets.top, baseInsets.left > contentInsets.left ? baseInsets.left - contentInsets.left : 0, baseInsets.bottom > contentInsets.bottom ? baseInsets.bottom - contentInsets.bottom : 0, baseInsets.right > contentInsets.right ? baseInsets.right - contentInsets.right : 0); }
createErrorTextBorder
280,736
DialogWrapperPeer () { return myPeer; }
getPeer
280,737
void () { if (!EventQueue.isDispatchThread()) { throw new IllegalStateException("The DialogWrapper can only be used in event dispatch thread. Current thread: "+Thread.currentThread()); } }
ensureEventDispatchThread
280,738
Disposable () { return myDisposable; }
getDisposable
280,739
boolean () { return myDisposed; }
isDisposed
280,740
void () { if (isDisposed()) return; Disposer.dispose(getDisposable()); }
disposeIfNeeded
280,741
void (@Nullable Object object, @NotNull Condition<? super Field> selectCondition) { if (object == null) return; for (Field each : ReflectionUtil.collectFields(object.getClass())) { if ((each.getModifiers() & (Modifier.FINAL | Modifier.STATIC)) > 0) continue; if (!selectCondition.value(each)) continue; try { ReflectionUtil.resetField(object, each); } catch (Exception ignore) { } } }
clearOwnFields
280,742
Color () { Color bg = UIManager.getColor("DialogWrapper.southPanelBackground"); if (myStyle == DialogStyle.COMPACT && bg != null) { return bg; } return super.getBackground(); }
getBackground
280,743
String (String message) { throw new RuntimeException(message); }
show
280,744
String (String message) { return ""; }
show
280,745
Dimension () { return getPreferredSize(); }
getMinimumSize
280,746
Dimension () { return getPreferredSize(); }
getMaximumSize
280,747
Dimension () { if (mySize != -1) { return new Dimension(mySize, mySize); } Dimension d = super.getPreferredSize(); int base = new JTextField().getPreferredSize().height; if (base %2 == 1) base++; d.width = Math.max(d.height, base); int width = mySize == -1 ? d.width : mySize; int height = myComponent != null ? myComponent.getPreferredSize().height : mySize != -1 ? mySize : base; return new Dimension(width, height); }
getPreferredSize
280,748
void (JComponent component) { myComponent = component; }
setAttachedComponent
280,749
JComponent () { return myComponent; }
getAttachedComponent
280,750
void (int size) { mySize = size; }
setSize
280,751
boolean () { return false; }
isChooseMultiple
280,752
void (@Nullable Project project) { myProject = project; }
setProject
280,753
void () { FileChooserDescriptor fileChooserDescriptor = myFileChooserDescriptor; if (myTitle != null || myDescription != null) { fileChooserDescriptor = (FileChooserDescriptor)myFileChooserDescriptor.clone(); if (myTitle != null) { fileChooserDescriptor.setTitle(myTitle); } if (myDescription != null) { fileChooserDescriptor.setDescription(myDescription); } } FileChooser.chooseFile(fileChooserDescriptor, getProject(), myTextComponent, getInitialFile(), this::onFileChosen); }
run
280,754
String () { return myAccessor.getText(myTextComponent).trim(); }
getComponentText
280,755
void (@NotNull VirtualFile chosenFile) { myAccessor.setText(myTextComponent, chosenFileToResultingText(chosenFile)); }
onFileChosen
280,756
String ( JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR) { String s = layoutCompoundLabel( label, fontMetrics, splitStringByLines(text), icon, label.getVerticalAlignment(), label.getHorizontalAlignment(), label.getVerticalTextPosition(), label.getHorizontalTextPosition(), viewR, iconR, textR, label.getIconTextGap()); if ("".equals(s)) return text; return s; }
layoutCL
280,757
String (JComponent c, FontMetrics fm, String[] text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) { boolean orientationIsLeftToRight = true; if (c != null) { if (!(c.getComponentOrientation().isLeftToRight())) { orientationIsLeftToRight = false; } } // Translate LEADING/TRAILING values in horizontalAlignment // to LEFT/RIGHT values depending on the components orientation int hAlign = switch (horizontalAlignment) { case LEADING -> (orientationIsLeftToRight) ? LEFT : RIGHT; case TRAILING -> (orientationIsLeftToRight) ? RIGHT : LEFT; default -> horizontalAlignment; }; // Translate LEADING/TRAILING values in horizontalTextPosition // to LEFT/RIGHT values depending on the components orientation int hTextPos = switch (horizontalTextPosition) { case LEADING -> (orientationIsLeftToRight) ? LEFT : RIGHT; case TRAILING -> (orientationIsLeftToRight) ? RIGHT : LEFT; default -> horizontalTextPosition; }; return layoutCompoundLabel(fm, text, icon, verticalAlignment, hAlign, verticalTextPosition, hTextPos, viewR, iconR, textR, textIconGap); }
layoutCompoundLabel
280,758
String ( FontMetrics fm, String[] text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap) { /* Initialize the icon bounds rectangle iconR. */ if (icon != null) { iconR.width = icon.getIconWidth(); iconR.height = icon.getIconHeight(); } else { iconR.width = iconR.height = 0; } /* Initialize the text bounds rectangle textR. If a null * or and empty String was specified we substitute "" here * and use 0,0,0,0 for textR. */ // Fix for textIsEmpty sent by Paulo Santos boolean textIsEmpty = (text == null) || (text.length == 0) || (text.length == 1 && ((text[0] == null) || text[0].isEmpty())); String rettext = ""; if (textIsEmpty) { textR.width = textR.height = 0; } else { Dimension dim = computeMultiLineDimension(fm, text); textR.width = dim.width; textR.height = dim.height; } /* Unless both text and icon are non-null, we effectively ignore * the value of textIconGap. The code that follows uses the * value of gap instead of textIconGap. */ int gap = (textIsEmpty || (icon == null)) ? 0 : textIconGap; if (!textIsEmpty) { /* If the label text string is too wide to fit within the available * space "..." and as many characters as will fit will be * displayed instead. */ int availTextWidth; if (horizontalTextPosition == CENTER) { availTextWidth = viewR.width; } else { availTextWidth = viewR.width - (iconR.width + gap); } if (textR.width > availTextWidth && text.length == 1) { String clipString = "..."; int totalWidth = SwingUtilities.computeStringWidth(fm, clipString); int nChars; for (nChars = 0; nChars < text[0].length(); nChars++) { totalWidth += fm.charWidth(text[0].charAt(nChars)); if (totalWidth > availTextWidth) { break; } } rettext = text[0].substring(0, nChars) + clipString; textR.width = SwingUtilities.computeStringWidth(fm, rettext); } } /* Compute textR.x,y given the verticalTextPosition and * horizontalTextPosition properties */ if (verticalTextPosition == TOP) { if (horizontalTextPosition != CENTER) { textR.y = 0; } else { textR.y = -(textR.height + gap); } } else if (verticalTextPosition == CENTER) { textR.y = (iconR.height / 2) - (textR.height / 2); } else { // (verticalTextPosition == BOTTOM) if (horizontalTextPosition != CENTER) { textR.y = iconR.height - textR.height; } else { textR.y = (iconR.height + gap); } } if (horizontalTextPosition == LEFT) { textR.x = -(textR.width + gap); } else if (horizontalTextPosition == CENTER) { textR.x = (iconR.width / 2) - (textR.width / 2); } else { // (horizontalTextPosition == RIGHT) textR.x = (iconR.width + gap); } /* labelR is the rectangle that contains iconR and textR. * Move it to its proper position given the labelAlignment * properties. * * To avoid actually allocating a Rectangle, Rectangle.union * has been inlined below. */ int labelR_x = Math.min(iconR.x, textR.x); int labelR_width = Math.max(iconR.x + iconR.width, textR.x + textR.width) - labelR_x; int labelR_y = Math.min(iconR.y, textR.y); int labelR_height = Math.max(iconR.y + iconR.height, textR.y + textR.height) - labelR_y; int dx, dy; if (verticalAlignment == TOP) { dy = viewR.y - labelR_y; } else if (verticalAlignment == CENTER) { dy = (viewR.y + (viewR.height / 2)) - (labelR_y + (labelR_height / 2)); } else { // (verticalAlignment == BOTTOM) dy = (viewR.y + viewR.height) - (labelR_y + labelR_height); } if (horizontalAlignment == LEFT) { dx = viewR.x - labelR_x; } else if (horizontalAlignment == RIGHT) { dx = (viewR.x + viewR.width) - (labelR_x + labelR_width); } else { // (horizontalAlignment == CENTER) dx = (viewR.x + (viewR.width / 2)) - (labelR_x + (labelR_width / 2)); } /* Translate textR and glypyR by dx,dy. */ textR.x += dx; textR.y += dy; iconR.x += dx; iconR.y += dy; return rettext; }
layoutCompoundLabel
280,759
void (JLabel l, Graphics g, String s, int textX, int textY) { int accChar = l.getDisplayedMnemonic(); g.setColor(l.getForeground()); drawString(g, s, accChar, textX, textY); }
paintEnabledText
280,760
void (JLabel l, Graphics g, String s, int textX, int textY) { int accChar = l.getDisplayedMnemonic(); g.setColor(l.getBackground()); drawString(g, s, accChar, textX, textY); }
paintDisabledText
280,761
void (Graphics g, String s, int accChar, int textX, int textY) { UISettings.setupAntialiasing(g); if (s.indexOf('\n') == -1) BasicGraphicsUtils.drawString(g, s, accChar, textX, textY); else { String[] strs = splitStringByLines(s); int height = g.getFontMetrics().getHeight(); // Only the first line can have the accel char BasicGraphicsUtils.drawString(g, strs[0], accChar, textX, textY); for (int i = 1; i < strs.length; i++) { g.drawString(strs[i], textX, textY + (height * i)); } } }
drawString
280,762
Dimension (FontMetrics fm, @Nls String [] strs) { int width = 0; for (@Nls String str : strs) { width = Math.max(width, SwingUtilities.computeStringWidth(fm, str)); } return new Dimension(width, fm.getHeight() * strs.length); }
computeMultiLineDimension
280,763
String[] (String str) { if (str == null) return ArrayUtilRt.EMPTY_STRING_ARRAY; if (str.equals(myString)) { return myLines; } myString = convertTabs(str, 2); myLines = StringUtil.splitByLines(myString, false); return myLines; }
splitStringByLines
280,764
String (@Nls String text, final int tabLength) { @Nls StringBuilder buf = new StringBuilder(text.length()); for (int idx = 0; idx < text.length(); idx++) { char ch = text.charAt(idx); if (ch == '\t') { for (int i = 0; i < tabLength; i++) buf.append(' '); } else { buf.append(ch); } } return buf.toString(); }
convertTabs
280,765
boolean () { return myNeedsRepaint; }
needsRepaint
280,766
void (boolean needsRepaint) { setNeedsRepaint(needsRepaint, null); }
setNeedsRepaint
280,767
void (boolean needsRepaint, @Nullable JComponent dirtyComponent) { myNeedsRepaint = needsRepaint; if (myNeedsRepaint) { fireNeedsRepaint(dirtyComponent); } }
setNeedsRepaint
280,768
void (@NotNull Listener listener) { myListeners.add(listener); }
addListener
280,769
void (@NotNull Listener listener) { myListeners.remove(listener); }
removeListener
280,770
void (JComponent dirtyComponent) { for (Listener each : myListeners) { each.onNeedsRepaint(this, dirtyComponent); } }
fireNeedsRepaint
280,771
void (Component component, Graphics2D g) { myNeedsRepaint = false; executePaint(component, g); }
paint
280,772
void (ContainerEvent e) { Component child = e.getChild(); if (child instanceof Container) { ((Container)child).addContainerListener(this); } if (myBorderless) { UIUtil.removeScrollBorder(SimpleToolWindowPanel.this); } }
componentAdded
280,773
void (ContainerEvent e) { Component child = e.getChild(); if (child instanceof Container) { ((Container)child).removeContainerListener(this); } }
componentRemoved
280,774
boolean () { return myVertical; }
isVertical
280,775
void (boolean vertical) { if (myVertical == vertical) return; removeAll(); myVertical = vertical; updateLayout(); setContent(myContent); setToolbar(myToolbar); }
setVertical
280,776
boolean () { return myToolbar != null && myToolbar.isVisible(); }
isToolbarVisible
280,777
void () { setLayout(new BorderLayout(myVertical ? 0 : 1, myVertical ? 1 : 0)); }
updateLayout
280,778
void (@Nullable JComponent c) { if (c == null) { JComponent toolbar = myToolbar; if (toolbar != null) { remove(toolbar); } } myToolbar = c; if (myToolbar instanceof ActionToolbar) { ((ActionToolbar)myToolbar).setOrientation(myVertical ? SwingConstants.HORIZONTAL : SwingConstants.VERTICAL); } if (c != null) { if (myVertical) { add(c, BorderLayout.NORTH); } else { add(c, BorderLayout.WEST); } } revalidate(); repaint(); }
setToolbar
280,779
SimpleToolWindowPanel (boolean provide) { myProvideQuickActions = provide; return this; }
setProvideQuickActions
280,780
List<AnAction> (boolean originalProvider) { return collectActions(myToolbar); }
getActions
280,781
JComponent () { return this; }
getComponent
280,782
void (@NotNull JComponent c) { if (myContent != null) { remove(myContent); } myContent = c; if (ExperimentalUI.isNewUI()) { JScrollPane scrollPane = UIUtil.findComponentOfType(myContent, JScrollPane.class); AdjustmentListener listener = event -> { ClientProperty.put(myContent, SCROLLED_STATE, event.getAdjustable().getValue() != 0); repaint(); }; if (scrollPane != null) { scrollPane.getVerticalScrollBar().addAdjustmentListener(listener); scrollPane.getHorizontalScrollBar().addAdjustmentListener(listener); } } add(c, BorderLayout.CENTER); if (myBorderless) { UIUtil.removeScrollBorder(c); } revalidate(); repaint(); }
setContent
280,783
void (Graphics g) { super.paintComponent(g); if (myToolbar != null && myToolbar.getParent() == this && myContent != null && myContent.getParent() == this) { g.setColor(JBColor.border()); if (ExperimentalUI.isNewUI()) { //don't draw line for scrolled content if (Boolean.FALSE.equals(ClientProperty.get(myContent, SCROLLED_STATE))) { return; } } if (myVertical) { int y = (int)myToolbar.getBounds().getMaxY(); LinePainter2D.paint((Graphics2D)g, 0, y, getWidth(), y); } else { int x = (int)myToolbar.getBounds().getMaxX(); LinePainter2D.paint((Graphics2D)g, x, 0, x, getHeight()); } } }
paintComponent
280,784
List<AnAction> (@Nullable JComponent component) { JBIterable<ActionToolbar> toolbars = UIUtil.uiTraverser(component).traverse().filter(ActionToolbar.class); if (toolbars.size() == 0) { return Collections.emptyList(); } return toolbars.flatten(ActionToolbar::getActions).toList(); }
collectActions
280,785
DialogWrapperPeerFactory () { if (!LoadingState.COMPONENTS_REGISTERED.isOccurred()) { return getInstanceByName(); } DialogWrapperPeerFactory factory = ApplicationManager.getApplication().getService(DialogWrapperPeerFactory.class); return factory == null ? getInstanceByName() : factory; }
getInstance
280,786
DialogWrapperPeerFactory () { try { Constructor<?> constructor = Class.forName("com.intellij.openapi.ui.impl.DialogWrapperPeerFactoryImpl").getDeclaredConstructor(); constructor.setAccessible(true); return (DialogWrapperPeerFactory)constructor.newInstance(); } catch (Exception e) { throw new RuntimeException("Can't instantiate DialogWrapperPeerFactory", e); } }
getInstanceByName
280,787
JComponent () { JPanel panel = createIconPanel(); JPanel messagePanel = createMessagePanel(); messagePanel.add(createCheckComponent(), BorderLayout.SOUTH); panel.add(messagePanel, BorderLayout.CENTER); return panel; }
createNorthPanel
280,788
JComponent () { myCheckBox = new JCheckBox(myCheckboxText); myCheckBox.setSelected(myChecked); return myCheckBox; }
createCheckComponent
280,789
int () { final int exitCode = super.getExitCode(); if (myExitFunc != null) { return myExitFunc.apply(exitCode, myCheckBox); } boolean checkBoxSelected = (myCheckBox != null && myCheckBox.isSelected()); boolean okExitCode = (exitCode == OK_EXIT_CODE); return checkBoxSelected && okExitCode ? OK_EXIT_CODE : CANCEL_EXIT_CODE; }
getExitCode
280,790
JComponent () { return myDefaultOptionIndex == -1 ? myCheckBox : super.getPreferredFocusedComponent(); }
getPreferredFocusedComponent
280,791
JComponent () { return null; }
createCenterPanel
280,792
void (@NlsContexts.DialogTitle String title, @NlsContexts.DialogMessage @Nullable String message, String @NotNull [] options, int defaultOptionIndex, int focusedOptionIndex, @Nullable Icon icon, @Nullable com.intellij.openapi.ui.DoNotAskOption doNotAskOption, @Nullable String helpId) { setTitle(title); myMessage = message; myOptions = options; myDefaultOptionIndex = defaultOptionIndex; myFocusedOptionIndex = focusedOptionIndex; myIcon = icon; myHelpId = helpId; setDoNotAskOption(doNotAskOption); init(); }
_init
280,793
void (ActionEvent e) { close(exitCode, true); }
actionPerformed
280,794
void () { close(-1); }
doCancelAction
280,795
JComponent () { return doCreateCenterPanel(); }
createCenterPanel
280,796
JComponent () { JPanel panel = createIconPanel(); if (myMessage != null) { JTextPane messageComponent = createMessageComponent(myMessage); panel.add(Messages.wrapToScrollPaneIfNeeded(messageComponent, 100, 15), BorderLayout.CENTER); } return panel; }
doCreateCenterPanel
280,797
JPanel () { JPanel panel = new JPanel(new BorderLayout(15, 0)); if (myIcon != null) { JLabel iconLabel = new JLabel(myIcon); Container container = new Container(); container.setLayout(new BorderLayout()); container.add(iconLabel, BorderLayout.NORTH); panel.add(container, BorderLayout.WEST); } return panel; }
createIconPanel
280,798
JPanel () { JPanel messagePanel = new JPanel(new BorderLayout()); if (myMessage != null) { JLabel textLabel = new JLabel(myMessage); textLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); textLabel.setUI(new MultiLineLabelUI()); messagePanel.add(textLabel, BorderLayout.NORTH); } return messagePanel; }
createMessagePanel
280,799
JTextPane (final @NlsContexts.DialogMessage String message) { final JTextPane messageComponent = new JTextPane(); return Messages.configureMessagePaneUi(messageComponent, message); }
createMessageComponent