本文整理匯總了Java中org.apache.wicket.model.LoadableDetachableModel類的典型用法代碼示例。如果您正苦於以下問題:Java LoadableDetachableModel類的具體用法?Java LoadableDetachableModel怎麽用?Java LoadableDetachableModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LoadableDetachableModel類屬於org.apache.wicket.model包,在下文中一共展示了LoadableDetachableModel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInitialize
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
input = new TextField<Number>("input", Model.of(getModelObject()));
input.setType(getPropertyDescriptor().getPropertyClass());
add(input);
add(new AttributeAppender("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
if (hasErrors(true))
return " has-error";
else
return "";
}
}));
}
示例2: onInitialize
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
add(AttributeAppender.append("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
BlobIdent blobIdent = (BlobIdent) getDefaultModelObject();
if (blobIdent.isTree())
return " fa fa-folder-o";
else if (blobIdent.isGitLink())
return " fa fa-ext fa-folder-submodule-o";
else if (blobIdent.isSymbolLink())
return " fa fa-ext fa-folder-symbol-link-o";
else
return " fa fa-file-text-o";
}
}));
}
示例3: onInitialize
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
add(input = new CheckBox("input", Model.of(getModelObject())));
add(new AttributeAppender("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
if (hasErrors(true))
return " has-error";
else
return "";
}
}));
}
示例4: onInitialize
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
input = new PasswordTextField("input", Model.of(getModelObject()));
input.setRequired(false);
input.setResetPassword(false);
add(input);
String autocomplete = EditableUtils.getAutocomplete(getPropertyDescriptor().getPropertyGetter());
if (autocomplete != null)
input.add(AttributeAppender.append("autocomplete", autocomplete));
add(new AttributeAppender("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
if (hasErrors(true))
return " has-error";
else
return "";
}
}));
}
示例5: onInitialize
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
BranchChoiceProvider branchProvider = new BranchChoiceProvider(new LoadableDetachableModel<Project>() {
@Override
protected Project load() {
ProjectPage page = (ProjectPage) getPage();
return page.getProject();
}
});
input = new BranchSingleChoice("input", getModel(), branchProvider);
input.setConvertEmptyInputStringToNull(true);
// add this to control allowClear flag of select2
input.setRequired(propertyDescriptor.isPropertyRequired());
add(input);
}
示例6: onInitialize
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected void onInitialize() {
super.onInitialize();
BranchChoiceProvider branchProvider = new BranchChoiceProvider(new LoadableDetachableModel<Project>() {
@Override
protected Project load() {
ProjectPage page = (ProjectPage) getPage();
return page.getProject();
}
});
ArrayList<String> projectAndBranches = new ArrayList<>();
if (getModelObject() != null)
projectAndBranches.addAll(getModelObject());
input = new BranchMultiChoice("input", new Model(projectAndBranches), branchProvider);
add(input);
}
示例7: CommitListPanel
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public CommitListPanel(String id, IModel<Project> projectModel, IModel<List<RevCommit>> commitsModel) {
super(id);
this.projectModel = projectModel;
this.commitsModel = new LoadableDetachableModel<List<RevCommit>>() {
@Override
protected List<RevCommit> load() {
List<RevCommit> commits = commitsModel.getObject();
if (commits.size() > WebConstants.MAX_DISPLAY_COMMITS)
commits = commits.subList(commits.size()-WebConstants.MAX_DISPLAY_COMMITS, commits.size());
CommitGraphUtils.sort(commits, 0);
return separateByDate(commits);
}
@Override
protected void onDetach() {
commitsModel.detach();
super.onDetach();
}
};
}
示例8: CommitMessageLabel
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public CommitMessageLabel(String id, IModel<Project> projectModel, IModel<String> messageModel) {
super(id, new LoadableDetachableModel<String>() {
@Override
protected String load() {
String message = HtmlEscape.escapeHtml5(messageModel.getObject());
for (CommitMessageTransformer transformer: GitPlex.getExtensions(CommitMessageTransformer.class)) {
message = transformer.transform(projectModel.getObject(), message);
}
return message;
}
@Override
protected void onDetach() {
projectModel.detach();
messageModel.detach();
super.onDetach();
}
});
}
示例9: PrivilegeSourcePanel
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public PrivilegeSourcePanel(String id, User user, Project project, ProjectPrivilege privilege) {
super(id);
Long userId = user.getId();
userModel = new LoadableDetachableModel<User>() {
@Override
protected User load() {
return GitPlex.getInstance(UserManager.class).load(userId);
}
};
Long projectId = project.getId();
projectModel = new LoadableDetachableModel<Project>() {
@Override
protected Project load() {
return GitPlex.getInstance(ProjectManager.class).load(projectId);
}
};
this.privilege = privilege;
}
示例10: RequestDetailPage
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public RequestDetailPage(PageParameters params) {
super(params);
if (getProject().getDefaultBranch() == null)
throw new RestartResponseException(NoBranchesPage.class, paramsOf(getProject()));
requestModel = new LoadableDetachableModel<PullRequest>() {
@Override
protected PullRequest load() {
Long requestNumber = params.get(PARAM_REQUEST).toLong();
PullRequest request = GitPlex.getInstance(PullRequestManager.class).find(getProject(), requestNumber);
if (request == null)
throw new EntityNotFoundException("Unable to find request #" + requestNumber + " in project " + getProject());
return request;
}
};
reviewUpdateId = requestModel.getObject().getLatestUpdate().getId();
}
示例11: onInitialize
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
add(AttributeAppender.append("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
if (anyMessage(FeedbackMessage.ERROR) || anyMessage(FeedbackMessage.FATAL))
return " error";
else if (anyMessage(FeedbackMessage.WARNING))
return " warning";
else if (anyMessage(FeedbackMessage.SUCCESS))
return " success";
else
return " info";
}
}));
}
示例12: ErrorPage
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public ErrorPage(PageParameters parameters) {
super(parameters);
this.errorType = getErrorType(parameters.get(PAGE_PARAMETER_RESPONSE_CODE).toString());
final PageParameters queryParams = new PageParameters(parameters).remove(PAGE_PARAMETER_RESPONSE_CODE);
final boolean hasQuery = !queryParams.get(VloWebAppParameters.QUERY).isEmpty() || !queryParams.get(VloWebAppParameters.FILTER_QUERY).isEmpty();
add(new BookmarkablePageLink("searchPage", FacetedSearchPage.class, queryParams)
.add(new Label("label", hasQuery ? "Return to query" : "Go to the search page"))
);
final IModel<String> errorDescriptionModel = new LoadableDetachableModel<String>() {
@Override
protected String load() {
return getDescriptionForError(errorType);
}
};
add(new Label("description", errorDescriptionModel) {
@Override
protected void onConfigure() {
setVisible(errorDescriptionModel.getObject() != null);
}
}.setEscapeModelStrings(false));
}
示例13: DiscoverItemsPage
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public DiscoverItemsPage() {
super();
this.add(new DiscoverForm("discoverForm"));
itemsContainer = new WebMarkupContainer("itemsContainer");
itemsContainer.setOutputMarkupId(true);
ComponentUtils.displayNone(itemsContainer);
itemsContainer.add(new ItemsForm("itemsForm", new LoadableDetachableModel<List<String>>() {
@Override
protected List<String> load() {
return discoItems;
}
}));
this.add(itemsContainer);
}
示例14: ExamplePage
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public ExamplePage() {
super();
this.add(new AttributeForm("attributeForm"));
this.add(new KindRequestPanel("kindPanel",
new Model<>(new MethodModel(null, null, null, null, null)),
new LoadableDetachableModel<KindModel>() {
@Override
protected KindModel load() {
return createExampleKindModel();
}
}));
this.add(new UriResponsePanel("uriResponsePanel", new LoadableDetachableModel<UriListRepresentationModel>() {
@Override
protected UriListRepresentationModel load() {
return createEmapmleUriRepresentationModel();
}
}));
}
示例15: AdministrationUserGroupPortfolioPage
import org.apache.wicket.model.LoadableDetachableModel; //導入依賴的package包/類
public AdministrationUserGroupPortfolioPage(PageParameters parameters) {
super(parameters);
addBreadCrumbElement(new BreadCrumbElement(new ResourceModel("navigation.administration.usergroup"),
AdministrationUserGroupPortfolioPage.linkDescriptor()));
IModel<List<UserGroup>> userGroupListModel = new LoadableDetachableModel<List<UserGroup>>() {
private static final long serialVersionUID = 1L;
@Override
protected List<UserGroup> load() {
return userGroupService.list();
}
};
UserGroupPopup addPopup = new UserGroupPopup("addPopup");
add(
new UserGroupPortfolioPanel("portfolio", userGroupListModel, propertyService.get(PORTFOLIO_ITEMS_PER_PAGE)),
addPopup,
new BlankLink("addButton")
.add(new AjaxModalOpenBehavior(addPopup, MouseEvent.CLICK))
);
}