Search in sources :

Example 1 with ConceptComposite

use of com.amalto.workbench.widgets.ConceptComposite 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 ConceptComposite

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

the class ComplexTypeInputDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    // Should not really be here but well,....
    final Composite composite = (Composite) super.createDialogArea(parent);
    createTopPart(composite);
    // encapsulate all widgets into the ConceptComposite which can be applied to several cases
    parent.getShell().setText(title);
    if (caller instanceof XSDNewComplexTypeDefinition) {
        conceptPanel = new ConceptComposite(composite, false, types, true);
    } else {
        conceptPanel = new ConceptComposite(composite, false, types, false);
        conceptPanel.setText(typeName);
        if (// $NON-NLS-1$
        superTypeName != null && !"anyType".equalsIgnoreCase(superTypeName))
            conceptPanel.setSuperName(superTypeName);
        if (typeComposite != null) {
            if (typeComposite.equals(XSDCompositor.ALL_LITERAL))
                conceptPanel.setAll();
            else if (typeComposite.equals(XSDCompositor.CHOICE_LITERAL))
                conceptPanel.setChoice();
            if (typeComposite.equals(XSDCompositor.SEQUENCE_LITERAL))
                conceptPanel.setSequence();
        }
        conceptPanel.setAbstract(isAbstract);
    }
    conceptPanel.getTypeCombo().addModifyListener(this);
    return composite;
}
Also used : ConceptComposite(com.amalto.workbench.widgets.ConceptComposite) Composite(org.eclipse.swt.widgets.Composite) XSDNewComplexTypeDefinition(com.amalto.workbench.actions.XSDNewComplexTypeDefinition) ConceptComposite(com.amalto.workbench.widgets.ConceptComposite)

Aggregations

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