use of org.apache.wicket.model.ResourceModel in project midpoint by Evolveum.
the class TaskSubtasksAndThreadsPanel method initLayout.
protected void initLayout() {
Label subtasksLabel = new Label(ID_SUBTASKS_LABEL, new ResourceModel("pageTaskEdit.subtasksLabel"));
add(subtasksLabel);
TaskTablePanel subtasksPanel = new TaskTablePanel(ID_SUBTASKS_PANEL, createOperationOptions()) {
@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> createSubtasksQuery(), null);
}
@Override
protected List<Component> createToolbarButtonsList(String buttonId) {
return new ArrayList<>();
}
@Override
protected List<IColumn<SelectableBean<TaskType>, String>> createDefaultColumns() {
List<IColumn<SelectableBean<TaskType>, String>> columns = super.createDefaultColumns();
// });
return columns;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_SUBTASKS;
}
@Override
@NotNull
protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, getObjectDetailsModels().getRootTaskModelObject());
}
};
add(subtasksPanel);
Label workerThreadsTableLabel = new Label(ID_WORKER_THREADS_TABLE_LABEL, new ResourceModel("TaskStatePanel.workerThreads"));
add(workerThreadsTableLabel);
TaskTablePanel workerThreadsTable = new TaskTablePanel(ID_WORKER_THREADS_TABLE, null) {
@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
return new SelectableListDataProvider<>(TaskSubtasksAndThreadsPanel.this, createWorkersModel());
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_WORKERS;
}
@Override
protected boolean isHeaderVisible() {
return false;
}
@Override
protected List<Component> createToolbarButtonsList(String buttonId) {
return new ArrayList<>();
}
@Override
@NotNull
protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, getObjectDetailsModels().getRootTaskModelObject());
}
};
add(workerThreadsTable);
}
use of org.apache.wicket.model.ResourceModel in project midpoint by Evolveum.
the class TaskSubtasksAndThreadsTabPanel method initLayout.
private void initLayout() {
Label subtasksLabel = new Label(ID_SUBTASKS_LABEL, new ResourceModel("pageTaskEdit.subtasksLabel"));
add(subtasksLabel);
TaskTablePanel subtasksPanel = new TaskTablePanel(ID_SUBTASKS_PANEL, createOperationOptions()) {
@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> createSubtasksQuery(), null);
}
@Override
protected List<IColumn<SelectableBean<TaskType>, String>> createDefaultColumns() {
List<IColumn<SelectableBean<TaskType>, String>> columns = super.createDefaultColumns();
// });
return columns;
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_SUBTASKS;
}
@Override
@NotNull
protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, rootTaskModel.getObject());
}
};
add(subtasksPanel);
Label workerThreadsTableLabel = new Label(ID_WORKER_THREADS_TABLE_LABEL, new ResourceModel("TaskStatePanel.workerThreads"));
add(workerThreadsTableLabel);
TaskTablePanel workerThreadsTable = new TaskTablePanel(ID_WORKER_THREADS_TABLE, null) {
@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
return new SelectableListDataProvider<>(TaskSubtasksAndThreadsTabPanel.this, createWorkersModel());
}
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.TABLE_WORKERS;
}
@Override
protected boolean isHeaderVisible() {
return false;
}
@Override
@NotNull
protected TaskInformation getAttachedTaskInformation(SelectableBean<TaskType> selectableTaskBean) {
return TaskInformationUtil.getOrCreateInfo(selectableTaskBean, rootTaskModel.getObject());
}
};
add(workerThreadsTable);
}
use of org.apache.wicket.model.ResourceModel in project the-app by devops-dojo.
the class HomePage method topSellerPanel.
private Component topSellerPanel() {
boolean userAuthorized = isUserAuthorized();
String ressourceKey = userAuthorized ? "your.favorite.products.topic" : "category.top.seller.topic";
String recommenderType = userAuthorized ? "FAVORITE_PRODUCTS" : "STARTPAGE_TOPSELLER";
return new RecommendationItemListPanel("topSellerProductsContainer", feedback, recommenderType, new ResourceModel(ressourceKey), new LoadableDetachableModel<List<ProductInfo>>() {
@Override
protected List<ProductInfo> load() {
return recommendationService.getTopsellerRecommendations(4);
}
}) {
};
}
use of org.apache.wicket.model.ResourceModel in project oc-explorer by devgateway.
the class ListViewSectionPanel method getAddNewChildButton.
/**
* Returns the new child button
*
* @return
*/
protected BootstrapAddButton getAddNewChildButton() {
BootstrapAddButton newButton = new BootstrapAddButton("newButton", new ResourceModel("newButton")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
@SuppressWarnings("unchecked") T newChild = createNewChild((IModel<PARENT>) ListViewSectionPanel.this.getParent().getDefaultModel());
ListViewSectionPanel.this.getModel().getObject().add(newChild);
listView.removeAll();
target.add(listWrapper);
}
};
newButton.setOutputMarkupPlaceholderTag(true);
return newButton;
}
use of org.apache.wicket.model.ResourceModel in project oc-explorer by devgateway.
the class BasePage method newMyDashboardsMenu.
protected NavbarButton<ListMyDashboardsPage> newMyDashboardsMenu() {
// home
NavbarButton<ListMyDashboardsPage> menu = new NavbarButton<>(ListMyDashboardsPage.class, this.getPageParameters(), new ResourceModel("mydashboards"));
menu.setIconType(GlyphIconType.filter);
MetaDataRoleAuthorizationStrategy.authorize(menu, Component.RENDER, SecurityConstants.Roles.ROLE_PROCURING_ENTITY);
return menu;
}
Aggregations