When I double click on the IA components, the property binding window opens for a specific property. How do I achieve that for my own components?
- Construct your own customizer (or use on of our existing ones); give it a
CustomizerDescriptor - In your component's bean info constructor, supply that descriptor to the vararg trailing arguments:
public VisionAdvancedTableBeanInfo() {
super(VisionAdvancedTable.class,
AdvancedTableCustomizer.VALUE_DESCRIPTOR,
DynamicPropertyProviderCustomizer.VALUE_DESCRIPTOR
);
- Also on the bean info, add a value for
DOUBLE_CLICK_CUSTOMIZER_KEYthat identifies the same descriptor by name:
getBeanDescriptor().setValue(DOUBLE_CLICK_CUSTOMIZER_KEY, TableCustomizer.VALUE_NAME);
Ah; got it. The dropdown list component, for instance, does so like this in the bean info:
getBeanDescriptor().setValue(DOUBLE_CLICK_HANDLER, (DoubleClickHandler) (component, workspace) -> {
try {
if (BindUtilities.isBound(component, "data")) {
workspace.getVisionDesigner().openBindingDialog(component, "data");
} else {
DataSetEditorDialog viewer = new DataSetEditorDialog(IgnitionDesigner.getFrame().getRootPane());
Dataset oldDataset = ((PMIComboBox) component).getData();
if (oldDataset == null) {
oldDataset = new BasicDataset();
}
Dataset newDataset = viewer.editDataSet(oldDataset);
if (newDataset != null) {
((PMIComboBox) component).setData(newDataset);
}
}
} catch (NotBindableException e) {
ErrorUtil.showError(e);
}
});
That works. Thanks Paul!
