use of org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog in project webtools.sourceediting by eclipse.
the class XSDTypeReferenceEditManager method getNewDialog.
public IComponentDialog getNewDialog() {
NewTypeDialog result = null;
if (schemas.length > 0) {
result = new NewTypeDialog(schemas[0]);
} else {
result = new NewTypeDialog();
}
if (referencer instanceof IField) {
IField field = (IField) referencer;
if (XSDConstants.ATTRIBUTE_ELEMENT_TAG.equals(field.getKind())) {
result.allowComplexType(false);
}
String fieldName = field.getName();
if (fieldName != null) {
fieldName = fieldName.trim();
if (fieldName.length() > 0) {
result.setDefaultName(NLS.bind(Messages._UI_VALUE_NEW_TYPE, fieldName));
}
}
}
return result;
}
Aggregations