Search in sources :

Example 1 with Property

use of com.intellij.uiDesigner.propertyInspector.Property 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 Property

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

the class RadComponent method writeClientProperties.

private void writeClientProperties(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 value = getDelegee().getClientProperty(clientProp.getName());
            if (value != null) {
                if (!haveClientProperties) {
                    writer.startElement(UIFormXmlConstants.ELEMENT_CLIENT_PROPERTIES);
                    haveClientProperties = true;
                }
                writer.startElement(clientProp.getName());
                writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_CLASS, value.getClass().getName());
                writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_VALUE, value.toString());
                writer.endElement();
            }
        }
    } finally {
        if (haveClientProperties) {
            writer.endElement();
        }
    }
}
Also used : ClientPropertyProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertyProperty) ClientPropertiesProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertiesProperty) Property(com.intellij.uiDesigner.propertyInspector.Property) ClientPropertyProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertyProperty) ClientPropertiesProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertiesProperty) IntroStringProperty(com.intellij.uiDesigner.propertyInspector.properties.IntroStringProperty) IntrospectedProperty(com.intellij.uiDesigner.propertyInspector.IntrospectedProperty)

Example 3 with Property

use of com.intellij.uiDesigner.propertyInspector.Property 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

Property (com.intellij.uiDesigner.propertyInspector.Property)3 InplaceContext (com.intellij.uiDesigner.propertyInspector.InplaceContext)2 RadComponent (com.intellij.uiDesigner.radComponents.RadComponent)2 IntrospectedProperty (com.intellij.uiDesigner.propertyInspector.IntrospectedProperty)1 ClientPropertiesProperty (com.intellij.uiDesigner.propertyInspector.properties.ClientPropertiesProperty)1 ClientPropertyProperty (com.intellij.uiDesigner.propertyInspector.properties.ClientPropertyProperty)1 IntroStringProperty (com.intellij.uiDesigner.propertyInspector.properties.IntroStringProperty)1