import org.argeo.api.acr.Content;
import org.argeo.api.acr.NamespaceUtils;
import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.widgets.SwtHierarchicalPart;
-import org.argeo.cms.swt.widgets.SwtTabularPart;
+import org.argeo.cms.swt.widgets.SwtTableView;
+import org.argeo.cms.swt.widgets.SwtTreeView;
import org.argeo.cms.ux.acr.ContentHierarchicalPart;
import org.argeo.cms.ux.widgets.Column;
import org.argeo.cms.ux.widgets.DefaultTabularPart;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.widgets.Composite;
+/** A simple ACR browser. */
public class AcrContentTreeView extends Composite {
private static final long serialVersionUID = -3707881216246077323L;
split.setLayoutData(CmsSwtUtils.fillAll());
ContentHierarchicalPart contentPart = new ContentHierarchicalPart();
+ contentPart.addColumn((model) -> {
+ try {
+ return NamespaceUtils.toPrefixedName(model.getName());
+ } catch (IllegalStateException e) {
+ return model.getName().toString();
+ }
+ });
contentPart.setInput(rootContent);
- SwtHierarchicalPart<Content> hPart = new SwtHierarchicalPart<>(split, getStyle(), contentPart);
+ new SwtTreeView<>(split, getStyle(), contentPart);
Composite area = new Composite(split, SWT.BORDER);
area.setLayout(CmsSwtUtils.noSpaceGridLayout(2));
});
// attributesPart.setInput(selected);
- SwtTabularPart<Content, QName> attributeTable = new SwtTabularPart<>(area, style, attributesPart);
+ SwtTableView<Content, QName> attributeTable = new SwtTableView<>(area, style, attributesPart);
attributeTable.setLayoutData(CmsSwtUtils.fillAll());
// types
// typesPart.setInput(selected);
- SwtTabularPart<Content, QName> typesTable = new SwtTabularPart<>(area, style, typesPart);
+ SwtTableView<Content, QName> typesTable = new SwtTableView<>(area, style, typesPart);
typesTable.setLayoutData(CmsSwtUtils.fillAll());
// controller