use of org.apache.wicket.markup.html.panel.Fragment in project syncope by apache.
the class ActionLinksTogglePanel method toggleWithContent.
public void toggleWithContent(final AjaxRequestTarget target, final ActionsPanel<T> actionsPanel, final T modelObject) {
updateHeader(target, modelObject);
modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
private static final long serialVersionUID = 8804221891699487139L;
@Override
public void onClose(final AjaxRequestTarget target) {
modal.show(false);
}
});
final Fragment frag = new Fragment("actions", "actionsFragment", this);
frag.setOutputMarkupId(true);
frag.add(actionsPanel);
container.addOrReplace(frag);
target.add(this.container);
toggle(target, modelObject, true);
}
use of org.apache.wicket.markup.html.panel.Fragment 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.markup.html.panel.Fragment 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.markup.html.panel.Fragment in project wicket by apache.
the class ComponentQueueingTest method fragment1.
@Test
public void fragment1() {
MarkupContainer a = new A(), b = new B(), r = new R(), s = new S();
TestPage page = new TestPage();
page.setPageMarkup("<a wicket:id='a'></a><f wicket:id='fragment'></f><b wicket:id='b'></b>" + "<wicket:fragment wicket:id='f'><r wicket:id='r'></r><s wicket:id='s'></s></wicket:fragment>");
Fragment fragment = new Fragment("fragment", "f", page);
fragment.queue(r, s);
page.queue(a, b, fragment);
assertThat(page, hasPath(new Path(a)));
assertThat(page, hasPath(new Path(b)));
assertThat(page, hasPath(new Path(fragment, r)));
assertThat(page, hasPath(new Path(fragment, s)));
}
use of org.apache.wicket.markup.html.panel.Fragment in project openmeetings by apache.
the class AppointmentTemplate method getSubjectFragment.
@Override
Fragment getSubjectFragment() {
Fragment f = new Fragment(COMP_ID, "subject", this);
f.add(new OmTextLabel("prefix", getPrefix()), new OmTextLabel("title", a.getTitle()), new OmTextLabel("start", format(a.getStart(), SHORT)), new DashOmTextLabel("dash"), new OmTextLabel("end", format(a.getEnd(), SHORT)));
return f;
}
Aggregations