public void setDefaultValues() { for (MetaTab t : MetaTabsDefaultValues.getMetaTabsForModel(getMetaComponent().getName())) { if (t.getMetaFilter() != null && getMetaFilter() == null) setMetaFilter(t.getMetaFilter()); if (t.getMetaRowStyles() != null && getMetaRowStyles() == null) setMetaRowStyles(t.getMetaRowStyles()); if (t.properties != null && properties == null) properties = t.properties; if (!Is.emptyString(t.getBaseCondition()) && Is.emptyString(getBaseCondition())) setBaseCondition(t.getBaseCondition()); if (!Is.emptyString(t.getDefaultOrder()) & Is.emptyString(getDefaultOrder())) setDefaultOrder(t.getDefaultOrder()); } }
public static MetaTab createDefault(MetaModel metaModel) { MetaTab tab = new MetaTab(); tab.setMetaModel(metaModel); return tab; }
public static MetaTab createDefault(MetaComponent component) throws XavaException { MetaTab tab = new MetaTab(); tab.setMetaComponent(component); tab.setDefaultValues(); return tab; }
public MetaTab cloneMetaTab() { try { MetaTab r = (MetaTab) clone(); if (r.metaPropertiesHiddenCalculated != null) { r.metaPropertiesHiddenCalculated = new ArrayList(metaPropertiesHiddenCalculated); } if (r.metaPropertiesHidden != null) { r.metaPropertiesHidden = new ArrayList(metaPropertiesHidden); } if (r.propertiesNames != null) { r.propertiesNames = new ArrayList(propertiesNames); } if (r.metaProperties != null) { r.metaProperties = new ArrayList(metaProperties); } if (r.metaPropertiesCalculated != null) { r.metaPropertiesCalculated = new ArrayList(metaPropertiesCalculated); } if (r.tableColumns != null) { r.tableColumns = new ArrayList(tableColumns); } if (r.hiddenPropertiesNames != null) { r.hiddenPropertiesNames = new ArrayList(hiddenPropertiesNames); } if (r.propertiesNamesWithKeyAndHidden != null) { r.propertiesNamesWithKeyAndHidden = new ArrayList(propertiesNamesWithKeyAndHidden); } if (r.hiddenTableColumns != null) { r.hiddenTableColumns = new ArrayList(hiddenTableColumns); } if (r.metaPropertiesTab != null) { r.metaPropertiesTab = new HashMap(metaPropertiesTab); } return r; } catch (CloneNotSupportedException ex) { throw new RuntimeException(XavaResources.getString("clone_error", getClass())); } }