Commit d756ad4c authored by Romain Bioteau's avatar Romain Bioteau Committed by GitHub

feat(eclipseUpdate) update target platform to 7.6 (#604)

* update target platform to e4.7

Closes BS-16807
parent 65c890b6
......@@ -9,6 +9,9 @@
<launcherArgs>
<programArgs>--launcher.XXMaxPermSize512m
</programArgs>
<programArgsLin>--launcher.GTK_version
2
</programArgsLin>
<vmArgs>-Xmx512m -Xms512m -Dosgi.requiredJavaVersion=1.8 -Dfile.encoding=UTF8 -Dtomcat.extra.params=&quot;-DnoCacheCustomPage=true&quot;
</vmArgs>
<vmArgsLin>-Djava.endorsed.dirs=endorsed
......@@ -28,7 +31,6 @@
startupForegroundColor="FFFCFC" />
<launcher name="BonitaStudioCommunity">
<macosx icon="icons/bonitasoft-icon-128-128-transparent.icns"/>
<solaris/>
<win useIco="true">
<ico path="icons/bonitasoft.ico"/>
<bmp/>
......@@ -67,13 +69,12 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<features>
<feature id="studio-feature"/>
<feature id="org.eclipse.rcp"/>
<feature id="studio-bos-specific-feature"/>
<feature id="bos-branding-feature"/>
<feature id="rootfiles-feature"/>
<feature id="org.eclipse.babel.nls_eclipse_es" version="4.4.0.v20141223043836"/>
<feature id="org.eclipse.babel.nls_eclipse_fr" version="4.4.0.v20141223043836"/>
<feature id="org.eclipse.babel.nls_eclipse_ja" version="4.4.0.v20141223043836"/>
<feature id="org.eclipse.babel.nls_eclipse_es" version="4.6.0.v20161126060001"/>
<feature id="org.eclipse.babel.nls_eclipse_fr" version="4.6.0.v20161126060001"/>
<feature id="org.eclipse.babel.nls_eclipse_ja" version="4.6.0.v20161126060001"/>
</features>
<configurations>
......
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.bonitasoft.eclipse.platform.patch</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.bonitasoft.eclipse.platform.patch"
label="Eclipse Platform patch"
version="7.4.0.qualifier"
provider-name="Bonitasoft S.A.">
<description>
Patch of Eclipse platform feature to patch org.eclipse.ui.views.properties.tabbed
</description>
<copyright>
Copyright (C) 2015 Bonitasoft S.A.
Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
This program is free software: you can redistribute it and/or
modify
it under the terms of the GNU General Public License as published
by
the Free Software Foundation, either version 2.0 of the License,
or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</copyright>
<license url="">
Copyright (C) 2015 Bonitasoft S.A.
Bonitasoft, 31 rue Gustave Eiffel - 38000 Grenoble
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2.0 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</license>
<requires>
<import feature="org.eclipse.platform" version="4.4.0.v20140925-0400" patch="true"/>
</requires>
<plugin
id="org.eclipse.ui.views.properties.tabbed"
download-size="0"
install-size="0"
version="3.6.100.v20140519-0906"
unpack="false"/>
</feature>
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.bonitasoft.studio.bundles</groupId>
<version>7.3.1-SNAPSHOT</version>
<artifactId>features</artifactId>
</parent>
<groupId>org.bonitasoft.studio.bundles.features</groupId>
<artifactId>org.bonitasoft.eclipse.platform.patch</artifactId>
<packaging>eclipse-feature</packaging>
</project>
......@@ -45,30 +45,36 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</license>
<includes
id="org.codehaus.groovy24.feature"
version="0.0.0"/>
<includes
id="org.codehaus.groovy.jdt.patch"
version="0.0.0"/>
<includes
id="org.codehaus.groovy.compilerless.feature"
version="0.0.0"/>
<includes
id="org.eclipse.jdt"
version="0.0.0"/>
<includes
id="org.eclipse.emf.edapt.runtime.feature"
version="1.2.2.201705070604"/>
<requires>
<import feature="org.eclipse.rcp" version="4.3.1.v20130911-1000" match="greaterOrEqual"/>
<import feature="org.eclipse.rcp" version="4.7.0.v20170612-1255" match="greaterOrEqual"/>
<import feature="platform-specific-feature" version="7.6.0" match="equivalent"/>
<import feature="org.eclipse.m2m.qvt.oml" version="3.4.0.v20140610-1621"/>
<import feature="org.eclipse.m2m.qvt.oml.runtime" version="3.4.0.v20140610-1621"/>
<import feature="org.eclipse.wst.web_ui.feature" version="3.6.1.v201409112028"/>
<import feature="org.eclipse.e4.rcp" version="1.3.100.v20140909-1633"/>
<import feature="org.eclipse.gmf" version="1.8.1.201408201453"/>
<import feature="org.eclipse.m2m.qvt.oml" version="3.7.0.v20170604-1316"/>
<import feature="org.eclipse.m2m.qvt.oml.runtime" version="3.7.0.v20170604-1316"/>
<import feature="org.eclipse.wst.web_ui.feature" version="3.9.0.v201706011953"/>
<import feature="org.eclipse.e4.rcp" version="1.6.0.v20170612-1255"/>
<import feature="org.eclipse.gmf" version="1.11.0.201706061437"/>
</requires>
<plugin
id="org.eclipse.jdt.groovy.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.emf.edapt.migration"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.bonitasoft.studio"
download-size="0"
......@@ -440,19 +446,6 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
version="0.0.0"
unpack="false"/>
<plugin
id="org.codehaus.groovy.eclipse.dsl"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.codehaus.groovy"
download-size="0"
install-size="0"
version="2.4.300.xx-201509250011-e44"/>
<plugin
id="org.objectweb.asm"
download-size="0"
......@@ -474,20 +467,6 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.emf.edapt.common"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.eclipse.osgi.compatibility.plugins"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.osgi.compatibility.state"
download-size="0"
......@@ -578,7 +557,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
id="org.eclipse.ui.views.properties.tabbed"
download-size="0"
install-size="0"
version="3.6.100.v20140519-0906"
version="3.8.0.v20170516-1617"
unpack="false"/>
<plugin
......
......@@ -38,7 +38,7 @@
</property>
<property
name="startupMessageRect"
value="223,220,250,25">
value="0,0,0,0">
</property>
<property
name="cssTheme"
......
......@@ -5,39 +5,39 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.application.views;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.gef.ui.parts.TreeViewer;
import org.eclipse.gmf.runtime.diagram.ui.internal.editparts.DiagramRootTreeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.internal.views.ViewsPlugin;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.views.contentoutline.ContentOutline;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
public class BonitaContentOutlineTreeView extends ContentOutline{
public class BonitaContentOutlineTreeView extends ContentOutline {
public static final String VIEW_ID ="org.bonitasoft.studio.views.overview.tree"; //$NON-NLS-1$
/* (non-Javadoc)
public static final String VIEW_ID = "org.bonitasoft.studio.views.overview.tree"; //$NON-NLS-1$
/*
* (non-Javadoc)
* @see org.eclipse.ui.views.contentoutline.ContentOutline#doCreatePage(org.eclipse.ui.IWorkbenchPart)
*/
@Override
protected PageRec doCreatePage(IWorkbenchPart part) {
Object obj = ViewsPlugin.getAdapter(part, IContentOutlinePage.class, false);
Object obj = Adapters.adapt(part, IContentOutlinePage.class, false);
if (obj instanceof IContentOutlinePage && part instanceof DiagramEditor) {
TreeViewer viewer = new TreeViewer();
viewer.setRootEditPart(new DiagramRootTreeEditPart());
IContentOutlinePage page = new BonitaTreeOutlinePage(viewer,(DiagramEditor) part);
IContentOutlinePage page = new BonitaTreeOutlinePage(viewer, (DiagramEditor) part);
if (page instanceof IPageBookViewPage) {
initPage((IPageBookViewPage) page);
}
......@@ -49,7 +49,7 @@ public class BonitaContentOutlineTreeView extends ContentOutline{
@Override
public void partClosed(IWorkbenchPart part) {
if(part instanceof DiagramEditor){
if (part instanceof DiagramEditor) {
super.partClosed(part);
}
}
......
package org.bonitasoft.studio.application.views;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.internal.views.ViewsPlugin;
import org.eclipse.ui.views.contentoutline.ContentOutline;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
public class BonitaContentOutlineView extends ContentOutline {
public static final String VIEW_ID ="org.bonitasoft.studio.views.overview"; //$NON-NLS-1$
public static final String VIEW_ID = "org.bonitasoft.studio.views.overview"; //$NON-NLS-1$
@Override
protected PageRec doCreatePage(IWorkbenchPart part) {
Object obj = ViewsPlugin.getAdapter(part, IContentOutlinePage.class, false);
Object obj = Adapters.adapt(part, IContentOutlinePage.class, false);
if (obj instanceof IContentOutlinePage && part instanceof DiagramEditor) {
return super.doCreatePage(part);
}
......
/**
* Copyright (C) 2009 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
......@@ -21,10 +18,10 @@ import org.bonitasoft.studio.common.perspectives.BonitaPerspectivesUtils;
import org.bonitasoft.studio.common.views.BonitaPropertiesBrowserPage;
import org.bonitasoft.studio.model.process.diagram.form.part.FormDiagramEditor;
import org.bonitasoft.studio.model.process.diagram.part.ProcessDiagramEditor;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.views.ViewsPlugin;
import org.eclipse.ui.part.IContributedContentsView;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.PageBookView;
......@@ -37,9 +34,10 @@ import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributo
* @author Romain Bioteau
* implements IContributedContentsView to have a "better" empty view
*/
public abstract class BonitaPropertiesView extends PropertySheet implements IContributedContentsView{
public abstract class BonitaPropertiesView extends PropertySheet implements IContributedContentsView {
/* (non-Javadoc)
/*
* (non-Javadoc)
* Method declared on PageBookView.
*/
@Override
......@@ -47,16 +45,16 @@ public abstract class BonitaPropertiesView extends PropertySheet implements ICon
// Get a custom property sheet page but not if the part is also a
// PropertySheet. In this case the child property sheet would
// accidentally reuse the parent's property sheet page.
if(part instanceof PropertySheet) {
if (part instanceof PropertySheet) {
return null;
}
IPropertySheetPage page;
/*Use our own PropertySheetPage depending on the view */
if(part instanceof ProcessDiagramEditor
|| part instanceof FormDiagramEditor){
page = getBonitaPropertiesBrowserPage((ITabbedPropertySheetPageContributor)part);
/* Use our own PropertySheetPage depending on the view */
if (part instanceof ProcessDiagramEditor
|| part instanceof FormDiagramEditor) {
page = getBonitaPropertiesBrowserPage((ITabbedPropertySheetPageContributor) part);
} else {
page = (IPropertySheetPage) ViewsPlugin.getAdapter(part,
page = (IPropertySheetPage) Adapters.adapt(part,
IPropertySheetPage.class, false);
}
......@@ -79,7 +77,8 @@ public abstract class BonitaPropertiesView extends PropertySheet implements ICon
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
}
/* (non-Javadoc)
/*
* (non-Javadoc)
* @see org.eclipse.ui.views.properties.PropertySheet#isImportant(org.eclipse.ui.IWorkbenchPart)
*/
@Override
......@@ -94,10 +93,12 @@ public abstract class BonitaPropertiesView extends PropertySheet implements ICon
protected IWorkbenchPart getBootstrapPart() {
IWorkbenchPage page = getSite().getPage();
//TODO: find a cleaner way to initialize the multiple Property views
/* by setting the focus here to the editor,
/*
* by setting the focus here to the editor,
* the getSelection that initialize the bootstrapSelection in the super
* will return the selection of the editor as we want instead of no selection*/
if(page != null && page.getActiveEditor() != null){
* will return the selection of the editor as we want instead of no selection
*/
if (page != null && page.getActiveEditor() != null) {
page.getActiveEditor().setFocus();
}
return super.getBootstrapPart();
......
......@@ -11,7 +11,8 @@ Export-Package: org.bonitasoft.studio.businessobject.core.operation,
org.bonitasoft.studio.businessobject.i18n;x-friends:="org.bonitasoft.studio.tests",
org.bonitasoft.studio.businessobject.ui,
org.bonitasoft.studio.businessobject.ui.expression,
org.bonitasoft.studio.businessobject.ui.wizard
org.bonitasoft.studio.businessobject.ui.wizard,
org.bonitasoft.studio.businessobject.ui.wizard.editingsupport
Require-Bundle: org.bonitasoft.studio.engine;bundle-version="1.0.0",
org.bonitasoft.studio.model;bundle-version="1.0.0",
org.bonitasoft.studio.common;bundle-version="1.0.0",
......
......@@ -18,6 +18,7 @@ import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -43,8 +44,8 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IWorkbenchPart;
import com.google.common.io.ByteSource;
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
/**
* @author Romain Bioteau
......@@ -171,7 +172,7 @@ public class BusinessObjectModelFileStore extends AbstractFileStore {
if (file != null) {
final File to = new File(targetAbsoluteFilePath);
to.mkdirs();
final File target = new File(to,ZIP_FILENAME);
final File target = new File(to, ZIP_FILENAME);
if (target.exists()) {
if (FileActionDialog.overwriteQuestion(file.getName())) {
PlatformUtil.delete(target, Repository.NULL_PROGRESS_MONITOR);
......@@ -179,7 +180,9 @@ public class BusinessObjectModelFileStore extends AbstractFileStore {
return;
}
}
Files.copy(ByteStreams.newInputStreamSupplier(toByteArray()), target);
try (InputStream inputStream = ByteSource.wrap(toByteArray()).openBufferedStream();) {
Files.copy(inputStream, target.toPath());
}
}
}
......
......@@ -18,7 +18,6 @@ import static com.google.common.collect.Iterables.find;
import static com.google.common.collect.Iterators.forArray;
import static com.google.common.collect.Lists.newArrayList;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
......@@ -60,10 +59,9 @@ import org.eclipse.swt.graphics.Image;
import org.xml.sax.SAXException;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
import com.google.common.io.ByteSource;
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
import com.google.common.io.InputSupplier;
/**
* @author Romain Bioteau
......@@ -78,6 +76,8 @@ public class BusinessObjectModelRepositoryStore extends AbstractRepositoryStore<
private static final String BDM_CLIENT_POJO_JAR_NAME = "bdm-client-pojo.jar";
private BusinessObjectModelConverter converter = new BusinessObjectModelConverter();
static {
extensions.add(BDM_TYPE_EXTENSION);
}
......@@ -155,8 +155,9 @@ public class BusinessObjectModelRepositoryStore extends AbstractRepositoryStore<
try {
final BusinessObjectModelConverter converter = new BusinessObjectModelConverter();
final BusinessObjectModel businessObjectModel = converter.unzip(ByteStreams.toByteArray(inputStream));
final InputSupplier<ByteArrayInputStream> inputSupplier = ByteStreams.newInputStreamSupplier(converter.marshall(businessObjectModel));
fileStore = superDoImportInputStream(BusinessObjectModelFileStore.BOM_FILENAME, inputSupplier.getInput());
try (InputStream is = ByteSource.wrap(converter.marshall(businessObjectModel)).openBufferedStream()) {
fileStore = superDoImportInputStream(BusinessObjectModelFileStore.BOM_FILENAME, is);
}
} catch (IOException | JAXBException | SAXException e) {
BonitaStudioLog.error("Failed to import Business data model", e);
}
......@@ -174,16 +175,20 @@ public class BusinessObjectModelRepositoryStore extends AbstractRepositoryStore<
public void migrate(IProgressMonitor monitor) throws CoreException, MigrationException {
super.migrate(monitor);
final BusinessObjectModelFileStore fStore = getChild(BusinessObjectModelFileStore.ZIP_FILENAME);
if(fStore != null){
if (fStore != null) {
final File legacyBDM = fStore.getResource().getLocation().toFile();
BusinessObjectModel businessObjectModel;
try {
final BusinessObjectModelConverter converter = new BusinessObjectModelConverter();
final BusinessObjectModel businessObjectModel = converter.unzip( Files.toByteArray(legacyBDM) );
final InputSupplier<ByteArrayInputStream> inputSupplier = ByteStreams.newInputStreamSupplier(converter.marshall(businessObjectModel));
doImportInputStream(BusinessObjectModelFileStore.BOM_FILENAME, inputSupplier.getInput());
} catch (IOException | JAXBException | SAXException e) {
businessObjectModel = converter.unzip(Files.toByteArray(legacyBDM));
try (InputStream is = ByteSource.wrap(converter.marshall(businessObjectModel)).openBufferedStream()) {
doImportInputStream(BusinessObjectModelFileStore.BOM_FILENAME, is);
} catch (IOException e) {
throw new MigrationException("Failed to migrate Business data model", e);
}
} catch (IOException | JAXBException | SAXException e1) {
throw new MigrationException("Failed to migrate Business data model", e1);
}
fStore.getResource().delete(true, monitor);
}
}
......@@ -242,12 +247,20 @@ public class BusinessObjectModelRepositoryStore extends AbstractRepositoryStore<
protected IRegion regionWithBDM(final IJavaProject javaProject) throws JavaModelException {
final IRegion newRegion = JavaCore.newRegion();
final IClasspathEntry repositoryDependenciesClasspathEntry = find(asIterable(javaProject.getRawClasspath()), repositoryDependenciesEntry(), null);
final IPackageFragmentRoot[] fragmentRoots = javaProject.findPackageFragmentRoots(repositoryDependenciesClasspathEntry);
final IPackageFragmentRoot packageFragmentRoot = find(asIterable(fragmentRoots), withElementName(BDM_CLIENT_POJO_JAR_NAME), null);
IClasspathEntry[] rawClasspath = javaProject.getRawClasspath();
if (rawClasspath != null) {
final IClasspathEntry repositoryDependenciesClasspathEntry = find(asIterable(rawClasspath),
repositoryDependenciesEntry(), null);
final IPackageFragmentRoot[] fragmentRoots = javaProject
.findPackageFragmentRoots(repositoryDependenciesClasspathEntry);
if (fragmentRoots != null) {
final IPackageFragmentRoot packageFragmentRoot = find(asIterable(fragmentRoots),
withElementName(BDM_CLIENT_POJO_JAR_NAME), null);