import java.io.IOException;
import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.security.PrivilegedAction;
import java.util.Map;
import java.util.UUID;
import org.argeo.api.cms.CmsEventBus;
import org.argeo.api.cms.CmsLog;
import org.argeo.api.cms.CmsSession;
+import org.argeo.api.cms.ux.CmsImageManager;
import org.argeo.api.cms.ux.CmsTheme;
import org.argeo.api.cms.ux.CmsView;
import org.argeo.cms.swt.AbstractSwtCmsView;
import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.AcrSwtImageManager;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler;
import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl;
private CSSEngine cssEngine;
+ private String httpServerBase;
+
public CmsRcpApp(String uiName) {
super(uiName);
uid = UUID.randomUUID().toString();
}
+ @SuppressWarnings("rawtypes")
public void initRcpApp() {
+ imageManager = (CmsImageManager) new AcrSwtImageManager();
+
display = Display.getCurrent();
shell = new Shell(display);
shell.setText("Argeo CMS");
return cmsApp;
}
+ @Override
+ public URI toBackendUri(String url) {
+ try {
+ URI u = new URI(url);
+ if (u.getHost() == null) {
+ // TODO make it more robust
+ u = new URI(httpServerBase + url);
+ }
+ return u;
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Cannot convert " + url, e);
+ }
+ }
+
+ public void setHttpServerBase(String httpServerBase) {
+ this.httpServerBase = httpServerBase;
+ }
+
/*
* DEPENDENCY INJECTION
*/