catch up with development
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF
index 890a208..20ed1ef 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/META-INF/MANIFEST.MF
@@ -107,8 +107,7 @@
org.eclipse.osbp.vaaclipse.addons.softwarefactory.perspective;version="0.9.0",
org.eclipse.osbp.vaaclipse.addons.softwarefactory.service;version="0.9.0",
org.eclipse.osbp.vaaclipse.addons.softwarefactory.systemsettings;version="0.9.9",
- org.eclipse.osbp.vaaclipse.addons.softwarefactory.userfilter;version="0.9.0",
- org.eclipse.osbp.vaaclipse.addons.softwarefactory.welcome;version="0.9.0"
+ org.eclipse.osbp.vaaclipse.addons.softwarefactory.userfilter;version="0.9.0"
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.osbp.vaaclipse.addons.softwarefactory.Activator
Service-Component: OSGI-INF/*.xml
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/DialogProvider.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/DialogProvider.java
index ce41dc1..947a154 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/DialogProvider.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/DialogProvider.java
@@ -87,12 +87,10 @@
import org.eclipse.osbp.runtime.common.event.SelectionStore;
import org.eclipse.osbp.runtime.common.filter.IDTOHistorizedService;
import org.eclipse.osbp.runtime.common.filter.IDTOService;
-import org.eclipse.osbp.runtime.common.filter.IDTOService;
import org.eclipse.osbp.runtime.common.validation.IStatus;
import org.eclipse.osbp.runtime.common.validation.ValidationKind;
import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.AcceptDeleteDialog;
import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.AcceptLoosingDataDialog;
-import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.AcceptSaveDialog;
import org.eclipse.osbp.runtime.web.vaadin.components.dialogs.QueryDeleteDialog;
import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
import org.eclipse.osbp.ui.api.contextfunction.IViewEmbeddedProvider;
@@ -505,9 +503,13 @@
@Override
public void validationChanged(IFieldValidationManager.Event event) {
// add them to the Vaaclipse status manager
- IStatusScope scope = statusManager.getScopeFor(mPart);
- scope.modifyStatus(event.getOldStatus(), event.getNewStatus());
- applyValidationResult();
+ if(mPart != null) {
+ IStatusScope scope = statusManager.getScopeFor(mPart);
+ scope.modifyStatus(event.getOldStatus(), event.getNewStatus());
+ applyValidationResult();
+ } else {
+ viewContext.setBean(BEAN_SLOT__VALIDATION_ERROR, Boolean.FALSE);
+ }
}
/**
@@ -515,8 +517,9 @@
*/
protected void applyValidationResult() {
// set the validation result
- viewContext.setBean(BEAN_SLOT__VALIDATION_ERROR, Boolean.FALSE);
- log.debug("applyValidationResult {}", ((Boolean)viewContext.getBean(BEAN_SLOT__VALIDATION_ERROR)).booleanValue());
+ boolean validationError = ((Boolean)viewContext.getBean(BEAN_SLOT__VALIDATION_ERROR)).booleanValue();
+ viewContext.setBean(BEAN_SLOT__VALIDATION_ERROR, validationError);
+ log.debug("applyValidationResult {}", validationError);
}
@IsValid
@@ -865,7 +868,8 @@
public void afterBind(IContext context) {
for(UiBeanSlot slot : dialogModel.getUiView().getBeanSlots()) {
if(dslMetadataService.hasSupertype(slot.getJvmType(), IStateMachineParticipant.class)) {
- ((IStateMachineParticipant)context.getBeanSlot(slot.getName()).getValue()).init();
+ IStateMachine sm = ((IStateMachineParticipant)context.getBeanSlot(slot.getName()).getValue()).getStatemachine();
+ ((IStateMachineParticipant)context.getBeanSlot(slot.getName()).getValue()).init( sm.getHostName(), sm.getRemotePort());
}
if(dslMetadataService.hasSupertype(slot.getJvmType(), IDataProvider.class)) {
for(UiBeanSlot innerslot : dialogModel.getUiView().getBeanSlots()) {
@@ -1424,12 +1428,13 @@
* Creates the embedded toolbar for embedded dialogs.
*/
private void createEmbeddedToolbar() {
- taskButtons = new ArrayList<Button>();
+ taskButtons = new ArrayList<>();
HorizontalLayout tools = new HorizontalLayout();
tools.addStyleName("os-embedded-toolbar");
tools.setSpacing(false);
Button b = new Button(null, new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
DTO savedDto = (DTO) viewContext.getBean(IViewContext.MAIN_BEAN_SLOT);
if(validate(savedDto)) {
@@ -1510,6 +1515,7 @@
return dslMetadataService;
}
+ @Override
public IThemeResourceService getThemeResourceService() {
return themeResourceService;
}
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java
index b661cc2..59c0d8a 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/perspective/PerspectiveProvider.java
@@ -77,6 +77,7 @@
import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherCommand;
import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherDataTag;
import org.eclipse.osbp.runtime.common.event.IEventDispatcher;
+import org.eclipse.osbp.ui.api.contextfunction.IDashboardProvider;
import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
import org.eclipse.osbp.ui.api.organization.IOrganizationViewPartProvider;
import org.eclipse.osbp.ui.api.perspective.IPerspectiveProvider;
@@ -87,7 +88,6 @@
import org.eclipse.osbp.utils.vaadin.bpmn.BpmnView;
import org.eclipse.osbp.utils.vaadin.saiku.SaikuView;
import org.eclipse.osbp.vaaclipse.addons.softwarefactory.maintoolbar.IMainToolbarProvider;
-import org.eclipse.osbp.vaaclipse.addons.softwarefactory.welcome.WelcomeView;
import org.eclipse.osbp.vaaclipse.publicapi.authentication.AuthenticationConstants;
import org.eclipse.osbp.vaadin.emf.api.IModelingContext;
import org.eclipse.osbp.xtext.action.ActionDSLPackage;
@@ -130,7 +130,6 @@
import org.eclipse.osbp.xtext.perspective.PerspectiveTable;
import org.eclipse.osbp.xtext.perspective.PerspectiveTopology;
import org.eclipse.osbp.xtext.perspective.PerspectiveView;
-import org.eclipse.osbp.xtext.perspective.PerspectiveWelcome;
import org.eclipse.osbp.xtext.reportdsl.Report;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
import org.eclipse.osbp.xtext.reportdsl.ReportPackage;
@@ -146,6 +145,7 @@
import org.osgi.service.event.EventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
import com.vaadin.server.Page;
/**
@@ -210,6 +210,10 @@
@Inject
private IEventDispatcher eventDispatcher;
+ @Inject
+ @Optional
+ private IDashboardProvider dashboardProvider;
+
/** The do logout. */
private EventHandler doLogout;
@@ -690,10 +694,6 @@
} else if (viewModel instanceof PerspectiveBPMN) {
String className = BpmnView.class.getCanonicalName();
return dslMetadataService.getClassURI(className, IPerspectiveProvider.PerspectiveViewType.BPMN);
- } else if (viewModel instanceof PerspectiveWelcome) {
- String className = WelcomeView.class.getCanonicalName();
- Bundle bundle = FrameworkUtil.getBundle(WelcomeView.class);
- return E4Constants.BUNDLE_PROTOCOL_SCHEME + "://" + bundle.getSymbolicName() + "/" + className;
} else if (viewModel instanceof PerspectiveSearch) {
String className = SearchView.class.getCanonicalName();
Bundle bundle = FrameworkUtil.getBundle(SearchView.class);
@@ -782,10 +782,6 @@
} else if (viewModel instanceof PerspectiveBPMN) {
String className = BpmnView.class.getCanonicalName();
return dslMetadataService.getClassURI(className, IPerspectiveProvider.PerspectiveViewType.BPMN);
- } else if (viewModel instanceof PerspectiveWelcome) {
- String className = WelcomeView.class.getCanonicalName();
- Bundle bundle = FrameworkUtil.getBundle(WelcomeView.class);
- return E4Constants.BUNDLE_PROTOCOL_SCHEME + "://" + bundle.getSymbolicName() + "/" + className;
} else if (viewModel instanceof PerspectiveSaiku) {
String className = SaikuView.class.getCanonicalName();
Bundle bundle = FrameworkUtil.getBundle(SaikuView.class);
@@ -1171,13 +1167,17 @@
*/
@Override
public void openPerspective(String perspectiveId) {
- PerspectiveFound perspectiveFound = findPerspective(perspectiveId);
- if (perspectiveFound != null) {
- log.debug("{}", "openPerspective starts");
- openPerspective(perspectiveFound, null);
- log.debug("{}", "openPerspective finished");
+ if(IDSLMetadataService.DASHBOARD.equals(perspectiveId) && dashboardProvider != null) {
+ dashboardProvider.createDashboard(eclipseContext);
} else {
- log.error("perspective id {} not found", perspectiveId);
+ PerspectiveFound perspectiveFound = findPerspective(perspectiveId);
+ if (perspectiveFound != null) {
+ log.debug("{}", "openPerspective starts");
+ openPerspective(perspectiveFound, null);
+ log.debug("{}", "openPerspective finished");
+ } else {
+ log.error("perspective id {} not found", perspectiveId);
+ }
}
}
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/OSBPServiceAddon.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/OSBPServiceAddon.java
index 673b118..0783b7d 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/OSBPServiceAddon.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/OSBPServiceAddon.java
@@ -27,7 +27,6 @@
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.contexts.RunAndTrack;
-import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.services.translation.TranslationService;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.commands.MBindingContext;
@@ -55,7 +54,6 @@
import org.eclipse.osbp.runtime.common.event.IEventDispatcher;
import org.eclipse.osbp.runtime.common.i18n.II18nService;
import org.eclipse.osbp.ui.api.contextfunction.ICommandsProvider;
-import org.eclipse.osbp.ui.api.contextfunction.IDashboardProvider;
import org.eclipse.osbp.ui.api.message.IMessageRequester;
import org.eclipse.osbp.ui.api.message.MessageEvent;
import org.eclipse.osbp.ui.api.message.MessageEvent.EventType;
@@ -72,7 +70,6 @@
import org.eclipse.osbp.vaaclipse.addons.softwarefactory.handler.ThemeHandler;
import org.eclipse.osbp.vaaclipse.addons.softwarefactory.handler.UserHandler;
import org.eclipse.osbp.vaaclipse.addons.softwarefactory.perspective.PerspectiveProvider;
-import org.eclipse.osbp.vaaclipse.addons.softwarefactory.welcome.WelcomeView;
import org.eclipse.osbp.vaaclipse.common.ecview.api.IECViewContainer;
import org.eclipse.osbp.vaaclipse.publicapi.theme.ThemeEngine;
import org.eclipse.osbp.vaaclipse.publicapi.theme.ThemeManager;
@@ -100,10 +97,6 @@
private ThemeManager themeManager;
private IDSLMetadataService dslMetadataService;
-
- @Inject
- @Optional
- private IDashboardProvider dashboardProvider;
protected Map<String, MessageDialog> messageDialogs = new HashMap<>();
protected Locale addonLocale;
@@ -161,10 +154,6 @@
return true;
}
});
-
- if (perspectiveProvider != null) {
- perspectiveProvider.openPerspective(IPerspectiveProvider.WELCOME_SCREEN_ID, "Welcome", WelcomeView.class);
- }
}
/**
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/ThemeResourceService.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/ThemeResourceService.java
index 2593666..80540ee 100644
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/ThemeResourceService.java
+++ b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/service/ThemeResourceService.java
@@ -142,13 +142,13 @@
public String getThemeResourceHTML(String subject, Locale locale) {
String localeTag = locale.toLanguageTag();
String path = getRelativeResourePath(subject, ThemeResourceType.HTML);
- String theme = themeManager.getThemeId();
StringBuilder htmlLoader = new StringBuilder();
- htmlLoader.append("<iframe src=\"./VAADIN/themes/$THEME$/$PATH$?localeTag=$LOCALETAG$\"");
+ htmlLoader.append("<iframe src=\"./VAADIN/themes/common/$PATH$?localeTag=$LOCALETAG$\"");
htmlLoader.append("\twidth=\"100%\" height=\"100%\" name=\"$SUBJECT$ page\">");
htmlLoader.append("\t\t<p>Alternative $SUBJECT$ page</p>");
htmlLoader.append("</iframe>");
- return htmlLoader.toString().replace("$SUBJEC$T", subject).replace("$THEME$", theme).replace("$PATH$", path).replace("$LOCALETAG$", localeTag);
+ String html = htmlLoader.toString().replace("$SUBJECT$", subject).replace("$PATH$", path).replace("$LOCALETAG$", localeTag);
+ return html;
}
@Override
@@ -163,8 +163,7 @@
@Override
public String getThemeResourceMxGraphPath() {
- String theme = themeManager.getThemeId();
- return "./VAADIN/themes/" + theme + "/mxGraph";
+ return "./VAADIN/themes/common/mxGraph";
}
}
diff --git a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/welcome/WelcomeView.java b/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/welcome/WelcomeView.java
deleted file mode 100644
index 36f1b18..0000000
--- a/org.eclipse.osbp.vaaclipse.addons.softwarefactory/src/org/eclipse/osbp/vaaclipse/addons/softwarefactory/welcome/WelcomeView.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- *
- * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
- *
- */
-package org.eclipse.osbp.vaaclipse.addons.softwarefactory.welcome;
-
-import java.util.Locale;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.contexts.IEclipseContext;
-import org.eclipse.e4.ui.model.application.MApplication;
-import org.eclipse.osbp.ui.api.themes.IThemeResourceService;
-import org.eclipse.osbp.ui.api.user.IUser;
-
-import com.vaadin.server.ClientConnector;
-import com.vaadin.server.ClientConnector.AttachEvent;
-import com.vaadin.server.ClientConnector.DetachEvent;
-import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.ui.AbstractComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-
-public class WelcomeView implements IUser.UserLocaleListener, ClientConnector.DetachListener, ClientConnector.AttachListener {
-
- private static final long serialVersionUID = 1L;
- private AbstractComponent label = null;
- private VerticalLayout parent;
- private IThemeResourceService themeResourceService;
- private IUser user;
- private Locale locale;
-
- @Inject
- public WelcomeView(VerticalLayout parent, IEclipseContext context, MApplication app) {
- this.parent = parent;
- this.themeResourceService = context.get(IThemeResourceService.class);
- this.user = context.get(IUser.class);
- locale = user.getLocale();
- parent.addStyleName("os-welcome");
- parent.addAttachListener(this);
- parent.addDetachListener(this);
- }
-
- @PostConstruct
- public void render() {
- renderView();
- }
-
- private void renderView() {
- if (label != null) {
- parent.removeComponent(label);
- }
- label = new Label(themeResourceService.getThemeResourceHTML("WelcomeTRANSLATABLE", locale), ContentMode.HTML);
- label.setSizeFull();
- parent.addComponent(label);
- parent.setMargin(true);
- }
-
- @Override
- public void attach(AttachEvent event) {
- user.addUserLocaleListener(this);
- }
-
- @Override
- public void detach(DetachEvent event) {
- user.removeUserLocaleListener(this);
- }
-
- @Override
- public void localeChanged(Locale locale) {
- this.locale = locale;
- parent.removeAllComponents();
- renderView();
- }
-}