Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
46,400
int[] (RadContainer container, boolean isRow) { GridLayoutManager grid = (GridLayoutManager) container.getLayout(); return isRow ? grid.getHeights() : grid.getWidths(); }
getGridCellSizes
46,401
CustomPropertiesPanel (RadContainer container, boolean isRow, int[] selectedIndices) { if (myPropertiesPanel == null) { myPropertiesPanel = new GridLayoutColumnProperties(); } myPropertiesPanel.showProperties(container, isRow, selectedIndices); return myPropertiesPanel; }
getRowColumnPropertiesPanel
46,402
ActionGroup () { DefaultActionGroup group = new DefaultActionGroup(); group.add(new InsertBeforeAction()); group.add(new InsertAfterAction()); group.add(new SplitAction()); group.add(new DeleteAction()); return group; }
getCaptionActions
46,403
boolean (RadContainer container, boolean isRow, int cellIndex) { final GridLayoutManager gridLayoutManager = ((GridLayoutManager)container.getLayout()); int maxSizePolicy = 0; for(int i=0; i<gridLayoutManager.getCellCount(isRow); i++) { maxSizePolicy = Math.max(maxSizePolicy, gridLayoutManager.getCellSizePolicy(isRow, ...
canCellGrow
46,404
void (RadContainer container, final boolean isRow, final int cell, final int newSize) { int cellCount = isRow ? container.getGridRowCount() : container.getGridColumnCount(); if (container.getParent().isXY() && cell == cellCount-1) { processRootContainerResize(container, isRow, newSize); } else { for(RadComponent compon...
processCellResized
46,405
void (final RadContainer container, final boolean isRow, final int newSize) { final JComponent parentDelegee = container.getDelegee(); Dimension containerSize = parentDelegee.getSize(); if (isRow) { containerSize.height = newSize + parentDelegee.getBounds().y; } else { containerSize.width = newSize + parentDelegee.getB...
processRootContainerResize
46,406
void (final RadContainer source, final RadContainer destination, final Rectangle rc) { destination.setLayout(new GridLayoutManager(rc.height, rc.width)); }
copyGridSection
46,407
LayoutManager (LayoutManager layout, int rowDelta, int columnDelta) { GridLayoutManager oldLayout = (GridLayoutManager) layout; final GridLayoutManager newLayout = new GridLayoutManager(oldLayout.getRowCount() + rowDelta, oldLayout.getColumnCount() + columnDelta); newLayout.setMargin(oldLayout.getMargin()); newLayout.s...
copyLayout
46,408
void (final XmlWriter writer) { writer.startElement(UIFormXmlConstants.ELEMENT_GROUP); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_NAME, myName); if (myBound) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_BOUND, true); } for(String id: myComponentIds) { writer.startElement(UIFormXmlConstants.ELEMENT_MEMBER); ...
write
46,409
boolean (final RadComponent component) { return myComponentIds.contains(component.getId()); }
contains
46,410
void (final String name) { myName = name; }
setName
46,411
boolean () { return myBound; }
isBound
46,412
void (final boolean bound) { myBound = bound; }
setBound
46,413
void (final RadComponent component) { myComponentIds.add(component.getId()); }
add
46,414
void (final RadComponent component) { myComponentIds.remove(component.getId()); }
remove
46,415
void (final String[] componentIds) { Collections.addAll(myComponentIds, componentIds); }
addComponentIds
46,416
String[] () { return ArrayUtilRt.toStringArray(myComponentIds); }
getComponentIds
46,417
boolean () { return myComponentIds.size() == 0; }
isEmpty
46,418
boolean () { return false; }
isSelected
46,419
void (final boolean ignored) { }
setSelected
46,420
void (final String classToBind) { myClassToBind = classToBind; }
setClassToBind
46,421
String () { return myMainComponentBinding; }
getMainComponentBinding
46,422
void (final String mainComponentBinding) { myMainComponentBinding = mainComponentBinding; }
setMainComponentBinding
46,423
void (final XmlWriter writer) { writer.startElement("form", Utils.FORM_NAMESPACE); try{ writer.addAttribute("version", 1); final String classToBind = getClassToBind(); if (classToBind != null){ writer.addAttribute("bind-to-class", classToBind); } final String mainComponentBinding = getMainComponentBinding(); if (mainCo...
write
46,424
void (final XmlWriter writer) { if (myInspectionSuppressions.size() > 0) { writer.startElement(UIFormXmlConstants.ELEMENT_INSPECTION_SUPPRESSIONS); for(LwInspectionSuppression suppression: myInspectionSuppressions) { writer.startElement(UIFormXmlConstants.ELEMENT_SUPPRESS); writer.addAttribute(UIFormXmlConstants.ATTRIB...
writeInspectionSuppressions
46,425
RadLayoutManager () { return RadXYLayoutManager.INSTANCE; }
createInitialLayoutManager
46,426
void (@NotNull RadComponent component, @Nullable RadButtonGroup value) { for(int i=myButtonGroups.size()-1; i >= 0; i--) { RadButtonGroup group = myButtonGroups.get(i); if (group == value) { group.add(component); } else { group.remove(component); if (group.isEmpty()) { myButtonGroups.remove(i); } } } }
setGroupForComponent
46,427
RadButtonGroup[] () { return myButtonGroups.toArray(new RadButtonGroup[0]); }
getButtonGroups
46,428
RadButtonGroup (final String groupName) { RadButtonGroup group = new RadButtonGroup(groupName); myButtonGroups.add(group); return group; }
createGroup
46,429
void (RadButtonGroup group) { myButtonGroups.remove(group); }
deleteGroup
46,430
void (final IButtonGroup[] buttonGroups) { myButtonGroups.clear(); for(IButtonGroup lwGroup: buttonGroups) { final String[] componentIds = lwGroup.getComponentIds(); if (componentIds.length > 0) { RadButtonGroup group = createGroup(lwGroup.getName()); group.setBound(lwGroup.isBound()); group.addComponentIds(componentId...
setButtonGroups
46,431
List<RadComponent> (final RadButtonGroup group) { ArrayList<RadComponent> result = new ArrayList<>(); for(String id: group.getComponentIds()) { RadComponent component = (RadComponent) FormEditingUtil.findComponent(this, id); if (component != null) { result.add(component); } } return result; }
getGroupContents
46,432
String (IComponent component) { for(RadButtonGroup group: myButtonGroups) { if (group.contains((RadComponent)component)) { return group.getName(); } } return null; }
getButtonGroupName
46,433
String[] (String groupName) { for(RadButtonGroup group: myButtonGroups) { if (group.getName().equals(groupName)) { return group.getComponentIds(); } } throw new IllegalArgumentException("Cannot find group " + groupName); }
getButtonGroupComponentIds
46,434
Locale () { return myStringDescriptorLocale; }
getStringDescriptorLocale
46,435
void (final Locale stringDescriptorLocale) { myStringDescriptorLocale = stringDescriptorLocale; }
setStringDescriptorLocale
46,436
void (String inspectionId, @Nullable RadComponent component) { for(int i=myInspectionSuppressions.size()-1; i >= 0; i--) { LwInspectionSuppression suppression = myInspectionSuppressions.get(i); if (suppression.getInspectionId().equals(inspectionId)) { if (component != null && (component.getId().equals(suppression.getCo...
suppressInspection
46,437
boolean (final String inspectionId, final String componentId) { for(LwInspectionSuppression suppression: myInspectionSuppressions) { if ((suppression.getComponentId() == null || suppression.getComponentId().equals(componentId)) && suppression.getInspectionId().equals(inspectionId)) { return true; } } return false; }
isInspectionSuppressed
46,438
LwInspectionSuppression[] () { return myInspectionSuppressions.toArray(LwInspectionSuppression.EMPTY_ARRAY); }
getInspectionSuppressions
46,439
void (final LwInspectionSuppression[] inspectionSuppressions) { myInspectionSuppressions.clear(); Collections.addAll(myInspectionSuppressions, inspectionSuppressions); }
setInspectionSuppressions
46,440
void (final LwInspectionSuppression suppression) { for(LwInspectionSuppression existing: myInspectionSuppressions) { if (existing.getInspectionId().equals(suppression.getInspectionId()) && Objects.equals(existing.getComponentId(), suppression.getComponentId())) { myInspectionSuppressions.remove(existing); break; } } }
removeInspectionSuppression
46,441
void () { super.doLayout(); int count = getComponentCount(); for (int i = 0; i < count; i++) { Component component = getComponent(i); Rectangle bounds = component.getBounds(); if (bounds.x < 0 || bounds.y < 0) { component.setBounds(bounds.x < 0 ? 20 : bounds.x, bounds.y < 0 ? 20 : bounds.y, bounds.width, bounds.height)...
doLayout
46,442
Cursor () { return myCursor; }
getCursor
46,443
void (final Cursor cursor) { myCursor = cursor; }
setCursor
46,444
boolean () { return false; }
isDragActive
46,445
boolean () { return false; }
needMousePressed
46,446
boolean (final int keyCode) { return keyCode == KeyEvent.VK_HOME || keyCode == KeyEvent.VK_END || keyCode == KeyEvent.VK_PAGE_UP || keyCode == KeyEvent.VK_PAGE_DOWN; }
isMoveToLast
46,447
ComponentDropLocation (final GuiEditor editor, final ComponentDropLocation location, final ComponentDragObject dragObject, final KeyEvent e) { ComponentDropLocation.Direction dir = directionFromKey(e.getKeyCode()); boolean moveToLast = isMoveToLast(e.getKeyCode()); if (dir != null && location != null) { e.consume(); Co...
moveDropLocation
46,448
void (int newCell) { if (myMode == GridInsertMode.RowBefore) { int oldRow = myInsertCellComponent.getConstraints().getRow(); int columns = myLayoutManager.getGridColumnCount(myContainer); for (int i = 0; i < columns; i++) { if (i != myColumn) { RadComponent component = RadAbstractGridLayoutManager.getComponentAtGrid(my...
doBefore
46,449
void (int newCell) { if (myMode == GridInsertMode.RowAfter) { int columns = myLayoutManager.getGridColumnCount(myContainer); for (int i = 0; i < columns; i++) { if (i != myColumn) { RadComponent component = RadAbstractGridLayoutManager.getComponentAtGrid(myContainer, myRow, i); if (component != null) { GridConstraints ...
doAfter
46,450
ComponentDropLocation (RadRootContainer rootContainer, Point aPoint) { RadContainer container = getDropTargetContainer(rootContainer, aPoint); if (container == null) { return NoDropLocation.INSTANCE; } final Point targetPoint = SwingUtilities.convertPoint(rootContainer.getDelegee(), aPoint, container.getDelegee()); ret...
getDropLocation
46,451
RadContainer (final RadRootContainer rootContainer, final Point aPoint) { int EPSILON = 4; RadContainer container = FormEditingUtil.getRadContainerAt(rootContainer, aPoint.x, aPoint.y, EPSILON); // to facilitate initial component adding, increase stickiness if there is one container at top level if (container instanceo...
getDropTargetContainer
46,452
ComponentDropLocation (Point pnt, ComponentDragObject dragObject) { final ComponentDropLocation dropLocation = getDropLocation(myEditor.getRootContainer(), pnt); LOG.info("GridInsertProcessor.processDragEvent(): dropLocation " + dropLocation.toString()); if (dropLocation.canDrop(dragObject)) { dropLocation.placeFeedbac...
processDragEvent
46,453
Cursor (final Point pnt, final boolean copyOnDrop, final ComponentDragObject dragObject) { ComponentDropLocation location = processDragEvent(pnt, dragObject); if (!location.canDrop(dragObject)) { return FormEditingUtil.getMoveNoDropCursor(); } return copyOnDrop ? FormEditingUtil.getCopyDropCursor() : FormEditingUtil.ge...
processMouseMoveEvent
46,454
void (final RadComponent component, final Graphics g) { // Paint component bounds and grid markers Painter.paintComponentDecoration(myEditor, component, g); final Set<RadButtonGroup> paintedGroups = new HashSet<>(); final RadRootContainer rootContainer = myEditor.getRootContainer(); final ComponentTree componentTree = ...
paintPassiveDecoration
46,455
boolean (final RadComponent component) { final Point point = SwingUtilities.convertPoint( component.getDelegee(), 0, 0, rootContainer.getDelegee() ); RadButtonGroup group = (RadButtonGroup)FormEditingUtil.findGroupForComponent(rootContainer, component); if (group != null && !paintedGroups.contains(group) && (component....
visit
46,456
Icon () { return UIDesignerIcons.Drag; }
getDragIcon
46,457
void (final Graphics g) { // Passive decoration final RadRootContainer root = myEditor.getRootContainer(); for(int i = root.getComponentCount() - 1; i >= 0; i--){ final RadComponent component = root.getComponent(i); paintPassiveDecoration(component, g); } // Paint active decorators paintChildren(g); }
paint
46,458
void () { // Store original constraints and parents. This information is required // to restore initial state if drag is canceled. myOriginalConstraints = new GridConstraints[mySelection.size()]; myOriginalBounds = new Rectangle[mySelection.size()]; myOriginalParents = new RadContainer[mySelection.size()]; for (int i1 ...
fillOriginalConstraints
46,459
DraggedComponentList (final GuiEditor editor, @Nullable Point pnt) { return new DraggedComponentList(editor, pnt); }
pickupSelection
46,460
DraggedComponentList (RadComponent... c) { ArrayList<RadComponent> list = new ArrayList<>(); Collections.addAll(list, c); return new DraggedComponentList(list); }
withComponents
46,461
DraggedComponentList (final Transferable transferable) { if (transferable.isDataFlavorSupported(ourDataFlavor)) { Object data; try { data = transferable.getTransferData(ourDataFlavor); } catch (Exception e) { return null; } if (data instanceof DraggedComponentList) { return (DraggedComponentList) data; } } return null;...
fromTransferable
46,462
int () { return myDragDeltaX; }
getDragDeltaX
46,463
int () { return myDragDeltaY; }
getDragDeltaY
46,464
ArrayList<RadComponent> () { return mySelection; }
getComponents
46,465
int () { return mySelection.size(); }
getComponentCount
46,466
RadContainer (final RadComponent c) { return myOriginalParents [mySelection.indexOf(c)]; }
getOriginalParent
46,467
GridConstraints[] () { GridConstraints[] result = new GridConstraints[myOriginalConstraints.length]; for(int i=0; i<myOriginalConstraints.length; i++) { result [i] = myOriginalConstraints [i].store(); } return result; }
getOriginalConstraints
46,468
Rectangle[] () { return myOriginalBounds; }
getOriginalBounds
46,469
Rectangle (final RadComponent c) { return myOriginalBounds [mySelection.indexOf(c)]; }
getOriginalBounds
46,470
DataFlavor[] () { return new DataFlavor[] { ourDataFlavor }; }
getTransferDataFlavors
46,471
boolean (DataFlavor flavor) { return flavor.equals(ourDataFlavor); }
isDataFlavorSupported
46,472
boolean () { for(GridConstraints c: myOriginalConstraints) { if ((c.getHSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) return true; } return false; }
isHGrow
46,473
boolean () { for(GridConstraints c: myOriginalConstraints) { if ((c.getVSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) return true; } return false; }
isVGrow
46,474
int (int componentIndex) { return myOriginalConstraints [componentIndex].getRow() - myComponentUnderMouseRow; }
getRelativeRow
46,475
int (int componentIndex) { return myOriginalConstraints [componentIndex].getColumn() - myComponentUnderMouseColumn; }
getRelativeCol
46,476
int (int componentIndex) { return myOriginalConstraints [componentIndex].getRowSpan(); }
getRowSpan
46,477
int (int componentIndex) { return myOriginalConstraints [componentIndex].getColSpan(); }
getColSpan
46,478
Point (int componentIndex) { return null; }
getDelta
46,479
Dimension (final RadContainer targetContainer) { if (myOriginalBounds.length == 1) { return myOriginalBounds [0].getSize(); } return new Dimension(-1, -1); }
getInitialSize
46,480
RadContainer[] () { return myOriginalParents; }
getOriginalParents
46,481
boolean () { return myHasDragDelta; }
hasDragDelta
46,482
int () { return myRow; }
getRow
46,483
int () { return myColumn; }
getColumn
46,484
RadContainer () { return myContainer; }
getContainer
46,485
boolean (final ComponentDragObject dragObject) { // If target point doesn't belong to any cell and column then do not allow drop. if (myRow == -1 || myColumn == -1) { LOG.debug("RadContainer.canDrop=false because no cell at mouse position"); return false; } int colSpan = 1; // allow drop any (NxM) component to cell (1x...
canDrop
46,486
RadComponent (final int startRow, final int startCol, final int rowSpan, final int colSpan) { return myContainer.findComponentInRect(startRow, startCol, rowSpan, colSpan); }
findOverlappingComponent
46,487
void (FeedbackLayer feedbackLayer, ComponentDragObject dragObject) { Rectangle feedbackRect = null; if (getContainer().getLayoutManager().isGrid()) { feedbackRect = getGridFeedbackRect(dragObject, false, false, true); } if (feedbackRect != null) { final JComponent component = getContainer().getDelegee(); String feedbac...
placeFeedback
46,488
Rectangle (ComponentDragObject dragObject, boolean ignoreWidth, boolean ignoreHeight, boolean overlapping) { if (dragObject.getComponentCount() == 0) { return null; } Rectangle rc = calculateGridFeedbackCellRect(dragObject, ignoreWidth, ignoreHeight, true); if (rc == null) { return calculateGridFeedbackCellRect(dragObj...
getGridFeedbackCellRect
46,489
Rectangle (ComponentDragObject dragObject, boolean ignoreWidth, boolean ignoreHeight, boolean spans) { Rectangle rc = getDragObjectDimensions(dragObject, spans); int w = ignoreWidth ? 1 : rc.width; int h = ignoreHeight ? 1 : rc.height; if (rc.x < 0 || rc.y < 0 || rc.y + h > getContainer().getGridRowCount() || rc.x + w ...
calculateGridFeedbackCellRect
46,490
Rectangle (ComponentDragObject dragObject, boolean spans) { int firstRow = getRow(); int lastRow = getRow(); int firstCol = getColumn(); int lastCol = getColumn(); for (int i = 0; i < dragObject.getComponentCount(); i++) { int relRow = dragObject.getRelativeRow(i); int relCol = dragObject.getRelativeCol(i); firstRow = ...
getDragObjectDimensions
46,491
Rectangle (ComponentDragObject dragObject, boolean ignoreWidth, boolean ignoreHeight, boolean overlapping) { Rectangle cellRect = getGridFeedbackCellRect(dragObject, ignoreWidth, ignoreHeight, overlapping); if (cellRect == null) return null; int h = ignoreHeight ? 0 : cellRect.height; int w = ignoreWidth ? 0 : cellRect...
getGridFeedbackRect
46,492
void (final GuiEditor editor, final RadComponent[] components, final GridConstraints[] constraintsToAdjust, final ComponentDragObject dragObject) { dropIntoGrid(myContainer, components, myRow, myColumn, dragObject); }
processDrop
46,493
ComponentDropLocation (Direction direction) { var insertMode = switch (direction) { case LEFT -> GridInsertMode.ColumnBefore; case UP -> GridInsertMode.RowBefore; case RIGHT -> GridInsertMode.ColumnAfter; case DOWN -> GridInsertMode.RowAfter; }; return new GridInsertLocation(myContainer, myRow, myColumn, insertMode); }
getAdjacentLocation
46,494
void (final RadContainer container, final RadComponent[] components, int row, int column, final ComponentDragObject dragObject) { assert components.length > 0; for(int i=0; i<components.length; i++) { RadComponent c = components [i]; if (c instanceof RadContainer) { final LayoutManager layout = ((RadContainer)c).getLay...
dropIntoGrid
46,495
boolean () { return true; }
isValidateRoot
46,496
void (final MouseEvent e) { if( myInplaceComponent != null && (MouseEvent.MOUSE_PRESSED == e.getID() || MouseEvent.MOUSE_RELEASED == e.getID()) ){ finishInplaceEditing(); } // [vova] this is very important! Without this code Swing doen't close popup menu on our // layered pane. Swing adds MouseListeners to all componen...
processMouseEvent
46,497
boolean () { return myInplaceComponent != null; }
isEditing
46,498
void (final int x, final int y) { final RadComponent inplaceComponent = FormEditingUtil.getRadComponentAt(myEditor.getRootContainer(), x, y); if(inplaceComponent == null){ // nothing to edit return; } // Try to find property with inplace editor final Point p = SwingUtilities.convertPoint(this, x, y, inplaceComponent.ge...
startInplaceEditing
46,499
void (@NotNull final RadComponent inplaceComponent, @Nullable final Property property, @Nullable final Rectangle bounds, final InplaceContext context) { myInplaceProperty = property; if(myInplaceProperty == null){ return; } if (!myEditor.ensureEditable()) { myInplaceProperty = null; return; } // Now we have to cancel p...
startInplaceEditing