Search in sources :

Example 1 with CouchVariablesComposite

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

the class ComponentInfoWizardPage 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);
        GridData couchVarData = new GridData(GridData.FILL_BOTH);
        couchVarData.horizontalSpan = 2;
        couchVariablesComposite.setLayoutData(couchVarData);
    } else {
        tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
        tree.setHeaderVisible(false);
        GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
        gridData.verticalSpan = 20;
        gridData.horizontalSpan = 2;
        tree.setLayoutData(gridData);
        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) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) CouchVariablesComposite(com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesComposite) Composite(org.eclipse.swt.widgets.Composite) 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) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent)

Example 2 with CouchVariablesComposite

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

the class ComponentInfoWizardPage 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);
        GridData couchVarData = new GridData(GridData.FILL_BOTH);
        couchVarData.horizontalSpan = 2;
        couchVariablesComposite.setLayoutData(couchVarData);
    } else {
        tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
        tree.setHeaderVisible(false);
        GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
        gridData.verticalSpan = 20;
        gridData.horizontalSpan = 2;
        tree.setLayoutData(gridData);
        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) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) CouchVariablesComposite(com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesComposite) Composite(org.eclipse.swt.widgets.Composite) 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) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent)

Example 3 with CouchVariablesComposite

use of com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesComposite 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);
        GridData couchVarData = new GridData(GridData.FILL_BOTH);
        couchVarData.horizontalSpan = 2;
        couchVariablesComposite.setLayoutData(couchVarData);
    } else {
        tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
        tree.setHeaderVisible(false);
        GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
        gridData.verticalSpan = 20;
        gridData.horizontalSpan = 2;
        tree.setLayoutData(gridData);
        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) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) CouchVariablesComposite(com.twinsoft.convertigo.eclipse.dialogs.CouchVariablesComposite) Composite(org.eclipse.swt.widgets.Composite) 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) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) Event(org.eclipse.swt.widgets.Event) ModifyEvent(org.eclipse.swt.events.ModifyEvent)

Aggregations

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