Search in sources :

Example 1 with GwtDatabaseDialog

use of org.pentaho.ui.database.gwt.GwtDatabaseDialog in project data-access by pentaho.

the class WizardConnectionController method showEditConnectionDialog.

@Bindable
public void showEditConnectionDialog() {
    datasourceModel.setEditing(true);
    if (databaseDialog != null) {
        IDatabaseConnection connection = datasourceModel.getSelectedRelationalConnection();
        previousConnectionName = connection.getName();
        existingConnectionName = previousConnectionName;
        DatabaseConnection editConnection = new DatabaseConnection();
        copyDatabaseConnectionProperties(connection, editConnection);
        databaseDialog.setDatabaseConnection(editConnection);
        databaseDialog.show();
    } else {
        databaseDialog = new GwtDatabaseDialog(databaseTypeHelper, GWT.getModuleBaseURL() + "dataaccess-databasedialog.xul", // $NON-NLS-1$
        connectionSetter);
    }
}
Also used : GwtDatabaseDialog(org.pentaho.ui.database.gwt.GwtDatabaseDialog) DatabaseConnection(org.pentaho.database.model.DatabaseConnection) IDatabaseConnection(org.pentaho.database.model.IDatabaseConnection) IDatabaseConnection(org.pentaho.database.model.IDatabaseConnection) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 2 with GwtDatabaseDialog

use of org.pentaho.ui.database.gwt.GwtDatabaseDialog in project data-access by pentaho.

the class WizardConnectionController method showAddConnectionDialog.

@Bindable
public void showAddConnectionDialog() {
    datasourceModel.setEditing(false);
    if (databaseDialog != null) {
        previousConnectionName = null;
        existingConnectionName = previousConnectionName;
        databaseDialog.setDatabaseConnection(null);
        databaseDialog.show();
    } else {
        databaseDialog = new GwtDatabaseDialog(databaseTypeHelper, GWT.getModuleBaseURL() + "dataaccess-databasedialog.xul", // $NON-NLS-1$
        connectionSetter);
    }
}
Also used : GwtDatabaseDialog(org.pentaho.ui.database.gwt.GwtDatabaseDialog) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 3 with GwtDatabaseDialog

use of org.pentaho.ui.database.gwt.GwtDatabaseDialog in project data-access by pentaho.

the class ConnectionController method createNewDatabaseDialog.

private void createNewDatabaseDialog() {
    if (databaseTypeHelper == null) {
        XulServiceCallback<List<IDatabaseType>> callback = new XulServiceCallback<List<IDatabaseType>>() {

            public void error(String message, Throwable error) {
                Window.alert(message + ":  " + error.getLocalizedMessage());
            // error.printStackTrace();
            }

            public void success(List<IDatabaseType> retVal) {
                databaseTypeHelper = new DatabaseTypeHelper(retVal);
                databaseDialog = new GwtDatabaseDialog(databaseTypeHelper, GWT.getModuleBaseURL() + "dataaccess-databasedialog.xul", // $NON-NLS-1$
                connectionSetter);
            }
        };
        dialectService.getDatabaseTypes(callback);
    } else {
        databaseDialog = new GwtDatabaseDialog(databaseTypeHelper, GWT.getModuleBaseURL() + "dataaccess-databasedialog.xul", // $NON-NLS-1$
        connectionSetter);
    }
}
Also used : XulServiceCallback(org.pentaho.ui.xul.XulServiceCallback) IDatabaseType(org.pentaho.database.model.IDatabaseType) DatabaseTypeHelper(org.pentaho.database.util.DatabaseTypeHelper) GwtDatabaseDialog(org.pentaho.ui.database.gwt.GwtDatabaseDialog) ArrayList(java.util.ArrayList) IDatabaseConnectionList(org.pentaho.ui.database.event.IDatabaseConnectionList) List(java.util.List)

Aggregations

GwtDatabaseDialog (org.pentaho.ui.database.gwt.GwtDatabaseDialog)3 Bindable (org.pentaho.ui.xul.stereotype.Bindable)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 DatabaseConnection (org.pentaho.database.model.DatabaseConnection)1 IDatabaseConnection (org.pentaho.database.model.IDatabaseConnection)1 IDatabaseType (org.pentaho.database.model.IDatabaseType)1 DatabaseTypeHelper (org.pentaho.database.util.DatabaseTypeHelper)1 IDatabaseConnectionList (org.pentaho.ui.database.event.IDatabaseConnectionList)1 XulServiceCallback (org.pentaho.ui.xul.XulServiceCallback)1