projects
/
gpl
/
argeo-suite.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Massive Argeo APIs refactoring
[gpl/argeo-suite.git]
/
org.argeo.suite.ui
/
src
/
org
/
argeo
/
suite
/
ui
/
SuiteUi.java
diff --git
a/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java
b/org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java
index b245762cc7d8f27220d7ee6bfef5f5eff82246d8..dc2ef509b1161d00e203d75a5ca5871df7a31376 100644
(file)
--- a/
org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java
+++ b/
org.argeo.suite.ui/src/org/argeo/suite/ui/SuiteUi.java
@@
-8,27
+8,32
@@
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.api.NodeConstants;
-import org.argeo.cms.ui.CmsView;
-import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.api.cms.CmsUi;
+import org.argeo.api.cms.CmsView;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.CmsConstants;
+import org.argeo.cms.Localized;
+import org.argeo.cms.swt.CmsSwtUtils;
import org.argeo.jcr.Jcr;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
/** The view for the default ergonomics of Argeo Suite. */
import org.argeo.jcr.Jcr;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
/** The view for the default ergonomics of Argeo Suite. */
-class SuiteUi extends Composite {
+class SuiteUi extends Composite
implements CmsUi
{
private static final long serialVersionUID = 6207018859086689108L;
private static final long serialVersionUID = 6207018859086689108L;
- private final static Log log = LogFactory.getLog(SuiteUi.class);
+ private final static CmsLog log = CmsLog.getLog(SuiteUi.class);
+
+ private Localized title;
private Composite header;
private Composite header;
+ private Composite footer;
private Composite belowHeader;
private Composite leadPane;
private Composite belowHeader;
private Composite leadPane;
+ private Composite sidePane;
private Composite dynamicArea;
private Session sysSession;
private Composite dynamicArea;
private Session sysSession;
-
//
private Session homeSession;
+
private Session homeSession;
private Node userDir;
private Map<String, SuiteLayer> layers = new HashMap<>();
private Node userDir;
private Map<String, SuiteLayer> layers = new HashMap<>();
@@
-39,40
+44,51
@@
class SuiteUi extends Composite {
public SuiteUi(Composite parent, int style) {
super(parent, style);
public SuiteUi(Composite parent, int style) {
super(parent, style);
- cmsView = Cms
View
.getCmsView(parent);
- this.setLayout(Cms
Ui
Utils.noSpaceGridLayout());
+ cmsView = Cms
SwtUtils
.getCmsView(parent);
+ this.setLayout(Cms
Swt
Utils.noSpaceGridLayout());
header = new Composite(this, SWT.NONE);
header = new Composite(this, SWT.NONE);
- header.setLayout(Cms
Ui
Utils.noSpaceGridLayout());
- Cms
Ui
Utils.style(header, SuiteStyle.header);
- header.setLayoutData(Cms
Ui
Utils.fillWidth());
+ header.setLayout(Cms
Swt
Utils.noSpaceGridLayout());
+ Cms
Swt
Utils.style(header, SuiteStyle.header);
+ header.setLayoutData(Cms
Swt
Utils.fillWidth());
belowHeader = new Composite(this, SWT.NONE);
belowHeader = new Composite(this, SWT.NONE);
- belowHeader.setLayoutData(CmsUiUtils.fillAll());
+ belowHeader.setLayoutData(CmsSwtUtils.fillAll());
+
+ footer = new Composite(this, SWT.NONE);
+ footer.setLayout(CmsSwtUtils.noSpaceGridLayout());
+ CmsSwtUtils.style(footer, SuiteStyle.footer);
+ footer.setLayoutData(CmsSwtUtils.fillWidth());
}
public void refreshBelowHeader(boolean initApp) {
}
public void refreshBelowHeader(boolean initApp) {
- Cms
Ui
Utils.clear(belowHeader);
+ Cms
Swt
Utils.clear(belowHeader);
int style = getStyle();
if (initApp) {
int style = getStyle();
if (initApp) {
- belowHeader.setLayout(Cms
UiUtils.noSpaceGridLayout(2
));
+ belowHeader.setLayout(Cms
SwtUtils.noSpaceGridLayout(3
));
if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
+ sidePane = new Composite(belowHeader, SWT.NONE);
+ sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout());
+ sidePane.setLayoutData(CmsSwtUtils.fillHeight());
dynamicArea = new Composite(belowHeader, SWT.NONE);
leadPane = new Composite(belowHeader, SWT.NONE);
} else {
leadPane = new Composite(belowHeader, SWT.NONE);
dynamicArea = new Composite(belowHeader, SWT.NONE);
dynamicArea = new Composite(belowHeader, SWT.NONE);
leadPane = new Composite(belowHeader, SWT.NONE);
} else {
leadPane = new Composite(belowHeader, SWT.NONE);
dynamicArea = new Composite(belowHeader, SWT.NONE);
+ sidePane = new Composite(belowHeader, SWT.NONE);
+ sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout());
+ sidePane.setLayoutData(CmsSwtUtils.fillHeight());
}
}
- leadPane.setLayoutData(Cms
Ui
Utils.fillHeight());
- leadPane.setLayout(Cms
Ui
Utils.noSpaceGridLayout());
- Cms
Ui
Utils.style(leadPane, SuiteStyle.leadPane);
+ leadPane.setLayoutData(Cms
Swt
Utils.fillHeight());
+ leadPane.setLayout(Cms
Swt
Utils.noSpaceGridLayout());
+ Cms
Swt
Utils.style(leadPane, SuiteStyle.leadPane);
- dynamicArea.setLayoutData(Cms
Ui
Utils.fillAll());
+ dynamicArea.setLayoutData(Cms
Swt
Utils.fillAll());
dynamicArea.setLayout(new FormLayout());
} else {
dynamicArea.setLayout(new FormLayout());
} else {
- belowHeader.setLayout(Cms
Ui
Utils.noSpaceGridLayout());
+ belowHeader.setLayout(Cms
Swt
Utils.noSpaceGridLayout());
}
}
}
}
@@
-156,8
+172,8
@@
class SuiteUi extends Composite {
protected Composite initLayer(String id, SuiteLayer layer, Node context) {
Composite workArea = cmsView.doAs(() -> (Composite) layer.createUiPart(dynamicArea, context));
protected Composite initLayer(String id, SuiteLayer layer, Node context) {
Composite workArea = cmsView.doAs(() -> (Composite) layer.createUiPart(dynamicArea, context));
- Cms
Ui
Utils.style(workArea, SuiteStyle.workArea);
- workArea.setLayoutData(Cms
Ui
Utils.coverAll());
+ Cms
Swt
Utils.style(workArea, SuiteStyle.workArea);
+ workArea.setLayoutData(Cms
Swt
Utils.coverAll());
workAreas.put(id, workArea);
return workArea;
}
workAreas.put(id, workArea);
return workArea;
}
@@
-165,7
+181,7
@@
class SuiteUi extends Composite {
synchronized void logout() {
userDir = null;
Jcr.logout(sysSession);
synchronized void logout() {
userDir = null;
Jcr.logout(sysSession);
-
//
Jcr.logout(homeSession);
+
Jcr.logout(homeSession);
currentLayerId = null;
workAreas.clear();
}
currentLayerId = null;
workAreas.clear();
}
@@
-178,10
+194,18
@@
class SuiteUi extends Composite {
return header;
}
return header;
}
+ Composite getFooter() {
+ return footer;
+ }
+
Composite getLeadPane() {
return leadPane;
}
Composite getLeadPane() {
return leadPane;
}
+ Composite getSidePane() {
+ return sidePane;
+ }
+
Composite getBelowHeader() {
return belowHeader;
}
Composite getBelowHeader() {
return belowHeader;
}
@@
-192,11
+216,11
@@
class SuiteUi extends Composite {
//
synchronized void initSessions(Repository repository, String userDirPath) throws RepositoryException {
this.sysSession = repository.login();
//
synchronized void initSessions(Repository repository, String userDirPath) throws RepositoryException {
this.sysSession = repository.login();
-
// this.homeSession = repository.login(Node
Constants.HOME_WORKSPACE);
+
this.homeSession = repository.login(Cms
Constants.HOME_WORKSPACE);
userDir = sysSession.getNode(userDirPath);
addDisposeListener((e) -> {
Jcr.logout(sysSession);
userDir = sysSession.getNode(userDirPath);
addDisposeListener((e) -> {
Jcr.logout(sysSession);
-
//
Jcr.logout(homeSession);
+
Jcr.logout(homeSession);
});
}
});
}
@@
-211,10
+235,10
@@
class SuiteUi extends Composite {
Session getSession(String workspaceName) {
if (workspaceName == null)
return sysSession;
Session getSession(String workspaceName) {
if (workspaceName == null)
return sysSession;
- if (
Node
Constants.SYS_WORKSPACE.equals(workspaceName))
+ if (
Cms
Constants.SYS_WORKSPACE.equals(workspaceName))
return sysSession;
return sysSession;
-
// else if (Node
Constants.HOME_WORKSPACE.equals(workspaceName))
-
//
return homeSession;
+
else if (Cms
Constants.HOME_WORKSPACE.equals(workspaceName))
+
return homeSession;
else
throw new IllegalArgumentException("Unknown workspace " + workspaceName);
}
else
throw new IllegalArgumentException("Unknown workspace " + workspaceName);
}
@@
-223,4
+247,12
@@
class SuiteUi extends Composite {
return cmsView;
}
return cmsView;
}
+ public Localized getTitle() {
+ return title;
+ }
+
+ public void setTitle(Localized title) {
+ this.title = title;
+ }
+
}
}