Search in sources :

Example 1 with DefaultSettingsManager

use of org.pentaho.ui.xul.impl.DefaultSettingsManager in project pentaho-kettle by pentaho.

the class XulDatabaseExplorerDialog method open.

public boolean open() {
    try {
        KettleXulLoader theLoader = new KettleXulLoader();
        theLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
        theLoader.setSettingsManager(new DefaultSettingsManager(new File(Const.getKettleDirectory() + Const.FILE_SEPARATOR + "xulSettings.properties")));
        theLoader.setOuterContext(this.shell);
        this.container = theLoader.loadXul(XUL, new XulDatabaseExplorerResourceBundle());
        XulDialog theExplorerDialog = (XulDialog) this.container.getDocumentRoot().getElementById("databaseExplorerDialog");
        SpoonPluginManager.getInstance().applyPluginsForContainer("database_dialog", container);
        this.controller = new XulDatabaseExplorerController(this.shell, this.databaseMeta, this.databases, look);
        this.container.addEventHandler(this.controller);
        this.runner = new SwtXulRunner();
        this.runner.addContainer(this.container);
        this.runner.initialize();
        this.controller.setSelectedSchemaAndTable(schemaName, selectedTable);
        // show dialog if connection is success only.
        if (controller.getActionStatus() == UiPostActionStatus.OK) {
            theExplorerDialog.show();
        }
    } catch (Exception e) {
        LogChannel.GENERAL.logError("Error exploring database", e);
    }
    return this.controller.getSelectedTable() != null;
}
Also used : XulDialog(org.pentaho.ui.xul.containers.XulDialog) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) File(java.io.File) SwtXulRunner(org.pentaho.ui.xul.swt.SwtXulRunner) DefaultSettingsManager(org.pentaho.ui.xul.impl.DefaultSettingsManager)

Aggregations

File (java.io.File)1 KettleXulLoader (org.pentaho.di.ui.xul.KettleXulLoader)1 XulDialog (org.pentaho.ui.xul.containers.XulDialog)1 DefaultSettingsManager (org.pentaho.ui.xul.impl.DefaultSettingsManager)1 SwtXulRunner (org.pentaho.ui.xul.swt.SwtXulRunner)1