Author: akazakov
Date: 2009-11-26 13:16:38 -0500 (Thu, 26 Nov 2009)
New Revision: 18868
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5275
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties 2009-11-26 17:59:36 UTC
(rev 18867)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties 2009-11-26 18:16:38 UTC
(rev 18868)
@@ -6,6 +6,7 @@
PreferencePage_SeamSettings=Seam Settings
ViewCategory_Seam=Seam
ViewName_SeamComponents=Seam Components
+ConfigureMenu_AddSeamSupport=Add Seam support...
perspective.name=Seam
Bundle-Vendor.0 = JBoss by Red Hat
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-11-26 17:59:36 UTC (rev
18867)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-11-26 18:16:38 UTC (rev
18868)
@@ -677,4 +677,35 @@
<xclass
id="org.jboss.tools.seam.ui.views.actions.RenameComponentAction"
class="org.jboss.tools.seam.ui.views.actions.RenameComponentAction"/>
</extension>
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+
+ <objectContribution
+ id="org.jboss.tools.seam.ui.project.configure"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <visibility>
+ <and>
+ <objectState
+ name="projectNature"
+ value="org.eclipse.jdt.core.javanature"/>
+ <not>
+ <objectState
+ name="projectNature"
+ value="org.jboss.tools.seam.core.seamnature"/>
+ </not>
+ </and>
+ </visibility>
+
+ <action
+ id="org.jboss.tools.seam.ui.AddSeamSupport"
+ label="%ConfigureMenu_AddSeamSupport"
+ class="org.jboss.tools.seam.ui.preferences.AddSeamSupportAction"
+ enablesFor="1"
+ menubarPath="org.eclipse.ui.projectConfigure/additions"/>
+
+ </objectContribution>
+ </extension>
+
</plugin>
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java 2009-11-26
18:16:38 UTC (rev 18868)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.seam.ui.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AddSeamSupportAction implements IObjectActionDelegate {
+
+ private ISelection currentSelection;
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IProject project = (IProject) ((IStructuredSelection)
currentSelection).getFirstElement();
+ PreferenceDialog dialog =
PreferencesUtil.createPropertyDialogOn(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
project, SeamSettingsPreferencePage.ID, new String[] {SeamSettingsPreferencePage.ID},
null);
+ dialog.open();
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.currentSelection = selection;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain