From: Bruno Sinou Date: Thu, 18 Nov 2010 11:36:49 +0000 (+0000) Subject: fix bug on excel to insure multi-os compatibility X-Git-Tag: argeo-slc-2.1.7~1083 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;ds=sidebyside;h=c871d4aadd7f493b587c3ede2994f8799de63791;p=gpl%2Fargeo-slc.git fix bug on excel to insure multi-os compatibility git-svn-id: https://svn.argeo.org/slc/trunk@3909 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/eclipse/plugins/runtime/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/contentprovider/ResultDetailContentProvider.java b/eclipse/plugins/runtime/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/contentprovider/ResultDetailContentProvider.java index fef065ea5..36c963266 100644 --- a/eclipse/plugins/runtime/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/contentprovider/ResultDetailContentProvider.java +++ b/eclipse/plugins/runtime/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/contentprovider/ResultDetailContentProvider.java @@ -80,8 +80,8 @@ public class ResultDetailContentProvider implements ITreeContentProvider { // We create intermediate folders if needed for (int i = 0; i < pathes.length; i++) { - if (log.isDebugEnabled()) - log.debug("i = " + i + " - " + pathes[i]); + // if (log.isDebugEnabled()) + // log.debug("i = " + i + " - " + pathes[i]); if (curTreeParent.getChildByName(pathes[i]) == null) { ResultTreeParent child = new ResultTreeParent(pathes[i]); diff --git a/eclipse/plugins/runtime/org.argeo.slc.client.ui/META-INF/MANIFEST.MF b/eclipse/plugins/runtime/org.argeo.slc.client.ui/META-INF/MANIFEST.MF index 4b932e3f2..679ac0771 100644 --- a/eclipse/plugins/runtime/org.argeo.slc.client.ui/META-INF/MANIFEST.MF +++ b/eclipse/plugins/runtime/org.argeo.slc.client.ui/META-INF/MANIFEST.MF @@ -11,14 +11,14 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5 Export-Package: org.argeo.slc.client.ui.listeners, org.argeo.slc.client.ui.perspectives, org.argeo.slc.client.ui.views -Import-Package: org.argeo.slc.client.ui, - org.apache.commons.io;version="1.4.0", +Import-Package: org.apache.commons.io;version="1.4.0", org.apache.commons.logging;version="1.1.1", org.argeo.eclipse.spring, org.argeo.eclipse.ui, org.argeo.slc, org.argeo.slc.build, org.argeo.slc.client.oxm, + org.argeo.slc.client.ui, org.argeo.slc.core.attachment, org.argeo.slc.core.execution, org.argeo.slc.core.runtime, @@ -35,6 +35,7 @@ Import-Package: org.argeo.slc.client.ui, org.argeo.slc.services, org.argeo.slc.services.impl, org.argeo.slc.test, + org.eclipse.core.expressions, org.springframework.beans.factory, org.springframework.context, org.springframework.core.io.support diff --git a/eclipse/plugins/runtime/org.argeo.slc.client.ui/plugin.xml b/eclipse/plugins/runtime/org.argeo.slc.client.ui/plugin.xml index fa05ca859..fb1ea90e3 100644 --- a/eclipse/plugins/runtime/org.argeo.slc.client.ui/plugin.xml +++ b/eclipse/plugins/runtime/org.argeo.slc.client.ui/plugin.xml @@ -110,6 +110,10 @@ id="org.argeo.slc.client.commands.resultUuid" name="Result UUID"> + + params = new HashMap(); + params.put(UUID_PARAM_ID, selectedRa.getUuid()); + params.put(NAME_PARAM_ID, + (selectedRa.getAttributes().get("testCase") == null) ? null + : selectedRa.getAttributes().get("testCase")); + contributionItemParameter.parameters = params; + + CommandContributionItem cci = new CommandContributionItem( + contributionItemParameter); + cci.setId(cmdId); + menuManager.add(cci); + } + + private void contextMenuAboutToShow(IMenuManager menuManager) { + + IContributionItem[] items = menuManager.getItems(); + IWorkbenchWindow window = ClientUiPlugin.getDefault().getWorkbench() + .getActiveWorkbenchWindow(); + + refreshCommand(menuManager, window, DISPLAY_CMD_ID, + "Display as a tree", "icons/result_details.gif"); + // We only show this command on windows OS + if (PLATFORM.equals("win32") || PLATFORM.equals("wpf")) { + refreshCommand(menuManager, window, DISPLAY_AS_XLS_CMD_ID, + "Display with Excel", "icons/excel.png"); + } + refreshCommand(menuManager, window, SAVE_AS_XLS_CMD_ID, + "Save as Excel file", "icons/excel.png"); + } + + // Providers + protected static class ViewContentProvider implements IStructuredContentProvider { @@ -142,8 +225,11 @@ public class ResultListView extends ViewPart { ResultAttributes ra = (ResultAttributes) obj; switch (index) { case 0: - return getText(ra.getCloseDate()); + return (ra.getAttributes().get("testCase") == null) ? null : ra + .getAttributes().get("testCase"); case 1: + return dateFormatter.format(ra.getCloseDate()); + case 2: return ra.getUuid(); } return getText(obj); @@ -186,7 +272,6 @@ public class ResultListView extends ViewPart { if (obj instanceof ResultAttributes) { ResultAttributes ra = (ResultAttributes) obj; - IWorkbench iw = ClientUiPlugin.getDefault().getWorkbench(); IHandlerService handlerService = (IHandlerService) iw .getService(IHandlerService.class);