Search in sources :

Example 1 with XulTree

use of org.pentaho.ui.xul.containers.XulTree in project pentaho-kettle by pentaho.

the class DataOverrideHandler method getControls.

@Override
protected void getControls() {
    super.getControls();
    XulTextbox[] boxes = new XulTextbox[] { hostNameBox, databaseNameBox, portNumberBox, userNameBox, passwordBox, customDriverClassBox, customUrlBox, dataTablespaceBox, indexTablespaceBox, poolSizeBox, maxPoolSizeBox, languageBox, systemNumberBox, clientBox };
    for (int i = 0; i < boxes.length; i++) {
        XulTextbox xulTextbox = boxes[i];
        if ((xulTextbox != null) && (xulTextbox instanceof ExtTextbox)) {
            ExtTextbox ext = (ExtTextbox) xulTextbox;
            ext.setVariableSpace(databaseMeta);
        }
    }
    XulTree[] trees = new XulTree[] { poolParameterTree, clusterParameterTree, optionsParameterTree };
    for (int i = 0; i < trees.length; i++) {
        XulTree xulTree = trees[i];
        if (xulTree != null) {
            xulTree.setData(databaseMeta);
        }
    }
}
Also used : ExtTextbox(org.pentaho.di.ui.core.database.dialog.tags.ExtTextbox) XulTextbox(org.pentaho.ui.xul.components.XulTextbox) XulTree(org.pentaho.ui.xul.containers.XulTree)

Example 2 with XulTree

use of org.pentaho.ui.xul.containers.XulTree in project pentaho-kettle by pentaho.

the class ExtMenuList method createNewExtMenuList.

private void createNewExtMenuList(XulComponent parent) {
    xulParent = parent;
    if ((xulParent != null) && (xulParent instanceof XulTree)) {
        variableSpace = (DatabaseMeta) ((XulTree) xulParent).getData();
    } else {
        variableSpace = new DatabaseMeta();
        style = SWT.BORDER;
    }
    extCombo = new ComboVar(variableSpace, (Composite) parent.getManagedObject(), style);
    combobox = extCombo.getCComboWidget();
    setManagedObject(extCombo);
    combobox.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            fireSelectedEvents();
        }
    });
    combobox.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent modifyEvent) {
            fireModifiedEvents();
        }
    });
}
Also used : ComboVar(org.pentaho.di.ui.core.widget.ComboVar) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) XulTree(org.pentaho.ui.xul.containers.XulTree) SelectionEvent(org.eclipse.swt.events.SelectionEvent) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta)

Example 3 with XulTree

use of org.pentaho.ui.xul.containers.XulTree in project pentaho-kettle by pentaho.

the class ExtTextbox method createNewExtText.

private void createNewExtText(XulComponent parent) {
    xulParent = parent;
    if ((xulParent != null) && (xulParent instanceof XulTree)) {
        variableSpace = (DatabaseMeta) ((XulTree) xulParent).getData();
    } else {
        variableSpace = new DatabaseMeta();
        style = SWT.BORDER;
    }
    if (type == TextType.PASSWORD) {
        extText = new PasswordTextVar(variableSpace, parentComposite, style);
    } else {
        extText = new TextVar(variableSpace, parentComposite, style);
    }
    textBox = extText.getTextWidget();
    addKeyListener(textBox);
    setManagedObject(extText);
}
Also used : PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) XulTree(org.pentaho.ui.xul.containers.XulTree) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) TextVar(org.pentaho.di.ui.core.widget.TextVar)

Example 4 with XulTree

use of org.pentaho.ui.xul.containers.XulTree in project data-access by pentaho.

the class StageDataStep method clearColumnGrid.

public void clearColumnGrid() throws XulException {
    // $NON-NLS-1$
    XulTree tree = (XulTree) document.getElementById("csvModelDataTable");
    tree.setElements(null);
    tree.update();
}
Also used : XulTree(org.pentaho.ui.xul.containers.XulTree)

Example 5 with XulTree

use of org.pentaho.ui.xul.containers.XulTree in project pentaho-kettle by pentaho.

the class XulDatabaseDialog method open.

/**
 * Opens the XUL database dialog
 *
 * @return databaseName (or NULL on error or cancel) TODO: Fix deprecation warning in v3.2 by using the new dialog
 */
public String open() {
    if (databaseDialogInstance == null) {
        createDialog();
    }
    try {
        // PDI-5088 clear previous options selections since we are re-using the dialog
        XulTree tree = (XulTree) xulDialogComponent.getDocument().getRootElement().getElementById("options-parameter-tree");
        tree.getRootChildren().removeAll();
        dataHandler.setData(databaseMeta);
        // Attention: onload: loadConnectionData() is called here the second time, see above
        xulDialogComponent.show();
        // for first time
        // caught with a HACK in DataHandler.loadConnectionData()
        databaseMeta = (DatabaseMeta) dataHandler.getData();
        // keep the original id
        if (databaseMeta != null) {
            databaseMeta.setObjectId(databaseMetaObjectId);
            databaseName = Utils.isEmpty(databaseMeta.getName()) ? null : databaseMeta.getName();
        } else {
            databaseName = null;
        }
    } catch (Exception e) {
        new ErrorDialog(parentShell, BaseMessages.getString(PKG, "XulDatabaseDialog.Error.Title"), BaseMessages.getString(PKG, "XulDatabaseDialog.Error.Dialog"), e);
        return null;
    }
    return databaseName;
}
Also used : XulTree(org.pentaho.ui.xul.containers.XulTree) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) XulException(org.pentaho.ui.xul.XulException) MissingResourceException(java.util.MissingResourceException)

Aggregations

XulTree (org.pentaho.ui.xul.containers.XulTree)11 XulTreeRow (org.pentaho.ui.xul.containers.XulTreeRow)3 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)2 XulComponent (org.pentaho.ui.xul.XulComponent)2 XulTreeCell (org.pentaho.ui.xul.components.XulTreeCell)2 XulTreeItem (org.pentaho.ui.xul.containers.XulTreeItem)2 Bindable (org.pentaho.ui.xul.stereotype.Bindable)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 MissingResourceException (java.util.MissingResourceException)1 Vector (java.util.Vector)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 Composite (org.eclipse.swt.widgets.Composite)1 Before (org.junit.Before)1 ExtTextbox (org.pentaho.di.ui.core.database.dialog.tags.ExtTextbox)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1 ComboVar (org.pentaho.di.ui.core.widget.ComboVar)1