本文整理匯總了Java中org.apache.wicket.markup.html.form.TextField.setRequired方法的典型用法代碼示例。如果您正苦於以下問題:Java TextField.setRequired方法的具體用法?Java TextField.setRequired怎麽用?Java TextField.setRequired使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.form.TextField
的用法示例。
在下文中一共展示了TextField.setRequired方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addGarbageCollectorMaintenance
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void addGarbageCollectorMaintenance(Form form) {
final Border gcBorder = new TitledBorder("gcBorder", new CompoundPropertyModel(gcConfigDescriptor));
form.add(gcBorder);
TextField<String> cronExpTextField = new TextField<>("cronExp");
cronExpTextField.setRequired(true);
cronExpTextField.add(CronExpValidator.getInstance());
gcBorder.add(cronExpTextField);
gcBorder.add(new SchemaHelpBubble("cronExp.help"));
gcBorder.add(new CronNextDatePanel("cronNextDatePanel", cronExpTextField));
TitledAjaxLink collectLink = new TitledAjaxLink("collect", "Run Now") {
@Override
public void onClick(AjaxRequestTarget target) {
BasicStatusHolder statusHolder = new BasicStatusHolder();
storageService.callManualGarbageCollect(statusHolder);
if (statusHolder.isError()) {
error("Could not run the garbage collector: " + statusHolder.getLastError().getMessage() + ".");
} else {
info("Garbage collector was successfully scheduled to run in the background.");
}
}
};
gcBorder.add(collectLink);
HelpBubble gcHelpBubble = new HelpBubble("gcHelp", new ResourceModel("garbageHelp"));
gcBorder.add(gcHelpBubble);
}
示例2: addGroupDetailFields
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void addGroupDetailFields()
{
add( new Label( "groupAssignmentsLabel", "Group Detail" ) );
TextField name = new TextField( "name" );
add( name );
name.setRequired( false );
TextField protocol = new TextField( "protocol" );
add( protocol );
TextField description = new TextField( "description" );
description.setRequired( false );
add( description );
protocol.setRequired( true );
memberPropsCB = new ComboBox<>( "memberProps", new PropertyModel<String>( this,
"memberPropsSelection" ), new ArrayList<String>() );
memberPropsCB.setOutputMarkupId( true );
add( memberPropsCB );
memberAssignTF = new TextField( "memberAssign", new PropertyModel( this, "memberAssign" ) );
memberAssignTF.setOutputMarkupId( true );
add( memberAssignTF );
addUserSearchModal();
createDataTable( null );
}
示例3: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<T> value, final List<PrismReferenceValue> values,
final boolean required, Collection<Class<? extends O>> types) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupId(true);
TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(value));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(values, target);
}
};
textWrapper.add(edit);
add(textWrapper);
initButtons();
}
示例4: createText
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
protected TextField createText(IModel<String> model, IModel<String> label, boolean required) {
TextField text = new TextField(ID_TEXT, model);
text.setRequired(required);
text.add(AttributeAppender.replace("placeholder", label));
return text;
}
示例5: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public void initLayout() {
// final Label question = new Label (F_QUESTION, mod.getPwdQuestion());
final Label question = new Label(F_QUESTION, new PropertyModel<PasswordQuestionsDto>(mod,
PasswordQuestionsDto.F_MY_QUESTIONS__QUESTIONITSELF));
question.setOutputMarkupId(true);
add(question);
final TextField<String> answer = new TextField<String>(F_ANSWER, new PropertyModel(mod,
SecurityQuestionAnswerDTO.F_PASSWORD_QUESTION_ANSWER));
answer.setRequired(true);
answer.setOutputMarkupId(true);
add(answer);
}
示例6: addArtifactsCleanupMaintenance
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void addArtifactsCleanupMaintenance(Form form) {
final Border cleanupBorder = new TitledBorder("cleanupBorder",
new CompoundPropertyModel(cleanupConfigDescriptor));
form.add(cleanupBorder);
TextField<String> cronExpTextField = new TextField<>("cronExp");
cronExpTextField.setRequired(true);
cronExpTextField.add(CronExpValidator.getInstance());
cleanupBorder.add(cronExpTextField);
cleanupBorder.add(new SchemaHelpBubble("cronExp.help"));
cleanupBorder.add(new CronNextDatePanel("cronNextDatePanel", cronExpTextField));
TitledAjaxLink collectLink = new TitledAjaxLink("cleanup", "Run Unused Cached Artifacts Cleanup") {
@Override
public void onClick(AjaxRequestTarget target) {
BasicStatusHolder statusHolder = new BasicStatusHolder();
artifactCleanupService.callManualArtifactCleanup(statusHolder);
if (statusHolder.isError()) {
error("Could not run the artifact cleanup: " + statusHolder.getLastError().getMessage() + ".");
} else {
info("Artifact cleanup was successfully scheduled to run in the background.");
}
}
};
cleanupBorder.add(collectLink);
HelpBubble cleanupHelpBubble = new HelpBubble("cleanupHelp", new ResourceModel("cleanupHelp"));
cleanupBorder.add(cleanupHelpBubble);
}
示例7: addVirtualCleanupMaintenance
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void addVirtualCleanupMaintenance(Form form) {
final Border virtualCleanupBorder = new TitledBorder("virtualCleanupBorder",
new CompoundPropertyModel(virtualCacheCleanupConfigDescriptor));
form.add(virtualCleanupBorder);
TextField<String> virtualCronExpTextField = new TextField<>("cronExp");
virtualCronExpTextField.setRequired(true);
virtualCronExpTextField.add(CronExpValidator.getInstance());
virtualCleanupBorder.add(virtualCronExpTextField);
virtualCleanupBorder.add(new SchemaHelpBubble("virtualCronExp.help", "cronExp"));
virtualCleanupBorder.add(new CronNextDatePanel("virtualCronNextDatePanel", virtualCronExpTextField));
TitledAjaxLink collectLink = new TitledAjaxLink("virtualCleanup", "Clean Virtual Repositories Now") {
@Override
public void onClick(AjaxRequestTarget target) {
BasicStatusHolder statusHolder = new BasicStatusHolder();
virtualCacheCleanupService.callVirtualCacheCleanup(statusHolder);
if (statusHolder.isError()) {
error("Could not run the virtual cache cleanup: " + statusHolder.getLastError().getMessage() + ".");
} else {
info("Virtual cache cleanup was successfully scheduled to run in the background.");
}
}
};
virtualCleanupBorder.add(collectLink);
HelpBubble virtualCleanupHelpBubble = new HelpBubble("virtualCleanupHelp", new ResourceModel("virtualCleanupHelp"));
virtualCleanupBorder.add(virtualCleanupHelpBubble);
}
示例8: RoleAdminDetailPanel
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public RoleAdminDetailPanel( String id, final IModel roleModel )
{
super( id, roleModel );
permouCB = new ComboBox<>( GlobalIds.OS_P, new PropertyModel<String>( this, PERMOU_SELECTION ), permous );
permouCB.setOutputMarkupId( true );
add( permouCB );
addPermOUSearchModal();
userouCB = new ComboBox<>( GlobalIds.OS_U, new PropertyModel<String>( this, USEROU_SELECTION ), userous );
userouCB.setOutputMarkupId( true );
add( userouCB );
addUserOUSearchModal();
beginRangeTF = new TextField( GlobalIds.BEGIN_RANGE );
beginRangeTF.setRequired( false );
beginRangeTF.setOutputMarkupId( true );
add( beginRangeTF );
addBeginRoleSearchModal();
CheckBox beginInclusiveCB = new CheckBox( GlobalIds.BEGIN_INCLUSIVE );
beginInclusiveCB.setRequired( false );
add( beginInclusiveCB );
endRangeTF = new TextField( GlobalIds.END_RANGE );
endRangeTF.setRequired( false );
endRangeTF.setOutputMarkupId( true );
add( endRangeTF );
addEndRoleSearchModal();
CheckBox endInclusiveCB = new CheckBox( GlobalIds.END_INCLUSIVE );
endInclusiveCB.setRequired( false );
add( endInclusiveCB );
setOutputMarkupId( true );
}
示例9: newUsernameTextField
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
/**
*
* @return
*/
private TextField<String> newUsernameTextField() {
TextField<String> usernameField = new TextField<>("adapterUsername", new PropertyModel<String>(adapterSettings, "adapterUsername"));
usernameField.add(new PopoverBehavior(Model.of(""), new StringResourceModel("step7.username.popover.text", this, null), getPopoverConfig(false)));
usernameField.setRequired(false);
return usernameField;
}
示例10: VlanIdPoolEditPage
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public VlanIdPoolEditPage(WebPage backPage, VlanIdPoolDto pool) {
try {
this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
this.pool = pool;
this.backPage = backPage;
if (pool != null) {
range = pool.getConcatenatedIdRangesStr();
name = pool.getName();
this.purpose = DtoUtil.getString(pool,ATTR.PURPOSE);
this.note = DtoUtil.getString(pool,ATTR.NOTE);
}
add(new FeedbackPanel("feedback"));
Form<Void> backForm = new Form<Void>("backForm");
add(backForm);
Button backButton = new Button("back") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
setResponsePage(getBackPage());
}
};
backForm.add(backButton);
Form<Void> form = new Form<Void>("poolEditForm");
add(form);
Button processButton = new Button("process") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
processUpdate();
PageUtil.setModelChanged(getBackPage());
setResponsePage(getBackPage());
}
};
form.add(processButton);
Button deleteButton = new Button("delete") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
delete();
PageUtil.setModelChanged(getBackPage());
setResponsePage(getBackPage());
}
};
form.add(deleteButton);
TextField<String> rangeField = new TextField<String>("range", new PropertyModel<String>(this, "range"));
rangeField.setRequired(true);
rangeField.add(new IdRangeValidator());
rangeField.setEnabled(pool == null);
form.add(rangeField);
TextField<String> nameField = new TextField<String>("name", new PropertyModel<String>(this, MPLSNMS_ATTR.NAME));
nameField.setRequired(true);
form.add(nameField);
TextField<String> purposeField = new TextField<String>("purpose", new PropertyModel<String>(this, "purpose"));
form.add(purposeField);
TextArea<String> noteArea = new TextArea<String>("note", new PropertyModel<String>(this, "note"));
form.add(noteArea);
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例11: PseudoWirePoolEditPage
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
public PseudoWirePoolEditPage(WebPage backPage, PseudowireStringIdPoolDto pool) {
try {
this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
this.pool = pool;
this.backPage = backPage;
if (pool != null) {
range = pool.getConcatenatedIdRangesStr();
name = pool.getName();
DtoUtil.putValues(attributes, MPLSNMS_ATTR.PURPOSE, pool);
DtoUtil.putValues(attributes, MPLSNMS_ATTR.NOTE, pool);
DtoUtil.putValuesWithDefault(attributes, MPLSNMS_ATTR.OPER_STATUS, pool, "In Use");
}
add(new FeedbackPanel("feedback"));
Form<Void> backForm = new Form<Void>("backForm");
add(backForm);
Button backButton = new Button("back") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
setResponsePage(getBackPage());
}
};
backForm.add(backButton);
Form<Void> form = new Form<Void>("poolEditForm");
add(form);
Button processButton = new Button("process") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
processUpdate();
PageUtil.setModelChanged(getBackPage());
setResponsePage(getBackPage());
}
};
form.add(processButton);
TextField<String> rangeField = new TextField<String>("range", new PropertyModel<String>(this, "range"));
rangeField.setRequired(true);
rangeField.add(new IdRangeValidator());
form.add(rangeField);
TextField<String> nameField = new TextField<String>("name", new PropertyModel<String>(this, "name"));
nameField.setRequired(true);
form.add(nameField);
TextField<String> purposeField = new TextField<String>("purpose", new PropertyModel<String>(attributes, MPLSNMS_ATTR.PURPOSE));
form.add(purposeField);
TextArea<String> noteArea = new TextArea<String>("noteArea", new PropertyModel<String>(attributes, MPLSNMS_ATTR.NOTE));
form.add(noteArea);
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例12: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<List<T>> chosenValues, final List<PrismReferenceValue> filterValues,
final boolean required, final boolean multiselect) {
AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(chosenValues.getObject(), filterValues, target, multiselect);
}
};
edit.setOutputMarkupPlaceholderTag(true);
add(edit);
ListView<T> selectedRowsList = new ListView<T>(ID_SELECTED_ROWS, chosenValues) {
@Override
protected void populateItem(ListItem<T> item) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupPlaceholderTag(true);
TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(item.getModel())); //was value
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
text.setOutputMarkupPlaceholderTag(true);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
feedback.setOutputMarkupPlaceholderTag(true);
textWrapper.add(feedback);
initButtons(item, item);
item.add(textWrapper);
}
};
selectedRowsList.setReuseItems(true);
add(selectedRowsList);
}
示例13: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<String> label, final String labelSize, final String textSize,
final boolean required) {
Label l = new Label(ID_LABEL, label);
if (StringUtils.isNotEmpty(labelSize)) {
l.add(AttributeAppender.prepend("class", labelSize));
}
add(l);
ListView repeater = new ListView<T>(ID_REPEATER, getModel()) {
@Override
protected void populateItem(final ListItem<T> item) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.add(AttributeAppender.prepend("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
StringBuilder sb = new StringBuilder();
if (StringUtils.isNotEmpty(textSize)) {
sb.append(textSize).append(' ');
}
if (item.getIndex() > 0 && StringUtils.isNotEmpty(getOffsetClass())) {
sb.append(getOffsetClass()).append(' ');
sb.append(CLASS_MULTI_VALUE);
}
return sb.toString();
}
}));
item.add(textWrapper);
TextField text = new TextField(ID_TEXT, createTextModel(item.getModel()));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
}
});
text.setRequired(required);
text.add(AttributeAppender.replace("placeholder", label));
text.setLabel(label);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
buttonGroup.add(AttributeAppender.append("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (item.getIndex() > 0 && StringUtils.isNotEmpty(labelSize)) {
return CLASS_MULTI_VALUE;
}
return null;
}
}));
item.add(buttonGroup);
initButtons(buttonGroup, item);
}
};
add(repeater);
}
示例14: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(String localPartLabelKey, String localPartTooltipKey,
String namespaceLabelKey, String namespaceTooltipKey, boolean markLocalPartAsRequired, boolean markNamespaceAsRequired){
Label localPartLabel = new Label(ID_LOCAL_PART_LABEL, getString(localPartLabelKey));
localPartLabel.setOutputMarkupId(true);
localPartLabel.setOutputMarkupPlaceholderTag(true);
add(localPartLabel);
WebMarkupContainer localPartRequired = new WebMarkupContainer(ID_LOCAL_PART_REQUIRED);
localPartRequired.setVisible(markLocalPartAsRequired);
add(localPartRequired);
Label namespaceLabel = new Label(ID_NAMESPACE_LABEL, getString(namespaceLabelKey));
namespaceLabel.setOutputMarkupId(true);
namespaceLabel.setOutputMarkupPlaceholderTag(true);
add(namespaceLabel);
WebMarkupContainer namespaceRequired = new WebMarkupContainer(ID_NAMESPACE_REQUIRED);
namespaceRequired.setVisible(markNamespaceAsRequired);
add(namespaceRequired);
TextField localPart = new TextField<>(ID_LOCAL_PART, localpartModel);
localPart.setOutputMarkupId(true);
localPart.setOutputMarkupPlaceholderTag(true);
localPart.setRequired(isLocalPartRequired());
localPart.add(new UpdateBehavior());
add(localPart);
DropDownChoice namespace = new DropDownChoice<>(ID_NAMESPACE, namespaceModel, prepareNamespaceList());
namespace.setOutputMarkupId(true);
namespace.setOutputMarkupPlaceholderTag(true);
namespace.setNullValid(false);
namespace.setRequired(isNamespaceRequired());
namespace.add(new UpdateBehavior());
add(namespace);
Label localPartTooltip = new Label(ID_T_LOCAL_PART);
localPartTooltip.add(new AttributeAppender("data-original-title", getString(localPartTooltipKey)));
localPartTooltip.add(new InfoTooltipBehavior());
localPartTooltip.setOutputMarkupPlaceholderTag(true);
add(localPartTooltip);
Label namespaceTooltip = new Label(ID_T_NAMESPACE);
namespaceTooltip.add(new AttributeAppender("data-original-title", getString(namespaceTooltipKey)));
namespaceTooltip.add(new InfoTooltipBehavior());
namespaceTooltip.setOutputMarkupPlaceholderTag(true);
add(namespaceTooltip);
}
示例15: initLayout
import org.apache.wicket.markup.html.form.TextField; //導入方法依賴的package包/類
private void initLayout(final IModel<PrismContainerValue<ShadowAssociationType>> value,
final List<PrismPropertyValue> values, final boolean required, Class<C> type) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupId(true);
TextField<String> text = new TextField<>(ID_TEXT, createTextModel(value));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
feedback.setFilter(new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
AjaxLink edit = new AjaxLink(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(target);
}
};
edit.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return model.getObject().isEmpty();
}
});
textWrapper.add(edit);
add(textWrapper);
initDialog(type, values);
}