Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
46,700
GlassLayer () { return myGlassLayer; }
getGlassLayer
46,701
InplaceEditingLayer () { return myInplaceEditingLayer; }
getInplaceEditingLayer
46,702
JLayeredPane () { return myLayeredPane; }
getLayeredPane
46,703
void () { myLayeredPane.repaint(); }
repaintLayeredPane
46,704
void (final ComponentSelectionListener l) { myListenerList.add(ComponentSelectionListener.class, l); }
addComponentSelectionListener
46,705
void (final ComponentSelectionListener l) { myListenerList.remove(ComponentSelectionListener.class, l); }
removeComponentSelectionListener
46,706
void (@NotNull final HierarchyChangeListener l) { myListenerList.add(HierarchyChangeListener.class, l); }
addHierarchyChangeListener
46,707
void (@NotNull final HierarchyChangeListener l) { myListenerList.remove(HierarchyChangeListener.class, l); }
removeHierarchyChangeListener
46,708
void () { LOG.debug("GuiEditor.saveToFile(): group ID=" + myNextSaveGroupId); CommandProcessor.getInstance().executeCommand(getProject(), () -> ApplicationManager.getApplication().runWriteAction(() -> { myInsideChange = true; try { final XmlWriter writer = new XmlWriter(); getRootContainer().write(writer); final String...
saveToFile
46,709
ActiveDecorationLayer () { return myActiveDecorationLayer; }
getActiveDecorationLayer
46,710
void (final Locale locale) { myRootContainer.setStringDescriptorLocale(locale); refreshProperties(); DesignerToolWindowManager.getInstance(this).updateComponentTree(); DaemonCodeAnalyzer.getInstance(getProject()).restart(); }
setStringDescriptorLocale
46,711
Locale () { return myRootContainer.getStringDescriptorLocale(); }
getStringDescriptorLocale
46,712
void () { final Ref<Boolean> anythingModified = new Ref<>(); FormEditingUtil.iterate(myRootContainer, component -> { final RadComponent radComponent = (RadComponent)component; boolean componentModified = false; for (IProperty prop : component.getModifiedProperties()) { if (prop instanceof IntroStringProperty strProp) {...
refreshProperties
46,713
MainProcessor () { return myProcessor; }
getMainProcessor
46,714
void () { myQuickFixManager.refreshIntentionHint(); }
refreshIntentionHint
46,715
void (final RadComponent component) { mySelectionAnchor = new ComponentPtr(this, component); }
setSelectionAnchor
46,716
RadComponent () { if (mySelectionAnchor == null) return null; mySelectionAnchor.validate(); return mySelectionAnchor.getComponent(); }
getSelectionAnchor
46,717
void (final RadComponent component) { mySelectionLead = new ComponentPtr(this, component); }
setSelectionLead
46,718
RadComponent () { if (mySelectionLead == null) return null; mySelectionLead.validate(); return mySelectionLead.getComponent(); }
getSelectionLead
46,719
void (final RadComponent component) { Rectangle rect = SwingUtilities.convertRectangle(component.getDelegee().getParent(), component.getBounds(), myLayeredPane); myLayeredPane.scrollRectToVisible(rect); }
scrollComponentInView
46,720
int () { return myStartOffset; }
getStartOffset
46,721
int () { return myEndOffset; }
getEndOffset
46,722
String () { return myReplacement; }
getReplacement
46,723
ReplaceInfo (final String oldText, final String newText) { if (oldText.equals(newText)) { return new ReplaceInfo(-1, -1, null); } final int oldLength = oldText.length(); final int newLength = newText.length(); int startOffset = 0; while ( startOffset < oldLength && startOffset < newLength && oldText.charAt(startOffset)...
findFragmentToChange
46,724
void (@NotNull final RadRootContainer rootContainer) { if (myRootContainer != null) { myLayeredPane.remove(myRootContainer.getDelegee()); } myRootContainer = rootContainer; setDesignTimeInsets(2); myLayeredPane.add(myRootContainer.getDelegee(), LAYER_COMPONENT); fireHierarchyChanged(); }
setRootContainer
46,725
void (final int insets) { Integer oldInsets = (Integer)myRootContainer.getDelegee().getClientProperty(GridLayoutManager.DESIGN_TIME_INSETS); if (oldInsets == null || oldInsets.intValue() != insets) { myRootContainer.getDelegee().putClientProperty(GridLayoutManager.DESIGN_TIME_INSETS, insets); revalidateRecursive(myRoot...
setDesignTimeInsets
46,726
void (final JComponent component) { for (Component child : component.getComponents()) { if (child instanceof JComponent) { revalidateRecursive((JComponent)child); } } component.revalidate(); component.repaint(); }
revalidateRecursive
46,727
void (final boolean keepSelection) { try { ComponentPtr[] selection = null; Map<String, String> tabbedPaneSelectedTabs = null; if (keepSelection) { selection = SelectionState.getSelection(this); tabbedPaneSelectedTabs = saveTabbedPaneSelectedTabs(); } Locale oldLocale = null; if (myRootContainer != null) { oldLocale = ...
readFromFile
46,728
void (final Throwable exc) { LOG.info(exc); // setting fictive container setRootContainer(new RadRootContainer(this, "0")); myFormInvalidLabel.setText(UIDesignerBundle.message("error.form.file.is.invalid.message", FormEditingUtil.getExceptionMessage(exc))); myInvalid = true; myCardLayout.show(myCardPanel, CARD_INVALID)...
showInvalidCard
46,729
boolean () { return myInvalid; }
isFormInvalid
46,730
void (final Map<String, String> tabbedPaneSelectedTabs) { FormEditingUtil.iterate(getRootContainer(), component -> { if (component instanceof RadTabbedPane tabbedPane) { String selectedTabId = tabbedPaneSelectedTabs.get(tabbedPane.getId()); if (selectedTabId != null) { for (RadComponent c : tabbedPane.getComponents()) ...
restoreTabbedPaneSelectedTabs
46,731
JComponent () { if (myValidCard.isVisible()) { return myGlassLayer; } else { return myInvalidCard; } }
getPreferredFocusedComponent
46,732
void (final RadComponent component) { final GuiEditor uiEditor = (GuiEditor)SwingUtilities.getAncestorOfClass(GuiEditor.class, component.getDelegee()); if (uiEditor != null) { uiEditor.repaintLayeredPane(); } }
repaintLayeredPane
46,733
boolean () { return myShowGrid; }
isShowGrid
46,734
void (final boolean showGrid) { if (myShowGrid != showGrid) { myShowGrid = showGrid; repaint(); } }
setShowGrid
46,735
boolean () { return myShowComponentTags; }
isShowComponentTags
46,736
void (final boolean showComponentTags) { if (myShowComponentTags != showComponentTags) { myShowComponentTags = showComponentTags; repaint(); } }
setShowComponentTags
46,737
DesignDropTargetListener () { return myDropTargetListener; }
getDropTargetListener
46,738
GridCaptionPanel () { if (myHorzCaptionPanel.isFocusOwner()) { return myHorzCaptionPanel; } if (myVertCaptionPanel.isFocusOwner()) { return myVertCaptionPanel; } return null; }
getFocusedCaptionPanel
46,739
boolean () { return UndoManager.getInstance(getProject()).isUndoOrRedoInProgress(); }
isUndoRedoInProgress
46,740
void () { EditorFactory editorFactory = EditorFactory.getInstance(); Editor editor = editorFactory.createViewer(myDocument, myProject); try { ((EditorEx)editor).setHighlighter( new LexerEditorHighlighter(new XmlFileHighlighter(), EditorColorsManager.getInstance().getGlobalScheme())); JComponent component = editor.getCo...
showFormSource
46,741
Dimension () { return getPreferredSize(); }
getMinimumSize
46,742
Dimension () { // make sure all components fit int width = 0; int height = 0; for (int i = 0; i < myRootContainer.getComponentCount(); i++) { final RadComponent component = myRootContainer.getComponent(i); width = Math.max(width, component.getX() + component.getWidth()); height = Math.max(height, component.getY() + com...
getPreferredSize
46,743
Dimension () { return getPreferredSize(); }
getPreferredScrollableViewportSize
46,744
int (Rectangle visibleRect, int orientation, int direction) { return 10; }
getScrollableUnitIncrement
46,745
int (Rectangle visibleRect, int orientation, int direction) { if (orientation == SwingConstants.HORIZONTAL) { return visibleRect.width - 10; } return visibleRect.height - 10; }
getScrollableBlockIncrement
46,746
boolean () { return false; }
getScrollableTracksViewportWidth
46,747
boolean () { return false; }
getScrollableTracksViewportHeight
46,748
void (@NotNull final AnActionEvent e) { myProcessor.cancelOperation(); myQuickFixManager.hideIntentionHint(); }
actionPerformed
46,749
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
46,750
void (@NotNull final AnActionEvent e) { PropertyInspector inspector = DesignerToolWindowManager.getInstance(GuiEditor.this).getPropertyInspector(); e.getPresentation().setEnabled(inspector != null && !inspector.isEditing()); }
update
46,751
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
46,752
void (@NotNull final DataContext dataContext) { if (!ensureEditable()) { return; } CommandProcessor.getInstance().executeCommand(getProject(), () -> FormEditingUtil.deleteSelection(GuiEditor.this), UIDesignerBundle.message("command.delete.selection"), null); }
deleteElement
46,753
boolean (@NotNull final DataContext dataContext) { return !DesignerToolWindowManager.getInstance(GuiEditor.this).getPropertyInspector().isEditing() && !myInplaceEditingLayer.isEditing() && FormEditingUtil.canDeleteSelection(GuiEditor.this); }
canDeleteElement
46,754
void () { myAlarm.cancelAllRequests(); }
dispose
46,755
void (@NotNull final PsiTreeChangeEvent event) { handleEvent(event); }
childAdded
46,756
void (@NotNull final PsiTreeChangeEvent event) { handleEvent(event); }
childMoved
46,757
void (@NotNull final PsiTreeChangeEvent event) { handleEvent(event); }
childrenChanged
46,758
void (@NotNull PsiTreeChangeEvent event) { handleEvent(event); }
childRemoved
46,759
void (@NotNull PsiTreeChangeEvent event) { handleEvent(event); }
childReplaced
46,760
void (@NotNull final PsiTreeChangeEvent event) { if (PsiTreeChangeEvent.PROP_ROOTS.equals(event.getPropertyName())) { myAlarm.cancelRequest(myRefreshPropertiesRequest); myAlarm.addRequest(myRefreshPropertiesRequest, 500, ModalityState.stateForComponent(GuiEditor.this)); } }
propertyChanged
46,761
void (final PsiTreeChangeEvent event) { if (event.getParent() != null) { PsiFile containingFile = event.getParent().getContainingFile(); if (containingFile instanceof PropertiesFile) { LOG.debug("Received PSI change event for properties file"); myAlarm.cancelRequest(myRefreshPropertiesRequest); myAlarm.addRequest(myRef...
handleEvent
46,762
void () { if (getModule().isDisposed()) { return; } Project project = getProject(); if (project.isDisposed()) { return; } LOG.debug("Synchronizing GUI editor " + myFile.getName() + " to document"); PsiDocumentManager.getInstance(project).commitDocument(myDocument); readFromFile(myKeepSelection); }
run
46,763
void () { if (!getModule().isDisposed() && !getProject().isDisposed() && !DumbService.isDumb(getProject())) { refreshProperties(); } }
run
46,764
void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SHIFT && PaletteToolWindowManager.getInstance(this).getActiveItem(ComponentItem.class) != null) { setDesignTimeInsets(12); } }
paletteKeyPressed
46,765
void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SHIFT) { setDesignTimeInsets(2); } }
paletteKeyReleased
46,766
void (int gestureModifiers) { if ((gestureModifiers & InputEvent.SHIFT_MASK) != 0) { setDesignTimeInsets(12); } else { setDesignTimeInsets(2); } }
paletteDropActionChanged
46,767
void (ListSelectionEvent e) { if (PaletteToolWindowManager.getInstance(this).getActiveItem() == null) { myProcessor.cancelPaletteInsert(); } }
paletteValueChanged
46,768
void (ListSelectionEvent e) { repaint(); myEditor.fireSelectedComponentChanged(); }
valueChanged
46,769
JBColor () { return JBColor.lazy(() -> { Color color = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.GUTTER_BACKGROUND); return color == null ? UIUtil.getPanelBackground() : color; }); }
getGutterColor
46,770
RadContainer () { // when the selected component changes, and we have focus, PropertyInspector asks us about our container and selection. // PropertyInspector's selection changed listener can be called before our own listener, so we need to update ourselves // so that we don't return stale and invalid data. checkSelect...
getSelectedContainer
46,771
boolean () { return myIsRow; }
isRow
46,772
Dimension () { return getPreferredSize(); }
getMinimumSize
46,773
Color (final int i) { if (mySelectionModel.isSelectedIndex(i)) { return LightColors.BLUE; } if (mySelectedContainer != null) { if (i >= 0 && i < mySelectedContainer.getGridCellCount(myIsRow)) { final GridChangeUtil.CellStatus status = GridChangeUtil.canDeleteCell(mySelectedContainer, i, myIsRow); if (status == GridChan...
getCaptionColor
46,774
void (@NotNull GuiEditor source) { checkSelectionChanged(); repaint(); }
selectedComponentChanged
46,775
void () { RadContainer container = getSelectedGridContainer(); if (container != mySelectedContainer) { mySelectedContainer = container; mySelectionModel.clearSelection(); repaint(); } }
checkSelectionChanged
46,776
void (final JScrollPane scrollPane) { scrollPane.getViewport().addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { repaint(); } }); }
attachToScrollPane
46,777
void (ChangeEvent e) { repaint(); }
stateChanged
46,778
boolean () { return GuiDesignerConfiguration.getInstance(myEditor.getProject()).RESIZE_HEADERS && mySelectedContainer != null && mySelectedContainer.getGridLayoutManager().canResizeCells(); }
canResizeCells
46,779
int (Point pnt) { if (mySelectedContainer == null) return -1; pnt = SwingUtilities.convertPoint(this, pnt, mySelectedContainer.getDelegee()); return myIsRow ? mySelectedContainer.getGridRowAt(pnt.y) : mySelectedContainer.getGridColumnAt(pnt.x); }
getCellAt
46,780
int[] (@Nullable final Point dragOrigin) { ArrayList<Integer> selection = new ArrayList<>(); RadContainer container = getSelectedGridContainer(); if (container == null) { return ArrayUtilRt.EMPTY_INT_ARRAY; } int size = getCellCount(); for(int i=0; i<size; i++) { if (mySelectionModel.isSelectedIndex(i)) { selection.add...
getSelectedCells
46,781
int () { final RadContainer gridContainer = getSelectedGridContainer(); assert gridContainer != null; return myIsRow ? gridContainer.getGridRowCount() : gridContainer.getGridColumnCount(); }
getCellCount
46,782
boolean (final MouseEvent e) { int cell = getCellAt(e.getPoint()); if (cell >= 0 && e.isPopupTrigger()) { if (!mySelectionModel.isSelectedIndex(cell)) { mySelectionModel.setSelectionInterval(cell, cell); } ActionGroup group = mySelectedContainer.getGridLayoutManager().getCaptionActions(); if (group != null) { final Act...
checkShowPopupMenu
46,783
void (final Point pnt) { int[] coords = mySelectedContainer.getGridLayoutManager().getGridCellCoords(mySelectedContainer, myIsRow); int prevCoord = coords [myResizeLine-1]; int newCoord = myIsRow ? pnt.y : pnt.x; if (newCoord < prevCoord + MINIMUM_RESIZED_SIZE) { return; } int newSize = newCoord - prevCoord; if (!myEdi...
doResize
46,784
void (MouseEvent e) { if (!canResizeCells()) { return; } Point pnt = SwingUtilities.convertPoint(GridCaptionPanel.this, e.getPoint(), mySelectedContainer.getDelegee()); int gridLine = mySelectedContainer.getGridLayoutManager().getGridLineNear(mySelectedContainer, myIsRow, pnt, 4); // first grid line may not be dragged ...
mouseMoved
46,785
void (MouseEvent e) { if (myResizeLine > 0) { Point pnt = SwingUtilities.convertPoint(GridCaptionPanel.this, e.getPoint(), mySelectedContainer.getDelegee()); int[] coords = mySelectedContainer.getGridLayoutManager().getGridCellCoords(mySelectedContainer, myIsRow); int prevCoord = coords [myResizeLine-1]; int newCoord =...
mouseDragged
46,786
void (Graphics2D g, Rectangle rc) { g.setColor(LightColors.YELLOW); if (rc.width == 1) { g.drawLine(rc.x, rc.y, rc.x, rc.y+rc.height); } else { g.drawLine(rc.x, rc.y, rc.x+rc.width, rc.y); } }
paintFeedback
46,787
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
46,788
void (@NotNull DataContext dataContext) { int[] selection = getSelectedCells(null); if (selection.length > 0) { FormEditingUtil.deleteRowOrColumn(myEditor, mySelectedContainer, selection, myIsRow); } }
deleteElement
46,789
boolean (@NotNull DataContext dataContext) { if (mySelectedContainer == null || mySelectionModel.isSelectionEmpty()) { return false; } int[] selection = getSelectedCells(null); return mySelectedContainer.getGridCellCount(myIsRow) - selection.length >= mySelectedContainer.getGridLayoutManager().getMinCellCount(); }
canDeleteElement
46,790
boolean (DnDAction action, @NotNull Point dragOrigin) { LOG.debug("canStartDragging(): dragOrigin=" + dragOrigin); if (myResizeLine != -1) { LOG.debug("canStartDragging(): have resize line"); return false; } RadContainer container = getSelectedGridContainer(); if (container != null && container.getGridLayoutManager().g...
canStartDragging
46,791
boolean (final int cell) { if (mySelectedContainer == null) return false; for(RadComponent c: mySelectedContainer.getComponents()) { if (c.getConstraints().contains(myIsRow, cell) && c.getConstraints().getSpan(myIsRow) > 1) { return false; } } return true; }
canDragCell
46,792
DnDDragStartBean (DnDAction action, @NotNull Point dragOrigin) { return new DnDDragStartBean(new MyDragBean(myIsRow, getSelectedCells(dragOrigin))); }
startDragging
46,793
boolean (DnDEvent aEvent) { aEvent.setDropPossible(false); if (mySelectedContainer == null) { return false; } if (!(aEvent.getAttachedObject() instanceof MyDragBean bean)) { return false; } if (bean.isRow != myIsRow || bean.cells.length == 0) { return false; } int gridLine = getDropGridLine(aEvent); setDropInsertLine(g...
update
46,794
int (final DnDEvent aEvent) { final Point point = aEvent.getPointOn(mySelectedContainer.getDelegee()); return mySelectedContainer.getGridLayoutManager().getGridLineNear(mySelectedContainer, myIsRow, point, 20); }
getDropGridLine
46,795
void (DnDEvent aEvent) { if (!(aEvent.getAttachedObject() instanceof MyDragBean dragBean)) { return; } int targetCell = getDropGridLine(aEvent); if (targetCell < 0) return; mySelectedContainer.getGridLayoutManager().processCellsMoved(mySelectedContainer, myIsRow, dragBean.cells, targetCell); mySelectionModel.clearSelec...
drop
46,796
void () { setDropInsertLine(-1); myEditor.getActiveDecorationLayer().removeFeedback(); }
cleanUpOnLeave
46,797
void (final int i) { if (myDropInsertLine != i) { myDropInsertLine = i; repaint(); } }
setDropInsertLine
46,798
void (final KeyEvent e, final int delta) { int leadIndex = mySelectionModel.getLeadSelectionIndex(); int newLeadIndex = leadIndex + delta; if (newLeadIndex >= 0 && newLeadIndex < getCellCount()) { if ((e.getModifiers() & KeyEvent.SHIFT_MASK) != 0) { mySelectionModel.setSelectionInterval(mySelectionModel.getAnchorSelect...
moveSelection
46,799
void (final Graphics g) { ((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.3f)); // Paint passive decoration of dragged components for(int i = getComponentCount() - 1; i >= 0; i--){ final Component child = getComponent(i); if(child instanceof JComponent){ final Object prop = ((JCompone...
paint