Search in sources :

Example 46 with TextVar

use of org.pentaho.di.ui.core.widget.TextVar in project pentaho-kettle by pentaho.

the class FileLockedDialog method open.

public String open() {
    Shell parent = getParent();
    Display display = parent.getDisplay();
    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    props.setLook(shell);
    setShellImage(shell, input);
    ModifyListener lsMod = new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            input.setChanged();
        }
    };
    changed = input.hasChanged();
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;
    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "FileLockedDialog.Shell.Title"));
    int middle = props.getMiddlePct();
    int margin = Const.MARGIN;
    // Stepname line
    wlStepname = new Label(shell, SWT.RIGHT);
    wlStepname.setText(BaseMessages.getString(PKG, "FileLockedDialog.Stepname.Label"));
    props.setLook(wlStepname);
    fdlStepname = new FormData();
    fdlStepname.left = new FormAttachment(0, 0);
    fdlStepname.right = new FormAttachment(middle, -margin);
    fdlStepname.top = new FormAttachment(0, margin);
    wlStepname.setLayoutData(fdlStepname);
    wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wStepname.setText(stepname);
    props.setLook(wStepname);
    wStepname.addModifyListener(lsMod);
    fdStepname = new FormData();
    fdStepname.left = new FormAttachment(middle, 0);
    fdStepname.top = new FormAttachment(0, margin);
    fdStepname.right = new FormAttachment(100, 0);
    wStepname.setLayoutData(fdStepname);
    // filename field
    wlFileName = new Label(shell, SWT.RIGHT);
    wlFileName.setText(BaseMessages.getString(PKG, "FileLockedDialog.FileName.Label"));
    props.setLook(wlFileName);
    fdlFileName = new FormData();
    fdlFileName.left = new FormAttachment(0, 0);
    fdlFileName.right = new FormAttachment(middle, -margin);
    fdlFileName.top = new FormAttachment(wStepname, margin);
    wlFileName.setLayoutData(fdlFileName);
    wFileName = new CCombo(shell, SWT.BORDER | SWT.READ_ONLY);
    wFileName.setEditable(true);
    props.setLook(wFileName);
    wFileName.addModifyListener(lsMod);
    fdfileName = new FormData();
    fdfileName.left = new FormAttachment(middle, 0);
    fdfileName.top = new FormAttachment(wStepname, margin);
    fdfileName.right = new FormAttachment(100, -margin);
    wFileName.setLayoutData(fdfileName);
    wFileName.addFocusListener(new FocusListener() {

        public void focusLost(org.eclipse.swt.events.FocusEvent e) {
        }

        public void focusGained(org.eclipse.swt.events.FocusEvent e) {
            get();
        }
    });
    // Result fieldname ...
    wlResult = new Label(shell, SWT.RIGHT);
    wlResult.setText(BaseMessages.getString(PKG, "FileLockedDialog.ResultField.Label"));
    props.setLook(wlResult);
    fdlResult = new FormData();
    fdlResult.left = new FormAttachment(0, 0);
    fdlResult.right = new FormAttachment(middle, -margin);
    fdlResult.top = new FormAttachment(wFileName, margin * 2);
    wlResult.setLayoutData(fdlResult);
    wResult = new TextVar(transMeta, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wResult.setToolTipText(BaseMessages.getString(PKG, "FileLockedDialog.ResultField.Tooltip"));
    props.setLook(wResult);
    wResult.addModifyListener(lsMod);
    fdResult = new FormData();
    fdResult.left = new FormAttachment(middle, 0);
    fdResult.top = new FormAttachment(wFileName, margin * 2);
    fdResult.right = new FormAttachment(100, 0);
    wResult.setLayoutData(fdResult);
    // Add filename to result filenames?
    wlAddResult = new Label(shell, SWT.RIGHT);
    wlAddResult.setText(BaseMessages.getString(PKG, "FileLockedDialog.AddResult.Label"));
    props.setLook(wlAddResult);
    fdlAddResult = new FormData();
    fdlAddResult.left = new FormAttachment(0, 0);
    fdlAddResult.top = new FormAttachment(wResult, 2 * margin);
    fdlAddResult.right = new FormAttachment(middle, -margin);
    wlAddResult.setLayoutData(fdlAddResult);
    wAddResult = new Button(shell, SWT.CHECK);
    props.setLook(wAddResult);
    wAddResult.setToolTipText(BaseMessages.getString(PKG, "FileLockedDialog.AddResult.Tooltip"));
    fdAddResult = new FormData();
    fdAddResult.left = new FormAttachment(middle, 0);
    fdAddResult.top = new FormAttachment(wResult, 2 * margin);
    wAddResult.setLayoutData(fdAddResult);
    // THE BUTTONS
    wOK = new Button(shell, SWT.PUSH);
    wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    setButtonPositions(new Button[] { wOK, wCancel }, margin, null);
    // Add listeners
    lsOK = new Listener() {

        public void handleEvent(Event e) {
            ok();
        }
    };
    lsCancel = new Listener() {

        public void handleEvent(Event e) {
            cancel();
        }
    };
    wOK.addListener(SWT.Selection, lsOK);
    wCancel.addListener(SWT.Selection, lsCancel);
    lsDef = new SelectionAdapter() {

        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    wStepname.addSelectionListener(lsDef);
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {

        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });
    // Set the shell size, based upon previous time...
    setSize();
    getData();
    input.setChanged(changed);
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return stepname;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ShellAdapter(org.eclipse.swt.events.ShellAdapter) FocusListener(org.eclipse.swt.events.FocusListener) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) ShellEvent(org.eclipse.swt.events.ShellEvent) Text(org.eclipse.swt.widgets.Text) TextVar(org.pentaho.di.ui.core.widget.TextVar) Shell(org.eclipse.swt.widgets.Shell) ModifyEvent(org.eclipse.swt.events.ModifyEvent) CCombo(org.eclipse.swt.custom.CCombo) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ShellEvent(org.eclipse.swt.events.ShellEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FocusListener(org.eclipse.swt.events.FocusListener) FormAttachment(org.eclipse.swt.layout.FormAttachment) Display(org.eclipse.swt.widgets.Display)

Example 47 with TextVar

use of org.pentaho.di.ui.core.widget.TextVar in project pentaho-kettle by pentaho.

the class ClusterSchemaDialog method open.

public boolean open() {
    Shell parent = getParent();
    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    props.setLook(shell);
    shell.setImage(GUIResource.getInstance().getImageCluster());
    lsMod = new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            clusterSchema.setChanged();
        }
    };
    middle = props.getMiddlePct();
    margin = Const.MARGIN;
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;
    shell.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.Shell.Title"));
    shell.setLayout(formLayout);
    // First, add the buttons...
    // Buttons
    wOK = new Button(shell, SWT.PUSH);
    wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    Button[] buttons = new Button[] { wOK, wCancel };
    BaseStepDialog.positionBottomButtons(shell, buttons, margin, null);
    // The rest stays above the buttons, so we added those first...
    // What's the schema name??
    Label wlName = new Label(shell, SWT.RIGHT);
    props.setLook(wlName);
    wlName.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.Schema.Label"));
    FormData fdlName = new FormData();
    fdlName.top = new FormAttachment(0, 0);
    // First one in the left top corner
    fdlName.left = new FormAttachment(0, 0);
    fdlName.right = new FormAttachment(middle, 0);
    wlName.setLayoutData(fdlName);
    wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wName);
    wName.addModifyListener(lsMod);
    FormData fdName = new FormData();
    fdName.top = new FormAttachment(0, 0);
    // To the right of the label
    fdName.left = new FormAttachment(middle, margin);
    fdName.right = new FormAttachment(95, 0);
    wName.setLayoutData(fdName);
    // What's the base port??
    Label wlPort = new Label(shell, SWT.RIGHT);
    props.setLook(wlPort);
    wlPort.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.Port.Label"));
    FormData fdlPort = new FormData();
    fdlPort.top = new FormAttachment(wName, margin);
    // First one in the left top corner
    fdlPort.left = new FormAttachment(0, 0);
    fdlPort.right = new FormAttachment(middle, 0);
    wlPort.setLayoutData(fdlPort);
    wPort = new TextVar(clusterSchema, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wPort);
    wPort.addModifyListener(lsMod);
    FormData fdPort = new FormData();
    fdPort.top = new FormAttachment(wName, margin);
    // To the right of the label
    fdPort.left = new FormAttachment(middle, margin);
    fdPort.right = new FormAttachment(95, 0);
    wPort.setLayoutData(fdPort);
    // What are the sockets buffer sizes??
    Label wlBufferSize = new Label(shell, SWT.RIGHT);
    props.setLook(wlBufferSize);
    wlBufferSize.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.SocketBufferSize.Label"));
    FormData fdlBufferSize = new FormData();
    fdlBufferSize.top = new FormAttachment(wPort, margin);
    // First one in the left top corner
    fdlBufferSize.left = new FormAttachment(0, 0);
    fdlBufferSize.right = new FormAttachment(middle, 0);
    wlBufferSize.setLayoutData(fdlBufferSize);
    wBufferSize = new TextVar(clusterSchema, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wBufferSize);
    wBufferSize.addModifyListener(lsMod);
    FormData fdBufferSize = new FormData();
    fdBufferSize.top = new FormAttachment(wPort, margin);
    // To the right of the label
    fdBufferSize.left = new FormAttachment(middle, margin);
    fdBufferSize.right = new FormAttachment(95, 0);
    wBufferSize.setLayoutData(fdBufferSize);
    // What are the sockets buffer sizes??
    Label wlFlushInterval = new Label(shell, SWT.RIGHT);
    props.setLook(wlFlushInterval);
    wlFlushInterval.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.SocketFlushRows.Label"));
    FormData fdlFlushInterval = new FormData();
    fdlFlushInterval.top = new FormAttachment(wBufferSize, margin);
    // First one in the left top corner
    fdlFlushInterval.left = new FormAttachment(0, 0);
    fdlFlushInterval.right = new FormAttachment(middle, 0);
    wlFlushInterval.setLayoutData(fdlFlushInterval);
    wFlushInterval = new TextVar(clusterSchema, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wFlushInterval);
    wFlushInterval.addModifyListener(lsMod);
    FormData fdFlushInterval = new FormData();
    fdFlushInterval.top = new FormAttachment(wBufferSize, margin);
    // To the right of the label
    fdFlushInterval.left = new FormAttachment(middle, margin);
    fdFlushInterval.right = new FormAttachment(95, 0);
    wFlushInterval.setLayoutData(fdFlushInterval);
    // What are the sockets buffer sizes??
    Label wlCompressed = new Label(shell, SWT.RIGHT);
    props.setLook(wlCompressed);
    wlCompressed.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.SocketDataCompressed.Label"));
    FormData fdlCompressed = new FormData();
    fdlCompressed.top = new FormAttachment(wFlushInterval, margin);
    // First one in the left top corner
    fdlCompressed.left = new FormAttachment(0, 0);
    fdlCompressed.right = new FormAttachment(middle, 0);
    wlCompressed.setLayoutData(fdlCompressed);
    wCompressed = new Button(shell, SWT.CHECK);
    props.setLook(wCompressed);
    FormData fdCompressed = new FormData();
    fdCompressed.top = new FormAttachment(wFlushInterval, margin);
    // To the right of the label
    fdCompressed.left = new FormAttachment(middle, margin);
    fdCompressed.right = new FormAttachment(95, 0);
    wCompressed.setLayoutData(fdCompressed);
    // What are the sockets buffer sizes??
    Label wlDynamic = new Label(shell, SWT.RIGHT);
    wlDynamic.setToolTipText(BaseMessages.getString(PKG, "ClusterSchemaDialog.DynamicCluster.Tooltip"));
    props.setLook(wlDynamic);
    wlDynamic.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.DynamicCluster.Label"));
    FormData fdlDynamic = new FormData();
    fdlDynamic.top = new FormAttachment(wCompressed, margin);
    // First one in the left top corner
    fdlDynamic.left = new FormAttachment(0, 0);
    fdlDynamic.right = new FormAttachment(middle, 0);
    wlDynamic.setLayoutData(fdlDynamic);
    wDynamic = new Button(shell, SWT.CHECK);
    wDynamic.setToolTipText(BaseMessages.getString(PKG, "ClusterSchemaDialog.DynamicCluster.Tooltip"));
    props.setLook(wDynamic);
    FormData fdDynamic = new FormData();
    fdDynamic.top = new FormAttachment(wCompressed, margin);
    // To the right of the label
    fdDynamic.left = new FormAttachment(middle, margin);
    fdDynamic.right = new FormAttachment(95, 0);
    wDynamic.setLayoutData(fdDynamic);
    // Schema servers:
    Label wlServers = new Label(shell, SWT.RIGHT);
    wlServers.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.SlaveServers.Label"));
    props.setLook(wlServers);
    FormData fdlServers = new FormData();
    fdlServers.left = new FormAttachment(0, 0);
    fdlServers.right = new FormAttachment(middle, 0);
    fdlServers.top = new FormAttachment(wDynamic, margin);
    wlServers.setLayoutData(fdlServers);
    // Some buttons to manage...
    wSelect = new Button(shell, SWT.PUSH);
    wSelect.setText(BaseMessages.getString(PKG, "ClusterSchemaDialog.SelectSlaveServers.Label"));
    props.setLook(wSelect);
    FormData fdSelect = new FormData();
    fdSelect.right = new FormAttachment(100, 0);
    fdSelect.top = new FormAttachment(wlServers, 5 * margin);
    wSelect.setLayoutData(fdSelect);
    wSelect.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            selectSlaveServers();
        }
    });
    ColumnInfo[] partitionColumns = new ColumnInfo[] { new ColumnInfo(BaseMessages.getString(PKG, "ClusterSchemaDialog.ColumnInfoName.Label"), ColumnInfo.COLUMN_TYPE_TEXT, true, false), new ColumnInfo(BaseMessages.getString(PKG, "ClusterSchemaDialog.ColumnInfoServiceURL.Label"), ColumnInfo.COLUMN_TYPE_TEXT, true, true), new ColumnInfo(BaseMessages.getString(PKG, "ClusterSchemaDialog.ColumnInfoMaster.Label"), ColumnInfo.COLUMN_TYPE_TEXT, true, true) };
    wServers = new TableView(clusterSchema, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE, partitionColumns, 1, lsMod, props);
    wServers.setReadonly(false);
    props.setLook(wServers);
    FormData fdServers = new FormData();
    fdServers.left = new FormAttachment(middle, margin);
    fdServers.right = new FormAttachment(wSelect, -2 * margin);
    fdServers.top = new FormAttachment(wDynamic, margin);
    fdServers.bottom = new FormAttachment(wOK, -margin * 2);
    wServers.setLayoutData(fdServers);
    wServers.table.addSelectionListener(new SelectionAdapter() {

        public void widgetDefaultSelected(SelectionEvent e) {
            editSlaveServer();
        }
    });
    // Add listeners
    wOK.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event e) {
            ok();
        }
    });
    wCancel.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event e) {
            cancel();
        }
    });
    SelectionAdapter selAdapter = new SelectionAdapter() {

        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    wName.addSelectionListener(selAdapter);
    wPort.addSelectionListener(selAdapter);
    wBufferSize.addSelectionListener(selAdapter);
    wFlushInterval.addSelectionListener(selAdapter);
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {

        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });
    getData();
    BaseStepDialog.setSize(shell);
    shell.open();
    Display display = parent.getDisplay();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    return ok;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ShellAdapter(org.eclipse.swt.events.ShellAdapter) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) ColumnInfo(org.pentaho.di.ui.core.widget.ColumnInfo) ShellEvent(org.eclipse.swt.events.ShellEvent) Text(org.eclipse.swt.widgets.Text) TextVar(org.pentaho.di.ui.core.widget.TextVar) Shell(org.eclipse.swt.widgets.Shell) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ShellEvent(org.eclipse.swt.events.ShellEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment) TableView(org.pentaho.di.ui.core.widget.TableView) Display(org.eclipse.swt.widgets.Display)

Example 48 with TextVar

use of org.pentaho.di.ui.core.widget.TextVar in project pentaho-kettle by pentaho.

the class SlaveServerDialog method addServiceTab.

private void addServiceTab() {
    // ////////////////////////
    // START OF DB TAB ///
    // ////////////////////////
    wServiceTab = new CTabItem(wTabFolder, SWT.NONE);
    wServiceTab.setText(BaseMessages.getString(PKG, "SlaveServerDialog.USER_TAB_SERVICE"));
    wServiceComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wServiceComp);
    FormLayout GenLayout = new FormLayout();
    GenLayout.marginWidth = Const.FORM_MARGIN;
    GenLayout.marginHeight = Const.FORM_MARGIN;
    wServiceComp.setLayout(GenLayout);
    // What's the name
    Label wlName = new Label(wServiceComp, SWT.RIGHT);
    props.setLook(wlName);
    wlName.setText(BaseMessages.getString(PKG, "SlaveServerDialog.ServerName.Label"));
    FormData fdlName = new FormData();
    fdlName.top = new FormAttachment(0, 0);
    // First one in the left top corner
    fdlName.left = new FormAttachment(0, 0);
    fdlName.right = new FormAttachment(middle, -margin);
    wlName.setLayoutData(fdlName);
    wName = new Text(wServiceComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wName);
    wName.addModifyListener(lsMod);
    FormData fdName = new FormData();
    fdName.top = new FormAttachment(0, 0);
    // To the right of the label
    fdName.left = new FormAttachment(middle, 0);
    fdName.right = new FormAttachment(95, 0);
    wName.setLayoutData(fdName);
    // What's the hostname
    Label wlHostname = new Label(wServiceComp, SWT.RIGHT);
    props.setLook(wlHostname);
    wlHostname.setText(BaseMessages.getString(PKG, "SlaveServerDialog.HostIP.Label"));
    FormData fdlHostname = new FormData();
    fdlHostname.top = new FormAttachment(wName, margin * 2);
    // First one in the left top corner
    fdlHostname.left = new FormAttachment(0, 0);
    fdlHostname.right = new FormAttachment(middle, -margin);
    wlHostname.setLayoutData(fdlHostname);
    wHostname = new TextVar(slaveServer, wServiceComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wHostname);
    wHostname.addModifyListener(lsMod);
    FormData fdHostname = new FormData();
    fdHostname.top = new FormAttachment(wName, margin * 2);
    // To the right of the label
    fdHostname.left = new FormAttachment(middle, 0);
    fdHostname.right = new FormAttachment(95, 0);
    wHostname.setLayoutData(fdHostname);
    // What's the service URL?
    Label wlPort = new Label(wServiceComp, SWT.RIGHT);
    props.setLook(wlPort);
    wlPort.setText(BaseMessages.getString(PKG, "SlaveServerDialog.Port.Label"));
    FormData fdlPort = new FormData();
    fdlPort.top = new FormAttachment(wHostname, margin);
    // First one in the left top corner
    fdlPort.left = new FormAttachment(0, 0);
    fdlPort.right = new FormAttachment(middle, -margin);
    wlPort.setLayoutData(fdlPort);
    wPort = new TextVar(slaveServer, wServiceComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wPort);
    wPort.addModifyListener(lsMod);
    FormData fdPort = new FormData();
    fdPort.top = new FormAttachment(wHostname, margin);
    // To the right of the label
    fdPort.left = new FormAttachment(middle, 0);
    fdPort.right = new FormAttachment(95, 0);
    wPort.setLayoutData(fdPort);
    // webapp name (optional)
    Label wlWebAppName = new Label(wServiceComp, SWT.RIGHT);
    wlWebAppName.setText(BaseMessages.getString(PKG, "SlaveServerDialog.WebAppName.Label"));
    props.setLook(wlWebAppName);
    FormData fdlWebAppName = new FormData();
    fdlWebAppName.top = new FormAttachment(wPort, margin);
    fdlWebAppName.left = new FormAttachment(0, 0);
    fdlWebAppName.right = new FormAttachment(middle, -margin);
    wlWebAppName.setLayoutData(fdlWebAppName);
    wWebAppName = new TextVar(slaveServer, wServiceComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wWebAppName);
    wWebAppName.addModifyListener(lsMod);
    FormData fdWebAppName = new FormData();
    fdWebAppName.top = new FormAttachment(wPort, margin);
    fdWebAppName.left = new FormAttachment(middle, 0);
    fdWebAppName.right = new FormAttachment(95, 0);
    wWebAppName.setLayoutData(fdWebAppName);
    // Username
    Label wlUsername = new Label(wServiceComp, SWT.RIGHT);
    wlUsername.setText(BaseMessages.getString(PKG, "SlaveServerDialog.UserName.Label"));
    props.setLook(wlUsername);
    FormData fdlUsername = new FormData();
    fdlUsername.top = new FormAttachment(wWebAppName, margin);
    fdlUsername.left = new FormAttachment(0, 0);
    fdlUsername.right = new FormAttachment(middle, -margin);
    wlUsername.setLayoutData(fdlUsername);
    wUsername = new TextVar(slaveServer, wServiceComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wUsername);
    wUsername.addModifyListener(lsMod);
    FormData fdUsername = new FormData();
    fdUsername.top = new FormAttachment(wWebAppName, margin);
    fdUsername.left = new FormAttachment(middle, 0);
    fdUsername.right = new FormAttachment(95, 0);
    wUsername.setLayoutData(fdUsername);
    // Password
    Label wlPassword = new Label(wServiceComp, SWT.RIGHT);
    wlPassword.setText(BaseMessages.getString(PKG, "SlaveServerDialog.Password.Label"));
    props.setLook(wlPassword);
    FormData fdlPassword = new FormData();
    fdlPassword.top = new FormAttachment(wUsername, margin);
    fdlPassword.left = new FormAttachment(0, 0);
    fdlPassword.right = new FormAttachment(middle, -margin);
    wlPassword.setLayoutData(fdlPassword);
    wPassword = new PasswordTextVar(slaveServer, wServiceComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wPassword);
    wPassword.addModifyListener(lsMod);
    FormData fdPassword = new FormData();
    fdPassword.top = new FormAttachment(wUsername, margin);
    fdPassword.left = new FormAttachment(middle, 0);
    fdPassword.right = new FormAttachment(95, 0);
    wPassword.setLayoutData(fdPassword);
    // Master
    Label wlMaster = new Label(wServiceComp, SWT.RIGHT);
    wlMaster.setText(BaseMessages.getString(PKG, "SlaveServerDialog.IsTheMaster.Label"));
    props.setLook(wlMaster);
    FormData fdlMaster = new FormData();
    fdlMaster.top = new FormAttachment(wPassword, margin);
    fdlMaster.left = new FormAttachment(0, 0);
    fdlMaster.right = new FormAttachment(middle, -margin);
    wlMaster.setLayoutData(fdlMaster);
    wMaster = new Button(wServiceComp, SWT.CHECK);
    props.setLook(wMaster);
    FormData fdMaster = new FormData();
    fdMaster.top = new FormAttachment(wPassword, margin);
    fdMaster.left = new FormAttachment(middle, 0);
    fdMaster.right = new FormAttachment(95, 0);
    wMaster.setLayoutData(fdMaster);
    // Https
    Control lastControl = wMaster;
    Label wlSSL = new Label(wServiceComp, SWT.RIGHT);
    wlSSL.setText(BaseMessages.getString(PKG, "SlaveServerDialog.UseSsl.Label"));
    props.setLook(wlSSL);
    FormData fd = new FormData();
    fd.top = new FormAttachment(lastControl, margin);
    fd.left = new FormAttachment(0, 0);
    fd.right = new FormAttachment(middle, -margin);
    wlSSL.setLayoutData(fd);
    // future functional
    wlSSL.setVisible(false);
    wSSL = new Button(wServiceComp, SWT.CHECK);
    props.setLook(wSSL);
    FormData bfd = new FormData();
    bfd.top = new FormAttachment(lastControl, margin);
    bfd.left = new FormAttachment(middle, 0);
    bfd.right = new FormAttachment(95, 0);
    wSSL.setLayoutData(bfd);
    // future functional
    wSSL.setVisible(false);
    fdServiceComp = new FormData();
    fdServiceComp.left = new FormAttachment(0, 0);
    fdServiceComp.top = new FormAttachment(0, 0);
    fdServiceComp.right = new FormAttachment(100, 0);
    fdServiceComp.bottom = new FormAttachment(100, 0);
    wServiceComp.setLayoutData(fdServiceComp);
    wServiceComp.layout();
    wServiceTab.setControl(wServiceComp);
// ///////////////////////////////////////////////////////////
// / END OF GEN TAB
// ///////////////////////////////////////////////////////////
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) CTabItem(org.eclipse.swt.custom.CTabItem) FormAttachment(org.eclipse.swt.layout.FormAttachment) TextVar(org.pentaho.di.ui.core.widget.TextVar) PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar)

Example 49 with TextVar

use of org.pentaho.di.ui.core.widget.TextVar in project pentaho-kettle by pentaho.

the class ExtTextbox method getManagedObject.

public Object getManagedObject() {
    if (textBox.isDisposed()) {
        int thisStyle = isMultiline() ? SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL : style;
        extText = new TextVar(variableSpace, parentComposite, thisStyle);
        setDisabled(isDisabled());
        setMaxlength(getMaxlength());
        setValue(getValue());
        setReadonly(isReadonly());
        setType(getType());
        textBox = extText.getTextWidget();
        setManagedObject(extText);
        layout();
    }
    return super.getManagedObject();
}
Also used : PasswordTextVar(org.pentaho.di.ui.core.widget.PasswordTextVar) TextVar(org.pentaho.di.ui.core.widget.TextVar)

Example 50 with TextVar

use of org.pentaho.di.ui.core.widget.TextVar 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)

Aggregations

TextVar (org.pentaho.di.ui.core.widget.TextVar)240 Label (org.eclipse.swt.widgets.Label)237 FormAttachment (org.eclipse.swt.layout.FormAttachment)236 FormData (org.eclipse.swt.layout.FormData)236 FormLayout (org.eclipse.swt.layout.FormLayout)220 Button (org.eclipse.swt.widgets.Button)207 SelectionEvent (org.eclipse.swt.events.SelectionEvent)196 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)194 Text (org.eclipse.swt.widgets.Text)189 ModifyListener (org.eclipse.swt.events.ModifyListener)186 ModifyEvent (org.eclipse.swt.events.ModifyEvent)184 Listener (org.eclipse.swt.widgets.Listener)184 Shell (org.eclipse.swt.widgets.Shell)184 Event (org.eclipse.swt.widgets.Event)183 ShellAdapter (org.eclipse.swt.events.ShellAdapter)181 ShellEvent (org.eclipse.swt.events.ShellEvent)181 Display (org.eclipse.swt.widgets.Display)181 CCombo (org.eclipse.swt.custom.CCombo)113 Composite (org.eclipse.swt.widgets.Composite)112 CTabItem (org.eclipse.swt.custom.CTabItem)108