Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
45,100
void (Graphics g) { Dimension size = getSize(); for (int i = 0; i < myLine; i++) { g.drawRect(i, i, size.width - i - i - 1, size.height - i - i - 1); } }
paintFeedback
45,101
void (int width, int height) { if (myHorizontal) { setSize(width, myLine); } else { setSize(myLine, height); } }
size
45,102
void (int x, int y, int width) { myHorizontal = true; setBounds(x, y, width, myLine); setVisible(true); }
horizontal
45,103
void (int x, int y, int height) { myHorizontal = false; setBounds(x, y, myLine, height); setVisible(true); }
vertical
45,104
void (Graphics g) { super.paintComponent(g); g.setColor(myColor); paintLines(g); }
paintComponent
45,105
void (Graphics g) { Dimension size = getSize(); if (myHorizontal) { paintHorizontal(g, size); } else { paintVertical(g, size); } }
paintLines
45,106
void (Graphics g, Dimension size) { for (int i = 0; i < myLine; i++) { g.drawLine(0, i, size.width, i); } }
paintHorizontal
45,107
void (Graphics g, Dimension size) { for (int i = 0; i < myLine; i++) { g.drawLine(i, 0, i, size.height); } }
paintVertical
45,108
void (@Nls String text) { append(text, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); }
bold
45,109
void (Rectangle bounds) { Dimension textSize = getPreferredSize(); setBounds(bounds.x + bounds.width / 2 - textSize.width / 2, bounds.y - textSize.height - 10, textSize.width, textSize.height); }
centerTop
45,110
void (Point location, int shift) { Dimension textSize = getPreferredSize(); setBounds(location.x + shift, location.y + shift, textSize.width, textSize.height); }
locationTo
45,111
DataFlavor[] () { try { return new DataFlavor[]{myFlavor}; } catch (Exception ex) { LOG.error(ex); return new DataFlavor[0]; } }
getTransferDataFlavors
45,112
boolean (DataFlavor flavor) { try { return myFlavor.equals(flavor); } catch (Exception ex) { LOG.error(ex); return false; } }
isDataFlavorSupported
45,113
void (EditableArea area) { updateSelectionActions(area.getSelection()); }
selectionChanged
45,114
DefaultActionGroup () { DefaultActionGroup group = new DefaultActionGroup(); group.add(myStaticGroup); group.add(myDynamicGroup); return group; }
createActionGroup
45,115
JComponent () { ActionManager actionManager = ActionManager.getInstance(); ActionToolbar actionToolbar = actionManager.createActionToolbar(TOOLBAR, myActionGroup, true); actionToolbar.setLayoutPolicy(ActionToolbar.WRAP_LAYOUT_POLICY); JComponent toolbar = actionToolbar.getComponent(); toolbar.setBorder(IdeBorderFactory...
createToolbar
45,116
ActionGroup (DesignerEditorPanel designer) { final DefaultActionGroup group = DefaultActionGroup.createPopupGroup(() -> DesignerBundle.message("action.select.text")); AnAction selectParent = new AnAction(UIBundle.messagePointer("action.DesignerActionPanel.Anonymous.text.select.parent"), UIBundle.messagePointer("action....
createSelectActionGroup
45,117
void (@NotNull AnActionEvent e) { myDesigner.getToolProvider().processKeyEvent(new KeyEvent(myDesigner.getSurfaceArea().getNativeComponent(), KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ESCAPE, (char)KeyEvent.VK_ESCAPE), myDesigner.getSurfaceArea() ); }
actionPerformed
45,118
AnAction (EditableArea area) { return new SelectAllAction(area); }
createSelectAllAction
45,119
StartInplaceEditing (JComponent shortcuts) { StartInplaceEditing action = new StartInplaceEditing(); action.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0)), shortcuts); return action; }
createInplaceEditingAction
45,120
void (AnAction action, @NonNls String actionId) { action.registerCustomShortcutSet( ActionManager.getInstance().getAction(actionId).getShortcutSet(), myShortcuts ); }
registerAction
45,121
JComponent () { return myToolbar; }
getToolbarComponent
45,122
DefaultActionGroup () { return myStaticGroup; }
getActionGroup
45,123
DefaultActionGroup () { return myPopupGroup; }
getPopupGroup
45,124
DefaultActionGroup () { return myDynamicGroup; }
getDynamicActionGroup
45,125
JComponent () { return myShortcuts; }
getShortcuts
45,126
void () { boolean oldVisible = myToolbar.isVisible(); boolean newVisible = isVisible(myActionGroup); myToolbar.setVisible(newVisible); if (oldVisible && newVisible) { myToolbar.getParent().revalidate(); } }
update
45,127
boolean (DefaultActionGroup group) { if (group.getChildrenCount() == 0) { return false; } for (AnAction action : group.getChildren(null)) { if (action instanceof DefaultActionGroup) { if (isVisible((DefaultActionGroup)action)) { return true; } } else { return true; } } return false; }
isVisible
45,128
void (List<RadComponent> selection) { boolean oldVisible = isVisible(myDynamicGroup); if (myDynamicGroup.getChildrenCount() > 0) { for (AnAction action : myDynamicGroup.getChildActionsOrStubs()) { action.unregisterCustomShortcutSet(myShortcuts); } myDynamicGroup.removeAll(); } addSelectionActions(selection, myDynamicGr...
updateSelectionActions
45,129
void (List<RadComponent> selection, DefaultActionGroup group) { for (RadComponent parent : RadComponent.getParents(selection)) { parent.getLayout().addSelectionActions(myDesigner, group, myShortcuts, selection); } for (RadComponent component : selection) { component.addSelectionActions(myDesigner, group, myShortcuts, s...
addSelectionActions
45,130
ActionGroup (EditableArea area) { if (myDynamicPopupGroup.getChildrenCount() > 0) { myDynamicPopupGroup.removeAll(); } WrapInAction.fill(myDesigner, myDynamicPopupGroup, area); MorphingAction.fill(myDesigner, myDynamicPopupGroup, area); return myPopupGroup; }
getPopupActions
45,131
Object (@NotNull @NonNls String dataId) { if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId) || PlatformDataKeys.CUT_PROVIDER.is(dataId) || PlatformDataKeys.COPY_PROVIDER.is(dataId) || PlatformDataKeys.PASTE_PROVIDER.is(dataId)) { JTable table = DesignerToolWindowManager.getInstance(myDesigner).getPropertyTable();...
getData
45,132
void (@NotNull AnActionEvent e) { myArea.deselectAll(); }
actionPerformed
45,133
void (@NotNull AnActionEvent e) { RadComponent rootComponent = myArea.getRootComponent(); if (rootComponent != null) { final List<RadComponent> selection = myArea.getSelection(); final List<RadComponent> components = new ArrayList<>(); rootComponent.accept(new RadComponentVisitor() { @Override public void endVisit(RadC...
actionPerformed
45,134
void (RadComponent component) { if (!component.isBackground()) { for (RadComponent selected : selection) { if (selected.isSameType(component)) { components.add(component); break; } } } }
endVisit
45,135
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
45,136
void (@NotNull AnActionEvent e) { PaletteItem paletteItem = myTarget.getPaletteItem(); e.getPresentation().setEnabled(paletteItem == null || paletteItem.isEnabled()); }
update
45,137
void (@NotNull AnActionEvent e) { myDesigner.getToolProvider().execute(() -> { List<RadComponent> newComponents = new ArrayList<>(); for (RadComponent component : myComponents) { RadComponent newComponent = component.morphingTo(myTarget); if (newComponent != null) { newComponents.add(newComponent); } } myArea.setSelect...
actionPerformed
45,138
void (DesignerEditorPanel designer, DefaultActionGroup group, EditableArea area) { List<RadComponent> selection = area.getSelection(); if (selection.isEmpty()) { return; } MetaModel model = null; for (RadComponent component : selection) { if (model == null) { model = component.getMetaModel(); } else if (model != compon...
fill
45,139
void (@NotNull AnActionEvent e) { RadComponent rootComponent = myArea.getRootComponent(); if (rootComponent != null) { final Set<RadComponent> parents = RadComponent.getParents(myArea.getSelection()); final List<RadComponent> components = new ArrayList<>(); rootComponent.accept(new RadComponentVisitor() { @Override pub...
actionPerformed
45,140
void (RadComponent component) { if (parents.contains(component.getParent())) { components.add(component); } }
endVisit
45,141
void (List<T> items, @Nullable T selection) { myItems = items; setSelection(selection); }
setItems
45,142
T () { return mySelection; }
getSelection
45,143
void (T selection) { mySelection = selection; if (selection == null && !myItems.isEmpty()) { mySelection = myItems.get(0); } update(); }
setSelection
45,144
void () { mySelection = null; update(); }
clearSelection
45,145
void (boolean value) { myShowDisabledActions = value; }
showDisabledActions
45,146
JComponent (@NotNull Presentation presentation, @NotNull String place) { myPresentation = presentation; update(); JPanel panel = new JPanel(new GridBagLayout()); panel.add( createComboBoxButton(presentation), new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 1, 2...
createCustomComponent
45,147
ComboBoxButton (@NotNull Presentation presentation) { if (myShowDisabledActions) { return new ComboBoxButton(presentation) { @Override protected @NotNull JBPopup createPopup(Runnable onDispose) { DataContext context = getDataContext(); ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup( null, createP...
createComboBoxButton
45,148
JBPopup (Runnable onDispose) { DataContext context = getDataContext(); ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup( null, createPopupActionGroup(this, context), context, true, onDispose, getMaxRows()); popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight())); return popup; }
createPopup
45,149
void () { update(mySelection, myPresentation == null ? getTemplatePresentation() : myPresentation, false); }
update
45,150
DefaultActionGroup (@NotNull JComponent button, @NotNull DataContext context) { DefaultActionGroup actionGroup = new DefaultActionGroup(); for (final T item : myItems) { if (addSeparator(actionGroup, item)) { continue; } AnAction action = new AnAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) ...
createPopupActionGroup
45,151
void (@NotNull AnActionEvent e) { if (mySelection != item && selectionChanged(item)) { mySelection = item; AbstractComboBoxAction.this.update(item, myPresentation, false); } }
actionPerformed
45,152
boolean (DefaultActionGroup actionGroup, T item) { return false; }
addSeparator
45,153
void (@Nullable DesignerEditorPanel designer) { myDesigner = designer; }
setDesignerPanel
45,154
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
45,155
void (@NotNull AnActionEvent event) { boolean enabled = false; if (myDesigner != null) { List<RadComponent> selection = myDesigner.getSurfaceArea().getSelection(); if (selection.size() == 1) { try { enabled = !selection.get(0).getInplaceProperties().isEmpty(); } catch (Exception e) { } } } event.getPresentation().setEn...
update
45,156
void (@NotNull AnActionEvent e) { myDesigner.getInplaceEditingLayer().startEditing(null); }
actionPerformed
45,157
void (@NotNull AnActionEvent e) { perform(); }
actionPerformed
45,158
void () { RadComponent rootComponent = myArea.getRootComponent(); if (rootComponent != null) { final List<RadComponent> components = new ArrayList<>(); rootComponent.accept(new RadComponentVisitor() { @Override public void endVisit(RadComponent component) { if (!component.isBackground()) { components.add(component); } ...
perform
45,159
void (RadComponent component) { if (!component.isBackground()) { components.add(component); } }
endVisit
45,160
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
45,161
EditableArea (DataContext dataContext) { EditableArea area = EditableArea.DATA_KEY.getData(dataContext); return area == null ? myDesigner.getSurfaceArea() : area; }
getArea
45,162
boolean (@NotNull DataContext dataContext) { if (myDesigner.getInplaceEditingLayer().isEditing()) { return false; } List<RadComponent> selection = getArea(dataContext).getSelection(); if (selection.isEmpty()) { return false; } for (RadComponent component : selection) { if (!component.canDelete()) { return false; } } re...
canDeleteElement
45,163
void (final @NotNull DataContext dataContext) { myDesigner.getToolProvider().execute(() -> { EditableArea area = getArea(dataContext); List<RadComponent> selection = area.getSelection(); if (selection.isEmpty()) { return; } myDesigner.getToolProvider().loadDefaultTool(); List<RadComponent> components = RadComponent.get...
deleteElement
45,164
void (EditableArea area, RadComponent component, List<RadComponent> excludes) { try { isDeleting = true; RadComponent newSelection = getNewSelection(component, excludes); if (newSelection == null) { area.deselectAll(); } else { area.select(newSelection); } } finally { isDeleting = false; } }
updateSelectionBeforeDelete
45,165
RadComponent (RadComponent component, List<RadComponent> excludes) { RadComponent parent = component.getParent(); if (parent == null) { return null; } List<RadComponent> children = parent.getChildren(); int size = children.size(); for (int i = children.indexOf(component) + 1; i < size; i++) { RadComponent next = childr...
getNewSelection
45,166
boolean (@NotNull DataContext dataContext) { return true; }
isCopyVisible
45,167
boolean (@NotNull DataContext dataContext) { if (myDesigner.getInplaceEditingLayer().isEditing()) { return false; } List<RadComponent> selection = getArea(dataContext).getSelection(); if (selection.isEmpty()) { return false; } return true; }
isCopyEnabled
45,168
void (@NotNull DataContext dataContext) { doCopy(dataContext); }
performCopy
45,169
boolean (DataContext dataContext) { try { Element root = new Element("designer"); root.setAttribute("target", myDesigner.getPlatformTarget()); List<RadComponent> components = RadComponent.getPureSelection(getArea(dataContext).getSelection()); for (RadComponent component : components) { component.copyTo(root); } Seriali...
doCopy
45,170
boolean (@NotNull DataContext dataContext) { return isPasteEnabled(dataContext); }
isPastePossible
45,171
boolean (@NotNull DataContext dataContext) { return !myDesigner.getInplaceEditingLayer().isEditing() && getSerializedComponentData() != null; }
isPasteEnabled
45,172
String () { try { Object transferData = CopyPasteManager.getInstance().getContents(DATA_FLAVOR); if (transferData instanceof SerializedComponentData data) { String xmlComponents = data.getSerializedComponents(); if (xmlComponents.startsWith("<designer target=\"" + myDesigner.getPlatformTarget() + "\">")) { return xmlCo...
getSerializedComponentData
45,173
void (@NotNull DataContext dataContext) { ComponentPasteFactory factory = myDesigner.createPasteFactory(getSerializedComponentData()); if (factory != null) { myDesigner.getToolProvider().setActiveTool(new PasteTool(true, factory)); } }
performPaste
45,174
boolean (@NotNull DataContext dataContext) { return true; }
isCutVisible
45,175
boolean (@NotNull DataContext dataContext) { return isCopyEnabled(dataContext) && canDeleteElement(dataContext); }
isCutEnabled
45,176
void (@NotNull DataContext dataContext) { if (doCopy(dataContext)) { deleteElement(dataContext); } }
performCut
45,177
void (@NotNull AnActionEvent e) { myDesigner.getToolProvider().execute(() -> myArea.select(myProvider.wrapIn(myParent, myComponents, myTarget)), DesignerBundle.message("run.wrap.in.action"), true); }
actionPerformed
45,178
void (DesignerEditorPanel designer, DefaultActionGroup group, EditableArea area) { List<RadComponent> selection = area.getSelection(); if (selection.isEmpty()) { return; } Set<RadComponent> parents = RadComponent.getParents(selection); if (parents.size() != 1) { return; } RadComponent parent = parents.iterator().next()...
fill
45,179
void () { if (myComponent.isShowing()) { updateHintVisibility(); } else { hideHint(); } }
visibilityChanged
45,180
void (FocusEvent e) { if (!e.isTemporary()) { updateHintVisibility(); } }
focusGained
45,181
void (FocusEvent e) { if (!(e.isTemporary())) { hideHint(); } }
focusLost
45,182
void (@NotNull AnActionEvent e) { if (myDesigner != null) { showHint(); showPopup(); } }
actionPerformed
45,183
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
45,184
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(e.getData(CommonDataKeys.EDITOR) == null); }
update
45,185
void (ChangeEvent e) { updateHintPosition(); }
stateChanged
45,186
void (@Nullable DesignerEditorPanel designer) { myDesigner = designer; }
setDesigner
45,187
void () { if (!myComponent.isShowing() || !IJSwingUtilities.hasFocus(myComponent)) { hideHint(); } else if (myHint == null || !myHint.isVisible()) { updateHintVisibility(); } else { Rectangle bounds = getErrorBounds(); if (!ErrorInfo.haveFixes(getErrorInfos()) || bounds == null || !bounds.equals(myLastHintBounds)) { hi...
update
45,188
void () { if (!myComponent.isShowing() || !IJSwingUtilities.hasFocus(myComponent)) { hideHint(); return; } // 1. Hide previous hint (if any) hideHint(); // 2. Found error (if any) List<ErrorInfo> infos = getErrorInfos(); if (!ErrorInfo.haveFixes(infos)) { hideHint(); return; } boolean error = false; for (ErrorInfo erro...
showHint
45,189
void () { if (myHint == null || !myHint.isVisible()) { return; } List<ErrorInfo> errorInfos = getErrorInfos(); if (!ErrorInfo.haveFixes(errorInfos)) { return; } ListPopup popup = JBPopupFactory.getInstance().createListPopup(new FirstStep(errorInfos)); popup.showUnderneathOf(myHint.getComponent()); }
showPopup
45,190
void () { myAlarm.cancelAllRequests(); if (myHint != null && myHint.isVisible()) { myHint.hide(); myHint = null; myComponent.paintImmediately(myComponent.getVisibleRect()); } }
hideHint
45,191
void () { myAlarm.cancelAllRequests(); myAlarm.addRequest(myShowHintRequest, 500); }
updateHintVisibility
45,192
void () { if (myHint != null && myHint.isVisible()) { Rectangle rc = getErrorBounds(); if (rc != null) { myLastHintBounds = rc; Rectangle hintRect = new Rectangle(rc.x - AllIcons.Actions.IntentionBulb.getIconWidth() - 4, rc.y, AllIcons.Actions.IntentionBulb .getIconWidth() + 4, AllIcons.Actions.IntentionBulb .getIconHe...
updateHintPosition
45,193
Rectangle () { return myViewPort.getViewRect(); }
getHintClipRect
45,194
Icon (ErrorInfo value) { return AllIcons.Actions.RealIntentionBulb; }
getIconFor
45,195
String (ErrorInfo value) { return value.getName(); }
getTextFor
45,196
PopupStep (ErrorInfo value, boolean finalChoice) { List<QuickFix> quickFixes = value.getQuickFixes(); if (finalChoice) { return doFinalStep(getQuickFixRunnable(quickFixes.get(0))); } return new SecondStep(quickFixes); }
onChosen
45,197
boolean (ErrorInfo selectedValue) { return true; }
hasSubstep
45,198
boolean () { return false; }
isAutoSelectionEnabled
45,199
Icon (QuickFix value) { return value.getIcon(); }
getIconFor