Search in sources :

Example 1 with ElementComposite

use of com.amalto.workbench.widgets.ElementComposite in project tmdm-studio-se by Talend.

the class NewConceptOrElementDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    parent.getShell().setText(title);
    Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout layout = (GridLayout) composite.getLayout();
    layout.numColumns = 2;
    Label typeNameLabel = new Label(composite, SWT.NONE);
    typeNameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 1));
    typeNameLabel.setText(Messages.NewConceptOrElementDialog_Name);
    typeNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    typeNameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
    typeNameText.addModifyListener(this);
    typeNameText.setFocus();
    complexTypeBtn = new Button(composite, SWT.RADIO);
    complexTypeBtn.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true, 2, 1));
    complexTypeBtn.setText(Messages.NewConceptOrElementDialog_ComplexType);
    complexTypeBtn.setSelection(true);
    complexTypeBtn.addSelectionListener(this);
    conceptPanel = new ConceptComposite(composite, true, Util.getComplexTypes(schema), false);
    simpleTypeBtn = new Button(composite, SWT.RADIO);
    simpleTypeBtn.setText(Messages.NewConceptOrElementDialog_SimpleType);
    simpleTypeBtn.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true, 2, 1));
    simpleTypeBtn.addSelectionListener(this);
    elemPanel = new ElementComposite(conceptPanel.getComposite(), customTypes, builtInTypes, null, true);
    composite = elemPanel.getComposite();
    elemPanel.addModifyListener(this);
    infoLabel = new Label(composite, SWT.NONE);
    infoLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    conceptPanel.getTypeCombo().addModifyListener(this);
    elemPanel.getTypeCombo().addModifyListener(this);
    maskTypeWidgets();
    return composite;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ElementComposite(com.amalto.workbench.widgets.ElementComposite) Composite(org.eclipse.swt.widgets.Composite) ConceptComposite(com.amalto.workbench.widgets.ConceptComposite) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) ConceptComposite(com.amalto.workbench.widgets.ConceptComposite) Text(org.eclipse.swt.widgets.Text) ElementComposite(com.amalto.workbench.widgets.ElementComposite)

Example 2 with ElementComposite

use of com.amalto.workbench.widgets.ElementComposite in project tmdm-studio-se by Talend.

the class SimpleTypeInputDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    // Should not really be here but well,....
    parent.getShell().setText(this.title);
    final Composite composite = (Composite) super.createDialogArea(parent);
    // encapsulate all widgets into the ElementComposite which can be applied to several cases
    elemPanel = new ElementComposite(composite, customTypes, builtInTypes, defaultTypeName, false);
    elemPanel.getTypeCombo().addModifyListener(this);
    infoLabel = new Label(composite, SWT.NONE);
    infoLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    infoLabel.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
    return elemPanel.getComposite();
}
Also used : ElementComposite(com.amalto.workbench.widgets.ElementComposite) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) ElementComposite(com.amalto.workbench.widgets.ElementComposite)

Aggregations

ElementComposite (com.amalto.workbench.widgets.ElementComposite)2 GridData (org.eclipse.swt.layout.GridData)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 ConceptComposite (com.amalto.workbench.widgets.ConceptComposite)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Text (org.eclipse.swt.widgets.Text)1