}
}
- private EditablePart findDataParent(Control parent) {
- if (parent instanceof EditablePart) {
- return (EditablePart) parent;
- }
- if (parent.getParent() != null)
- return findDataParent(parent.getParent());
- else
- throw new CmsException("No data parent found");
- }
-
@Override
public void mouseUp(MouseEvent e) {
}
import javax.jcr.RepositoryException;
import org.argeo.cms.CmsEditable;
-import org.argeo.cms.CmsException;
import org.argeo.cms.util.CmsUtils;
import org.argeo.cms.viewers.AbstractPageViewer;
import org.argeo.cms.viewers.EditablePart;
}
- private EditablePart findDataParent(Control parent) {
- if (parent instanceof EditablePart) {
- return (EditablePart) parent;
- }
- if (parent.getParent() != null)
- return findDataParent(parent.getParent());
- else
- throw new CmsException("No data parent found");
- }
-
protected void refresh(Control control) throws RepositoryException {
if (control instanceof UserPart)
((UserPart) control).refresh();
// 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
page.layout(controls);
}
+ /**
+ * Find the first {@link EditablePart} in the parents hierarchy of this
+ * control
+ */
+ protected EditablePart findDataParent(Control parent) {
+ if (parent instanceof EditablePart) {
+ return (EditablePart) parent;
+ }
+ if (parent.getParent() != null)
+ return findDataParent(parent.getParent());
+ else
+ throw new CmsException("No data parent found");
+ }
+
// UTILITIES
/** Check whether the edited part is in a proper state */
protected void checkEdited() {