Author: akazakov
Date: 2011-10-07 20:17:12 -0400 (Fri, 07 Oct 2011)
New Revision: 35501
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIPerspectiveFactory.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
Log:
https://issues.jboss.org/browse/JBIDE-9844 Cleanup perspectives
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2011-10-08 00:16:00 UTC
(rev 35500)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2011-10-08 00:17:12 UTC
(rev 35501)
@@ -16,6 +16,4 @@
preferenceKeywords.newBeansXML=CDI XML
NewWizards.file=File beans.xml
-NewWizards.file.description=Create a new beans.xml File
-
-perspective.name=CDI
\ No newline at end of file
+NewWizards.file.description=Create a new beans.xml File
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2011-10-08 00:16:00 UTC (rev
35500)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2011-10-08 00:17:12 UTC (rev
35501)
@@ -340,19 +340,9 @@
</extension>
<extension
- point="org.eclipse.ui.perspectives">
- <perspective
- class="org.jboss.tools.cdi.ui.CDIPerspectiveFactory"
- icon="$nl$/icons/cdi16.png"
- id="org.jboss.tools.cdi.ui.CDIPerspective"
- name="%perspective.name">
- </perspective>
- </extension>
-
- <extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
- targetID="org.jboss.tools.cdi.ui.CDIPerspective">
+ targetID="org.eclipse.jst.j2ee.J2EEPerspective">
<newWizardShortcut
id="org.jboss.tools.cdi.ui.wizard.NewBeanCreationWizard">
</newWizardShortcut>
@@ -385,24 +375,140 @@
id="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective">
</perspectiveShortcut>
<perspectiveShortcut
- id="org.eclipse.jdt.ui.JavaPerspective">
- </perspectiveShortcut>
- <perspectiveShortcut
- id="org.eclipse.jdt.ui.JavaBrowsingPerspective">
- </perspectiveShortcut>
- <perspectiveShortcut
- id="org.eclipse.debug.ui.DebugPerspective">
- </perspectiveShortcut>
- <perspectiveShortcut
id="org.hibernate.eclipse.console.HibernateConsolePerspective">
</perspectiveShortcut>
- <actionSet
- id="org.eclipse.debug.ui.breakpointActionSet">
- </actionSet>
- <actionSet
id="org.eclipse.wst.server.ui.internal.webbrowser.actionSet"/>
</perspectiveExtension>
</extension>
+ <extension point="org.eclipse.ui.navigator.navigatorContent">
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+ wizardId="org.jboss.tools.cdi.ui.wizard.NewBeanCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+
wizardId="org.jboss.tools.cdi.ui.wizard.NewQualifierCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+
wizardId="org.jboss.tools.cdi.ui.wizard.NewStereotypeCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+ wizardId="org.jboss.tools.cdi.ui.wizard.NewScopeCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+
wizardId="org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+
wizardId="org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+
wizardId="org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+
wizardId="org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ <commonWizard
+ menuGroupId="org.jboss.tools.cdi.ui"
+ type="new"
+
wizardId="org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard">
+ <enablement>
+ <or>
+ <adapt type="org.eclipse.core.resources.IFile" />
+ <adapt type="org.eclipse.core.resources.IFolder" />
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <adapt type="org.eclipse.core.resources.IWorkspaceRoot"
/>
+ <adapt type="org.eclipse.jdt.core.IJavaElement" />
+ </or>
+ </enablement>
+ </commonWizard>
+ </extension>
+
<extension
point="org.eclipse.wst.sse.ui.completionProposal">
<proposalCategory
Deleted:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIPerspectiveFactory.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIPerspectiveFactory.java 2011-10-08
00:16:00 UTC (rev 35500)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIPerspectiveFactory.java 2011-10-08
00:17:12 UTC (rev 35501)
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.cdi.ui;
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.navigator.resources.ProjectExplorer;
-
-/**
- * @author Alexey Kazakov
- */
-public class CDIPerspectiveFactory implements IPerspectiveFactory {
-
- private static String WTP_SERVERS_VIEW =
"org.eclipse.wst.server.ui.ServersView"; //$NON-NLS-1$
-
- public static final String PERSPECTIVE_ID =
"org.jboss.tools.cdi.ui.CDIPerspective"; //$NON-NLS-1$
-
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
-
- IFolderLayout leftTop = layout.createFolder("leftTop", IPageLayout.LEFT,
(float)0.2, editorArea); //$NON-NLS-1$
- leftTop.addView(JavaUI.ID_PACKAGES);
- leftTop.addView(ProjectExplorer.VIEW_ID);
- leftTop.addPlaceholder(IPageLayout.ID_RES_NAV);
-
- IFolderLayout leftBottom = layout.createFolder("leftBottom",
IPageLayout.BOTTOM, 0.64f, "leftTop"); //$NON-NLS-1$ //$NON-NLS-2$
- //leftBottom.addView(IPageLayout.ID_OUTLINE);
- leftBottom.addView(IPageLayout.ID_PROP_SHEET);
-
- IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM,
(float)0.78, editorArea); //$NON-NLS-1$
- bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
- bottom.addView(IPageLayout.ID_TASK_LIST);
- bottom.addView(WTP_SERVERS_VIEW);
-
- IFolderLayout rightTop = layout.createFolder("right", IPageLayout.RIGHT,
(float)0.8, editorArea); //$NON-NLS-1$
-// rightTop.addView("org.jboss.tools.common.model.ui.views.palette.PaletteView");
//$NON-NLS-1$
- rightTop.addView("org.eclipse.gef.ui.palette_view"); //$NON-NLS-1$
- IFolderLayout rightBottom = layout.createFolder("rightBottom",
IPageLayout.BOTTOM, (float)0.64, "right"); //$NON-NLS-1$ //$NON-NLS-2$
- rightBottom.addView(IPageLayout.ID_OUTLINE);
-
- layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
- layout.addActionSet(JavaUI.ID_ACTION_SET);
- layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
- layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
-
- // views - java
- layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
- layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
- layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
-
- // views - standard workbench
- layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
- layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
-
- // new actions - Java project creation wizard
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard");
//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard");
//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard");
//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard");
//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard");
//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
- }
-}
\ No newline at end of file
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java 2011-10-08
00:16:00 UTC (rev 35500)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java 2011-10-08
00:17:12 UTC (rev 35501)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.test.perspective;
+import java.util.HashSet;
+import java.util.Set;
+
import junit.framework.TestCase;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.WorkbenchException;
-import org.jboss.tools.cdi.ui.CDIPerspectiveFactory;
import org.jboss.tools.test.util.WorkbenchUtils;
/**
@@ -23,7 +25,21 @@
public class CDIPerspectiveTest extends TestCase {
public void testPerspective() throws WorkbenchException {
- IWorkbenchPage page =
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(CDIPerspectiveFactory.PERSPECTIVE_ID,
null);
+ IWorkbenchPage page =
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage("org.eclipse.jst.j2ee.J2EEPerspective",
null);
assertNotNull(page);
+ String[] shortcuts = page.getNewWizardShortcuts();
+ Set<String> shortcutSet = new HashSet<String>();
+ for (String shortcut : shortcuts) {
+ shortcutSet.add(shortcut);
+ }
+ assertTrue("Have not found org.jboss.tools.cdi.ui.wizard.NewBeanCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewBeanCreationWizard"));
+ assertTrue("Have not found
org.jboss.tools.cdi.ui.wizard.NewQualifierCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewQualifierCreationWizard"));
+ assertTrue("Have not found
org.jboss.tools.cdi.ui.wizard.NewStereotypeCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewStereotypeCreationWizard"));
+ assertTrue("Have not found org.jboss.tools.cdi.ui.wizard.NewScopeCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewScopeCreationWizard"));
+ assertTrue("Have not found
org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingCreationWizard"));
+ assertTrue("Have not found
org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard"));
+ assertTrue("Have not found
org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard"));
+ assertTrue("Have not found
org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard in
org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard"));
+ assertTrue("Have not found org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard
in org.eclipse.jst.j2ee.J2EEPerspective.",
shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard"));
}
}
\ No newline at end of file