From 53af7f3e924d388392d26dc13add1a20031acb82 Mon Sep 17 00:00:00 2001 From: Bruno Sinou Date: Fri, 5 Nov 2010 17:27:52 +0000 Subject: [PATCH] + Clean some code + reorganize perspective + add icons... git-svn-id: https://svn.argeo.org/slc/trunk@3850 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../icons/slc_execution_perspective.gif} | Bin .../org.argeo.slc.client.rcp/plugin.xml | 5 +- .../META-INF/spring/commands.xml | 5 -- .../org.argeo.slc.client.ui/icons/batch.gif | Bin 0 -> 223 bytes .../icons/clear_batch.gif | Bin 0 -> 204 bytes .../icons/edit_parameters.gif | Bin 0 -> 204 bytes .../org.argeo.slc.client.ui/icons/error.gif | Bin 0 -> 350 bytes .../icons/execution_module.gif | Bin 0 -> 145 bytes .../org.argeo.slc.client.ui/icons/launch.gif | Bin 0 -> 318 bytes .../org.argeo.slc.client.ui/icons/passed.gif | Bin 0 -> 76 bytes .../icons/{OK.png => passed.png} | Bin .../icons/process_details.gif | Bin 0 -> 368 bytes .../icons/processes.gif | Bin 0 -> 586 bytes .../icons/processes.png | Bin 0 -> 586 bytes .../icons/remove_one.gif | Bin 0 -> 163 bytes .../icons/result_details.gif | Bin 0 -> 393 bytes .../org.argeo.slc.client.ui/icons/results.gif | Bin 0 -> 152 bytes .../org.argeo.slc.client.ui/icons/sample.gif | Bin 983 -> 0 bytes .../org.argeo.slc.client.ui/plugin.xml | 47 +++++------ .../argeo/slc/client/ui/ClientUiPlugin.java | 6 +- .../EditRealizedFlowDetailsHandler.java | 59 ------------- .../client/ui/perspectives/SlcExecution.java | 44 +++++----- .../ProcessParametersEditingSupport.java | 8 +- .../client/ui/views/ProcessBuilderView.java | 78 ++++++------------ 24 files changed, 81 insertions(+), 171 deletions(-) rename eclipse/plugins/{org.argeo.slc.client.ui/icons/slc-launch.gif => org.argeo.slc.client.rcp/icons/slc_execution_perspective.gif} (100%) create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/batch.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/clear_batch.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/edit_parameters.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/error.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/execution_module.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/launch.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/passed.gif rename eclipse/plugins/org.argeo.slc.client.ui/icons/{OK.png => passed.png} (100%) create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/process_details.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/processes.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/processes.png create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/remove_one.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/result_details.gif create mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/results.gif delete mode 100644 eclipse/plugins/org.argeo.slc.client.ui/icons/sample.gif delete mode 100644 eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/EditRealizedFlowDetailsHandler.java diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/slc-launch.gif b/eclipse/plugins/org.argeo.slc.client.rcp/icons/slc_execution_perspective.gif similarity index 100% rename from eclipse/plugins/org.argeo.slc.client.ui/icons/slc-launch.gif rename to eclipse/plugins/org.argeo.slc.client.rcp/icons/slc_execution_perspective.gif diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/plugin.xml b/eclipse/plugins/org.argeo.slc.client.rcp/plugin.xml index 8b78bb368..36f23ee95 100644 --- a/eclipse/plugins/org.argeo.slc.client.rcp/plugin.xml +++ b/eclipse/plugins/org.argeo.slc.client.rcp/plugin.xml @@ -14,9 +14,10 @@ + id="org.argeo.slc.client.ui.perspectives.slcExecution" + icon="icons/slc_execution_perspective.gif"> - - - diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/batch.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/batch.gif new file mode 100644 index 0000000000000000000000000000000000000000..b8ca14a8ba640a1122845b8804e4345daf24c8ed GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsdn-{N=Z-udGXF56B^aha7FwydIfbAR~iqKMUn5kPWPq3`lk z-({(Z8xorLH8$^UoP4zX|Nr^_@5k?-Z~y=IhyVNSXZ04}pKqV%t2!qmEX2a#|Ns9C zNI>x?3nK%AG=mOE3}hz*Ys>?+zLd;)88b5@wUTCtWfpY#2H7RP(2A7mZYjMKq9xTO zSQ!=CAeNHN%)sKdy}Qhu$$^3OAltH?7b=tvJbuU^;IcYXe4&MmP=iRq!3YK(JqBI| O=A_0jy-syS25SJFSX2-I literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/clear_batch.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/clear_batch.gif new file mode 100644 index 0000000000000000000000000000000000000000..28a3785aaca7c24373e69a73b2307fdb4331b725 GIT binary patch literal 204 zcmZ?wbhEHb6krfw*v!Dt(a|trLdS{~3vS%Fv0=l86+qU41v6&Mm;e+7$~81pR8$lc z6l7#%BqSvK|Nmd{CkrD313!Zf0}z1BU|^~IuvcM;=)qeJFP_d6<6(9$NpZ+va*#XV z$Tanv0@q6Ij$F;fM->-rkP#C*lC&X!LwxVz&)al#c-qnqcDm}#WIy(BLW0V%N5`2M zYBi)fD)t0U*`nI(nzTRThYA-TS95cdU1Kv3A5Uwk5NlIM^h7?h?zV>Mb~Eg!3Nly& E026Ie7ytkO literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/edit_parameters.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/edit_parameters.gif new file mode 100644 index 0000000000000000000000000000000000000000..94eedf6f92944ef56a7165d98ee6482ad24d00f3 GIT binary patch literal 204 zcmZ?wbhEHb6krfwIKsdXQ?+X1(&P7^zE^TizkPY(?k!y(Zmf8Dr0(0Z6O(Jgr_{$z zZA_S45!jz;(U)n_pJO+nzamx|{omhdZ+pPy1w_LK}lAn?gfP%@e4Za z7j!fz^mBg6Cm<>)Iqd2GAv*PabjlI$z{B2wpAs@ZBxHU{%e_=seQ(b4%iWD9GU85T z#vRX$JCT!crab5N()q_zVvom19gmMb79V{tFY9Y-)92QvhpEX&qauz*MLs-q=>Px! z3}gYtpDc_F47v7O@vFB`qe}(^LZldT0EV8>Vg_9 zLJJQmK3X=#VuqVqOJj;^TG)i+hd&0SPGDu0Xl7#d(B)+m7ZYRT^^oKinmn1O-c?d$ wGK(mSkg(`@Cf|62_ON9lcoOJ}bmOHOv5R7r!u*hlEj`sZrbR8M20XzVCnE(I) literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/execution_module.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/execution_module.gif new file mode 100644 index 0000000000000000000000000000000000000000..983932fcccdf483e87b2c27e6d1b574edb8d4042 GIT binary patch literal 145 zcmV;C0B-+BNk%w1VGsZi0J8u9Z+3+G_PW7(ExmRt!+txlXeYmUIjdnLlT{y*Qz5No zFO*m*vTHJMI~f1}{{R30A^8LW000gEEC2ui01yBW000C&(8)<_1vX181xW;van2Ad zfiVIsvNTIFPQ@88vveqnqU4&(Bm@#!NCung$O0r@F(AW+J5GGPpEbzsdLsZkG>S40 literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/launch.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/launch.gif new file mode 100644 index 0000000000000000000000000000000000000000..ec477ea431f2ab07ac943b10a3f7a9606cae1ed0 GIT binary patch literal 318 zcmZ?wbhEHb6krfwxXQpFmhCE$>n54!E}icoQ{bso79d~jEnnoVP~@#t=BHW_s9qJM zRU4*R6|7Sirc)oL*ATAX5N^~QW!w^D(h_6T92vg4C}MSC1dv=+=({}4cX_Jsved-& ziHRE$n)fv}?`>$_+nBpGK6h)}HxkwZp6 z#@|enuI}!dc^e}PxRM+XU(Yd=!dWtVN2m6K!RaA#IlQc`AN@nlq2V`TDYnCm}( Jftw?PH2}meT_XSh literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/passed.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/passed.gif new file mode 100644 index 0000000000000000000000000000000000000000..23c97f09e677bb8812b26d4415fd97997e5c95a4 GIT binary patch literal 76 zcmZ?wbhEHb6krfwn8?f!yfVYEKB{JS)&Kwh6@RiYGB7YR=r8~QNS=X7c257w({Jy) dG&pl*gzr#W|He>ggQJQAZ^o%@>w*~=tO0mX7=r)+ literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/OK.png b/eclipse/plugins/org.argeo.slc.client.ui/icons/passed.png similarity index 100% rename from eclipse/plugins/org.argeo.slc.client.ui/icons/OK.png rename to eclipse/plugins/org.argeo.slc.client.ui/icons/passed.png diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/process_details.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/process_details.gif new file mode 100644 index 0000000000000000000000000000000000000000..c81630a08081ef028834e42594bfd40bb98f88c1 GIT binary patch literal 368 zcmZ?wbhEHb6krfwxXQqgQ8p>Nd_rDje}3!wqK=IvU7IWWx7AGCQ8#&K%glXE)AzK` zKG3t^NZ+EPh1I>?3l2|Qdc3r@v#O!}`=9@xfB*mX=l|8u|6l+7|L)iSmp}i%{q_ID z@BgoU{r~*u|M$QD-~Rsp>CgXffB)AvH@CFccXrnF^;ArmP&#vR;qo~d3uolaotnRN zR_6cz{~5>yia%Kx85nec5C}kiVqoia5XrE<)2g&1Ye6Yh%{$pqArjmOFr=-7_ZS-2Qr*6IeMi1XcFBKi-=$KGt9VIat0bYJ?E)F(U z78!9R9U(D^dGi-!2QvuUjXm!TdfM8Hb2nXEy7Tt)cRyde`|-ygpG`u5}Z!`D9^y!!t5&5tK+PqXU%vnDpS5D*?Bx$%1I52TfB*C4 zho3Lr|9Jo9*Qam4r_5RU^xco=?|;1d`19kp-=Dty`uOeF_g{Zz%wJ?aBVon4?KL}U z=PjDIXzA<~E2ghqJ!Rv%iCZ`H?cLhBb5qa$Z5{vr|7RG2K=CIFBLjmogAT~;pg3V* zU*6#C?9|fQ*3#7Ez|qs&=g{fw$YEh_(bwZR(Vo%V(wvc%nT5gBexjZ1R0~=5wQKDr z+A^tZW!kbu#de~N$!c9=Ha2M^n~Byk^UQS?E#bAEXeGK@^s17wsMSO>DMP8dckgML zP1Ms|ZJ^B~EF!5lQC0tx{#gcn)rnjRs}(d96cimaI$9DN+l4u7Z3-qFXzuiIHmI5L XgV9NeM?!&bXM&>>OK%esBZD;nX%XK6 literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/processes.png b/eclipse/plugins/org.argeo.slc.client.ui/icons/processes.png new file mode 100644 index 0000000000000000000000000000000000000000..364c0e70b1d6dc48f9d9abfceafbb4f63e5e1edb GIT binary patch literal 586 zcmZ?wbhEHb6krfwc*el6W%tD&KmUCB_Pefs%iNVm(`#3L`uh9Zk3TTdfM8Hb2nXEy7Tt)cRyde`|-ygpG`u5}Z!`D9^y!!t5&5tK+PqXU%vnDpS5D*?Bx$%1I52TfB*C4 zho3Lr|9Jo9*Qam4r_5RU^xco=?|;1d`19kp-=Dty`uOeF_g{Zz%wJ?aBVon4?KL}U z=PjDIXzA<~E2ghqJ!Rv%iCZ`H?cLhBb5qa$Z5{vr|7RG2K=CIFBLjmogAT~;pg3V* zU*6#C?9|fQ*3#7Ez|qs&=g{fw$YEh_(bwZR(Vo%V(wvc%nT5gBexjZ1R0~=5wQKDr z+A^tZW!kbu#de~N$!c9=Ha2M^n~Byk^UQS?E#bAEXeGK@^s17wsMSO>DMP8dckgML zP1Ms|ZJ^B~EF!5lQC0tx{#gcn)rnjRs}(d96cimaI$9DN+l4u7Z3-qFXzuiIHmI5L XgV9NeM?!&bXM&>>OK%esBZD;nX%XK6 literal 0 HcmV?d00001 diff --git a/eclipse/plugins/org.argeo.slc.client.ui/icons/remove_one.gif b/eclipse/plugins/org.argeo.slc.client.ui/icons/remove_one.gif new file mode 100644 index 0000000000000000000000000000000000000000..2cd9c544436c47a57f20b348b3fb024bb50701a7 GIT binary patch literal 163 zcmZ?wbhEHb6krfw*v!DNV#SID3l_|nF=N7n2^}3B4Gj$y6%_>q1sNF`2?+`R|Nmz| z1&Tje7#SG27<53wATtBYuHJj2L#xNM)vQ#JRl<>hDKU#-N&yE`p}?0M(Gw4T zcQCOfDoF5h^e6?|s2Q}nBw9^!OQRNg)3%kxRBAkW9!LB3?4I> z>>K8v`g!xg3)YaO%`47cc=&n8;d9gHE!9q#Xpz4_GI6eV%leGv*H2x$fB3A@ynTq@31iOxG7C+bPzbDc(LQiJeN5J7CvIy2j%)T-dggA zH8XokK3d`|=kxT_%LYAB3H8!U6**yEUN+$lLB3`gSveJcepwD-)gDD$KmH z>@2gyWO=!S7N~G9k)6dME6d8gR!wb@#8wvJt+G;F3`ZGMSj4wVNgZTk@w%uk%qhEn eD-+kHixR@qwu*2y-M+}r#m&Y4op$N_rU!pFKlpp@&HrhazaM<@|J>XE z=imN+`0YOgFfcGE{$ycfVBllW0kVN62rw|PxL&YySiPrW(^-de2MTq%rq6l7%F`5B z;i$8k#Yy1a@~|oIyr9*?jxd%4aX0yzy`dymabz zw#(eg=y~&N&n)dZv2xzduG}5lraiApo3(c4*{Ylg5#|$JO_EEZ<^|a2`Z*=9ns7DV zy=TR&gYw*7f%auV?ip3tvjRPmcdoho{K?x$_vR?C#t5&<;~V}S*>OMCr>h}%%bLZ9 zmo3`hYEwTICo-TTCZwgTsC&VjZRgJ1eE#fBa^%9R zmmfWS@;bnyJ27HWY}kxYzv(Hl>yu;FCPlAEh+34Muq-8Rb6C)<8qA3{r2e5 z`$vyngh#H=FWlqqvnapfc5%(!sQ4v?r7J61-&eJNEN^;KTK}T7{#i-gJh%G*9vcYdwv_*~xdw!Gz4Va?T!sXyyF@8?w<>X`X=#j%uHV4GRvj@+tE@ zQ%F!a)GKcn^~8abN>4la1UNXVL;{ZWi)lEwyeatDu%Lr6;aASiLrXXW zQm# @@ -96,19 +103,6 @@ name="Result UUID"> - - - - - - @@ -155,16 +149,19 @@ locationURI="toolbar:org.argeo.slc.client.ui.processBuilderView"> diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/ClientUiPlugin.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/ClientUiPlugin.java index 805fdc2b0..7148f0f54 100644 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/ClientUiPlugin.java +++ b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/ClientUiPlugin.java @@ -75,10 +75,10 @@ public class ClientUiPlugin extends AbstractUIPlugin { reg.put("agent", getImageDescriptor("icons/computer.png")); reg.put("executionModule", getImageDescriptor("icons/archive.png")); reg.put("folder", getImageDescriptor("icons/folder.png")); - // reg.put("flow", getImageDescriptor("icons/slc-launch.gif")); reg.put("flow", getImageDescriptor("icons/system.png")); - reg.put("passedTest", getImageDescriptor("icons/OK.png")); - reg.put("failedTest", getImageDescriptor("icons/error.png")); + reg.put("processes", getImageDescriptor("icons/processes.gif")); + reg.put("passedTest", getImageDescriptor("icons/passed.gif")); + reg.put("failedTest", getImageDescriptor("icons/error.gif")); } public BundleContext getBundleContext() { diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/EditRealizedFlowDetailsHandler.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/EditRealizedFlowDetailsHandler.java deleted file mode 100644 index f26e29f47..000000000 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/EditRealizedFlowDetailsHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.argeo.slc.client.ui.commands; - -import org.argeo.slc.client.oxm.OxmInterface; -import org.argeo.slc.client.ui.views.ProcessParametersView; -import org.argeo.slc.process.RealizedFlow; -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.ui.handlers.HandlerUtil; - -/** - * - * @author bsinou - * - * Command handler to display and edit the attributes of a given - * Realizedflow. The corresponding RealizedFlow is passed via command - * parameters and unmarshalled with the oxmBean which is injected by - * Spring. - * - * Note thet passing an index of -1 will cause the reset of the View - * (used among others when removing processes from the batch). - */ - -public class EditRealizedFlowDetailsHandler extends AbstractHandler { - - // IoC - private OxmInterface oxmBean; - - public Object execute(ExecutionEvent event) throws ExecutionException { - // We pass Realized flow through command parameters as XML - String rfAsXml = event - .getParameter("org.argeo.slc.client.commands.realizedFlowAsXml"); - int index = new Integer( - event.getParameter("org.argeo.slc.client.commands.realizedFlowIndex")) - .intValue(); - try { - ProcessParametersView ppView = (ProcessParametersView) HandlerUtil - .getActiveWorkbenchWindow(event).getActivePage() - .showView(ProcessParametersView.ID); - - if (index == -1) - ppView.setRealizedFlow(-1, null); - else { - RealizedFlow rf = (RealizedFlow) oxmBean.unmarshal(rfAsXml); - ppView.setRealizedFlow(index, rf); - - } - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - // IoC - public void setOxmBean(OxmInterface oxmBean) { - this.oxmBean = oxmBean; - } - -} diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/perspectives/SlcExecution.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/perspectives/SlcExecution.java index bb533cb76..f50ea1814 100644 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/perspectives/SlcExecution.java +++ b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/perspectives/SlcExecution.java @@ -11,28 +11,34 @@ public class SlcExecution implements IPerspectiveFactory { layout.setEditorAreaVisible(false); layout.setFixed(false); - IFolderLayout topLeft = layout.createFolder("topLeft", - IPageLayout.LEFT, 0.7f, editorArea); - topLeft.addView("org.argeo.slc.client.ui.executionModulesView"); + // Create the main ui layout + + // For a vertical split, the part on top gets the specified ratio of the + // current space and the part on bottom gets the rest. Likewise, for a + // horizontal split, the part at left gets the specified ratio of the + // current space. + IFolderLayout main = layout.createFolder("main", IPageLayout.RIGHT, + 0.3f, editorArea); + IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, + 0.3f, editorArea); + + IFolderLayout bottom = layout.createFolder("bottom", + IPageLayout.BOTTOM, 0.65f, "main"); IFolderLayout topRight = layout.createFolder("topRight", - IPageLayout.RIGHT, 0.3f, editorArea); - topRight.addView("org.argeo.slc.client.ui.resultListView"); - topRight.addPlaceholder("org.argeo.slc.client.ui.resultDetailView:UUID-*"); - - IFolderLayout bottomRight = layout.createFolder("bottomRight", - IPageLayout.BOTTOM, 0.6f, "topRight"); - bottomRight.addView("org.argeo.slc.client.ui.processListView"); - bottomRight - .addPlaceholder("org.argeo.slc.client.ui.processDetailView:UUID-*"); - - IFolderLayout bottomLeft = layout.createFolder("bottomLeft", - IPageLayout.BOTTOM, 0.6f, "topLeft"); - bottomLeft.addView("org.argeo.slc.client.ui.processBuilderView"); - IFolderLayout paramsEditor = layout.createFolder("paramsEditor", - IPageLayout.RIGHT, 0.6f, "bottomLeft"); - paramsEditor.addView("org.argeo.slc.client.ui.processParametersView"); + IPageLayout.RIGHT, 0.6f, "main"); + + // add the views to the corresponding place holder + left.addView("org.argeo.slc.client.ui.executionModulesView"); + left.addView("org.argeo.slc.client.ui.resultListView"); + + main.addView("org.argeo.slc.client.ui.processBuilderView"); + main.addPlaceholder("org.argeo.slc.client.ui.resultDetailView:UUID-*"); + main.addPlaceholder("org.argeo.slc.client.ui.processDetailView:UUID-*"); + + bottom.addView("org.argeo.slc.client.ui.processListView"); + topRight.addView("org.argeo.slc.client.ui.processParametersView"); } } diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java index 847463e83..7ca534e0f 100644 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java +++ b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java @@ -11,17 +11,19 @@ import org.eclipse.jface.viewers.TextCellEditor; /** * - * @author bsinou * - * This class implements the ability to edit and save various type of + * Implements the ability to edit and save various type of * parameter of a given process. Parameter values are directly saved as * soon as the focus on a given field is lost. * * - * Note that this EditingSupport is tightly coupled with both + * Note that EditingSupport is tightly coupled with both * ProcessParametersView and ProcessBuilderView; it cannot serve as a * generic EditingSupport as is. Note also that it assumes that the * processes in ProcessBuilderView as stored as an ordered list. + + @author bsinou + * */ public class ProcessParametersEditingSupport extends EditingSupport { diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ProcessBuilderView.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ProcessBuilderView.java index e0e5aec16..5d62983f9 100644 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ProcessBuilderView.java +++ b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ProcessBuilderView.java @@ -17,10 +17,6 @@ import org.argeo.slc.client.ui.controllers.ProcessController; import org.argeo.slc.process.RealizedFlow; import org.argeo.slc.process.SlcExecution; import org.argeo.slc.runtime.SlcAgent; -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.IParameter; -import org.eclipse.core.commands.Parameterization; -import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; @@ -40,10 +36,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.IHandlerService; +import org.eclipse.ui.PartInitException; import org.eclipse.ui.part.ViewPart; /** @@ -145,7 +138,7 @@ public class ProcessBuilderView extends ViewPart { // we clear the list realizedFlows = new ArrayList(); curSelectedRow = -1; - refreshParameterview(null); + refreshParameterview(); viewer.refresh(); } @@ -156,56 +149,30 @@ public class ProcessBuilderView extends ViewPart { else realizedFlows.remove(curSelectedRow); curSelectedRow = -1; - refreshParameterview(null); + refreshParameterview(); viewer.refresh(); } // calling this method with index =-1 will cause the reset of the view. - private void refreshParameterview(RealizedFlow rf) { - IWorkbench iw = ClientUiPlugin.getDefault().getWorkbench(); - IHandlerService handlerService = (IHandlerService) iw - .getService(IHandlerService.class); + private void refreshParameterview() { + // We choose to directly access the view rather than going through + // commands. + ProcessParametersView ppView; try { - // get the command from plugin.xml - IWorkbenchWindow window = iw.getActiveWorkbenchWindow(); - ICommandService cmdService = (ICommandService) window - .getService(ICommandService.class); - Command cmd = cmdService.getCommand(EDIT_CMD); - - ArrayList parameters = new ArrayList(); - - IParameter iparam; - Parameterization params; - - // The current index to be able to records changes on - // parameters - iparam = cmd.getParameter(INDEX_PARAM); - params = new Parameterization(iparam, - (new Integer(curSelectedRow)).toString()); - parameters.add(params); - - if (curSelectedRow != -1) { - // The current Realized flow marshalled as XML - String result = oxmBean.marshal(rf); - iparam = cmd.getParameter(FLOWASXML_PARAM); - params = new Parameterization(iparam, result); - parameters.add(params); - } - // build the parameterized command - ParameterizedCommand pc = new ParameterizedCommand(cmd, - parameters.toArray(new Parameterization[parameters.size()])); - - // execute the command - handlerService = (IHandlerService) window - .getService(IHandlerService.class); - handlerService.executeCommand(pc, null); - - } catch (Exception e) { - e.printStackTrace(); - throw new SlcException("Problem while rendering result. " - + e.getMessage()); + ppView = (ProcessParametersView) ClientUiPlugin.getDefault() + .getWorkbench().getActiveWorkbenchWindow().getActivePage() + .showView(ProcessParametersView.ID); + + if (curSelectedRow == -1) + ppView.setRealizedFlow(-1, null); + else + ppView.setRealizedFlow(curSelectedRow, + realizedFlows.get(curSelectedRow)); + } catch (PartInitException e) { + throw new SlcException( + "Cannot Retrieve ProcessParameterView to edit parameters of selected process", + e); } - } // Return the list of the processes to execute. @@ -274,7 +241,7 @@ public class ProcessBuilderView extends ViewPart { if (obj instanceof RealizedFlow) { RealizedFlow rf = (RealizedFlow) obj; curSelectedRow = realizedFlows.indexOf(rf); - refreshParameterview(rf); + refreshParameterview(); } } } @@ -320,7 +287,8 @@ public class ProcessBuilderView extends ViewPart { return false; RealizedFlow rf = (RealizedFlow) oxmBean.unmarshal(fdXml); realizedFlows.add(rf); - + curSelectedRow = realizedFlows.indexOf(rf); + refreshParameterview(); getViewer().refresh(); return true; } -- 2.39.2