Author: akazakov
Date: 2011-02-16 10:27:21 -0500 (Wed, 16 Feb 2011)
New Revision: 29177
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIPerspectiveFactory.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
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/CDIUIAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-8270: Created CDI Perspective.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2011-02-16 15:10:30 UTC
(rev 29176)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2011-02-16 15:27:21 UTC
(rev 29177)
@@ -29,7 +29,10 @@
org.eclipse.core.expressions,
org.eclipse.ltk.core.refactoring,
org.jboss.tools.jst.jsp,
- org.eclipse.wst.common.project.facet.ui
+ org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.debug.ui,
+ org.eclipse.ui.navigator,
+ org.eclipse.ui.navigator.resources
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor.0
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2011-02-16 15:10:30 UTC
(rev 29176)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.properties 2011-02-16 15:27:21 UTC
(rev 29177)
@@ -17,3 +17,5 @@
NewWizards.file=File beans.xml
NewWizards.file.description=Create a new beans.xml File
+
+perspective.name=Context and Dependency Injection (CDI)
\ 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-02-16 15:10:30 UTC (rev
29176)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2011-02-16 15:27:21 UTC (rev
29177)
@@ -281,8 +281,7 @@
<keyword
label="%preferenceKeywords.newBeansXML"
id="org.jboss.tools.cdi.ui.newBeansXML"/>
-
- </extension>
+ </extension>
<extension
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
@@ -291,7 +290,71 @@
</wizard-pages>
</extension>
- <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">
+ <newWizardShortcut
+ id="org.jboss.tools.cdi.ui.wizard.NewBeanCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+
id="org.jboss.tools.cdi.ui.wizard.NewQualifierCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+
id="org.jboss.tools.cdi.ui.wizard.NewStereotypeCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.jboss.tools.cdi.ui.wizard.NewScopeCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+
id="org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+
id="org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+
id="org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+
id="org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+
id="org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard">
+ </newWizardShortcut>
+ <actionSet id="org.hibernate.eclipse.launch.actionset"/>
+ <perspectiveShortcut
+ 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.wst.sse.ui.completionProposal">
<proposalCategory
icon="icons/cdi16.png"
@@ -319,5 +382,5 @@
markerType="org.jboss.tools.cdi.core.cdiproblem"
class="org.jboss.tools.cdi.ui.marker.CDIProblemMarkerResolutionGenerator"/>
</extension>
-
+
</plugin>
Added:
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
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIPerspectiveFactory.java 2011-02-16
15:27:21 UTC (rev 29177)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIPerspectiveFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-02-16
15:10:30 UTC (rev 29176)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-02-16
15:27:21 UTC (rev 29177)
@@ -10,15 +10,16 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.test;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.eclipse.jdt.internal.core.JavaModelManager;
import org.jboss.tools.cdi.ui.test.marker.CDIMarkerResolutionTest;
+import org.jboss.tools.cdi.ui.test.perspective.CDIPerspectiveTest;
import org.jboss.tools.cdi.ui.test.preferences.CDIPreferencePageTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIClassWizardFactoryTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIWizardTest;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
/**
* @author Alexey Kazakov
*/
@@ -27,14 +28,15 @@
public static Test suite() {
// it could be done here because it is not needed to be enabled back
JavaModelManager.getIndexManager().disable();
-
+
TestSuite suite = new TestSuite("CDI UI Tests");
suite.addTestSuite(CDIMarkerResolutionTest.class);
suite.addTestSuite(CATest.class);
suite.addTestSuite(NewCDIWizardTest.class);
suite.addTestSuite(CDIPreferencePageTest.class);
suite.addTestSuite(NewCDIClassWizardFactoryTest.class);
-
+ suite.addTestSuite(CDIPerspectiveTest.class);
+
return suite;
}
}
\ No newline at end of file
Added:
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
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java 2011-02-16
15:27:21 UTC (rev 29177)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.test.perspective;
+
+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;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIPerspectiveTest extends TestCase {
+
+ public void testPerspective() throws WorkbenchException {
+ IWorkbenchPage page =
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(CDIPerspectiveFactory.PERSPECTIVE_ID,
null);
+ assertNotNull(page);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain