Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
46,100
void (final boolean selected) { if (mySelected != selected) { mySelected = selected; firePropertyChanged(PROP_SELECTED, !mySelected, mySelected); GuiEditor.repaintLayeredPane(this); } }
setSelected
46,101
Object (@NotNull final Object key) { return myDelegee.getClientProperty(key); }
getClientProperty
46,102
void (@NotNull final Object key, final Object value) { myDelegee.putClientProperty(key, value); }
putClientProperty
46,103
int () { return myDelegee.getX(); }
getX
46,104
int () { return myDelegee.getY(); }
getY
46,105
void (final Point location) { myDelegee.setLocation(location); }
setLocation
46,106
void (final int dx, final int dy) { myDelegee.setLocation(myDelegee.getX() + dx, myDelegee.getY() + dy); }
shift
46,107
int () { return myDelegee.getWidth(); }
getWidth
46,108
int () { return myDelegee.getHeight(); }
getHeight
46,109
Dimension () { return myDelegee.getSize(); }
getSize
46,110
void (final Dimension size) { myDelegee.setSize(size); }
setSize
46,111
Rectangle () { return myDelegee.getBounds(); }
getBounds
46,112
void (final Rectangle bounds) { myDelegee.setBounds(bounds); }
setBounds
46,113
Dimension () { return Util.getMinimumSize(myDelegee, myConstraints, false); }
getMinimumSize
46,114
Dimension () { return Util.getPreferredSize(myDelegee, myConstraints, false); }
getPreferredSize
46,115
void () { }
refresh
46,116
void () { RadContainer theContainer = null; for (RadContainer container = this instanceof RadContainer ? (RadContainer)this : getParent(); container != null; container = container.getParent()) { final RadContainer parent = container.getParent(); if (parent != null && parent.isXY()) { final Dimension size = container.ge...
revalidate
46,117
boolean (final Property property) { return myModifiedPropertyNames.contains(property.getName()); }
isMarkedAsModified
46,118
void (final Property property) { myModifiedPropertyNames.add(property.getName()); }
markPropertyAsModified
46,119
void (final Property property) { myModifiedPropertyNames.remove(property.getName()); }
removeModifiedProperty
46,120
RadComponent (final Point pnt) { return this; }
getComponentToDrag
46,121
void (final MouseEvent event) { }
processMouseEvent
46,122
EventProcessor (final MouseEvent event) { return null; }
getEventProcessor
46,123
void (final XmlWriter writer) { writer.addAttribute("id", getId()); }
writeId
46,124
void (final XmlWriter writer) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_CLASS, getComponentClass().getName()); }
writeClass
46,125
void (final XmlWriter writer, String defaultClassName) { if (!getComponentClassName().equals(defaultClassName)) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_CLASS, getComponentClass().getName()); } }
writeClassIfDifferent
46,126
void (final XmlWriter writer) { // Binding if (getBinding() != null) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_BINDING, getBinding()); } if (isCustomCreate()) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_CUSTOM_CREATE, Boolean.TRUE.toString()); } if (isDefaultBinding()) { writer.addAttribute(UIFormXmlCon...
writeBinding
46,127
void (final XmlWriter writer) { writer.startElement("constraints"); try { if (getParent() != null) { getParent().getLayoutManager().writeChildConstraints(writer, this); } } finally { writer.endElement(); // constraints } }
writeConstraints
46,128
void (final XmlWriter writer) { writer.startElement(UIFormXmlConstants.ELEMENT_PROPERTIES); try { final IntrospectedProperty[] introspectedProperties = getPalette().getIntrospectedProperties(this); for (final IntrospectedProperty property : introspectedProperties) { if (isMarkedAsModified(property)) { final Object valu...
writeProperties
46,129
void (final XmlWriter writer) { if (myModule == null) { return; } boolean haveClientProperties = false; try { ClientPropertiesProperty cpp = ClientPropertiesProperty.getInstance(getProject()); for (Property prop : cpp.getChildren(this)) { ClientPropertyProperty clientProp = (ClientPropertyProperty)prop; final Object va...
writeClientProperties
46,130
void (GridConstraints oldConstraints) { firePropertyChanged(PROP_CONSTRAINTS, oldConstraints, myConstraints); }
fireConstraintsChanged
46,131
IProperty[] () { IntrospectedProperty[] props = getPalette().getIntrospectedProperties(this); ArrayList<IProperty> result = new ArrayList<>(); for (IntrospectedProperty prop : props) { if (isMarkedAsModified(prop)) { result.add(prop); } } return result.toArray(new IProperty[0]); }
getModifiedProperties
46,132
IContainer () { return myParent; }
getParentContainer
46,133
boolean () { return true; }
hasIntrospectedProperties
46,134
boolean (ComponentVisitor visitor) { return visitor.visit(this); }
accept
46,135
boolean () { return false; }
areChildrenExclusive
46,136
void (final LwComponent lwComponent, final LwIntrospectedProperty lwProperty, final IntrospectedProperty property) { myLoadingProperties = true; try { try { final Object value = lwComponent.getPropertyValue(lwProperty); //noinspection unchecked property.setValue(this, value); } catch (Exception e) { LOG.error(e); //TOD...
loadLwProperty
46,137
void () { }
doneLoadingFromLw
46,138
String () { StringBuilder titleBuilder = new StringBuilder(); if (getBinding() != null) { titleBuilder.append(getBinding()); } else { final String className = getComponentClassName(); int pos = className.lastIndexOf('.'); if (pos < 0) { titleBuilder.append(className); } else { titleBuilder.append(className.substring(po...
getDisplayName
46,139
void (ChangeEvent e) { saveButtonGroupIsBound(); }
stateChanged
46,140
void (FocusEvent e) { saveButtonGroupName(); }
focusLost
46,141
void (ActionEvent e) { saveButtonGroupName(); }
actionPerformed
46,142
void () { if (myGroup.isBound() != myBindToFieldCheckBox.isSelected()) { myGroup.setBound(myBindToFieldCheckBox.isSelected()); notifyListeners(new ChangeEvent(myGroup)); if (myGroup.isBound()) { BindingProperty.updateBoundFieldName(myRootContainer, null, myGroup.getName(), ButtonGroup.class.getName()); } else { Binding...
saveButtonGroupIsBound
46,143
void () { String oldName = myGroup.getName(); String newName = myNameTextField.getText(); if (!oldName.equals(newName)) { myGroup.setName(newName); notifyListeners(new ChangeEvent(myGroup)); if (myGroup.isBound()) { BindingProperty.updateBoundFieldName(myRootContainer, oldName, newName, ButtonGroup.class.getName()); } ...
saveButtonGroupName
46,144
JComponent () { return myPanel; }
getComponent
46,145
void (ChangeListener listener) { myListeners.add(listener); }
addChangeListener
46,146
void (ChangeListener listener) { myListeners.remove(listener); }
removeChangeListener
46,147
void (final ChangeEvent event) { for (ChangeListener changeListener : myListeners) { changeListener.stateChanged(event); } }
notifyListeners
46,148
LayoutManager () { return new FormLayout(ENCODED_FORMSPEC_GROW, ENCODED_FORMSPEC_GROW); }
createLayout
46,149
void (final RadContainer container, final List<RadComponent> contents, final List<Boolean> canRowsGrow, final List<Boolean> canColumnsGrow) { int rowCount = canRowsGrow.size(); int columnCount = canColumnsGrow.size(); int rowCountWithGaps = (rowCount == 0) ? 0 : rowCount * 2 - 1; int columnCountWithGaps = (columnCount ...
changeLayoutFromGrid
46,150
void (final RadContainer container, final List<RadComponent> components) { int maxSizePolicy = 0; for(RadComponent c: components) { maxSizePolicy = Math.max(maxSizePolicy, c.getConstraints().getHSizePolicy()); } ColumnSpec[] colSpecs = new ColumnSpec [components.size() * 2 - 1]; for(int i=0; i<components.size(); i++) {...
changeLayoutFromIndexed
46,151
void (final XmlWriter writer, final RadContainer radContainer) { FormLayout layout = (FormLayout) radContainer.getLayout(); for(int i=1; i<=layout.getRowCount(); i++) { RowSpec rowSpec = layout.getRowSpec(i); writer.startElement(UIFormXmlConstants.ELEMENT_ROWSPEC); try { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE...
writeLayout
46,152
void (final XmlWriter writer, final String elementName, final int[][] groups) { for(int[] group: groups) { writer.startElement(elementName); try { for(int member: group) { writer.startElement(UIFormXmlConstants.ELEMENT_MEMBER); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_INDEX, member); writer.endElement(); } } fi...
writeGroups
46,153
void (final RadContainer container, final RadComponent component, final int index) { super.addComponentToContainer(container, component, index); final CellConstraints cc = gridToCellConstraints(component); if (component.getCustomLayoutConstraints() instanceof CellConstraints customCellConstraints) { cc.insets = customC...
addComponentToContainer
46,154
CellConstraints (final RadComponent component) { GridConstraints gc = component.getConstraints(); CellConstraints.Alignment hAlign = ((gc.getHSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) ? CellConstraints.FILL : CellConstraints.DEFAULT; CellConstraints.Alignment vAlign = ((gc.getVSizePolicy() & GridConstr...
gridToCellConstraints
46,155
void (final XmlWriter writer, final RadComponent child) { writeGridConstraints(writer, child); if (child.getCustomLayoutConstraints() instanceof CellConstraints cc) { writer.startElement(UIFormXmlConstants.ELEMENT_FORMS); try { if (!cc.insets.equals(new Insets(0, 0, 0, 0))) { writer.addAttribute(UIFormXmlConstants.ATTR...
writeChildConstraints
46,156
FormLayout (final RadContainer container) { return (FormLayout) container.getLayout(); }
getFormLayout
46,157
int (final int[] origins, final int coord) { for(int i=0; i<origins.length-1; i++) { if (coord >= origins [i] && coord < origins [i+1]) return i; } return -1; }
findCell
46,158
ComponentDropLocation (@NotNull RadContainer container, @Nullable final Point location) { FormLayout formLayout = getFormLayout(container); if (formLayout.getRowCount() == 0 || formLayout.getColumnCount() == 0) { if (location != null) { Rectangle rc = new Rectangle(new Point(), container.getDelegee().getSize()); return...
getDropLocation
46,159
CustomPropertiesPanel (RadContainer container, boolean isRow, int[] selectedIndices) { if (myPropertiesPanel == null) { myPropertiesPanel = new FormLayoutColumnProperties(); } myPropertiesPanel.showProperties(container, isRow, selectedIndices); return myPropertiesPanel; }
getRowColumnPropertiesPanel
46,160
ActionGroup () { DefaultActionGroup group = new DefaultActionGroup(); group.add(new InsertBeforeAction()); group.add(new InsertAfterAction()); group.add(new SplitAction()); group.add(new DeleteAction()); group.add(new GroupRowsColumnsAction()); group.add(new UngroupRowsColumnsAction()); return group; }
getCaptionActions
46,161
boolean (RadContainer container, boolean isRow, int index) { FormLayout layout = (FormLayout) container.getLayout(); FormSpec spec = isRow ? layout.getRowSpec(index+1) : layout.getColumnSpec(index+1); return spec.getResizeWeight() > 0.01d; }
canCellGrow
46,162
void (RadComponent child, boolean dragging) { // do nothing here - otherwise the layout will jump around }
setChildDragging
46,163
void (final RadContainer container, final boolean isRow, final int index, final Graphics2D g2d, final Rectangle rc) { // don't paint gap rows/columns with red background if (isGapCell(container, isRow, index)) { g2d.setColor(Color.LIGHT_GRAY); g2d.fillRect(rc.x, rc.y, rc.width, rc.height); } if (canCellGrow(container, ...
paintCaptionDecoration
46,164
void (final Rectangle rc, final boolean isRow, final Graphics2D g2d, boolean isTop, final boolean haveLeft, final boolean haveRight, final boolean haveLine) { int maxX = (int) rc.getMaxX(); int maxY = (int) rc.getMaxY(); Point linePos = isTop ? new Point(rc.x+1, rc.y+1) : new Point(rc.x+3, rc.y+3); Point markerPos = ne...
drawGroupLine
46,165
Property[] (final Project project, final RadComponent component) { return new Property[] { HorzAlignProperty.getInstance(project), VertAlignProperty.getInstance(project), new ComponentInsetsProperty() }; }
getComponentProperties
46,166
int (final RadContainer grid, final int cellIndex, final boolean isRow, final boolean isBefore, final boolean grow) { FormSpec formSpec; if (isRow) { formSpec = grow ? new RowSpec(ENCODED_FORMSPEC_GROW) : new RowSpec(DEFAULT_NOGROW_SIZE); } else { formSpec = grow ? new ColumnSpec(ENCODED_FORMSPEC_GROW) : new ColumnSpec...
insertGridCells
46,167
void (RadContainer source, final RadContainer destination, final boolean isRow, int cellIndex, int cellCount, int targetIndex) { FormLayout sourceLayout = getFormLayout(source); FormLayout destinationLayout = getFormLayout(destination); if (isRow) { insertOrAppendRow(destinationLayout, targetIndex+1, FormFactory.RELATE...
copyGridCells
46,168
void (final FormLayout sourceLayout, final FormLayout destinationLayout, final boolean isRow, int cellIndex, int cellCount, int targetIndex) { for(int i=0; i < cellCount; i++) { if (isRow) { RowSpec rowSpec = sourceLayout.getRowSpec(cellIndex + 1); insertOrAppendRow(destinationLayout, targetIndex+1, rowSpec); } else { ...
copyFormSpecs
46,169
void (final RadContainer source, final RadContainer destination, final Rectangle rc) { final FormLayout destinationLayout = new FormLayout(); destination.setLayout(destinationLayout); copyFormSpecs(getFormLayout(source), destinationLayout, true, rc.y, rc.height, 0); copyFormSpecs(getFormLayout(source), destinationLayou...
copyGridSection
46,170
int () { return 1; }
getGapCellCount
46,171
int (final RadContainer container, boolean isRow) { Size size = isRow ? FormFactory.RELATED_GAP_ROWSPEC.getSize() : FormFactory.RELATED_GAP_COLSPEC.getSize(); if (size instanceof ConstantSize) { return ((ConstantSize) size).getPixelSize(container.getDelegee()); } return 0; }
getGapCellSize
46,172
boolean (RadContainer grid, boolean isRow, int cellIndex) { if (cellIndex < 0 || cellIndex >= getGridCellCount(grid, isRow)) { return false; } if (cellIndex % 2 == 1) { final GridChangeUtil.CellStatus status = GridChangeUtil.canDeleteCell(grid, cellIndex, isRow); if (status == GridChangeUtil.CellStatus.Empty || status ...
isGapCell
46,173
int () { return 1; }
getCellIndexBase
46,174
int (RadContainer grid, int cellIndex, boolean isRow, boolean isBefore, FormSpec formSpec) { FormLayout formLayout = (FormLayout) grid.getLayout(); int index = isBefore ? cellIndex+1 : cellIndex+2; if (isRow) { if (getGridCellCount(grid, true) > 0) { insertOrAppendRow(formLayout, index, FormFactory.RELATED_GAP_ROWSPEC)...
insertGridCells
46,175
void (final FormLayout formLayout, final int index, final RowSpec rowSpec) { if (index == formLayout.getRowCount()+1) { formLayout.appendRow(rowSpec); } else { formLayout.insertRow(index, rowSpec); } }
insertOrAppendRow
46,176
void (final FormLayout formLayout, final int index, final ColumnSpec columnSpec) { if (index == formLayout.getColumnCount()+1) { formLayout.appendColumn(columnSpec); } else { formLayout.insertColumn(index, columnSpec); } }
insertOrAppendColumn
46,177
int (final RadContainer grid, final int cellIndex, final boolean isRow) { int result = 1; FormLayout formLayout = (FormLayout) grid.getLayout(); adjustDeletedCellOrigins(grid, cellIndex, isRow); if (isRow) { int[][] groupIndices = formLayout.getRowGroups(); groupIndices = removeDeletedCell(groupIndices, cellIndex+1); f...
deleteGridCells
46,178
void (final RadContainer grid, final int cellIndex, final boolean isRow) { int gapCellDelta = isGapCell(grid, isRow, cellIndex+1) ? 2 : 1; for(RadComponent component: grid.getComponents()) { // ensure that we don't have component origins in the deleted cells final GridConstraints gc = component.getConstraints(); if (gc...
adjustDeletedCellOrigins
46,179
int[][] (final int[][] groupIndices, final int deletedIndex) { for(int i=0; i<groupIndices.length; i++) { for(int j=0; j<groupIndices [i].length; j++) { if (groupIndices [i][j] == deletedIndex) { int[][] newIndices; if (groupIndices [i].length <= 2) { // deleted cell is contained in a group with 1 or 2 cells => delete ...
removeDeletedCell
46,180
String (RadContainer container, boolean isRow, int cell, int newSize) { final String size = getUpdatedSize(container, isRow, cell, newSize).toString(); return isRow ? UIDesignerBundle.message("tooltip.resize.row", cell+getCellIndexBase(), size) : UIDesignerBundle.message("tooltip.resize.column", cell+getCellIndexBase()...
getCellResizeTooltip
46,181
void (RadContainer container, final boolean isRow, final int cell, final int newSize) { FormLayout formLayout = (FormLayout) container.getLayout(); final ConstantSize updatedSize = getUpdatedSize(container, isRow, cell, newSize); FormSpec newSpec; if (isRow) { RowSpec rowSpec = formLayout.getRowSpec(cell+1); newSpec = ...
processCellResized
46,182
void (final int cell, final FormLayout formLayout, final FormSpec newSpec, final boolean isRow) { int[][] groups = isRow ? formLayout.getRowGroups() : formLayout.getColumnGroups(); for(int[] group: groups) { boolean foundGroup = false; for(int groupCell: group) { if (groupCell == cell+1) { foundGroup = true; break; } }...
resizeSameGroupCells
46,183
void (final FormLayout formLayout, final FormSpec newSpec, final int cell, boolean isRow) { if (isRow) { formLayout.setRowSpec(cell, (RowSpec) newSpec); } else { formLayout.setColumnSpec(cell, (ColumnSpec) newSpec); } }
setSpec
46,184
ConstantSize (RadContainer container, boolean isRow, int cell, int newPx) { FormLayout formLayout = (FormLayout) container.getLayout(); if (isRow) { return scaleSize(formLayout.getRowSpec(cell+1), container, newPx); } else { return scaleSize(formLayout.getColumnSpec(cell+1), container, newPx); } }
getUpdatedSize
46,185
ConstantSize (final FormSpec rowSpec, final RadContainer container, final int newPx) { if (rowSpec.getSize() instanceof ConstantSize oldSize) { int oldPx = oldSize.getPixelSize(container.getDelegee()); double newValue = Math.round(oldSize.getValue() * newPx / oldPx * 10) / 10; return new ConstantSize(newValue, oldSize....
scaleSize
46,186
void (final RadContainer container, final boolean isRow, final int[] cellsToMove, int targetCell) { for(int i=0; i<cellsToMove.length; i++) { final int sourceCell = cellsToMove[i]; moveCells(container, isRow, sourceCell, targetCell); if (sourceCell < targetCell) { for(int j=i+1; j<cellsToMove.length; j++) { cellsToMove...
processCellsMoved
46,187
void (final RadContainer container, final boolean isRow, final int cell, int targetCell) { if (targetCell >= cell && targetCell <= cell+2) { return; } FormLayout layout = (FormLayout) container.getLayout(); List<RadComponent> componentsToMove = new ArrayList<>(); FormSpec oldSpec = isRow ? layout.getRowSpec(cell+1) : l...
moveCells
46,188
void (RadContainer grid) { FormLayout layout = (FormLayout) grid.getLayout(); for(RadComponent c: grid.getComponents()) { CellConstraints cc = layout.getConstraints(c.getDelegee()); GridConstraints gc = c.getConstraints(); copyCellToGridConstraints(gc, cc); } }
updateGridConstraintsFromCellConstraints
46,189
void (final GridConstraints gc, final CellConstraints cc) { gc.setColumn(cc.gridX-1); gc.setRow(cc.gridY-1); gc.setColSpan(cc.gridWidth); gc.setRowSpan(cc.gridHeight); }
copyCellToGridConstraints
46,190
int (RadComponent component, boolean horizontal) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); CellConstraints.Alignment al = horizontal ? cc.hAlign : cc.vAlign; if (al == CellConstraints.DEFAULT) { FormLayout formLayout = (FormLayout) component.getParent().getLayout(); FormSpec formS...
getAlignment
46,191
void (RadComponent component, boolean horizontal, int alignment) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); if (horizontal) { cc.hAlign = FormLayoutSerializer.ourHorizontalAlignments [alignment]; } else { cc.vAlign = FormLayoutSerializer.ourVerticalAlignments [alignment]; } updateC...
setAlignment
46,192
void (RadComponent component, boolean horizontal) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); if (horizontal) { cc.hAlign = CellConstraints.DEFAULT; } else { cc.vAlign = CellConstraints.DEFAULT; } updateConstraints(component); }
resetAlignment
46,193
boolean (RadComponent component, boolean horizontal) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); CellConstraints.Alignment al = horizontal ? cc.hAlign : cc.vAlign; return al != CellConstraints.DEFAULT; }
isAlignmentModified
46,194
void (final RadComponent component) { FormLayout layout = (FormLayout) component.getParent().getLayout(); layout.setConstraints(component.getDelegee(), gridToCellConstraints(component)); super.updateConstraints(component); }
updateConstraints
46,195
int () { return 0; }
getMinCellCount
46,196
Object (final Object original) { // FormLayout may have been loaded with a different classloader, so we need to create a copy through serialization Object copy; try { BufferExposingByteArrayOutputStream baos = new BufferExposingByteArrayOutputStream(); try (ObjectOutputStream os = new ObjectOutputStream(baos)) { os.wri...
createSerializedCopy
46,197
Insets (final RadComponent component) { if (component.getCustomLayoutConstraints() instanceof CellConstraints cellConstraints) { return cellConstraints.insets; } return new Insets(0, 0, 0, 0); }
getValue
46,198
boolean () { return true; }
isGrid
46,199
int (RadContainer container, boolean isRow) { return isRow ? getGridRowCount(container) : getGridColumnCount(container); }
getGridCellCount