use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project syncope by apache.
the class Relationships method getViewFragment.
private Fragment getViewFragment() {
final Map<String, List<RelationshipTO>> relationships = new HashMap<>();
addRelationship(relationships, getCurrentRelationships().toArray(new RelationshipTO[] {}));
final Fragment viewFragment = new Fragment("relationships", "viewFragment", this);
viewFragment.setOutputMarkupId(true);
viewFragment.add(new Accordion("relationships", relationships.keySet().stream().map(relationship -> {
return new AbstractTab(new ResourceModel("relationship", relationship)) {
private static final long serialVersionUID = 1037272333056449378L;
@Override
public Panel getPanel(final String panelId) {
return new ListViewPanel.Builder<>(RelationshipTO.class, pageRef).setItems(relationships.get(relationship)).includes("otherEndType", "otherEndKey").addAction(new ActionLink<RelationshipTO>() {
private static final long serialVersionUID = -6847033126124401556L;
@Override
public void onClick(final AjaxRequestTarget target, final RelationshipTO modelObject) {
removeRelationships(relationships, modelObject);
send(Relationships.this, Broadcast.DEPTH, new ListViewReload<>(target));
}
}, ActionType.DELETE, AnyEntitlement.UPDATE.getFor(anyTO.getType()), true).build(panelId);
}
};
}).collect(Collectors.toList())) {
private static final long serialVersionUID = 1037272333056449379L;
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
if (relationships.isEmpty()) {
response.render(OnDomReadyHeaderItem.forScript(String.format("$('#emptyPlaceholder').append(\"%s\")", getString("relationships.empty.list"))));
}
}
});
final ActionsPanel<RelationshipTO> panel = new ActionsPanel<>("actions", null);
viewFragment.add(panel);
panel.add(new ActionLink<RelationshipTO>() {
private static final long serialVersionUID = 3257738274365467945L;
@Override
public void onClick(final AjaxRequestTarget target, final RelationshipTO ignore) {
Fragment addFragment = new Fragment("relationships", "addFragment", Relationships.this);
addOrReplace(addFragment);
addFragment.add(new Specification().setRenderBodyOnly(true));
target.add(Relationships.this);
}
}, ActionType.CREATE, AnyEntitlement.UPDATE.getFor(anyTO.getType())).hideLabel();
return viewFragment;
}
use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project syncope by apache.
the class ReconciliationWidget method buildExecFragment.
private Fragment buildExecFragment() {
Fragment execFragment = new Fragment("reportResult", "execFragment", this);
execFragment.setOutputMarkupId(true);
Pair<List<ProgressBean>, ReconciliationReport> execResult;
try {
execResult = parseReconciliationReportExec();
} catch (Exception e) {
LOG.error("Could not parse the reconciliation report result", e);
execResult = Pair.of(Collections.<ProgressBean>emptyList(), new ReconciliationReport(new Date()));
}
final List<ProgressBean> progressBeans = execResult.getLeft();
final ReconciliationReport report = execResult.getRight();
List<ITab> tabs = new ArrayList<>();
tabs.add(new AbstractTab(new ResourceModel("summary")) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
return new ProgressesPanel(panelId, report.getRun(), progressBeans);
}
});
tabs.add(new AbstractTab(Model.of(AnyTypeKind.USER.name())) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
return new AnysReconciliationPanel(panelId, report.getUsers(), pageRef);
}
});
tabs.add(new AbstractTab(Model.of(AnyTypeKind.GROUP.name())) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
return new AnysReconciliationPanel(panelId, report.getGroups(), pageRef);
}
});
for (final Anys anys : report.getAnyObjects()) {
tabs.add(new AbstractTab(Model.of(anys.getAnyType())) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
return new AnysReconciliationPanel(panelId, anys, pageRef);
}
});
}
execFragment.add(new AjaxBootstrapTabbedPanel<>("execResult", tabs));
return execFragment;
}
use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project syncope by apache.
the class JobWidget method buildTabList.
private List<ITab> buildTabList(final PageReference pageRef) {
final List<ITab> tabs = new ArrayList<>();
tabs.add(new AbstractTab(new ResourceModel("available")) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
availableJobsPanel = new AvailableJobsPanel(panelId, pageRef);
availableJobsPanel.setOutputMarkupId(true);
return availableJobsPanel;
}
});
tabs.add(new AbstractTab(new ResourceModel("recent")) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
recentExecPanel = new RecentExecPanel(panelId, pageRef);
recentExecPanel.setOutputMarkupId(true);
return recentExecPanel;
}
});
return tabs;
}
use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project midpoint by Evolveum.
the class StageEditorPanel method nameClickPerformed.
private void nameClickPerformed(AjaxRequestTarget target) {
TabbedPanel tabbedPanel = this.findParent(TabbedPanel.class);
IModel<List<ITab>> tabsModel = tabbedPanel.getTabs();
List<ITab> tabsList = tabsModel.getObject();
PropertyModel<String> tabNameModel;
if (getModel().getObject().getName() == null || getModel().getObject().getName().trim().equals("")) {
tabNameModel = new PropertyModel<>(getModel(), StageDefinitionDto.F_NUMBER);
} else {
tabNameModel = new PropertyModel<>(getModel(), StageDefinitionDto.F_NAME);
}
for (ITab tab : tabsList) {
if (tab.getTitle().getObject().equals(tabNameModel.getObject())) {
int i = tabsList.indexOf(tab);
tabbedPanel.setSelectedTab(i);
target.add(tabbedPanel);
return;
}
}
tabsList.add(new AbstractTab(tabNameModel) {
@Override
public WebMarkupContainer getPanel(String panelId) {
return new DefinitionStagePanel(panelId, getModel());
}
});
tabbedPanel.setSelectedTab(tabsList.size() - 1);
target.add(tabbedPanel);
}
use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project midpoint by Evolveum.
the class PageInternals method initLayout.
private void initLayout() {
List<ITab> tabs = new ArrayList<>();
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.clock")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return createClockPanel(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.debugUtil")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initDebugUtilForm(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.internalConfig")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initInternalsConfigForm(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.traces")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initTraces(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.counters")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initCounters(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.cache")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initCachePanel(panelId);
}
});
// TODO show only if experimental features are enabled?
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.memory")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initMemoryPanel(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.threads")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initThreadsPanel(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.performance")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initPerformancePanel(panelId);
}
});
tabs.add(new AbstractTab(createStringResource("PageInternals.tab.loggedUsers")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer getPanel(String panelId) {
return initLoggedUsersPanel(panelId);
}
});
add(new TabbedPanel<>(ID_TAB_PANEL, tabs));
}
Aggregations