Search in sources :

Example 1 with InplaceContext

use of com.intellij.uiDesigner.propertyInspector.InplaceContext in project intellij-community by JetBrains.

the class InplaceEditingLayer method startInplaceEditing.

/**
   * Starts editing of "inplace" property for the component at the
   * specified point <code>(x, y)</code>.
   *
   * @param x x coordinate in the editor coordinate system
   * @param y y coordinate in the editor coordinate system
   */
public void startInplaceEditing(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.getDelegee());
    final Property inplaceProperty = inplaceComponent.getInplaceProperty(p.x, p.y);
    if (inplaceProperty != null) {
        final Rectangle bounds = inplaceComponent.getInplaceEditorBounds(inplaceProperty, p.x, p.y);
        startInplaceEditing(inplaceComponent, inplaceProperty, bounds, new InplaceContext(true));
    }
}
Also used : RadComponent(com.intellij.uiDesigner.radComponents.RadComponent) Property(com.intellij.uiDesigner.propertyInspector.Property) InplaceContext(com.intellij.uiDesigner.propertyInspector.InplaceContext)

Example 2 with InplaceContext

use of com.intellij.uiDesigner.propertyInspector.InplaceContext in project intellij-community by JetBrains.

the class StartInplaceEditingAction method actionPerformed.

public void actionPerformed(final AnActionEvent e) {
    final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(myEditor);
    final RadComponent component = selection.get(0);
    final Property defaultInplaceProperty = component.getDefaultInplaceProperty();
    myEditor.getInplaceEditingLayer().startInplaceEditing(component, defaultInplaceProperty, component.getDefaultInplaceEditorBounds(), new InplaceContext(true));
}
Also used : RadComponent(com.intellij.uiDesigner.radComponents.RadComponent) Property(com.intellij.uiDesigner.propertyInspector.Property) InplaceContext(com.intellij.uiDesigner.propertyInspector.InplaceContext)

Aggregations

InplaceContext (com.intellij.uiDesigner.propertyInspector.InplaceContext)2 Property (com.intellij.uiDesigner.propertyInspector.Property)2 RadComponent (com.intellij.uiDesigner.radComponents.RadComponent)2