use of com.servoy.j2db.util.editlist.IEditListEditor in project servoy-client by Servoy.
the class ListView method getReadOnlyAwareComponents.
private List<HasRuntimeReadOnly> getReadOnlyAwareComponents() {
List<HasRuntimeReadOnly> readOnlyAwareComponents = new ArrayList<HasRuntimeReadOnly>();
ListCellRenderer cellRenderer = getCellRenderer();
if (cellRenderer instanceof DataRenderer) {
DataRenderer dr = (DataRenderer) cellRenderer;
for (int i = 0; i < dr.getComponentCount(); i++) {
Component c = dr.getComponent(i);
if (c instanceof IScriptableProvider && ((IScriptableProvider) c).getScriptObject() instanceof HasRuntimeReadOnly) {
readOnlyAwareComponents.add((HasRuntimeReadOnly) ((IScriptableProvider) c).getScriptObject());
}
}
}
IEditListEditor editorComponent = getCellEditor();
if (editorComponent instanceof FormBodyEditor) {
FormBodyEditor formBodyEditor = (FormBodyEditor) editorComponent;
DataRenderer dataRenderer = formBodyEditor.getDataRenderer();
for (int i = 0; i < dataRenderer.getComponentCount(); i++) {
Component c = dataRenderer.getComponent(i);
if (c instanceof IScriptableProvider && ((IScriptableProvider) c).getScriptObject() instanceof HasRuntimeReadOnly) {
readOnlyAwareComponents.add((HasRuntimeReadOnly) ((IScriptableProvider) c).getScriptObject());
}
}
}
return readOnlyAwareComponents;
}
Aggregations