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 previous inplace editing (if any) // Start new inplace editing myInplaceComponent = inplaceComponent; myInplaceEditor = myInplaceProperty.getEditor(); LOG.assertTrue(myInplaceEditor != null); // 1. Get editor component myInplaceEditorComponent = myInplaceEditor.getComponent( myInplaceComponent, context.isKeepInitialValue() ? myInplaceProperty.getValue(myInplaceComponent) : null, context ); if (context.isModalDialogDisplayed()) { // ListModel, for example finishInplaceEditing(); return; } LOG.assertTrue(myInplaceEditorComponent != null); myInplaceEditor.addPropertyEditorListener(myPropertyEditorListener); // 2. Set editor component bounds final Dimension prefSize = myInplaceEditorComponent.getPreferredSize(); if(bounds != null){ // use bounds provided by the component itself final Point _p = SwingUtilities.convertPoint(myInplaceComponent.getDelegee(), bounds.x, bounds.y, this); myPreferredBounds = new Rectangle(_p.x, _p.y, bounds.width, bounds.height); } else{ // set some default bounds final Point _p = SwingUtilities.convertPoint(myInplaceComponent.getDelegee(), 0, 0, this); myPreferredBounds = new Rectangle(_p.x, _p.y, myInplaceComponent.getWidth(), myInplaceComponent.getHeight()); } myInplaceEditorComponent.setBounds( myPreferredBounds.x, myPreferredBounds.y + (myPreferredBounds.height - prefSize.height)/2, MathUtil.clamp(prefSize.width, myPreferredBounds.width, getWidth() - myPreferredBounds.x), prefSize.height ); // 3. Add it into layer add(myInplaceEditorComponent); myInplaceEditorComponent.revalidate(); // 4. Request focus into proper component JComponent componentToFocus = myInplaceEditor.getPreferredFocusedComponent(myInplaceEditorComponent); if (componentToFocus == null) { componentToFocus = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myInplaceEditorComponent); } if (componentToFocus == null) { componentToFocus = myInplaceEditorComponent; } if (componentToFocus.requestFocusInWindow()) { myFocusWatcher.install(myInplaceEditorComponent); } else { grabFocus(); final JComponent finalComponentToFocus = componentToFocus; ApplicationManager.getApplication().invokeLater(() -> { finalComponentToFocus.requestFocusInWindow(); myFocusWatcher.install(myInplaceEditorComponent); }); } // 5. Block any mouse event to finish editing by any of them enableEvents(MouseEvent.MOUSE_EVENT_MASK); repaint(); }