Search in sources :

Example 11 with DataMapEvent

use of org.apache.cayenne.configuration.event.DataMapEvent in project cayenne by apache.

the class DataMapView method setDefaultClientSuperclass.

void setDefaultClientSuperclass(String newSuperclass) {
    DataMap dataMap = eventController.getCurrentDataMap();
    if (dataMap == null) {
        return;
    }
    if (newSuperclass != null && newSuperclass.trim().length() == 0) {
        newSuperclass = null;
    }
    String oldSuperclass = dataMap.getDefaultClientSuperclass();
    if (Util.nullSafeEquals(newSuperclass, oldSuperclass)) {
        return;
    }
    dataMap.setDefaultClientSuperclass(newSuperclass);
    eventController.fireDataMapEvent(new DataMapEvent(this, dataMap));
}
Also used : DataMapEvent(org.apache.cayenne.configuration.event.DataMapEvent) DataMap(org.apache.cayenne.map.DataMap)

Example 12 with DataMapEvent

use of org.apache.cayenne.configuration.event.DataMapEvent in project cayenne by apache.

the class DataMapView method setQuoteSQLIdentifiers.

void setQuoteSQLIdentifiers(boolean flag) {
    DataMap dataMap = eventController.getCurrentDataMap();
    if (dataMap == null) {
        return;
    }
    if (dataMap.isQuotingSQLIdentifiers() != flag) {
        dataMap.setQuotingSQLIdentifiers(flag);
        eventController.fireDataMapEvent(new DataMapEvent(this, dataMap));
    }
}
Also used : DataMapEvent(org.apache.cayenne.configuration.event.DataMapEvent) DataMap(org.apache.cayenne.map.DataMap)

Example 13 with DataMapEvent

use of org.apache.cayenne.configuration.event.DataMapEvent in project cayenne by apache.

the class DataMapView method setDefaultPackage.

void setDefaultPackage(String newDefaultPackage) {
    DataMap dataMap = eventController.getCurrentDataMap();
    if (dataMap == null) {
        return;
    }
    if (newDefaultPackage != null && newDefaultPackage.trim().length() == 0) {
        newDefaultPackage = null;
    }
    String oldPackage = dataMap.getDefaultPackage();
    if (Util.nullSafeEquals(newDefaultPackage, oldPackage)) {
        return;
    }
    dataMap.setDefaultPackage(newDefaultPackage);
    // update class generation preferences
    eventController.getDataMapPreferences("").setSuperclassPackage(newDefaultPackage, DataMapDefaults.DEFAULT_SUPERCLASS_PACKAGE_SUFFIX);
    eventController.fireDataMapEvent(new DataMapEvent(this, dataMap));
}
Also used : DataMapEvent(org.apache.cayenne.configuration.event.DataMapEvent) DataMap(org.apache.cayenne.map.DataMap)

Example 14 with DataMapEvent

use of org.apache.cayenne.configuration.event.DataMapEvent in project cayenne by apache.

the class DataMapView method setDefaultSuperclass.

void setDefaultSuperclass(String newSuperclass) {
    DataMap dataMap = eventController.getCurrentDataMap();
    if (dataMap == null) {
        return;
    }
    if (newSuperclass != null && newSuperclass.trim().length() == 0) {
        newSuperclass = null;
    }
    String oldSuperclass = dataMap.getDefaultSuperclass();
    if (Util.nullSafeEquals(newSuperclass, oldSuperclass)) {
        return;
    }
    dataMap.setDefaultSuperclass(newSuperclass);
    eventController.fireDataMapEvent(new DataMapEvent(this, dataMap));
}
Also used : DataMapEvent(org.apache.cayenne.configuration.event.DataMapEvent) DataMap(org.apache.cayenne.map.DataMap)

Example 15 with DataMapEvent

use of org.apache.cayenne.configuration.event.DataMapEvent in project cayenne by apache.

the class DataMapView method setDefaultCatalog.

void setDefaultCatalog(String newCatalog) {
    DataMap dataMap = eventController.getCurrentDataMap();
    if (dataMap == null) {
        return;
    }
    if (newCatalog != null && newCatalog.trim().length() == 0) {
        newCatalog = null;
    }
    String oldCatalog = dataMap.getDefaultCatalog();
    if (Util.nullSafeEquals(newCatalog, oldCatalog)) {
        return;
    }
    dataMap.setDefaultCatalog(newCatalog);
    eventController.fireDataMapEvent(new DataMapEvent(this, dataMap));
}
Also used : DataMapEvent(org.apache.cayenne.configuration.event.DataMapEvent) DataMap(org.apache.cayenne.map.DataMap)

Aggregations

DataMapEvent (org.apache.cayenne.configuration.event.DataMapEvent)19 DataMap (org.apache.cayenne.map.DataMap)15 DataChannelDescriptor (org.apache.cayenne.configuration.DataChannelDescriptor)3 Test (org.junit.Test)3 DataNodeEvent (org.apache.cayenne.configuration.event.DataNodeEvent)2 ProjectController (org.apache.cayenne.modeler.ProjectController)2 DataMapDisplayEvent (org.apache.cayenne.modeler.event.DataMapDisplayEvent)2 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 EventObject (java.util.EventObject)1 DataNodeDescriptor (org.apache.cayenne.configuration.DataNodeDescriptor)1 DomainEvent (org.apache.cayenne.configuration.event.DomainEvent)1 ProcedureEvent (org.apache.cayenne.configuration.event.ProcedureEvent)1 QueryEvent (org.apache.cayenne.configuration.event.QueryEvent)1 EmbeddableEvent (org.apache.cayenne.map.event.EmbeddableEvent)1 EntityEvent (org.apache.cayenne.map.event.EntityEvent)1 DataNodeDisplayEvent (org.apache.cayenne.modeler.event.DataNodeDisplayEvent)1 DomainDisplayEvent (org.apache.cayenne.modeler.event.DomainDisplayEvent)1 EmbeddableDisplayEvent (org.apache.cayenne.modeler.event.EmbeddableDisplayEvent)1 EntityDisplayEvent (org.apache.cayenne.modeler.event.EntityDisplayEvent)1