Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
46,300
ComponentDropLocation (Direction direction) { return null; }
getAdjacentLocation
46,301
void (final XmlWriter writer) { writer.startElement("component"); try{ writeId(writer); writeClass(writer); writeBinding(writer); writeConstraints(writer); writeProperties(writer); }finally{ writer.endElement(); // component } }
write
46,302
RadComponent (ModuleProvider moduleProvider, Class aClass, String id) { return new RadHSpacer(moduleProvider, aClass, id); }
newInstance
46,303
RadComponent (final Class componentClass, final String id, final Palette palette) { throw new UnsupportedOperationException("Spacer instances should not be created by SnapShooter"); }
newInstance
46,304
void (final XmlWriter writer) { writer.startElement("hspacer"); try { writeId(writer); writeConstraints(writer); } finally { writer.endElement(); // hspacer } }
write
46,305
boolean () { return false; }
hasIntrospectedProperties
46,306
RadComponent (ModuleProvider module, Class aClass, String id) { return new RadTable(module, aClass, id); }
newInstance
46,307
RadComponent (final Class componentClass, final String id, final Palette palette) { return new RadTable(componentClass, id, palette); }
newInstance
46,308
void () { @NonNls Object[][] data = new Object[][] { new Object[] { "round", "red"}, new Object[] { "square", "green" } }; @NonNls Object[] columnNames = new Object[] { "Shape", "Color" }; try { ((JTable) getDelegee()).setModel(new DefaultTableModel(data, columnNames)); } catch(Exception | AssertionError ex) { // a cus...
initDefaultModel
46,309
void (ActionEvent e) { for(RadComponent c: myContainer.getComponents()) { if (c.getConstraints().getCell(myRow) == mySelectedIndex) { Property<RadComponent, Integer> property = myRow ? VSizePolicyProperty.getInstance(c.getProject()) : HSizePolicyProperty.getInstance(c.getProject()); if (myWantGrowCheckBox.isSelected())...
actionPerformed
46,310
JComponent () { return myRootPanel; }
getComponent
46,311
void (RadContainer container, boolean isRow, int[] selectedIndices) { myContainer = container; myRow = isRow; if (selectedIndices.length != 1) { myTitleLabel.setText(UIDesignerBundle.message("grid.layout.column.selected.property", selectedIndices.length, isRow ? 0 : 1)); myWantGrowCheckBox.setEnabled(false); } else { m...
showProperties
46,312
void (ChangeListener listener) { myListeners.add(listener); }
addChangeListener
46,313
void (ChangeListener listener) { myListeners.remove(listener); }
removeChangeListener
46,314
String () { return UIFormXmlConstants.LAYOUT_GRIDBAG; }
getName
46,315
LayoutManager () { return new GridBagLayout(); }
createLayout
46,316
void (final XmlWriter writer, final RadComponent child) { writeGridConstraints(writer, child); if (child.getCustomLayoutConstraints() instanceof GridBagConstraints gbc) { writer.startElement(UIFormXmlConstants.ELEMENT_GRIDBAG); try { if (!gbc.insets.equals(new Insets(0, 0, 0, 0))) { writer.addAttribute(UIFormXmlConstan...
writeChildConstraints
46,317
void (final RadContainer container, final RadComponent component, final int index) { super.addComponentToContainer(container, component, index); GridBagConstraints gbc = GridBagConverter.getGridBagConstraints(component); component.setCustomLayoutConstraints(gbc); container.getDelegee().add(component.getDelegee(), gbc, ...
addComponentToContainer
46,318
void (RadContainer container) { checkEmptyCells(container); }
refresh
46,319
void (RadContainer container) { JComponent jComponent = container.getDelegee(); GridBagLayout layout = (GridBagLayout)jComponent.getLayout(); Dimension oldSize = jComponent.getSize(); // clear cells layout.columnWidths = null; layout.rowHeights = null; // calculate layout fields jComponent.setSize(500, 400); jComponent...
checkEmptyCells
46,320
Property[] (final Project project, final RadComponent component) { return new Property[]{ new HorzAlignProperty(), new VertAlignProperty(), new ComponentInsetsProperty(), new WeightProperty(true), new WeightProperty(false), new IPadProperty(true), new IPadProperty(false) }; }
getComponentProperties
46,321
GridBagLayout (RadContainer container) { return (GridBagLayout)container.getLayout(); }
getGridBag
46,322
int (RadContainer container) { int[][] layoutDimensions = getGridBag(container).getLayoutDimensions(); return layoutDimensions[1].length; }
getGridRowCount
46,323
int (RadContainer container) { int[][] layoutDimensions = getGridBag(container).getLayoutDimensions(); return layoutDimensions[0].length; }
getGridColumnCount
46,324
int[] (RadContainer container) { return getGridLines(container, 1, 1); }
getHorizontalGridLines
46,325
int[] (RadContainer container) { return getGridLines(container, 0, 1); }
getVerticalGridLines
46,326
int[] (RadContainer container, boolean isRow) { return getGridLines(container, isRow ? 1 : 0, 0); }
getGridCellCoords
46,327
int[] (RadContainer container, boolean isRow) { int[][] layoutDimensions = getGridBag(container).getLayoutDimensions(); return layoutDimensions[isRow ? 1 : 0]; }
getGridCellSizes
46,328
int[] (final RadContainer container, final int rowColIndex, final int delta) { final GridBagLayout gridBag = getGridBag(container); Point layoutOrigin = gridBag.getLayoutOrigin(); int[][] layoutDimensions = gridBag.getLayoutDimensions(); int[] result = new int[layoutDimensions[rowColIndex].length + delta]; if (result.l...
getGridLines
46,329
ComponentDropLocation (@NotNull RadContainer container, @Nullable final Point location) { if (getGridRowCount(container) == 0 && getGridColumnCount(container) == 0) { return new FirstComponentInsertLocation(container, new Rectangle(0, 0, container.getWidth(), container.getHeight()), 0, 0); } return super.getDropLocatio...
getDropLocation
46,330
void (final RadContainer source, final RadContainer destination, final Rectangle rc) { destination.setLayout(new GridBagLayout()); }
copyGridSection
46,331
void (final RadComponent component) { GridBagLayout layout = (GridBagLayout)component.getParent().getLayout(); GridBagConstraints gbc = GridBagConverter.getGridBagConstraints(component); layout.setConstraints(component.getDelegee(), gbc); super.updateConstraints(component); }
updateConstraints
46,332
boolean () { return true; }
isGridDefinedByComponents
46,333
boolean () { return false; }
canResizeCells
46,334
boolean (RadContainer container, boolean isRow, int i) { GridBagLayout gridBag = getGridBag(container); double[][] weights = gridBag.getLayoutWeights(); if (weights != null) { double[] cellWeights = weights[isRow ? 1 : 0]; return i >= 0 && i < cellWeights.length && cellWeights[i] >= 0.1; } return false; }
canCellGrow
46,335
void (RadComponent child, boolean dragging) { // do nothing here - setting visible to false would cause exceptions }
setChildDragging
46,336
Dimension (final JComponent parent) { GridBagLayout gridBag = (GridBagLayout)parent.getLayout(); gridBag.layoutContainer(parent); int[][] layoutDimensions = gridBag.getLayoutDimensions(); int rowCount = layoutDimensions[1].length; int colCount = layoutDimensions[0].length; // account for invisible components for (Compo...
getGridBagSize
46,337
void (final JComponent parent, final JComponent child, final RadContainer container, final RadComponent component) { Dimension gridBagSize = getGridBagSize(parent); // logic copied from GridBagLayout.java GridBagLayout gridBag = (GridBagLayout)parent.getLayout(); final GridBagConstraints constraints = gridBag.getConstr...
addSnapshotComponent
46,338
int (final GridBagConstraints gbc) { return switch (gbc.anchor) { case GridBagConstraints.NORTHWEST -> GridConstraints.ANCHOR_NORTHWEST; case GridBagConstraints.NORTH -> GridConstraints.ANCHOR_NORTH; case GridBagConstraints.NORTHEAST -> GridConstraints.ANCHOR_NORTHEAST; case GridBagConstraints.EAST -> GridConstraints.A...
convertAnchor
46,339
int (final GridBagConstraints gbc) { return switch (gbc.fill) { case GridBagConstraints.HORIZONTAL -> GridConstraints.FILL_HORIZONTAL; case GridBagConstraints.VERTICAL -> GridConstraints.FILL_VERTICAL; case GridBagConstraints.BOTH -> GridConstraints.FILL_BOTH; default -> GridConstraints.FILL_NONE; }; }
convertFill
46,340
Insets (final RadComponent component) { if (component.getCustomLayoutConstraints() instanceof GridBagConstraints gbc) { return gbc.insets; } return new Insets(0, 0, 0, 0); }
getValue
46,341
boolean (final RadComponent component) { return !getValue(component).equals(new Insets(0, 0, 0, 0)); }
isModified
46,342
Double (final RadComponent component) { if (component.getCustomLayoutConstraints() instanceof GridBagConstraints gbc) { return myIsWeightX ? gbc.weightx : gbc.weighty; } return 0.0; }
getValue
46,343
PropertyRenderer<Double> () { if (myRenderer == null) { myRenderer = new LabelPropertyRenderer<>(); } return myRenderer; }
getRenderer
46,344
PropertyEditor<Double> () { if (myEditor == null) { myEditor = new PrimitiveTypeEditor<>(Double.class); } return myEditor; }
getEditor
46,345
boolean (final RadComponent component) { return !(new Double(0.0).equals(getValue(component))); }
isModified
46,346
Integer (final RadComponent component) { if (component.getCustomLayoutConstraints() instanceof GridBagConstraints gbc) { return myIsIpadX ? gbc.ipadx : gbc.ipady; } return 0; }
getValue
46,347
void (ChangeEvent e) { myGrowSpinner.setEnabled(myGrowCheckBox.isSelected()); updateSpec(); }
stateChanged
46,348
JPanel () { return myRootPanel; }
getComponent
46,349
void (ChangeListener listener) { myListeners.add(listener); }
addChangeListener
46,350
void (ChangeListener listener) { myListeners.remove(listener); }
removeChangeListener
46,351
void (final RadContainer container, final boolean row, final int[] selectedIndices) { if (mySaving) return; if (selectedIndices.length == 1) { showControls(true); myShowing = true; try { myLayout = (FormLayout)container.getLayout(); myIndex = selectedIndices[0] + 1; myIsRow = row; myTitleLabel.setText(myIsRow ? UIDesig...
showProperties
46,352
void (final boolean visible) { mySizePanel.setVisible(visible); myAlignmentPanel.setVisible(visible); myGrowCheckBox.setVisible(visible); myGrowSpinner.setVisible(visible); }
showControls
46,353
void (final FormSpec.DefaultAlignment defaultAlignment) { if (defaultAlignment.equals(RowSpec.TOP) || defaultAlignment.equals(ColumnSpec.LEFT)) { myLeftRadioButton.setSelected(true); } else if (defaultAlignment.equals(RowSpec.CENTER)) { myCenterRadioButton.setSelected(true); } else if (defaultAlignment.equals(RowSpec.B...
showAlignment
46,354
void (Size size) { Size minimumSize = null; Size maximumSize = null; if (size instanceof BoundedSize boundedSize) { minimumSize = boundedSize.getLowerBound(); maximumSize = boundedSize.getUpperBound(); size = boundedSize.getBasis(); } if (size instanceof ConstantSize) { myConstantRadioButton.setSelected(true); myMinimu...
showSize
46,355
void (final ConstantSize size, final JComboBox unitsCombo, final JSpinner spinner) { double value = size.getValue(); ConstantSize.Unit unit = size.getUnit(); @NlsSafe String item; if (unit.equals(ConstantSize.DIALOG_UNITS_X) || unit.equals(ConstantSize.DIALOG_UNITS_Y)) { item = "dlu"; } else { item = unit.abbreviation(...
showConstantSize
46,356
void () { final boolean canSetBounds = !myConstantRadioButton.isSelected(); myMinimumCheckBox.setEnabled(canSetBounds); myMaximumCheckBox.setEnabled(canSetBounds); // TODO: remove this code when IDEADEV-9678 is implemented if (myMinimumCheckBox.isSelected()) { myMaximumCheckBox.setEnabled(false); myMaximumCheckBox.setS...
updateOnRadioChange
46,357
void () { if (myLayout == null || myShowing) return; mySaving = true; try { Size size = getSelectedSize(); final SpinnerNumberModel model = (SpinnerNumberModel)myGrowSpinner.getModel(); double resizeWeight = myGrowCheckBox.isSelected() ? model.getNumber().doubleValue() : 0.0; FormSpec.DefaultAlignment alignment = getSe...
updateSpec
46,358
Size () { Size size; if (myDefaultRadioButton.isSelected()) { size = Sizes.DEFAULT; } else if (myPreferredRadioButton.isSelected()) { size = Sizes.PREFERRED; } else if (myMinimumRadioButton.isSelected()) { size = Sizes.MINIMUM; } else { size = getConstantSize(myConstantSizeUnitsCombo, myConstantSizeSpinner); } if (myMi...
getSelectedSize
46,359
ConstantSize (final JComboBox unitsCombo, final JSpinner spinner) { return Sizes.constant(spinner.getValue().toString() + Objects.requireNonNull(unitsCombo.getSelectedItem()).toString(), myIsRow); }
getConstantSize
46,360
void (@NotNull JList<? extends String> list, String value, int index, boolean selected, boolean hasFocus) { setText(UNITS_MAP.getOrDefault(value, "")); }
customize
46,361
void (ActionEvent e) { updateOnRadioChange(); }
actionPerformed
46,362
void (ChangeEvent e) { if (myWasSelected != myButton.isSelected()) { myWasSelected = myButton.isSelected(); myUnitsCombo.setEnabled(myButton.isSelected()); mySpinner.setEnabled(myButton.isSelected()); if (myButton.isSelected() && mySpinner.getValue().equals(Integer.valueOf(0))) { mySpinner.setValue(100); } updateOnRadi...
stateChanged
46,363
void (ChangeEvent e) { updateSpec(); }
stateChanged
46,364
void (ItemEvent e) { updateSpec(); }
itemStateChanged
46,365
RadComponent (ModuleProvider module, Class aClass, String id) { return new RadVSpacer(module, aClass, id); }
newInstance
46,366
RadComponent (final Class componentClass, final String id, final Palette palette) { throw new UnsupportedOperationException("Spacer instances should not be created by SnapShooter"); }
newInstance
46,367
void (final XmlWriter writer) { writer.startElement("vspacer"); try { writeId(writer); writeConstraints(writer); } finally { writer.endElement(); // vspacer } }
write
46,368
boolean () { return false; }
hasIntrospectedProperties
46,369
void (final RadContainer container, final RadComponent component, final int index) { container.getDelegee().add(component.getDelegee(), index); }
addComponentToContainer
46,370
boolean () { return true; }
isIndexed
46,371
void (final XmlWriter writer, final RadComponent child) { }
writeChildConstraints
46,372
boolean (RadComponent c, int rowDelta, int colDelta, final int rowSpanDelta, final int colSpanDelta) { if (colDelta == 1 || colDelta == -1) { int newIndex = c.getParent().indexOfComponent(c) + colDelta; return newIndex >= 0 && newIndex < c.getParent().getComponentCount(); } return false; }
canMoveComponent
46,373
void (RadComponent c, int rowDelta, int colDelta, final int rowSpanDelta, final int colSpanDelta) { final RadContainer container = c.getParent(); int newIndex = container.indexOfComponent(c) + colDelta; container.removeComponent(c); container.addComponent(c, newIndex); }
moveComponent
46,374
RadComponent (ModuleProvider module, Class aClass, String id) { return new RadScrollPane(module, aClass, id); }
newInstance
46,375
RadComponent (final Class componentClass, final String id, final Palette palette) { return new RadScrollPane(componentClass, id, palette); }
newInstance
46,376
RadLayoutManager () { return new RadScrollPaneLayoutManager(); }
createInitialLayoutManager
46,377
void (final XmlWriter writer) { writer.startElement(UIFormXmlConstants.ELEMENT_SCROLLPANE); try { writeNoLayout(writer, JScrollPane.class.getName()); } finally { writer.endElement(); // scrollpane } }
write
46,378
void (final XmlWriter writer, final RadComponent child) { }
writeChildConstraints
46,379
ComponentDropLocation (RadContainer container, @Nullable final Point location) { if (myDropLocation == null) { myDropLocation = new MyDropLocation(); } return myDropLocation; }
getDropLocation
46,380
void (final RadContainer container, final RadComponent component, final int index) { try { final JScrollPane scrollPane = (JScrollPane)container.getDelegee(); final JComponent delegee = component.getDelegee(); delegee.setLocation(0,0); scrollPane.setViewportView(delegee); } catch (ClassCastException e) { LOG.info(e); L...
addComponentToContainer
46,381
RadContainer () { return RadScrollPane.this; }
getContainer
46,382
boolean (ComponentDragObject dragObject) { return dragObject.getComponentCount() == 1 && getComponentCount() == 0; }
canDrop
46,383
void (FeedbackLayer feedbackLayer, ComponentDragObject dragObject) { feedbackLayer.putFeedback(getDelegee(), new Rectangle(0, 0, getWidth(), getHeight()), getDisplayName()); }
placeFeedback
46,384
void (GuiEditor editor, RadComponent[] components, GridConstraints[] constraintsToAdjust, ComponentDragObject dragObject) { addComponent(components[0]); }
processDrop
46,385
ComponentDropLocation (Direction direction) { return null; }
getAdjacentLocation
46,386
void (final Dimension size) { myPreferredSize.setSize(size); }
setPreferredSize
46,387
Dimension (final Container container) { return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); }
maximumLayoutSize
46,388
Dimension (final Container container) { return myPreferredSize; }
preferredLayoutSize
46,389
void (final Container parent) { }
layoutContainer
46,390
Dimension (final Container container) { final Container parent = container.getParent(); if (!(parent instanceof JComponent)) { return MIN_SIZE; } final RadComponent component = (RadComponent)((JComponent)parent).getClientProperty(RadComponent.CLIENT_PROP_RAD_COMPONENT); if (component == null) { return MIN_SIZE; } // th...
minimumLayoutSize
46,391
String () { return UIFormXmlConstants.LAYOUT_INTELLIJ; }
getName
46,392
LayoutManager () { return new GridLayoutManager(1, 1); }
createLayout
46,393
void (final RadContainer container, final List<RadComponent> contents, final List<Boolean> canRowsGrow, final List<Boolean> canColumnsGrow) { int rowCount = Math.max(1, canRowsGrow.size()); int columnCount = Math.max(1, canColumnsGrow.size()); container.setLayoutManager(this, new GridLayoutManager(rowCount, columnCount...
changeLayoutFromGrid
46,394
void (final RadContainer container, final List<RadComponent> components) { container.setLayoutManager(this, new GridLayoutManager(1, Math.max(1, components.size()))); }
changeLayoutFromIndexed
46,395
void (final XmlWriter writer, final RadContainer radContainer) { GridLayoutManager layout = (GridLayoutManager) radContainer.getLayout(); writer.addAttribute("row-count", layout.getRowCount()); writer.addAttribute("column-count", layout.getColumnCount()); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_SAME_SIZE_HORIZ...
writeLayout
46,396
void (final RadContainer container, final RadComponent component, final int index) { super.addComponentToContainer(container, component, index); container.getDelegee().add(component.getDelegee(), component.getConstraints()); }
addComponentToContainer
46,397
void (RadComponent component) { GridLayoutManager layout = (GridLayoutManager) component.getParent().getLayout(); final GridConstraints radConstraints = component.getConstraints(); final GridConstraints delegeeConstraints = layout.getConstraintsForComponent(component.getDelegee()); if (radConstraints != delegeeConstrai...
updateConstraints
46,398
void (final XmlWriter writer, final RadComponent child) { writeGridConstraints(writer, child); }
writeChildConstraints
46,399
int[] (RadContainer container, boolean isRow) { GridLayoutManager grid = (GridLayoutManager) container.getLayout(); return isRow ? grid.getYs() : grid.getXs(); }
getGridCellCoords