From 6e87a72310ed71a5d4db3084f2b937ef5e3251d8 Mon Sep 17 00:00:00 2001 From: msrocka Date: Thu, 14 Aug 2014 11:26:17 +0200 Subject: [PATCH] put Eclipse 4.4 changes on top of current master which uses Eclipse 3.8 --- olca-app-runtime/build.xml | 54 +-- olca-app/openLCA.product | 409 ++++++++++++---- .../app/components/charts/ChartViewer.java | 2 +- .../src/org/openlca/app/rcp/RcpActivator.java | 1 + .../org/openlca/app/rcp/WorkbenchLayout.java | 58 +++ .../src/org/openlca/app/rcp/workbench.xmi | 442 ++++++++++++++++++ 6 files changed, 845 insertions(+), 121 deletions(-) create mode 100644 olca-app/src/org/openlca/app/rcp/WorkbenchLayout.java create mode 100644 olca-app/src/org/openlca/app/rcp/workbench.xmi diff --git a/olca-app-runtime/build.xml b/olca-app-runtime/build.xml index 2d4680a8b..747ea26e4 100644 --- a/olca-app-runtime/build.xml +++ b/olca-app-runtime/build.xml @@ -28,37 +28,37 @@ --> - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -67,8 +67,8 @@ - - + + @@ -81,19 +81,19 @@ - + - + - + - + @@ -102,7 +102,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -120,7 +120,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -145,7 +145,7 @@ - + diff --git a/olca-app/openLCA.product b/olca-app/openLCA.product index 408d23b1a..54f071d65 100644 --- a/olca-app/openLCA.product +++ b/olca-app/openLCA.product @@ -6,9 +6,9 @@ - openLCA 1.4.0 + openLCA 1.4 -Copyright (c) 2007 - 2013 GreenDelta. All rights reserved. +Copyright (c) 2007 - 2014 GreenDelta. All rights reserved. Visit http://openlca.org and http://greendelta.com This product includes software developed in the openLCA @@ -22,9 +22,12 @@ project and other open source software. -nl en --data @noDefault - -Xmx1024M - -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts +-data @noDefault + + -Xmx1024M + + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts + @@ -51,91 +54,15 @@ en org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 - - http://www.openlca.org - - == License == - -The openLCA project makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided -to you under the terms and conditions of the Mozilla Public License -Version 1.1 ("MPL"). A copy of the MPL is available at -http://openlca.org/uploads/media/MPL-1.1.html. - -The openLCA project is maintained and coordinated by GreenDelta, -www.greendelta.com. If you did not receive this Content directly -from the openLCA project, the Content is being redistributed by -another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the -Redistributor's license that was provided with the Content. If no such -license exists, contact the Redistributor. Unless otherwise indicated -below, the terms and conditions of the MPL still apply to any source -code in the Content and such source code may be obtained at -http://sourceforge.net/projects/openlca. - -A copy of the full license text and also copies of the licenses of the -third party content can be found in the installation directory -(/licenses). - - -== MySQL Server == - -In order to work with openLCA you need a MySQL Server -(http://dev.mysql.com/). The MySQL Server is licensed under the -General Public License v2 (GPL, -http://www.gnu.org/licenses/old-licenses/gpl-2.0.html). As the GPL is -not compatible with other open source software components in the -Content, the MySQL server is NOT included or distributed with the -Content. However, you can download und install the MySQL Server with -the help of the openLCA installer or retrieve it directly from the -MySQL website. - - -== Third Party Content == - -= Apache Projects = -The Content includes software developed by the Apache Software -Foundation (http://www.apache.org). This software is licensed under -the Apache License v2.0 which can be found at -http://www.apache.org/licenses/LICENSE-2.0.txt. Original binaries and -source code are available from the respective project web-sites of the -Apache Software Foundation. - -= Eclipse Rich Client Platform = -The openLCA application is built on top of the Eclipse Rich Client -Platform and, therefore, includes plug-ins that are made available by -the Eclipse Foundation and are licensed under the Eclipse Public -License Version 1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. These plug-ins can again -contain third party content which is indicated in the legal -information of the respective plug-ins (see the plug-in details in the -application). Original binaries and source code are available from the -Eclipse website (http://eclipse.org). - -= JDOM = -JDOM is licensed under the JDOM License (BSD style). The license and -original binaries and source are available from the JDOM website -http://www.jdom.org. - -= Silk Icons = -The Silk icon set is licensed under the Creative Commons Attribution -2.5 License (http://creativecommons.org/licenses/by/2.5/legalcode) and -is available from the following website: -http://www.famfamfam.com/lab/icons/silk. - -= MySQL Connector/J = -The MySQL Connector/J is licensed under the General Public License v2 -(GPL v2) with a FOSS Exception. The GPL v2 is available at -http://www.gnu.org/licenses/old-licenses/gpl-2.0.html and the FOSS -exception at http://www.mysql.com/about/legal/licensing/foss-exception. -Original binaries and source are available from the MySQL website -http://dev.mysql.com. - - - + + + + + + @@ -148,59 +75,237 @@ http://dev.mysql.com. + + + + + + - + + + + + + + + + - - + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -209,79 +314,197 @@ http://dev.mysql.com. + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/olca-app/src/org/openlca/app/components/charts/ChartViewer.java b/olca-app/src/org/openlca/app/components/charts/ChartViewer.java index 42f5d866b..3efc3379f 100644 --- a/olca-app/src/org/openlca/app/components/charts/ChartViewer.java +++ b/olca-app/src/org/openlca/app/components/charts/ChartViewer.java @@ -163,7 +163,7 @@ public Object peerInstance() { @Override public void processAction(org.eclipse.birt.chart.model.data.Action action, - StructureSource source) { + StructureSource source, RunTimeContext arg2) { if (ActionType.SHOW_TOOLTIP_LITERAL.equals(action.getType())) { final TooltipValue tv = (TooltipValue) action.getValue(); if (StructureType.SERIES_DATA_POINT.equals(source.getType())) { diff --git a/olca-app/src/org/openlca/app/rcp/RcpActivator.java b/olca-app/src/org/openlca/app/rcp/RcpActivator.java index f260ea6d0..d86dd92dc 100644 --- a/olca-app/src/org/openlca/app/rcp/RcpActivator.java +++ b/olca-app/src/org/openlca/app/rcp/RcpActivator.java @@ -61,6 +61,7 @@ public void start(final BundleContext context) throws Exception { File workspace = Workspace.init(); log.trace("Workspace initialised at {}", workspace); LoggerConfig.setUp(); + WorkbenchLayout.initialize(workspace); log.trace("Start application. Workspace: {}.", Platform.getLocation()); log.trace("Bundle {} started", PLUGIN_ID); log.trace("Try init olca-eigen"); diff --git a/olca-app/src/org/openlca/app/rcp/WorkbenchLayout.java b/olca-app/src/org/openlca/app/rcp/WorkbenchLayout.java new file mode 100644 index 000000000..7611cbc12 --- /dev/null +++ b/olca-app/src/org/openlca/app/rcp/WorkbenchLayout.java @@ -0,0 +1,58 @@ +package org.openlca.app.rcp; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * When there is no initial workbench.xmi file in the workspace the search field + * in the tool bar is shown on the left side (seems to be an error in Eclipse + * 4.4). In order to fix this we copy a default workbench.xmi into the workspace + * folder. + */ +class WorkbenchLayout { + + private Logger log = LoggerFactory.getLogger(getClass()); + + private WorkbenchLayout() { + } + + public static void initialize(File workspace) { + new WorkbenchLayout().apply(workspace); + } + + private void apply(File workspace) { + if (!workspace.exists() || !workspace.isDirectory()) + return; + try { + log.trace("initialize workbench layout in {}", workspace); + String sep = File.separator; + String path = ".metadata" + sep + ".plugins" + sep + + "org.eclipse.e4.workbench"; + File dir = new File(workspace, path); + if (!dir.exists()) + dir.mkdirs(); + File workbenchXmi = new File(dir, "workbench.xmi"); + if (workbenchXmi.exists()) { + log.trace("{} exists", workbenchXmi); + return; + } + createXmi(workbenchXmi); + } catch (Exception e) { + log.error("failed to initialize workbench layout", e); + } + } + + private void createXmi(File workbenchXmi) throws Exception { + log.trace("create {}", workbenchXmi); + try (InputStream in = getClass().getResourceAsStream( + "workbench.xmi"); + FileOutputStream out = new FileOutputStream(workbenchXmi)) { + IOUtils.copy(in, out); + } + } +} diff --git a/olca-app/src/org/openlca/app/rcp/workbench.xmi b/olca-app/src/org/openlca/app/rcp/workbench.xmi new file mode 100644 index 000000000..2ced1fc98 --- /dev/null +++ b/olca-app/src/org/openlca/app/rcp/workbench.xmi @@ -0,0 +1,442 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + ModelMigrationProcessor.001 + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + + + newtablook + active + + + + + + newtablook + + + + + + + + + + + + View + categoryTag:General + + + + newtablook + org.eclipse.e4.primaryDataStack + EditorStack + + + + + View + categoryTag:Other + active + activeOnClose + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:General + + + + Draggable + + + toolbarSeparator + + + + stretch + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Other + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +