Improve base workbench UI
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 19 Dec 2017 14:27:17 +0000 (15:27 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 19 Dec 2017 14:27:17 +0000 (15:27 +0100)
org.argeo.cms.ui.workbench.rap/plugin.xml
org.argeo.cms.ui.workbench.rap/src/org/argeo/cms/ui/workbench/rap/commands/OpenHome.java
org.argeo.cms.ui.workbench/plugin.xml

index 39770d3f62ac697288ca20261c509039685496b3..3dfbf2dc19c7fb00c598e8181ef90668e47bde49 100644 (file)
                        </toolbar>
                </menuContribution>
                -->
+       <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
+               <toolbar id="org.argeo.cms.ui.workbench.userToolbar">
+                               <command
+                                       commandId="org.argeo.cms.ui.workbench.rap.mainMenuCommand"
+                                       icon="icons/home.png"
+                                       id="org.argeo.cms.ui.workbench.rap.mainMenu"
+                                       style="pulldown">
+                               </command>
+                               <command commandId="org.eclipse.ui.file.save" icon="icons/save.png"/>
+                               <command commandId="org.eclipse.ui.file.saveAll" icon="icons/save-all.png"/>
+                       </toolbar>
+               </menuContribution>
                
                <!-- User drop down default menu -->
                <menuContribution locationURI="menu:org.argeo.cms.ui.workbench.rap.mainMenu">
index a6744d213f33fef91c66c8ee42b899a1f6962e50..86e01036da9d530f073e5086f9c8e5c1e9c794b5 100644 (file)
@@ -35,8 +35,10 @@ public class OpenHome extends AbstractHandler {
                        CommandUtils.callCommand(defaultCmdId);
                else {
                        try {
+                               String defaultPerspective = HandlerUtil.getActiveWorkbenchWindow(event).getWorkbench()
+                                               .getPerspectiveRegistry().getDefaultPerspective();
                                HandlerUtil.getActiveSite(event).getWorkbenchWindow()
-                                               .openPage(UserHomePerspective.ID, null);
+                                               .openPage(defaultPerspective != null ? defaultPerspective : UserHomePerspective.ID, null);
                        } catch (WorkbenchException e) {
                                ErrorFeedback.show("Cannot open home perspective", e);
                        }
index 32935842ea84343c5741c91fa1c959c191eaee14..758a9e339ea48439255d7211c7272581a4cd59db 100644 (file)
        <!-- MENU CONTRIBUTIONS -->
        <extension
                point="org.eclipse.ui.menus">
-       <!-- Main tool bar menu -->
+       <!-- Main tool bar menu
        <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
                <toolbar id="org.argeo.cms.ui.workbench.userToolbar">
                                <command
                                <command commandId="org.eclipse.ui.file.saveAll" icon="icons/save-all.png"/>
                        </toolbar>
                </menuContribution>
-               
+               -->
                <menuContribution
                        locationURI="toolbar:org.argeo.cms.ui.workbench.userToolbar?after=org.eclipse.ui.file.saveAll"> 
                        <!-- Transaction management -->