Commit 077dd620 authored by Romain Bioteau's avatar Romain Bioteau Committed by GitHub
Browse files

tr(eclipse) update tp to 4.10 (#1537)

Closes BST-10
parent 5bb1e063
......@@ -9,11 +9,9 @@
<launcherArgs>
<vmArgs>-Xmx512m -Xms512m -Dosgi.requiredJavaVersion=1.8 -Dfile.encoding=UTF8
</vmArgs>
<vmArgsLin>-Djava.endorsed.dirs=endorsed
</vmArgsLin>
<vmArgsMac>-XstartOnFirstThread -Djava.endorsed.dirs=./endorsed
<vmArgsMac>-XstartOnFirstThread
</vmArgsMac>
<vmArgsWin>-Dgreclipse.nonlocking=true -Djava.endorsed.dirs=endorsed
<vmArgsWin>-Dgreclipse.nonlocking=true
</vmArgsWin>
</launcherArgs>
......@@ -41,7 +39,7 @@
<license>
<url>http://www.gnu.org/licenses/gpl-2.0.html</url>
<text>
Copyright (C) 2018 BonitaSoft S.A.
Copyright (C) 2019 BonitaSoft S.A.
BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
This program is free software: you can redistribute it and/or modify
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</license>
<requires>
<import feature="org.eclipse.rcp" version="3.7.1.r37x_v20110729-9DB5FmNFnFLSFCtLxnRfMqt15A4A" match="greaterOrEqual"/>
<import feature="org.eclipse.rcp" version="4.10.0.v20181206-0815" match="greaterOrEqual"/>
</requires>
<plugin
......@@ -59,16 +59,6 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.core.filesystem.linux.x86"
os="linux"
arch="x86"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.core.filesystem.win32.x86_64"
os="win32"
......@@ -79,16 +69,6 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.core.filesystem.win32.x86"
os="win32"
arch="x86"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
<plugin
id="org.eclipse.core.filesystem.macosx"
os="macosx"
......
......@@ -63,7 +63,7 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<includes
id="org.eclipse.emf.edapt.runtime.feature"
version="1.2.2.201705070604"/>
version="1.3.1.201812130816"/>
<includes
id="org.eclipse.equinox.p2.extras.feature"
......@@ -114,19 +114,39 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
version="0.0.0"/>
<includes
id="org.eclipse.emf.compare.rcp.ui"
id="org.eclipse.babel.nls_eclipse_pt_BR"
version="0.0.0"/>
<includes
id="org.eclipse.babel.nls_technology.egit_pt_BR"
version="0.0.0"/>
<includes
id="org.eclipse.babel.nls_technology.jgit_pt_BR"
version="0.0.0"/>
<includes
id="org.eclipse.babel.nls_technology.recommenders_pt_BR"
version="0.0.0"/>
<includes
id="org.eclipse.babel.nls_webtools_pt_BR"
version="0.0.0"/>
<requires>
<import feature="org.eclipse.rcp" version="4.7.0.v20170612-1255" match="greaterOrEqual"/>
<import feature="org.eclipse.rcp" version="4.10.0.v20181206-0815" match="greaterOrEqual"/>
<import feature="platform-specific-feature" version="7.9.0" match="equivalent"/>
<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"/>
<import feature="org.eclipse.wst.web_ui.feature" version="3.11.0.v201811192212" match="greaterOrEqual"/>
<import feature="org.eclipse.gmf" version="1.12.0.201806010809" match="greaterOrEqual"/>
</requires>
<plugin
id="org.eclipse.equinox.ds"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.bonitasoft.studio"
download-size="0"
......@@ -536,7 +556,21 @@ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
unpack="false"/>
<plugin
id="org.eclipse.ui.views.properties.tabbed"
id="javax.activation"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.xml.bind"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="javax.annotation"
download-size="0"
install-size="0"
version="0.0.0"
......
......@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
......@@ -4,4 +4,5 @@ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-test/java"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.bonitasoft.studio.preferences"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
......@@ -4,4 +4,5 @@ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
......@@ -66,7 +66,8 @@ Require-Bundle: org.bonitasoft.studio.diagram,
org.bonitasoft.studio.ui;bundle-version="7.9.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Import-Package: javax.inject;version="1.0.0",
Import-Package: javax.annotation;version="1.2.0",
javax.inject;version="1.0.0",
org.bonitasoft.engine.api,
org.bonitasoft.engine.bpm.bar,
org.bonitasoft.engine.exception,
......
......@@ -1231,9 +1231,12 @@
<viewerContentBinding
viewerId="org.bonitasoft.studio.application.project.explorer">
<includes>
<contentExtension
<contentExtension
pattern="org.bonitasoft.studio.application.navigatorContent">
</contentExtension>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.nested.nestedProjectContentProvider">
</contentExtension>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.linkHelper">
</contentExtension>
......@@ -1249,9 +1252,6 @@
<contentExtension
pattern="org.bonitasoft.studio.application.project.explorer.filters.*">
</contentExtension>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.nested.nestedProjectContentProvider">
</contentExtension>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.nested.HideFolderWhenProjectIsShownAsNested">
</contentExtension>
......@@ -1279,7 +1279,8 @@
contentProvider="org.bonitasoft.studio.application.views.provider.BonitaExplorerContentProvider"
id="org.bonitasoft.studio.application.navigatorContent"
labelProvider="org.bonitasoft.studio.application.views.provider.BonitaExplorerLabelProvider"
name="Bonita Project Explorer Content">
name="Bonita Project Explorer Content"
priority="highest">
<triggerPoints>
<or>
<adapt type="org.eclipse.core.resources.IProject" >
......
......@@ -42,6 +42,7 @@ import org.bonitasoft.studio.model.process.impl.ContractInputImpl;
import org.codehaus.groovy.eclipse.dsl.DSLPreferences;
import org.codehaus.groovy.eclipse.dsl.DSLPreferencesInitializer;
import org.codehaus.groovy.eclipse.dsl.GroovyDSLCoreActivator;
import org.codehaus.groovy.eclipse.launchers.GroovyConsoleLineTracker;
import org.eclipse.core.internal.databinding.beans.BeanPropertyHelper;
import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.ResourcesPlugin;
......@@ -407,6 +408,8 @@ public class BonitaStudioWorkbenchAdvisor extends WorkbenchAdvisor implements IS
disableInternalWebBrowser();
disableGroovyDSL();
initXMLandHTMLValidationPreferences();
//Avoid deadlock and thread timeout at startup
new GroovyConsoleLineTracker();
repositoryAccessor.start(monitor);
executeContributions();
......
......@@ -51,6 +51,7 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.internal.PartSite;
......@@ -63,241 +64,241 @@ import org.eclipse.ui.views.properties.IPropertySheetPage;
public class BonitaProjectExplorer extends CommonNavigator {
public static final String ID = "org.bonitasoft.studio.application.project.explorer";
@Inject
private RepositoryAccessor repositoryAccessor;
private JobChangeAdapter openIntroListener = new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
Job job = event.getJob();
if (Objects.equals(job.getName(), getTitle())) {
PlatformUtil.openIntroIfNoOtherEditorOpen();
}
}
};
@Override
protected Object getInitialInput() {
return repositoryAccessor.getWorkspace().getRoot();
}
public BonitaProjectExplorer() {
super();
}
@Override
public void createPartControl(Composite aParent) {
super.createPartControl(aParent);
setLinkingEnabled(true);
activateNestedProjectsState();
getNavigatorContentService().bindExtensions(
new String[] { "org.bonitasoft.studio.application.extendedResourceLinkHelper" },
false);
initContextMenu();
getCommonViewer().expandToLevel(2);
Job.getJobManager().addJobChangeListener(openIntroListener);
}
@Override
public void dispose() {
if (openIntroListener != null) {
Job.getJobManager().removeJobChangeListener(openIntroListener);
}
super.dispose();
}
private void initContextMenu() {
TreeViewer commonViewer = getCommonViewer();
Menu previousMenu = commonViewer.getTree().getMenu();
//Remove menu created by default
if (previousMenu != null) {
previousMenu.dispose();
}
MenuManager menuMgr = new MenuManager(getNavigatorContentService()
.getViewerDescriptor().getPopupMenuId());
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(manager -> fillContextMenu(manager));
Menu menu = menuMgr.createContextMenu(commonViewer.getTree());
commonViewer.getTree().setMenu(menu);
IEclipseContext e4Context = ((PartSite) getSite()).getContext();
new CustomPopupMenuExtender(ID, menuMgr, getSite().getSelectionProvider(), getSite().getPart(), e4Context, true);
}
protected void fillContextMenu(IMenuManager aMenuManager) {
ISelection selection = getCommonViewer().getSelection();
NavigatorActionService navigatorActionService = getNavigatorActionService();
navigatorActionService.setContext(new ActionContext(selection));
navigatorActionService.fillContextMenu(aMenuManager);
}
private void activateNestedProjectsState() {
getNavigatorContentService().getActivationService().activateExtensions(
new String[] { "org.eclipse.ui.navigator.resources.nested.nestedProjectContentProvider" },
false);
List<String> activeFilters = Arrays
.asList(getNavigatorContentService().getFilterService().getVisibleFilterDescriptors()).stream()
.filter(ICommonFilterDescriptor::isActiveByDefault)
.map(ICommonFilterDescriptor::getId)
.collect(Collectors.toList());
activeFilters.add("org.eclipse.ui.navigator.resources.nested.HideFolderWhenProjectIsShownAsNested");
getNavigatorContentService().getFilterService()
.activateFilterIdsAndUpdateViewer((activeFilters.toArray(new String[activeFilters.size()])));
}
@Override
protected CommonViewer createCommonViewerObject(Composite aParent) {
CommonViewer commonViewer = new PackageExplorerProblemTreeViewer(getViewSite().getId(), aParent,
SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
commonViewer.getTree().setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY,
"org.bonitasoft.studio.application.projectExplorerTree");
commonViewer.addFilter(UIDArtifactFilters.filterUIDArtifactChildren());
return commonViewer;
}
@Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter == IPropertySheetPage.class) {
return null;
}
return super.getAdapter(adapter);
}
private class PackageExplorerProblemTreeViewer extends ProblemTreeViewer {
// fix for 64372 Projects showing up in Package Explorer twice [package explorer]
private final List<Object> fPendingRefreshes;
public PackageExplorerProblemTreeViewer(String id, Composite parent, int style) {
super(id, parent, style);
fPendingRefreshes = Collections.synchronizedList(new ArrayList<>());
initizialize();
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.navigator.CommonViewer#init()
*/
@Override
protected void init() {
}
protected void initizialize() {
setUseHashlookup(true);
setContentProvider(getNavigatorContentService().createCommonContentProvider());
setLabelProvider(new NavigatorDecoratingLabelProvider(getNavigatorContentService().createCommonLabelProvider()));
initDragAndDrop();
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.navigator.CommonViewer#initDragAndDrop()
*/
@Override
protected void initDragAndDrop() {
}
@Override
public void add(Object parentElement, Object[] childElements) {
if (fPendingRefreshes.contains(parentElement)) {
return;
}
super.add(parentElement, childElements);
}
@Override
protected void internalRefresh(Object element, boolean updateLabels) {
if (!getTree().isDisposed()) {
try {
fPendingRefreshes.add(element);
super.internalRefresh(element, updateLabels);
} finally {
fPendingRefreshes.remove(element);
}
}
}
@Override
protected boolean evaluateExpandableWithFilters(Object parent) {
if (parent instanceof IJavaProject
|| parent instanceof ICompilationUnit || parent instanceof IClassFile
|| parent instanceof ClassPathContainer) {
return false;
}
if (parent instanceof IPackageFragmentRoot && ((IPackageFragmentRoot) parent).isArchive()) {
return false;
}
return true;
}
@Override
protected boolean isFiltered(Object object, Object parent, ViewerFilter[] filters) {
boolean res = super.isFiltered(object, parent, filters);
if (res && isEssential(object)) {
return false;
}
return res;
}
/*
* Checks if a filtered object in essential (i.e. is a parent that
* should not be removed).
*/
private boolean isEssential(Object object) {
try {
if (object instanceof IPackageFragment) {
IPackageFragment fragment = (IPackageFragment) object;
if (!fragment.isDefaultPackage() && fragment.hasSubpackages()) {
return hasFilteredChildren(fragment);
}
}
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
return false;
}
@Override
protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) {
IStructuredSelection is = (IStructuredSelection) invalidSelection;
List<Object> ns = null;
if (newSelection instanceof IStructuredSelection) {
ns = new ArrayList<Object>(((IStructuredSelection) newSelection).toList());
} else {
ns = new ArrayList<>();
}
boolean changed = false;
for (Iterator<?> iter = is.iterator(); iter.hasNext();) {
Object element = iter.next();
if (element instanceof IJavaProject) {
IProject project = ((IJavaProject) element).getProject();
if (!project.isOpen() && project.exists()) {
ns.add(project);
changed = true;
}
} else if (element instanceof IProject) {
IProject project = (IProject) element;
if (project.isOpen()) {
IJavaProject jProject = JavaCore.create(project);
if (jProject != null && jProject.exists()) {
ns.add(jProject);
}
changed = true;
}
}
}
if (changed) {
newSelection = new StructuredSelection(ns);
setSelection(newSelection);
}
super.handleInvalidSelection(invalidSelection, newSelection);
}
}
public static final String ID = "org.bonitasoft.studio.application.project.explorer";
@Inject
private RepositoryAccessor repositoryAccessor;
private JobChangeAdapter openIntroListener = new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
Job job = event.getJob();
if (Objects.equals(job.getName(), getTitle())) {
PlatformUtil.openIntroIfNoOtherEditorOpen();
}
}
};
@Override
protected Object getInitialInput() {
return repositoryAccessor.getWorkspace().getRoot();
}
public BonitaProjectExplorer() {
super();
}
@Override
public void createPartControl(Composite aParent) {
super.createPartControl(aParent);
setLinkingEnabled(true);
activateNestedProjectsState();
getNavigatorContentService().bindExtensions(
new String[] { "org.bonitasoft.studio.application.extendedResourceLinkHelper" }, false);
initContextMenu();
getCommonViewer().expandToLevel(2);
Job.getJobManager().addJobChangeListener(openIntroListener);
}
@Override
public void dispose() {
if (openIntroListener != null) {
Job.getJobManager().removeJobChangeListener(openIntroListener);
}
super.dispose();
}
private void initContextMenu() {
TreeViewer commonViewer = getCommonViewer();
Menu previousMenu = commonViewer.getTree().getMenu();
// Remove menu created by default
if (previousMenu != null) {
previousMenu.dispose();
}
MenuManager menuMgr = new MenuManager(getNavigatorContentService().getViewerDescriptor().getPopupMenuId(