OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 152 → Rev 153

/trunk/Modules/Module Extension Builder/src/org/openconcerto/modules/extensionbuilder/table/TableDescritor.java
11,13 → 11,18
import org.openconcerto.erp.config.ComptaPropsConfiguration;
import org.openconcerto.erp.config.Log;
import org.openconcerto.modules.extensionbuilder.Extension;
import org.openconcerto.modules.extensionbuilder.ExtensionGroupSQLComponent;
import org.openconcerto.modules.extensionbuilder.component.ComponentDescritor;
import org.openconcerto.modules.extensionbuilder.menu.mainmenu.MenuDescriptor;
import org.openconcerto.modules.extensionbuilder.list.ListDescriptor;
import org.openconcerto.sql.element.GroupSQLComponent;
import org.openconcerto.sql.element.SQLComponent;
import org.openconcerto.sql.element.SQLElement;
import org.openconcerto.sql.model.DBRoot;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.sql.request.ListSQLRequest;
import org.openconcerto.sql.request.RowItemDesc;
import org.openconcerto.sql.view.list.SQLTableModelSource;
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
 
public class TableDescritor {
private String name;
42,14 → 47,28
}
 
@Override
protected SQLTableModelSourceOnline instantiateTableSourceOnline(ListSQLRequest req) {
ListDescriptor listDesc = null;
for (ListDescriptor listDescriptor : ext.getCreateListList()) {
if (listDescriptor.getMainTable().equals(getTable().getName())) {
listDesc = listDescriptor;
break;
}
}
if (listDesc != null) {
return ext.createSource(this, req, listDesc);
} else {
return super.instantiateTableSourceOnline(req);
}
 
}
 
@Override
protected SQLComponent createComponent() {
 
for (final ComponentDescritor cDescriptor : ext.getCreateComponentList()) {
if (cDescriptor.getTable().equals(table.getTable().getName())) {
 
final GroupSQLComponent gComponent = new GroupSQLComponent(this, cDescriptor.getGroup());
return gComponent;
 
return new ExtensionGroupSQLComponent(this, cDescriptor.getGroup());
}
}
JOptionPane.showMessageDialog(new JFrame(), "Unable to create default creation component for table " + name);