Search in sources :

Example 16 with KettleXulLoader

use of org.pentaho.di.ui.xul.KettleXulLoader 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));
    }
}
Also used : KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) XulLoader(org.pentaho.ui.xul.XulLoader) ToolBar(org.eclipse.swt.widgets.ToolBar) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) ResourceBundle(java.util.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer)

Example 17 with KettleXulLoader

use of org.pentaho.di.ui.xul.KettleXulLoader 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));
    }
}
Also used : XulSpoonResourceBundle(org.pentaho.di.ui.spoon.XulSpoonResourceBundle) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) XulLoader(org.pentaho.ui.xul.XulLoader) ToolBar(org.eclipse.swt.widgets.ToolBar) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) XulSpoonResourceBundle(org.pentaho.di.ui.spoon.XulSpoonResourceBundle) ResourceBundle(java.util.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer)

Example 18 with KettleXulLoader

use of org.pentaho.di.ui.xul.KettleXulLoader in project pentaho-kettle by pentaho.

the class TransPreviewDelegate 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_PREVIEW_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);
        swtToolBar.pack();
        firstRadio = (SwtRadio) xulDomContainer.getDocumentRoot().getElementById("preview-first");
        lastRadio = (SwtRadio) xulDomContainer.getDocumentRoot().getElementById("preview-last");
        offRadio = (SwtRadio) xulDomContainer.getDocumentRoot().getElementById("preview-off");
        PropsUI.getInstance().setLook((Control) firstRadio.getManagedObject(), Props.WIDGET_STYLE_TOOLBAR);
        PropsUI.getInstance().setLook((Control) lastRadio.getManagedObject(), Props.WIDGET_STYLE_TOOLBAR);
        PropsUI.getInstance().setLook((Control) offRadio.getManagedObject(), Props.WIDGET_STYLE_TOOLBAR);
    } catch (Throwable t) {
        log.logError(toString(), Const.getStackTracker(t));
        new ErrorDialog(transPreviewComposite.getShell(), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_TRANS_PREVIEW_TOOLBAR), new Exception(t));
    }
}
Also used : XulLoader(org.pentaho.ui.xul.XulLoader) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) ToolBar(org.eclipse.swt.widgets.ToolBar) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) ResourceBundle(java.util.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) KettleStepException(org.pentaho.di.core.exception.KettleStepException) KettleException(org.pentaho.di.core.exception.KettleException)

Example 19 with KettleXulLoader

use of org.pentaho.di.ui.xul.KettleXulLoader in project pentaho-kettle by pentaho.

the class JobHistoryDelegate 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_GRID_TOOLBAR, bundle);
        xulDomContainer.addEventHandler(this);
        toolbar = (XulToolbar) xulDomContainer.getDocumentRoot().getElementById("nav-toolbar");
        refreshButton = (XulToolbarbutton) xulDomContainer.getDocumentRoot().getElementById("refresh-history");
        fetchNextBatchButton = (XulToolbarbutton) xulDomContainer.getDocumentRoot().getElementById("fetch-next-batch-history");
        fetchAllButton = (XulToolbarbutton) xulDomContainer.getDocumentRoot().getElementById("fetch-all-history");
        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(jobHistoryComposite.getShell(), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Title"), BaseMessages.getString(PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_TRANS_GRID_TOOLBAR), new Exception(t));
    }
}
Also used : XulSpoonResourceBundle(org.pentaho.di.ui.spoon.XulSpoonResourceBundle) XulLoader(org.pentaho.ui.xul.XulLoader) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) ToolBar(org.eclipse.swt.widgets.ToolBar) KettleXulLoader(org.pentaho.di.ui.xul.KettleXulLoader) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) XulSpoonResourceBundle(org.pentaho.di.ui.spoon.XulSpoonResourceBundle) ResourceBundle(java.util.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) KettleValueException(org.pentaho.di.core.exception.KettleValueException)

Aggregations

KettleXulLoader (org.pentaho.di.ui.xul.KettleXulLoader)19 XulDomContainer (org.pentaho.ui.xul.XulDomContainer)11 ResourceBundle (java.util.ResourceBundle)9 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)9 SwtXulRunner (org.pentaho.ui.xul.swt.SwtXulRunner)9 ToolBar (org.eclipse.swt.widgets.ToolBar)8 KettleException (org.pentaho.di.core.exception.KettleException)7 XulLoader (org.pentaho.ui.xul.XulLoader)7 XulSpoonResourceBundle (org.pentaho.di.ui.spoon.XulSpoonResourceBundle)5 XulException (org.pentaho.ui.xul.XulException)5 SwtDialog (org.pentaho.ui.xul.swt.tags.SwtDialog)4 KettleValueException (org.pentaho.di.core.exception.KettleValueException)3 XulDialog (org.pentaho.ui.xul.containers.XulDialog)3 FormData (org.eclipse.swt.layout.FormData)2 File (java.io.File)1 MalformedURLException (java.net.MalformedURLException)1 MissingResourceException (java.util.MissingResourceException)1 FileObject (org.apache.commons.vfs2.FileObject)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 SWTException (org.eclipse.swt.SWTException)1