Search in sources :

Example 1 with NewTypeDialog

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;
}
Also used : NewTypeDialog(org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog) IField(org.eclipse.wst.xsd.ui.internal.adt.facade.IField)

Aggregations

IField (org.eclipse.wst.xsd.ui.internal.adt.facade.IField)1 NewTypeDialog (org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog)1