use of org.pentaho.ui.xul.swt.tags.SwtDialog 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.ui.xul.swt.tags.SwtDialog 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.ui.xul.swt.tags.SwtDialog in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceDialogControllerTest method testShowHelpUsesDialogShell.
@Test
public void testShowHelpUsesDialogShell() throws Exception {
controller = mock(DataServiceDialogController.class);
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) {
MatcherAssert.assertThat(runtimeException, is(sameInstance(e)));
}
verify(dialog).getShell();
}
use of org.pentaho.ui.xul.swt.tags.SwtDialog in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapConfirmationDialogControllerTest method testCancel.
@Test
public void testCancel() {
DataServiceDelegate delegate = mock(DataServiceDelegate.class);
DataServiceRemapConfirmationDialogController controller = spy(new DataServiceRemapConfirmationDialogController(mock(DataServiceMeta.class), Arrays.asList("Step1"), delegate));
SwtDialog dialog = mock(SwtDialog.class);
doReturn(dialog).when(controller).getElementById(anyString());
controller.cancel();
verify(dialog).dispose();
}
use of org.pentaho.ui.xul.swt.tags.SwtDialog in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapNoStepsDialogControllerTest method testController.
@Test
public void testController() {
SwtDialog dialog = mock(SwtDialog.class);
DataServiceRemapNoStepsDialogController controller = spy(new DataServiceRemapNoStepsDialogController());
Assert.hasText(controller.getName());
doReturn(dialog).when(controller).getElementById(anyString());
controller.close();
verify(dialog).dispose();
}
Aggregations