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;
}
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;
}
Aggregations