use of org.pentaho.ui.xul.XulLoader in project pentaho-kettle by pentaho.
the class JobLogDelegate method addToolBar.
private void addToolBar() {
try {
XulLoader loader = new KettleXulLoader();
loader.setSettingsManager(XulSpoonSettingsManager.getInstance());
ResourceBundle bundle = new XulSpoonResourceBundle(Spoon.class);
XulDomContainer xulDomContainer = loader.loadXul(XUL_FILE_TRANS_LOG_TOOLBAR, bundle);
xulDomContainer.addEventHandler(this);
toolbar = (XulToolbar) xulDomContainer.getDocumentRoot().getElementById("nav-toolbar");
ToolBar swtToolbar = (ToolBar) toolbar.getManagedObject();
spoon.props.setLook(swtToolbar, Props.WIDGET_STYLE_TOOLBAR);
swtToolbar.layout(true, true);
} catch (Throwable t) {
log.logError(Const.getStackTracker(t));
new ErrorDialog(jobLogComposite.getShell(), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_TRANS_LOG_TOOLBAR), new Exception(t));
}
}
use of org.pentaho.ui.xul.XulLoader in project pentaho-kettle by pentaho.
the class ImportRulesDialog method addToolBar.
private void addToolBar() {
try {
XulLoader loader = new KettleXulLoader();
loader.setSettingsManager(XulSpoonSettingsManager.getInstance());
ResourceBundle bundle = new XulSpoonResourceBundle(Spoon.class);
XulDomContainer xulDomContainer = loader.loadXul(XUL_FILE_TOOLBAR, bundle);
xulDomContainer.addEventHandler(this);
toolbar = (XulToolbar) xulDomContainer.getDocumentRoot().getElementById("import-rules-toolbar");
ToolBar swtToolbar = (ToolBar) toolbar.getManagedObject();
swtToolbar.layout(true, true);
} catch (Throwable t) {
LogChannel.GENERAL.logError(Const.getStackTracker(t));
new ErrorDialog(shell, BaseMessages.getString(PKG, "ImportRulesDialog.Exception.ErrorReadingXULFile.Title"), BaseMessages.getString(PKG, "ImportRulesDialog.Exception.ErrorReadingXULFile.Message", XUL_FILE_TOOLBAR), new Exception(t));
}
}
use of org.pentaho.ui.xul.XulLoader in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapNoStepsDialogTest method testInitXul.
@Test
public void testInitXul() throws KettleException, XulException {
Shell shell = mock(Shell.class);
XulLoader xulLoader = mock(XulLoader.class);
XulRunner xulRunner = mock(XulRunner.class);
XulDomContainer xulDomContainer = mock(XulDomContainer.class);
when(xulLoader.loadXul(anyString(), any(ResourceBundle.class))).thenReturn(xulDomContainer);
DataServiceRemapNoStepsDialog dialog = mock(DataServiceRemapNoStepsDialog.class);
when(dialog.initXul(shell, xulLoader, xulRunner)).thenCallRealMethod();
dialog.initXul(shell, xulLoader, xulRunner);
verify(xulLoader).setOuterContext(shell);
verify(xulLoader).registerClassLoader(any(ClassLoader.class));
verify(xulRunner).addContainer(xulDomContainer);
verify(xulRunner).initialize();
}
use of org.pentaho.ui.xul.XulLoader in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceDialogTest method testLoadXul.
@Test
public void testLoadXul() throws Exception {
Shell shell = mock(Shell.class);
XulLoader xulLoader = mock(XulLoader.class);
XulRunner xulRunner = mock(XulRunner.class);
XulDomContainer xulDomContainer = mock(XulDomContainer.class);
final ResourceBundle resourceBundle = mock(ResourceBundle.class);
DataServiceDialog dialog = new DataServiceDialog(controller, model) {
@Override
protected ResourceBundle createResourceBundle(Class<?> packageClass) {
assertThat(packageClass, equalTo((Class) DataServiceDialog.class));
assertThat(super.createResourceBundle(packageClass), isA(ResourceBundle.class));
return resourceBundle;
}
};
when(xulLoader.loadXul(anyString(), same(resourceBundle))).thenReturn(xulDomContainer);
dialog.loadXul(shell, xulLoader, xulRunner);
verify(xulLoader).setOuterContext(shell);
verify(xulLoader).registerClassLoader(any(ClassLoader.class));
verify(xulDomContainer).addEventHandler(controller);
verify(xulRunner).addContainer(xulDomContainer);
verify(xulRunner).initialize();
}
use of org.pentaho.ui.xul.XulLoader in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceRemapConfirmationDialogTest method testInitXul.
@Test
public void testInitXul() throws KettleException, XulException {
Shell shell = mock(Shell.class);
XulLoader xulLoader = mock(XulLoader.class);
XulRunner xulRunner = mock(XulRunner.class);
XulDomContainer xulDomContainer = mock(XulDomContainer.class);
when(xulLoader.loadXul(anyString(), any(ResourceBundle.class))).thenReturn(xulDomContainer);
DataServiceRemapConfirmationDialog dialog = mock(DataServiceRemapConfirmationDialog.class);
when(dialog.initXul(shell, xulLoader, xulRunner)).thenCallRealMethod();
dialog.initXul(shell, xulLoader, xulRunner);
verify(xulLoader).setOuterContext(shell);
verify(xulLoader).registerClassLoader(any(ClassLoader.class));
verify(xulRunner).addContainer(xulDomContainer);
verify(xulRunner).initialize();
}
Aggregations