use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class ComponentEditor method collectFilteredComponents.
protected RadComponent[] collectFilteredComponents(final RadComponent component) {
final ArrayList<RadComponent> result = new ArrayList<>();
result.add(null);
RadContainer container = component.getParent();
while (container.getParent() != null) {
container = container.getParent();
}
FormEditingUtil.iterate(container, new FormEditingUtil.ComponentVisitor() {
public boolean visit(final IComponent component) {
RadComponent radComponent = (RadComponent) component;
final JComponent delegee = radComponent.getDelegee();
if (!myPropertyType.isInstance(delegee)) {
return true;
}
if (myFilter == null || myFilter.value(radComponent)) {
result.add(radComponent);
}
return true;
}
});
return result.toArray(new RadComponent[result.size()]);
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class IntroComponentProperty method updateLabelForBinding.
void updateLabelForBinding(final RadComponent component) {
String value = getValue(component);
String text = FormInspectionUtil.getText(component.getModule(), component);
if (text != null && value != null) {
RadRootContainer root = (RadRootContainer) FormEditingUtil.getRoot(component);
if (root != null) {
RadComponent valueComponent = (RadComponent) FormEditingUtil.findComponent(root, value);
if (valueComponent != null) {
if (valueComponent instanceof RadScrollPane && ((RadScrollPane) valueComponent).getComponentCount() == 1) {
valueComponent = ((RadScrollPane) valueComponent).getComponent(0);
}
BindingProperty.checkCreateBindingFromText(valueComponent, text);
}
}
}
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class ComponentRenderer method getComponent.
public JComponent getComponent(final RadRootContainer rootContainer, String value, boolean selected, boolean hasFocus) {
clear();
setBackground(selected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground());
if (value != null && value.length() > 0) {
RadComponent target = (RadComponent) FormEditingUtil.findComponent(rootContainer, value);
if (target != null) {
renderComponent(target, selected);
} else {
append(UIDesignerBundle.message("component.not.found"), SimpleTextAttributes.ERROR_ATTRIBUTES);
}
}
return this;
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class ActiveDecorationLayer method layoutListenerNavigateButtons.
private void layoutListenerNavigateButtons() {
for (Map.Entry<RadComponent, ListenerNavigateButton> e : myNavigateButtons.entrySet()) {
RadComponent c = e.getKey();
ListenerNavigateButton btn = e.getValue();
if (btn.isVisible()) {
Rectangle rc = SwingUtilities.convertRectangle(c.getDelegee().getParent(), c.getBounds(), this);
btn.setLocation(rc.x, rc.y + rc.height);
}
}
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class ComponentPtrDescriptor method update.
public boolean update() {
myPtr.validate();
if (!myPtr.isValid()) {
myPtr = null;
return true;
}
final String oldBinding = myBinding;
final String oldTitle = myTitle;
final RadComponent component = myPtr.getComponent();
if (component.getModule().isDisposed()) {
return false;
}
if (component instanceof RadRootContainer) {
myBinding = ((RadRootContainer) component).getClassToBind();
} else {
myBinding = component.getBinding();
}
myTitle = component.getComponentTitle();
return !Comparing.equal(oldBinding, myBinding) || !Comparing.equal(oldTitle, myTitle);
}
Aggregations