/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.wso2.developerstudio.codenvy.core.client;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.che.ide.api.action.ActionManager;
import org.eclipse.che.ide.api.action.DefaultActionGroup;
import org.eclipse.che.ide.api.action.IdeActions;
import org.eclipse.che.ide.api.extension.Extension;
import org.eclipse.che.ide.api.parts.WorkspaceAgent;
import org.wso2.developerstudio.codenvy.core.client.actions.AboutDialogBoxAction;
import org.wso2.developerstudio.codenvy.core.client.actions.OpenDashboardAction;
import org.wso2.developerstudio.codenvy.core.client.ui.dashboard.DashboardItemRegistry;
import org.wso2.developerstudio.codenvy.core.client.ui.dashboard.page.DashboardPagePresenter;
import org.wso2.developerstudio.codenvy.core.shared.CoreExtConstants;

@Singleton
@Extension(title = CoreExtConstants.EXT_NAME_PREFIX + CoreExtConstants.EXT_NAME,
           version = CoreExtConstants.EXT_VERSION)
public class CoreExtension {

	@Inject
	public CoreExtension(ActionManager actionManager, AboutDialogBoxAction aboutAction,
	                     OpenDashboardAction openDashboardAction,
	                     WorkspaceAgent workspaceAgent,
	                     DashboardPagePresenter dashboardPagePresenter,
	                     DashboardItemRegistry dashboardItemRegistry) {

		DefaultActionGroup wso2CloudStudioActionGroup =
				new DefaultActionGroup(CoreExtConstants.WSO2_ACTION_GROUP_NAME, true, actionManager);
		actionManager
				.registerAction(CoreExtConstants.WSO2_ACTION_GROUP_ID, wso2CloudStudioActionGroup);
		DefaultActionGroup mainMenu =
				(DefaultActionGroup) actionManager.getAction(IdeActions.GROUP_MAIN_MENU);
		mainMenu.add(wso2CloudStudioActionGroup);

		DefaultActionGroup wso2ActionGroup = (DefaultActionGroup) actionManager
				.getAction(CoreExtConstants.WSO2_ACTION_GROUP_ID);

		actionManager.registerAction(CoreExtConstants.WSO2_ABOUT_ACTION_ID, aboutAction);
		wso2ActionGroup.add(aboutAction);

		actionManager.registerAction(CoreExtConstants.WSO2_OPEN_DASHBOARD_ACTION_ID,
		                             openDashboardAction);
		wso2ActionGroup.add(openDashboardAction);

	}
}
@@ -16,16 +16,21 @@
 (c) 2014
+-2015
 , WSO2 I
@@ -962,61 +962,8 @@
 on;%0A
-import org.eclipse.che.ide.api.parts.WorkspaceAgent;%0A
 impo
@@ -1125,190 +1125,8 @@
 on;%0A
-import org.wso2.developerstudio.codenvy.core.client.ui.dashboard.DashboardItemRegistry;%0Aimport org.wso2.developerstudio.codenvy.core.client.ui.dashboard.page.DashboardPagePresenter;%0A
 impo
@@ -1292,19 +1292,16 @@
         
-   
 version 
@@ -1366,17 +1366,20 @@
  %7B%0A%0A
-%09
+    
 @Inject%0A
 %09pub
@@ -1374,17 +1374,20 @@
 @Inject%0A
-%09
+    
 public C
@@ -1454,33 +1454,36 @@
 on aboutAction,%0A
-%09
+    
                 
@@ -1530,204 +1530,21 @@
 tion
-,%0A%09                     WorkspaceAgent workspaceAgent,%0A%09                     DashboardPagePresenter dashboardPagePresenter,%0A%09                     DashboardItemRegistry dashboardItemRegistry) %7B%0A%0A%09%09
+) %7B%0A%0A        
 Defa
@@ -1587,20 +1587,32 @@
 Group =%0A
-%09%09%09%09
+                
 new Defa
@@ -1689,18 +1689,24 @@
 nager);%0A
-%09%09
+        
 actionMa
@@ -1711,20 +1711,32 @@
 Manager%0A
-%09%09%09%09
+                
 .registe
@@ -1811,18 +1811,24 @@
 Group);%0A
-%09%09
+        
 DefaultA
@@ -1849,20 +1849,32 @@
 nMenu =%0A
-%09%09%09%09
+                
 (Default
@@ -1939,18 +1939,24 @@
 _MENU);%0A
-%09%09
+        
 mainMenu
@@ -1990,18 +1990,24 @@
 roup);%0A%0A
-%09%09
+        
 DefaultA
@@ -2074,12 +2074,24 @@
 ger%0A
-%09%09%09%09
+                
 .get
@@ -2134,26 +2134,32 @@
 GROUP_ID);%0A%0A
-%09%09
+        
 actionManage
@@ -2220,34 +2220,40 @@
 , aboutAction);%0A
-%09%09
+        
 wso2ActionGroup.
@@ -2271,18 +2271,104 @@
 tion);%0A%0A
-%09%09
+        //TODO Add open dashboard action when some actions added to dashboard%0A        /*
 actionMa
@@ -2436,18 +2436,24 @@
 ION_ID,%0A
-%09%09
+        
         
@@ -2542,10 +2542,15 @@
 on);
-%0A%0A%09
+*/%0A%0A    
 %7D%0A%7D

Remove "Open Dashboard" option from DevS 4.0.0 M1 release since it doesn't have anything