use of org.pentaho.ui.xul.swt.tags.SwtDialog in project pdi-dataservice-server-plugin by pentaho.
the class DriverDetailsDialogControllerTest method testShowHelpUsesDialogShell.
@Test
public void testShowHelpUsesDialogShell() throws Exception {
doCallRealMethod().when(controller).showHelp();
SwtDialog dialog = mock(SwtDialog.class);
doReturn(dialog).when(controller).getDialog();
IllegalStateException runtimeException = new IllegalStateException();
doThrow(runtimeException).when(dialog).getShell();
try {
controller.showHelp();
} catch (Exception e) {
assertThat(runtimeException, is(sameInstance(e)));
}
verify(dialog).getShell();
}
use of org.pentaho.ui.xul.swt.tags.SwtDialog in project pentaho-kettle by pentaho.
the class XulStepFieldsDialog method open.
public void open(boolean isAcceptButtonHidden) {
try {
KettleXulLoader theLoader = new KettleXulLoader();
theLoader.setOuterContext(this.shell);
theLoader.setSettingsManager(XulSpoonSettingsManager.getInstance());
this.container = theLoader.loadXul(XUL);
this.controller = new XulStepFieldsController(this.shell, this.databaseMeta, this.schemaTableCombo, this.rowMeta);
this.controller.setShowAcceptButton(isAcceptButtonHidden);
this.container.addEventHandler(this.controller);
this.runner = new SwtXulRunner();
this.runner.addContainer(this.container);
this.runner.initialize();
XulDialog thePreviewDialog = (XulDialog) this.container.getDocumentRoot().getElementById("stepFieldsDialog");
thePreviewDialog.show();
((SwtDialog) thePreviewDialog).dispose();
} catch (Exception e) {
logger.info(e);
}
}
use of org.pentaho.ui.xul.swt.tags.SwtDialog in project pentaho-kettle by pentaho.
the class KettleDialog method hide.
@Override
public void hide() {
if (closing || dialog.getMainArea().isDisposed() || getParentShell(getParent()).isDisposed() || (getParent() instanceof SwtDialog && ((SwtDialog) getParent()).isDisposing())) {
return;
}
// Save the window location & size in the Kettle world...
//
WindowProperty windowProperty = new WindowProperty(getShell());
PropsUI.getInstance().setScreen(windowProperty);
super.hide();
}
use of org.pentaho.ui.xul.swt.tags.SwtDialog in project pentaho-kettle by pentaho.
the class RepositoryExplorer method dispose.
public void dispose() {
SwtDialog dialog = (SwtDialog) container.getDocumentRoot().getElementById("repository-explorer-dialog");
dialog.dispose();
initialized = false;
}
use of org.pentaho.ui.xul.swt.tags.SwtDialog in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapConfirmationDialog method open.
void open() throws KettleException {
Document xulDocument;
try {
xulDocument = initXul(parent, new KettleXulLoader(), new SwtXulRunner());
} catch (XulException e) {
throw new KettleException("Failed to create data service remap confirmation dialog", e);
}
((SwtDialog) xulDocument.getElementById(XUL_DIALOG_ID)).show();
}
Aggregations