本文整理汇总了Java中org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings类的典型用法代码示例。如果您正苦于以下问题:Java AutoCompleteSettings类的具体用法?Java AutoCompleteSettings怎么用?Java AutoCompleteSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AutoCompleteSettings类属于org.apache.wicket.extensions.ajax.markup.html.autocomplete包,在下文中一共展示了AutoCompleteSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newAutoCompleteBehavior
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
@Override
protected AutoCompleteBehavior<T> newAutoCompleteBehavior(IAutoCompleteRenderer<T> renderer,
AutoCompleteSettings settings) {
return new AutoCompleteBehavior<T>(renderer, settings) {
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
response.renderJavaScriptReference(AUTOCOMPLETE_JS);
}
@Override
protected Iterator<T> getChoices(String input) {
return ImprovedAutoCompleteTextField.this.getChoices(input);
}
};
}
示例2: initTextField
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
private TextField initTextField() {
// IModel data = new PropertyModel(getModel(), SearchValue.F_VALUE);
if (lookup == null) {
return new TextField(ID_TEXT_INPUT, new PropertyModel(getModel(), SearchValue.F_VALUE));
}
LookupPropertyModel<String> lookupPropertyModel = new LookupPropertyModel<String>(getModel(), SearchValue.F_VALUE, lookup.asObjectable()) {
private static final long serialVersionUID = 1L;
@Override
public boolean isSupportsDisplayName() {
return true;
}
};
AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setShowListOnEmptyInput(true);
return new AutoCompleteTextField<String>(ID_TEXT_INPUT, lookupPropertyModel, settings) {
private static final long serialVersionUID = 1L;
@Override
protected Iterator<String> getChoices(String input) {
return prepareAutoCompleteList(input).iterator();
}
};
}
示例3: createAutoCompleteSettings
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
protected AutoCompleteSettings createAutoCompleteSettings() {
AutoCompleteSettings autoCompleteSettings = new AutoCompleteSettings();
autoCompleteSettings.setShowListOnEmptyInput(true);
autoCompleteSettings.setShowListOnFocusGain(true);
autoCompleteSettings.setMaxHeightInPx(200);
autoCompleteSettings.setShowCompleteListOnFocusGain(true);
return autoCompleteSettings;
}
示例4: AssigneeLabel
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public AssigneeLabel(String id, String docId, Document docData, DocumentTabs tabs) {
super(id, new Model(docData.getWorkflow().getAssignment().getAssignee()));
this.tabs = tabs;
this.docData = docData;
Set<String> permissions = workflowService.getPermissionsFromDoc(docData);
AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setThrottleDelay(400);
autocomplete = new UserAutoCompleteBehavior(settings, permissions, true);
add(new AssigneeValidator(authClient));
}
示例5: ImprovedAutoCompleteTextField
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public ImprovedAutoCompleteTextField(String id, IModel<T> model, Class<T> type, IAutoCompleteRenderer<T> renderer,
AutoCompleteSettings settings) {
super(id, model, type, renderer, settings);
add(new CssClass("text autocomplete"));
add(new AttributeModifier("autocomplete", "off"));
}
示例6: initTextField
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
private TextField initTextField() {
// IModel data = new PropertyModel(getModel(), SearchValue.F_VALUE);
if (lookup == null) {
return new TextField(ID_TEXT_INPUT, new PropertyModel(getModel(), SearchValue.F_VALUE));
}
LookupPropertyModel<String> lookupPropertyModel = new LookupPropertyModel<String>(getModel(), SearchValue.F_VALUE, lookup.asObjectable()) {
private static final long serialVersionUID = 1L;
@Override
public boolean isSupportsDisplayName() {
return true;
}
};
AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setShowListOnEmptyInput(true);
return new AutoCompleteTextField<String>(ID_TEXT_INPUT, lookupPropertyModel, settings) {
private static final long serialVersionUID = 1L;
@Override
protected Iterator<String> getChoices(String input) {
return prepareAutoCompleteList(input).iterator();
}
};
}
示例7: IndicatorAutoCompleteBehavior
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public IndicatorAutoCompleteBehavior(
final IAutoCompleteRenderer<T> renderer,
final AutoCompleteSettings settings,
final String indicator) {
super(renderer, settings);
this.indicator = indicator;
}
示例8: settings
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
private static AutoCompleteSettings settings(){
return new AutoCompleteSettings().setMinInputLength(MINIMUM_INPUT_LENGTH);
}
示例9: AutoCompleteTextField
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public AutoCompleteTextField(String id, AutoCompleteSettings settings) {
super(id, settings);
}
示例10: createPermissionsForm
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
private void createPermissionsForm() {
final Set<String> permissions = workflowService.getPermissionsFromDoc(docData);
userValues = convert.docPermissionsToString(permissions);
final IModel<String> model = new IModel<String>() {
private String value = null;
@Override
public String getObject() {
return value;
}
@Override
public void setObject(String object) {
value = object;
if (object != null) {
if (!permissions.contains(value)) {
userValues.append("\n");
userValues.append(value);
}
}
}
@Override
public void detach() {
}
};
textField = new TextField("users", model);
AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setThrottleDelay(400);
textField.add(new UserAutoCompleteBehavior(settings, permissions, false));
final MultiLineLabel label = new MultiLineLabel("selectedUsers", new PropertyModel<>(this,
"userValues"));
label.setOutputMarkupId(true);
Form<?> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
if (textField.getModelObject() == null)
return;
workflowService.addPermissionsToDoc(docData, textField.getModelObject().toString());
// clear the textfield
textField.setModelObject(null);
}
};
add(form);
form.add(textField);
form.add(label);
}
示例11: UserAutoCompleteBehavior
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public UserAutoCompleteBehavior(AutoCompleteSettings settings) {
super(StringAutoCompleteRenderer.INSTANCE, settings);
filter = Collections.EMPTY_SET;
}
示例12: AssociationFieldAutoCompleteTextField
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public AssociationFieldAutoCompleteTextField(String id, IModel<Topic> model, final RoleFieldModel valueFieldModel) {
super(id);
AutoCompleteSettings opts = new AutoCompleteSettings();
opts.setCssClassName("ontopoly-autocompleter");
opts.setAdjustInputWidth(false);
opts.setPreselect(true);
this.textField = new AutoCompleteTextField<Topic>("autoComplete", model, Topic.class, new AbstractAutoCompleteRenderer<Topic>() {
@Override
protected String getTextValue(Topic o) {
return TOPIC_CONVERTER.convertToString(o);
}
@Override
protected void renderChoice(Topic o, Response response, String criteria) {
response.write(o.getName());
}}, opts) {
@Override
public IConverter getConverter(Class<?> type) {
if (Topic.class.equals(type)) {
return new TopicConverter();
} else {
return super.getConverter(type);
}
}
@Override
protected Iterator<Topic> getChoices(String input) {
List<Topic> result = new ArrayList<Topic>(valueFieldModel.getRoleField().searchAllowedPlayers(input));
filterPlayers(result);
Collections.sort(result, TopicComparator.INSTANCE);
return result.iterator();
}
@Override
protected void onModelChanged() {
super.onModelChanged();
Topic topic = getModelObject();
if (topic != null) {
AssociationFieldAutoCompleteTextField.this.onTopicSelected(topic);
}
}
};
add(textField);
}
示例13: getDefaultAutoCompleteSettings
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public static AutoCompleteSettings getDefaultAutoCompleteSettings() {
return new AutoCompleteSettings()
.setPreselect(true)
.setThrottleDelay(100)
.setShowListOnFocusGain(true);
}
示例14: AjaxTextFieldPanel
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public AjaxTextFieldPanel(
final String id, final String name, final IModel<String> model, final boolean enableOnChange) {
super(id, name, model);
questionMarkJexlHelp = Constants.getJEXLPopover(this, TooltipConfig.Placement.right);
add(questionMarkJexlHelp.setVisible(false));
final AutoCompleteSettings settings = new AutoCompleteSettings();
settings.setShowCompleteListOnFocusGain(true);
settings.setShowListOnEmptyInput(true);
settings.setCssClassName("custom-autocomplete-box");
field = new AutoCompleteTextField<String>("textField", model, settings) {
private static final long serialVersionUID = -6648767303091874219L;
@Override
protected Iterator<String> getChoices(final String input) {
return AjaxTextFieldPanel.this.getChoices(input);
}
@Override
protected AutoCompleteBehavior<String> newAutoCompleteBehavior(
final IAutoCompleteRenderer<String> renderer, final AutoCompleteSettings settings) {
return new IndicatorAutoCompleteBehavior<String>(renderer, settings) {
private static final long serialVersionUID = 1070808433195962931L;
@Override
protected Iterator<String> getChoices(final String input) {
return AjaxTextFieldPanel.this.getChoices(input);
}
};
}
};
add(field.setLabel(new ResourceModel(name, name)).setOutputMarkupId(true));
if (enableOnChange && !isReadOnly()) {
field.add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
private static final long serialVersionUID = -1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
// nothing to do
}
});
}
}
示例15: PartAutoCompleteText
import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteSettings; //导入依赖的package包/类
public PartAutoCompleteText(String id, IModel<CustomerProjectPartDto> model, IModel<List<CustomerProjectPartDto>> allChoices) {
super(id, model, CustomerProjectPartDto.class, new PartAutoCompleteConverter(allChoices), new AutoCompleteSettings());
this.allChoices = allChoices;
}