use of org.pentaho.di.ui.xul.KettleXulLoader in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapNoStepsDialog method open.
void open() throws KettleException {
Document xulDocument;
try {
xulDocument = initXul(parent, new KettleXulLoader(), new SwtXulRunner());
} catch (XulException xulException) {
throw new KettleException("Failed to initialize RemapNoStepsDialog.", xulException);
}
((SwtDialog) xulDocument.getElementById(XUL_DIALOG_ID)).show();
}
use of org.pentaho.di.ui.xul.KettleXulLoader in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapStepChooserDialog method open.
void open() throws KettleException {
SwtDialog dialog;
try {
dialog = (SwtDialog) initXul(parent, new KettleXulLoader(), new SwtXulRunner()).getElementById(XUL_DIALOG_ID);
} catch (XulException xulException) {
throw new KettleException("Failed to initialize DataServiceRemapStepChooserDialog.", xulException);
}
dialog.show();
}
use of org.pentaho.di.ui.xul.KettleXulLoader in project pentaho-kettle by pentaho.
the class XulDatabaseDialog method createDialog.
@SuppressWarnings("deprecation")
private void createDialog() {
XulDomContainer container = null;
try {
databaseDialogInstance = new DatabaseConnectionDialog();
if (((Shell) this.parentShell).getText().contains("Metadata Editor")) {
databaseDialogInstance.registerClass(EXTENDED_WIDGET_ID, PMD_WIDGET_CLASSNAME);
databaseDialogInstance.registerClass(EXTENDED_MENULIST_WIDGET_ID, PMD_MENULIST_WIDGET_CLASSNAME);
} else {
databaseDialogInstance.registerClass(EXTENDED_WIDGET_ID, EXTENDED_WIDGET_CLASSNAME);
databaseDialogInstance.registerClass(EXTENDED_MENULIST_WIDGET_ID, EXTENDED_MENULIST_WIDGET_CLASSNAME);
}
/*
* Attention: onload: loadConnectionData() is called here the first time, see below for second time
*/
container = databaseDialogInstance.getSwtInstance(new KettleXulLoader(), parentShell);
container.addEventHandler(EVENT_ID, DataOverrideHandler.class.getName());
SpoonPluginManager.getInstance().applyPluginsForContainer("connection_dialog", container);
dataHandler = (DataOverrideHandler) container.getEventHandler(EVENT_ID);
if (databaseMeta != null) {
dataHandler.setData(databaseMeta);
}
dataHandler.setDatabases(databases);
dataHandler.getControls();
} catch (XulException e) {
new ErrorDialog(parentShell, BaseMessages.getString(PKG, "XulDatabaseDialog.Error.Title"), BaseMessages.getString(PKG, "XulDatabaseDialog.Error.HandleXul"), e);
return;
}
try {
// Inject the button panel that contains the "Feature List" and "Explore" buttons
XulComponent boxElement = container.getDocumentRoot().getElementById(FRAGMENT_ID);
XulComponent parentElement = boxElement.getParent();
ResourceBundle res = null;
try {
res = GlobalMessages.getBundle(MESSAGES);
} catch (MissingResourceException e) {
log.logError(BaseMessages.getString(PKG, "XulDatabaseDialog.Error.ResourcesNotFound.Title"), e.getMessage(), e);
}
XulDomContainer fragmentContainer = null;
String pkg = getClass().getPackage().getName().replace('.', '/');
// to check for it here.
if (res != null) {
fragmentContainer = container.loadFragment(pkg.concat(DIALOG_FRAGMENT_FILE), res);
} else {
fragmentContainer = container.loadFragment(pkg.concat(DIALOG_FRAGMENT_FILE));
}
XulComponent newBox = fragmentContainer.getDocumentRoot().getFirstChild();
parentElement.replaceChild(boxElement, newBox);
} catch (Exception e) {
new ErrorDialog(parentShell, BaseMessages.getString(PKG, "XulDatabaseDialog.Error.Title"), BaseMessages.getString(PKG, "XulDatabaseDialog.Error.HandleXul"), e);
return;
}
try {
xulDialogComponent = (XulDialog) container.getDocumentRoot().getRootElement();
parentShell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent arg0) {
xulDialogComponent.hide();
}
});
} catch (Exception e) {
new ErrorDialog(parentShell, BaseMessages.getString(PKG, "XulDatabaseDialog.Error.Title"), BaseMessages.getString(PKG, "XulDatabaseDialog.Error.Dialog"), e);
return;
}
}
use of org.pentaho.di.ui.xul.KettleXulLoader in project pentaho-kettle by pentaho.
the class XulPreviewRowsDialog method open.
public void open() {
try {
KettleXulLoader theLoader = new KettleXulLoader();
theLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
theLoader.setOuterContext(this.shell);
this.container = theLoader.loadXul(XUL);
this.controller = new XulPreviewRowsController(this.shell, this.databaseMeta, this.schema, this.table, this.limit);
this.container.addEventHandler(this.controller);
this.runner = new SwtXulRunner();
this.runner.addContainer(this.container);
this.runner.initialize();
XulDialog thePreviewDialog = (XulDialog) this.container.getDocumentRoot().getElementById("previewRowsDialog");
thePreviewDialog.show();
} catch (Exception e) {
logger.info(e);
}
}
use of org.pentaho.di.ui.xul.KettleXulLoader in project pentaho-kettle by pentaho.
the class FileOverwriteDialogController method getInstance.
public static FileOverwriteDialogController getInstance(Shell shell, List<UIRepositoryObject> objects) {
try {
KettleXulLoader swtLoader = new KettleXulLoader();
swtLoader.setOuterContext(shell);
swtLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
XulDomContainer container = swtLoader.loadXul("org/pentaho/di/ui/repository/repositoryexplorer/xul/file-overwrite-dialog.xul", resourceBundle);
final XulRunner runner = new SwtXulRunner();
runner.addContainer(container);
FileOverwriteDialogController dialogController = new FileOverwriteDialogController(container, objects);
container.addEventHandler(dialogController);
runner.initialize();
return dialogController;
} catch (Exception e) {
return null;
}
}
Aggregations