Search in sources :

Example 1 with MergerOptions

use of org.apache.cayenne.modeler.dialog.db.merge.MergerOptions in project cayenne by apache.

the class MigrateAction method performAction.

public void performAction(ActionEvent e) {
    DataSourceWizard connectWizard = dataSourceWizardDialog("Migrate DB Schema: Connect to Database");
    if (connectWizard == null) {
        return;
    }
    DataMap map = getProjectController().getCurrentDataMap();
    if (map == null) {
        throw new IllegalStateException("No current DataMap selected.");
    }
    dialogShown = false;
    DbActionOptionsDialog optionsDialog = loaderOptionDialog(connectWizard);
    if (dialogShown && optionsDialog == null) {
        return;
    }
    String selectedCatalog = optionsDialog == null ? null : optionsDialog.getSelectedCatalog();
    String selectedSchema = optionsDialog == null ? null : optionsDialog.getSelectedSchema();
    MergerTokenFactoryProvider mergerTokenFactoryProvider = getApplication().getInjector().getInstance(MergerTokenFactoryProvider.class);
    // ... show dialog...
    new MergerOptions(getProjectController(), "Migrate DB Schema: Options", connectWizard.getConnectionInfo(), map, selectedCatalog, selectedSchema, mergerTokenFactoryProvider).startupAction();
}
Also used : DataSourceWizard(org.apache.cayenne.modeler.dialog.db.DataSourceWizard) MergerTokenFactoryProvider(org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider) MergerOptions(org.apache.cayenne.modeler.dialog.db.merge.MergerOptions) DbActionOptionsDialog(org.apache.cayenne.modeler.dialog.db.DbActionOptionsDialog) DataMap(org.apache.cayenne.map.DataMap)

Aggregations

MergerTokenFactoryProvider (org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider)1 DataMap (org.apache.cayenne.map.DataMap)1 DataSourceWizard (org.apache.cayenne.modeler.dialog.db.DataSourceWizard)1 DbActionOptionsDialog (org.apache.cayenne.modeler.dialog.db.DbActionOptionsDialog)1 MergerOptions (org.apache.cayenne.modeler.dialog.db.merge.MergerOptions)1