public NamespaceDialog() { add(setFocus(new RequiredTextFieldWidget("prefix", new PropertyModel<String>(this, "prefix"), new Model<String>("namespace prefix")))); add(new RequiredTextFieldWidget("uri", new PropertyModel<String>(this, "uri"), new Model<String>("namespace uri"))); }
public RequiredTextFieldWidget(String id, IModel<String> model, IModel<String> labelModel) { super(id, model, labelModel); getFormComponent().setRequired(true); } }
public NamespaceDialog(NamespacePlugin plugin) { add(setFocus(new RequiredTextFieldWidget("name", new PropertyModel(this, "namespaceName"), new Model("namespace name")))); add(new RequiredTextFieldWidget("uri", new PropertyModel(this, "namespaceUri"), new Model("namespace url"))); }
public NamespaceDialog(final IWorkflowInvoker invoker, final IModel<Namespace> namespaceModel, final IModel<String> titleModel) { super(invoker, namespaceModel, titleModel); final PropertyModel<String> prefixModel = PropertyModel.of(namespaceModel, "prefix"); final Model<String> prefixLabel = Model.of(getString("prefix")); final TextFieldWidget prefixField = new RequiredTextFieldWidget("prefix", prefixModel, prefixLabel); prefixField.getFormComponent().add(NamespaceValidator.createNameValidator()); add(prefixField); final PropertyModel<String> urlModel = PropertyModel.of(namespaceModel, "url"); final Model<String> urlLabel = Model.of(getString("url")); final TextFieldWidget urlField = new RequiredTextFieldWidget("url", urlModel, urlLabel); urlField.getFormComponent().add(NamespaceValidator.createUrlValidator()); add(urlField); setFocus(prefixField); setSize(DialogConstants.SMALL_AUTO); } }
TypeDetailStep(NewCompoundTypeAction action) { super(new ResourceModel("type-detail-title"), new ResourceModel("compound-type-detail-summary")); final IModel<String> nameLabel = new ResourceModel("name-caption"); nameComponent = new RequiredTextFieldWidget("name", PropertyModel.of(action, "name"), nameLabel); nameComponent.getFormComponent().add(NamespaceValidator.createNameValidator()); add(nameComponent); setFocus(nameComponent.getFormComponent()); }
TypeDetailStep(NewDocumentTypeAction action, final List<String> candidatesSuperTypes) { super(new ResourceModel("type-detail-title"), new ResourceModel("type-detail-summary")); final DropDownChoice<String> superTypeChoice = new DropDownChoice<>("super-type-list", new PropertyModel<>(action, "superType"), candidatesSuperTypes); add(superTypeChoice); IModel<String> nameLabel = new ResourceModel("name-caption"); nameComponent = new RequiredTextFieldWidget("name", PropertyModel.of(action, "name"), nameLabel); nameComponent.getFormComponent().add(NamespaceValidator.createNameValidator()); add(nameComponent); setFocus(nameComponent.getFormComponent()); }