Search in sources :

Example 1 with HttpTransactionVariablesComposite

use of com.twinsoft.convertigo.eclipse.dialogs.HttpTransactionVariablesComposite in project convertigo by convertigo.

the class ObjectInfoWizardPage method createControl.

public void createControl(Composite parent) {
    container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 2;
    layout.verticalSpacing = 9;
    Label label = new Label(container, SWT.NULL);
    label.setText("&Name:");
    beanName = new Text(container, SWT.BORDER | SWT.SINGLE);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    beanName.setLayoutData(gd);
    beanName.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            dialogChanged(false);
        }
    });
    if (parentObject instanceof CouchDbConnector || parentObject instanceof FullSyncConnector) {
        couchVariablesComposite = new CouchVariablesComposite(container, SWT.V_SCROLL);
        gd = new GridData(GridData.FILL_BOTH);
        gd.horizontalSpan = 2;
        couchVariablesComposite.setLayoutData(gd);
    } else if (parentObject instanceof HttpConnector) {
        httpTransactionVariablesComposite = new HttpTransactionVariablesComposite(container, SWT.V_SCROLL);
        gd = new GridData(GridData.FILL_BOTH);
        gd.horizontalSpan = 2;
        httpTransactionVariablesComposite.setLayoutData(gd);
    } else {
        tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
        tree.setHeaderVisible(false);
        gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.verticalSpan = 20;
        gd.horizontalSpan = 2;
        tree.setLayoutData(gd);
        tree.addListener(SWT.Selection, new Listener() {

            public void handleEvent(final Event event) {
                TreeItem item = (TreeItem) event.item;
                treeItemName = item.getText();
                String suffix = getBeanName().endsWith(ScHandlerStatement.EVENT_ENTRY_HANDLER) ? ScHandlerStatement.EVENT_ENTRY_HANDLER : getBeanName().endsWith(ScHandlerStatement.EVENT_EXIT_HANDLER) ? ScHandlerStatement.EVENT_EXIT_HANDLER : "";
                setBeanName("on" + treeItemName + suffix);
                dialogChanged(true);
            }
        });
        tree.setVisible(false);
    }
    initialize();
    dialogChanged(true);
    setControl(container);
}
Also used : CouchVariablesComposite(com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesComposite) HttpConnector(com.twinsoft.convertigo.beans.connectors.HttpConnector) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) Composite(org.eclipse.swt.widgets.Composite) HttpTransactionVariablesComposite(com.twinsoft.convertigo.eclipse.dialogs.HttpTransactionVariablesComposite) CouchVariablesComposite(com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesComposite) ModifyListener(org.eclipse.swt.events.ModifyListener) TreeItem(org.eclipse.swt.widgets.TreeItem) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) FullSyncConnector(com.twinsoft.convertigo.beans.connectors.FullSyncConnector) CouchDbConnector(com.twinsoft.convertigo.beans.connectors.CouchDbConnector) HttpTransactionVariablesComposite(com.twinsoft.convertigo.eclipse.dialogs.HttpTransactionVariablesComposite) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Event(org.eclipse.swt.widgets.Event)

Aggregations

CouchDbConnector (com.twinsoft.convertigo.beans.connectors.CouchDbConnector)1 FullSyncConnector (com.twinsoft.convertigo.beans.connectors.FullSyncConnector)1 HttpConnector (com.twinsoft.convertigo.beans.connectors.HttpConnector)1 CouchVariablesComposite (com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesComposite)1 HttpTransactionVariablesComposite (com.twinsoft.convertigo.eclipse.dialogs.HttpTransactionVariablesComposite)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Event (org.eclipse.swt.widgets.Event)1 Label (org.eclipse.swt.widgets.Label)1 Listener (org.eclipse.swt.widgets.Listener)1 Text (org.eclipse.swt.widgets.Text)1 Tree (org.eclipse.swt.widgets.Tree)1 TreeItem (org.eclipse.swt.widgets.TreeItem)1