use of org.pentaho.ui.xul.XulDomContainer in project pentaho-kettle by pentaho.
the class DatabaseConnectionDialog method getSwtInstance.
public XulDomContainer getSwtInstance(SwtXulLoader loader, Shell shell) throws XulException {
XulDomContainer container = null;
Iterable<String> keyIterable = extendedClasses.keySet();
for (Object key : keyIterable) {
loader.register((String) key, extendedClasses.get(key));
}
loader.setOuterContext(shell);
container = loader.loadXul(DIALOG_DEFINITION_FILE, Messages.getBundle());
container.initialize();
return container;
}
use of org.pentaho.ui.xul.XulDomContainer in project pentaho-kettle by pentaho.
the class BrowseControllerTest method setUp.
@Before
public void setUp() throws Exception {
DocumentFactory.registerElementClass(ElementDom4J.class);
controller = new BrowseController();
controller.setRepositoryDirectory(mock(UIRepositoryDirectory.class));
directoryMap = new HashMap<>(8);
controller.setDirMap(directoryMap);
document = mock(Document.class);
XulDomContainer xulDomContainer = mock(XulDomContainer.class);
when(xulDomContainer.getDocumentRoot()).thenReturn(document);
controller.setXulDomContainer(xulDomContainer);
UIRepositoryDirectory someDirectory = mock(UIRepositoryDirectory.class);
selectedFolder = mock(UIRepositoryDirectory.class);
when(selectedFolder.createFolder(FOLDER_NAME)).thenReturn(someDirectory);
XulTree folderTree = mock(XulTree.class);
when(folderTree.getSelectedItems()).thenReturn(Collections.<Object>singleton(selectedFolder));
controller.setFolderTree(folderTree);
directoryBinding = mock(Binding.class);
controller.setDirectoryBinding(directoryBinding);
selectedItemsBinding = mock(Binding.class);
controller.setSelectedItemsBinding(selectedItemsBinding);
}
use of org.pentaho.ui.xul.XulDomContainer in project pentaho-kettle by pentaho.
the class SpoonBrowser method addToolBar.
protected void addToolBar() {
try {
XulLoader loader = new KettleXulLoader();
loader.setSettingsManager(XulSpoonSettingsManager.getInstance());
ResourceBundle bundle = GlobalMessages.getBundle("org/pentaho/di/ui/spoon/messages/messages");
XulDomContainer xulDomContainer = loader.loadXul(XUL_FILE_BROWSER_TOOLBAR, bundle);
xulDomContainer.addEventHandler(this);
toolbar = (XulToolbar) xulDomContainer.getDocumentRoot().getElementById("nav-toolbar");
@SuppressWarnings("unused") ToolBar swtToolBar = (ToolBar) toolbar.getManagedObject();
spoon.props.setLook(swtToolBar, Props.WIDGET_STYLE_TOOLBAR);
// Add a URL
back = (XulToolbarbutton) toolbar.getElementById("browse-back");
back.setDisabled(true);
forward = (XulToolbarbutton) toolbar.getElementById("browse-forward");
forward.setLabel(BaseMessages.getString(PKG, "SpoonBrowser.Dialog.Forward"));
forward.setDisabled(false);
location = (XulTextbox) toolbar.getElementById("browser-address");
Control toolbarControl = (Control) toolbar.getManagedObject();
toolbarControl.setLayoutData(new FormData());
toolbarControl.setParent(composite);
} catch (Exception e) {
e.printStackTrace();
new ErrorDialog(shell, BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_BROWSER_TOOLBAR), e);
}
}
use of org.pentaho.ui.xul.XulDomContainer in project pentaho-kettle by pentaho.
the class TransGridDelegate method addToolBar.
private void addToolBar() {
try {
XulLoader loader = new KettleXulLoader();
loader.setSettingsManager(XulSpoonSettingsManager.getInstance());
ResourceBundle bundle = GlobalMessages.getBundle("org/pentaho/di/ui/spoon/messages/messages");
XulDomContainer xulDomContainer = loader.loadXul(XUL_FILE_TRANS_GRID_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(toString(), Const.getStackTracker(t));
new ErrorDialog(transGridComposite.getShell(), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_TRANS_GRID_TOOLBAR), new Exception(t));
}
}
use of org.pentaho.ui.xul.XulDomContainer in project pentaho-kettle by pentaho.
the class TransLogDelegate 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(transLogComposite.getShell(), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_TRANS_LOG_TOOLBAR), new Exception(t));
}
}
Aggregations