本文整理汇总了Java中org.apache.wicket.markup.html.form.DropDownChoice.setModel方法的典型用法代码示例。如果您正苦于以下问题:Java DropDownChoice.setModel方法的具体用法?Java DropDownChoice.setModel怎么用?Java DropDownChoice.setModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.form.DropDownChoice
的用法示例。
在下文中一共展示了DropDownChoice.setModel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ImportDocumentsPanel
import org.apache.wicket.markup.html.form.DropDownChoice; //导入方法依赖的package包/类
public ImportDocumentsPanel(String aId, IModel<Project> aProject)
{
super(aId);
projectModel = aProject;
Form<Void> form = new Form<>("form");
add(form);
format = Model.of();
List<String> readableFormats = listReadableFormats();
if (!readableFormats.isEmpty()) {
format.setObject(readableFormats.get(0));
}
form.add(fileUpload = new FileUploadField("documents"));
DropDownChoice<String> formats = new DropDownChoice<String>("format");
formats.setModel(format);
formats.setChoices(LambdaModel.of(this::listReadableFormats));
form.add(formats);
form.add(new LambdaAjaxButton<>("import", this::actionImport));
}
示例2: SearchForm
import org.apache.wicket.markup.html.form.DropDownChoice; //导入方法依赖的package包/类
public SearchForm(String id, String repositoryName) {
super(id, RepositoryPage.this.getClass(), RepositoryPage.this.getPageParameters());
this.repositoryName = repositoryName;
DropDownChoice<Constants.SearchType> searchType = new DropDownChoice<Constants.SearchType>(
"searchType", Arrays.asList(Constants.SearchType.values()));
searchType.setModel(searchTypeModel);
add(searchType.setVisible(app().settings().getBoolean(Keys.web.showSearchTypeSelection, false)));
TextField<String> searchBox = new TextField<String>("searchBox", searchBoxModel);
add(searchBox);
}
示例3: DropDownInput
import org.apache.wicket.markup.html.form.DropDownChoice; //导入方法依赖的package包/类
public DropDownInput(String id, IModel<T> model) {
super(id, model);
DropDownChoice input = new DropDownChoice(ID_INPUT, new Model<>(new ArrayList<T>())) {
@Override
protected CharSequence getDefaultChoice(String selectedValue) {
return getString(defaultChoice);
}
};
input.setModel(model);
add(input);
}
示例4: SearchForm
import org.apache.wicket.markup.html.form.DropDownChoice; //导入方法依赖的package包/类
public SearchForm(String id, String repositoryName) {
super(id, RepositoryPage.this.getClass(), RepositoryPage.this.getPageParameters());
this.repositoryName = repositoryName;
DropDownChoice<Constants.SearchType> searchType = new DropDownChoice<Constants.SearchType>(
"searchType", Arrays.asList(Constants.SearchType.values()));
searchType.setModel(searchTypeModel);
add(searchType.setVisible(GitBlit.getBoolean(Keys.web.showSearchTypeSelection, false)));
TextField<String> searchBox = new TextField<String>("searchBox", searchBoxModel);
add(searchBox);
}
示例5: populateItem
import org.apache.wicket.markup.html.form.DropDownChoice; //导入方法依赖的package包/类
@Override
protected void populateItem(final ListItem<LoggerTO> item) {
item.add(new Label("name"));
DropDownChoice<LoggerLevel> level =
new DropDownChoice<LoggerLevel>("level");
level.setModel(new IModel<LoggerLevel>() {
private static final long serialVersionUID =
-2350428186089596562L;
@Override
public LoggerLevel getObject() {
return item.getModelObject().getLevel();
}
@Override
public void setObject(final LoggerLevel object) {
item.getModelObject().setLevel(object);
}
@Override
public void detach() {
}
});
level.setChoices(Arrays.asList(LoggerLevel.values()));
level.setOutputMarkupId(true);
level.add(new AjaxFormComponentUpdatingBehavior(
"onchange") {
private static final long serialVersionUID =
-1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
boolean result = getId().equals("corelogger")
? confRestClient.setLoggerLevel(
item.getModelObject().getName(),
item.getModelObject().getLevel())
: consoleLoggerController.setLoggerLevel(
item.getModelObject().getName(),
item.getModelObject().getLevel());
if (result) {
info(getString("operation_succeded"));
} else {
info(getString("operation_error"));
}
target.add(feedbackPanel);
}
});
MetaDataRoleAuthorizationStrategy.authorize(level, ENABLE,
xmlRolesReader.getAllAllowedRoles(
"Configuration", "loggerSetLevel"));
item.add(level);
}