use of org.apache.wicket.behavior.AttributeAppender in project midpoint by Evolveum.
the class WorkItemsPanel method createTargetNameColumn.
IColumn<WorkItemDto, String> createTargetNameColumn(final String headerKey) {
return new LinkColumn<WorkItemDto>(createStringResource(headerKey), WorkItemDto.F_TARGET_NAME) {
@Override
protected IModel<String> createLinkModel(IModel<WorkItemDto> rowModel) {
return Model.of(WebModelServiceUtils.resolveReferenceName(rowModel.getObject().getTargetRef(), getPageBase()));
}
@Override
public void onClick(AjaxRequestTarget target, IModel<WorkItemDto> rowModel) {
WorkItemDto dto = rowModel.getObject();
dispatchToObjectDetailsPage(dto.getTargetRef(), getPageBase(), false);
}
@Override
public void populateItem(Item<ICellPopulator<WorkItemDto>> cellItem, String componentId, final IModel<WorkItemDto> rowModel) {
super.populateItem(cellItem, componentId, rowModel);
Component c = cellItem.get(componentId);
c.add(new AttributeAppender("title", getTargetObjectDescription(rowModel)));
}
};
}
use of org.apache.wicket.behavior.AttributeAppender in project midpoint by Evolveum.
the class SceneButtonPanel method initLayout.
private void initLayout(final IModel<SceneDto> model) {
AjaxLink<String> minimize = new AjaxLink<String>(ID_MINIMIZE_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
minimizeOnClick(target);
}
};
add(minimize);
Label icon = new Label(ID_ICON);
icon.add(AttributeModifier.append("class", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
SceneDto dto = model.getObject();
if (dto.isMinimized()) {
return GuiStyleConstants.CLASS_ICON_EXPAND;
}
return GuiStyleConstants.CLASS_ICON_COLLAPSE;
}
}));
minimize.add(icon);
icon.add(new AttributeAppender("title", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
SceneDto dto = model.getObject();
if (dto.isMinimized()) {
return getString("prismOptionButtonPanel.maximize");
}
return getString("prismOptionButtonPanel.minimize");
}
}, ""));
}
use of org.apache.wicket.behavior.AttributeAppender in project midpoint by Evolveum.
the class PageAuditLogDetails method initAuditLogHistoryPanel.
private void initAuditLogHistoryPanel(WebMarkupContainer eventPanel) {
AuditEventRecordProvider provider = new AuditEventRecordProvider(PageAuditLogDetails.this) {
private static final long serialVersionUID = 1L;
public Map<String, Object> getParameters() {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(TASK_IDENTIFIER_PARAMETER, recordModel.getObject().getTaskIdentifier());
return parameters;
}
};
BoxedTablePanel<AuditEventRecordType> table = new BoxedTablePanel<AuditEventRecordType>(ID_HISTORY_PANEL, provider, initColumns(), UserProfileStorage.TableId.TASK_EVENTS_TABLE, TASK_EVENTS_TABLE_SIZE) {
@Override
protected Item<AuditEventRecordType> customizeNewRowItem(final Item<AuditEventRecordType> item, final IModel<AuditEventRecordType> rowModel) {
if (rowModel.getObject().getTimestamp().equals(recordModel.getObject().getTimestamp())) {
item.add(new AttributeAppender("style", "background-color: #eee; border-color: #d6d6d6; color: #000"));
}
item.add(new AjaxEventBehavior("click") {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
PageAuditLogDetails.this.rowItemClickPerformed(target, item, rowModel);
}
});
return item;
}
};
table.getFooterMenu().setVisible(false);
table.getFooterCountLabel().setVisible(false);
//TODO hidden temporarily
table.setVisible(false);
table.setOutputMarkupId(true);
table.setAdditionalBoxCssClasses("without-box-header-top-border");
eventPanel.addOrReplace(table);
}
use of org.apache.wicket.behavior.AttributeAppender in project midpoint by Evolveum.
the class DashboardPanel method initLayout.
private void initLayout(IModel<String> titleModel, String icon, String boxCssClasses) {
if (boxCssClasses == null) {
boxCssClasses = GuiStyleConstants.CLASS_BOX_DEFAULT;
}
WebMarkupContainer dashboardParent = new WebMarkupContainer(ID_DASHBOARD_PARENT);
dashboardParent.add(new AttributeAppender("class", " " + boxCssClasses));
add(dashboardParent);
WebMarkupContainer dashboardTitle = new WebMarkupContainer(ID_DASHBOARD_TITLE);
dashboardParent.add(dashboardTitle);
Label title = new Label(ID_TITLE);
title.setRenderBodyOnly(true);
title.setDefaultModel(titleModel);
dashboardTitle.add(title);
WebMarkupContainer dashboardContent = new WebMarkupContainer(ID_DASHBOARD_CONTENT);
dashboardContent.add(getMainComponent(ID_CONTENT));
dashboardParent.add(dashboardContent);
WebMarkupContainer iconI = new WebMarkupContainer(ID_ICON);
iconI.add(AttributeModifier.replace("class", icon));
dashboardTitle.add(iconI);
}
use of org.apache.wicket.behavior.AttributeAppender in project midpoint by Evolveum.
the class OrgUnitAddDeletePopup method setState.
public void setState(ActionState state, AjaxRequestTarget target) {
this.state = state;
AjaxButton actionButton = (AjaxButton) getContent().get(ID_BUTTON_ACTION);
actionButton.setModel(createActionButtonStringResource());
actionButton.add(new AttributeAppender("class", getActionButtonClass()));
target.add(actionButton);
TablePanel panel = getTable();
DataTable table = panel.getDataTable();
ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
provider.setQuery(getDataProviderQuery());
target.add(panel);
}
Aggregations