本文整理匯總了Java中org.apache.wicket.model.AbstractReadOnlyModel類的典型用法代碼示例。如果您正苦於以下問題:Java AbstractReadOnlyModel類的具體用法?Java AbstractReadOnlyModel怎麽用?Java AbstractReadOnlyModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AbstractReadOnlyModel類屬於org.apache.wicket.model包,在下文中一共展示了AbstractReadOnlyModel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInitialize
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
PullRequestReference reference = getModelObject();
User userForDisplay = User.getForDisplay(reference.getUser(), reference.getUserName());
add(new AvatarLink("avatar", userForDisplay));
add(new UserLink("name", userForDisplay));
add(new Label("age", DateUtils.formatAge(reference.getDate())));
ViewStateAwarePageLink<Void> link = new ViewStateAwarePageLink<Void>("link",
RequestOverviewPage.class, RequestOverviewPage.paramsOf(reference.getReferencedBy()));
link.add(new Label("number", "#" + reference.getReferencedBy().getNumber()));
link.add(new Label("title", reference.getReferencedBy().getTitle()));
add(link);
add(new RequestStatusPanel("status", new AbstractReadOnlyModel<PullRequest>() {
@Override
public PullRequest getObject() {
return ReferencedPanel.this.getModelObject().getReferencedBy();
}
}));
}
示例2: onInitialize
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
@Override
protected void onInitialize() {
super.onInitialize();
add(new UserLink("user", User.getForDisplay(getComment().getUser(), getComment().getUserName())));
add(new Label("age", DateUtils.formatAge(getComment().getDate())));
add(new SinceChangesLink("changes", new AbstractReadOnlyModel<PullRequest>() {
@Override
public PullRequest getObject() {
return getComment().getRequest();
}
}, getComment().getDate()));
add(newViewer());
setOutputMarkupId(true);
}
示例3: initResultColumns
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private List<IColumn<OperationResult, String>> initResultColumns() {
List<IColumn<OperationResult, String>> columns = new ArrayList<IColumn<OperationResult, String>>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.token"), "token"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.operation"), "operation"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.status"), "status"));
columns.add(new AbstractColumn<OperationResult, String>(createStringResource("pageTaskEdit.opResult.message"), "message") {
@Override
public void populateItem(Item<ICellPopulator<OperationResult>> cellItem, String componentId,
IModel<OperationResult> rowModel) {
Label label = new Label(componentId, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return WebComponentUtil.nl2br(rowModel.getObject().getMessage());
}
});
label.setEscapeModelStrings(false);
cellItem.add(label);
}
});
//columns.add(new PropertyColumn(createStringResource("pageTaskEdit.opResult.message"), "message"));
return columns;
}
示例4: initLayout
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
protected void initLayout() {
refreshModel = new Model(new AutoRefreshDto());
refreshModel.getObject().setInterval(getRefreshInterval());
IModel<PrismObject<TaskType>> prismObjectModel = new AbstractReadOnlyModel<PrismObject<TaskType>>() {
@Override
public PrismObject<TaskType> getObject() {
return objectWrapperModel.getObject().getObject();
}
};
final TaskSummaryPanel summaryPanel = new TaskSummaryPanel(ID_SUMMARY_PANEL, prismObjectModel, refreshModel, this);
summaryPanel.setOutputMarkupId(true);
add(summaryPanel);
mainPanel = new TaskMainPanel(ID_MAIN_PANEL, objectWrapperModel, taskDtoModel, showAdvancedFeaturesModel, this);
mainPanel.setOutputMarkupId(true);
add(mainPanel);
summaryPanel.getRefreshPanel().startRefreshing(this, null);
}
示例5: createPageTitleModel
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
@Override
protected IModel<String> createPageTitleModel() {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (model == null) {
return "";
}
ObjectViewDto object;
try {
object = model.getObject();
} catch (RuntimeException e) {
// e.g. when the object is unreadable
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get object", e);
return "";
}
if (object == null) {
return "";
} else {
return createStringResource("PageDebugView.title", object.getName()).getString();
}
}
};
}
示例6: getDeleteProjectionPopupContent
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private Popupable getDeleteProjectionPopupContent() {
ConfirmationPanel dialog = new ConfirmationPanel(getPageBase().getMainPopupBodyId(),
new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return createStringResource("pageAdminFocus.message.deleteAccountConfirm",
getSelectedProjections(projectionModel).size()).getString();
}
}) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
deleteAccountConfirmedPerformed(target, getSelectedProjections(projectionModel));
}
}
};
return dialog;
}
示例7: getCountModel
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
@Override
public IModel<String> getCountModel() {
// We cannot get the count information from the panel.
// When we display the tab the panel does not exist yet.
// The panel is created only when the tab is clicked.
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return getCount();
}
};
}
示例8: createAssignmentNameLabelModel
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
protected IModel<String> createAssignmentNameLabelModel(final boolean isManager) {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (getModel() != null && getModel().getObject() != null) {
AssignmentEditorDto dto = getModelObject();
if (dto.getName() != null) {
StringBuilder name = new StringBuilder(dto.getName());
if (isManager) {
name.append(" - Manager");
}
return name.toString();
}
if (dto.getAltName() != null) {
return getString("AssignmentEditorPanel.name.focus");
}
}
return getString("AssignmentEditorPanel.name.noTarget");
}
};
}
示例9: createImageTypeModel
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
protected IModel<String> createImageTypeModel(final IModel<AssignmentEditorDto> model) {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
AssignmentEditorDto assignmentEditorDto = model.getObject();
PrismObject targetObject = null;
try {
targetObject = getTargetObject(assignmentEditorDto);
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object", ex);
// Otherwise ignore, will be pocessed by the fallback code
// below
}
if (targetObject == null) {
AssignmentEditorDtoType type = assignmentEditorDto.getType();
return type.getIconCssClass();
} else {
return WebComponentUtil.createDefaultIcon(targetObject);
}
}
};
}
示例10: createJsonModel
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private IModel<String> createJsonModel(final IModel<SolrDocument> model, final IModel<String> endpointModel) {
// Prepare a JSON object that holds the CQL endpoint and the document self link
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
final String endPoint = endpointModel.getObject();
final Object selfLink = model.getObject().getFirstValue(FacetConstants.FIELD_SELF_LINK);
try {
final JSONObject json = new JSONObject();
json.put(endPoint, new JSONArray(new Object[]{selfLink}));
return json.toString(2);
} catch (JSONException ex) {
logger.warn("Could not create JSON for aggregation context with endpoint '{}' and docId '{}'", endPoint, selfLink, ex);
return null;
}
}
@Override
public void detach() {
super.detach();
endpointModel.detach();
}
};
}
示例11: getEmptyIconColumn
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private static <T extends ObjectType> IColumn<SelectableBean<T>, String> getEmptyIconColumn(){
return new IconColumn<SelectableBean<T>>(createIconColumnHeaderModel()) {
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createIconModel(final IModel<SelectableBean<T>> rowModel) {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return "";
}
};
}
};
}
示例12: getRoleIconColumn
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private static <T extends ObjectType> IColumn<SelectableBean<T>, String> getRoleIconColumn(){
return new IconColumn<SelectableBean<T>>(createIconColumnHeaderModel()) {
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createIconModel(final IModel<SelectableBean<T>> rowModel) {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
T role = rowModel.getObject().getValue();
return role != null ? WebComponentUtil.createRoleIcon(role.asPrismContainer()) : null;
}
};
}
};
}
示例13: getServiceIconColumn
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private static <T extends ObjectType> IColumn<SelectableBean<T>, String> getServiceIconColumn(){
return new IconColumn<SelectableBean<T>>(createIconColumnHeaderModel()) {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createIconModel(final IModel<SelectableBean<T>> rowModel) {
return new AbstractReadOnlyModel<String>() {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
T service = rowModel.getObject().getValue();
return service != null ? WebComponentUtil.createServiceIcon(service.asPrismContainer()) : null;
}
};
}
};
}
示例14: getTaskIconColumn
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private static <T extends ObjectType> IColumn<SelectableBean<T>, String> getTaskIconColumn(){
return new IconColumn<SelectableBean<T>>(createIconColumnHeaderModel()) {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createIconModel(final IModel<SelectableBean<T>> rowModel) {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
T task = rowModel.getObject().getValue();
return task != null ? WebComponentUtil.createTaskIcon(task.asPrismContainer()) : null;
}
};
}
};
}
示例15: getAccessCertificationDefinitionIconColumn
import org.apache.wicket.model.AbstractReadOnlyModel; //導入依賴的package包/類
private static <T extends ObjectType> IColumn<SelectableBean<T>, String> getAccessCertificationDefinitionIconColumn(){
return new IconColumn<SelectableBean<T>>(createIconColumnHeaderModel()) {
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createIconModel(final IModel<SelectableBean<T>> rowModel) {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return GuiStyleConstants.CLASS_OBJECT_CERT_DEF_ICON + " " + GuiStyleConstants.CLASS_ICON_STYLE_NORMAL;
}
};
}
};
}