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));
}
}
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();
}
}
}
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));
}
Aggregations