package org.argeo.cms.users;
+import static org.eclipse.swt.SWT.NONE;
+
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.argeo.cms.util.CmsUtils;
import org.argeo.cms.viewers.AbstractPageViewer;
import org.argeo.cms.viewers.EditablePart;
+import org.argeo.cms.viewers.Section;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
private UserViewer(UserPart userPart, int style, Node userNode,
CmsEditable cmsEditable) throws RepositoryException {
- super(userPart, style, cmsEditable);
+ super(new Section(userPart, NONE, userNode), style, cmsEditable);
this.userPart = userPart;
- userPart.createControl(userPart,"cms_test");
+ userPart.createControl(userPart, "cms_test");
userPart.setStyle("cms_test");
refresh();
userPart.setLayoutData(CmsUtils.fillWidth());
userPart.setMouseListener(getMouseListener());
-
- // Add other parts
-// userRolesPart.createControl(userPart,"cms_test");
-// userPart.setStyle("cms_test");
-// refresh();
-// userPart.setLayoutData(CmsUtils.fillWidth());
-// userPart.setMouseListener(getMouseListener());
-
-
+
+ // Add other parts
+ // userRolesPart.createControl(userPart,"cms_test");
+ // userPart.setStyle("cms_test");
+ // refresh();
+ // userPart.setLayoutData(CmsUtils.fillWidth());
+ // userPart.setMouseListener(getMouseListener());
+
}
// private JcrComposite createParents(Composite parent, Node userNode)
}
}
}
-
+
protected void updateContent(EditablePart part) throws RepositoryException {
if (part instanceof UserPart)
((UserPart) part).refresh();
}
-
protected void refresh(Control control) throws RepositoryException {
if (control instanceof UserPart)
((UserPart) control).refresh();
private EditablePart edited;
private ISelection selection = StructuredSelection.EMPTY;
- // FIXME Added by BSinou to manage non-section Composite.
- // Is it the correct method?
- @Deprecated
- protected AbstractPageViewer(Composite parent, int style,
- CmsEditable cmsEditable) {
- // read only at UI level
- readOnly = SWT.READ_ONLY == (style & SWT.READ_ONLY);
-
- this.cmsEditable = cmsEditable == null ? CmsEditable.NON_EDITABLE
- : cmsEditable;
- if (this.cmsEditable instanceof Observable)
- ((Observable) this.cmsEditable).addObserver(this);
-
- if (cmsEditable.canEdit()) {
- mouseListener = createMouseListener();
- }
- page = findPage(parent);
- }
-
protected AbstractPageViewer(Section parent, int style,
CmsEditable cmsEditable) {
// read only at UI level
public ISelection getSelection() {
return selection;
}
-
-}
+}
\ No newline at end of file