本文整理匯總了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);
}