Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [wtp-jsf-dev] Extension point in Visual Page editor of JSF

Hello,

I looked in the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=221197
and was able to solve it by sending correct location in supportTaglib of
class JSPUtil so that call to ITaglibRecord.resolve succeeds

I have submitted the patch in the bug itself along with comments.
Now I am able to create context menu using popupMenuContributor
extension available in org.eclipse.jst.pagedesigner after the changes.

Also I have created an extension in org.eclipse.jst.pagedesigner.jsf.ui
earlier which is attached as patch in this mail. This extension can be
used for creating context menu in the "insert" sub menu of JSF-HTML UI
components.

Thanks

Neeraj



-----Original Message-----
From: Cameron Bateman [mailto:cameron.bateman@xxxxxxxxxx] 
Sent: Tuesday, March 04, 2008 12:26 AM
To: Neeraj Bhatt; Java Server Faces Tools developer discussion
Cc: Ankit Kakkar; marco.dubbeld@xxxxxxxxxx; Abhishek Jain
Subject: RE: [wtp-jsf-dev] Extension point in Visual Page editor of JSF

One option would be to sub-class the JSFHTMLElementEditFactory and
install this as your element edit factory for HTML.  In the sub-class,
you could override what you want on the components you want, and then
delegate the rest to the super-class.  

There is also a popupMenuContributor that would work but appears to have
a blocking bug.  I have added
https://bugs.eclipse.org/bugs/show_bug.cgi?id=221197 which you can CC
yourself on.  Once we get this fixed, you should be able to contribute
additional menu actions by taglib uri.


--Cam


-----Original Message-----
From: Neeraj Bhatt [mailto:neeraj.bhatt@xxxxxxxxxxxxxxx]
Sent: Wednesday, February 27, 2008 5:01 AM
To: cameron.bateman@xxxxxxxxxx; Java Server Faces Tools developer
discussion
Cc: Ankit Kakkar; marco.dubbeld@xxxxxxxxxx; Abhishek Jain
Subject: RE: [wtp-jsf-dev] Extension point in Visual Page editor of JSF


Hello,

I tried using option "elementEditFactory" of extension
"org.eclipse.jst.pagedesigner.pageDesignerExtension"

I created a factory similar to
org.eclipse.jst.pagedesigner.jsf.ui.elementedit.jsfhtml.JSFHTMLElementEd
itFactory which returns instances of AbstractElementEdit, but it did not
worked for me.

It looks like call to fillContextMenu() of SingleElementActionGroup from
ContextMenuListener calls createElementEdit of
ElementEditFactoryRegistry

This createElementEdit method of ElementEditFactoryRegistry returns a
single instance of IElementEdit depending on Tag URI and factory, so
even if I create another factory with same Tag URI
("http://java.sun.com/jsf/html"; or return null from getSupportedURI) I
get only one IElementEdit.

This result in either the already available options in context menu for
"html" JSF tags to be displayed or the new one's which I need to create.

What I need is some new options to be added on the already available
context menu of "html" JSF tags.

Thanks.

Neeraj








-----Original Message-----
From: wtp-jsf-dev-bounces@xxxxxxxxxxx
[mailto:wtp-jsf-dev-bounces@xxxxxxxxxxx] On Behalf Of Cameron Bateman
Sent: Wednesday, February 27, 2008 12:02 AM
To: Java Server Faces Tools developer discussion
Cc: Ankit Kakkar; marco.dubbeld@xxxxxxxxxx; Abhishek Jain
Subject: RE: [wtp-jsf-dev] Extension point in Visual Page editor of JSF

There is an extension used in pagedesigner.jsf.ui called
"org.eclipse.jst.pagedesigner.pageDesignerExtension".  It has an option
called "elementEditFactory".  An example is
org.eclipse.jst.pagedesigner.jsf.ui.elementedit.jsfhtml.JSFHTMLElementEd
itFactory used for the "html" JSF tag library.  If you create such a
factory, you can return instances of AbstractElementEdit for tags.  The
fillContextMenu callback on AbstractElementEdit should provide what you
want.  If not let me know.


--Cam

-----Original Message-----
From: wtp-jsf-dev-bounces@xxxxxxxxxxx
[mailto:wtp-jsf-dev-bounces@xxxxxxxxxxx]On Behalf Of Neeraj Bhatt
Sent: Tuesday, February 26, 2008 12:14 AM
To: Java Server Faces Tools developer discussion
Cc: Ankit Kakkar; marco.dubbeld@xxxxxxxxxx; Abhishek Jain
Subject: RE: [wtp-jsf-dev] Extension point in Visual Page editor of JSF


Hello

I need to add more options on the right click of JSF UI components
available in palette like Command Button. 

In the plugin org.eclipse.jst.pagedesigner.jsf.ui (Version 20070912) I
am not able to see any available extension points.

Basically all the options on the right click of UI components come from
addJSFAddItems method in org.eclipse.jst.pagedesigner.jsf.ui.actions.
JSFAddActionGroup, so I am trying to add an extension point which will
be called in addJSFAddItems as below

IExtension[] extensions = Platform.getExtensionRegistry()
	      .getExtensionPoint("xyz").getExtensions();

And subsequently adding in context menu and doing the required action.
(The action will open a tree which will display all the methods of some
specific java bean classes)

Are there any better approaches/available extension point to do this
task?

Thanks

		   



-----Original Message-----
From: wtp-jsf-dev-bounces@xxxxxxxxxxx
[mailto:wtp-jsf-dev-bounces@xxxxxxxxxxx] On Behalf Of
CAMERON.BATEMAN@xxxxxxxxxx
Sent: Tuesday, February 26, 2008 12:33 AM
To: wtp-jsf-dev@xxxxxxxxxxx
Cc: Ankit Kakkar; marco.dubbeld@xxxxxxxxxx; Abhishek Jain
Subject: Re: [wtp-jsf-dev] Extension point in Visual Page editor of JSF

Can you expand a bit on what you are trying to do and what extension
points you would like?  The Visual page editor already has extensive
extension points for extending such things as the context menus used on
the design canvas.

--Cam

--- Original Message ---
> 
> 
> <head>
> <meta http-equiv=Content-Type content="text/html; charset=us-ascii">
> 
> <!--[if gte mso 9]><xml>
>  <o:shapedefaults v:ext="edit" spidmax="1026" />
> </xml><![endif]--><!--[if gte mso 9]><xml>
>  <o:shapelayout v:ext="edit">
>   <o:idmap v:ext="edit" data="1" />
>  </o:shapelayout></xml><![endif]-->
> </head>
> 
> 
> 
> <div class=Section1>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>Hi,<o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>I am trying to add some features in the
> palette of &nbsp;the
> Visual page editor of JSF which is provided as part of
> WTP.<o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>For example I need to add extra option in
> the right click of
> command button, so that I can browse all the beans and their
> methods (in a tree
> format) available in the project.<o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>Once a particular method is available the
> underlying jsf
> code should change to incorporate the method name in the command
> tag like <o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>&lt;h:commandButton
>
action=&quot;#{whistleblowerBean.getPerson}&quot;&gt;&lt;/h:commandButto
n&gt;&nbsp;&nbsp;
> (Seam Specific action binding)<o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>&nbsp;<o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>I have implemented it by changing the
> org.eclipse.jst.pagedesigner.jsf.ui
> &amp; &nbsp;org.eclipse.jst.pagedesigner plugin code, but it
> would be a cleaner
> and extensible approach if I can do it through extension point
> mechanism<o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>If anyone can provide some help on extension
> point approach,
> it would be greatly appreciated<o:p></o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=MsoNormal><font size=2 face=Arial><span
> style='font-size:10.0pt;
> font-family:Arial'>Neeraj Bhatt<o:p></o:p></span></font></p>
> 
> </div>
> 
> 
> 
> 
> 
> 
> --------_______________________________________________
> wtp-jsf-dev mailing list
> wtp-jsf-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/wtp-jsf-dev
> 

_______________________________________________
wtp-jsf-dev mailing list
wtp-jsf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-jsf-dev
_______________________________________________
wtp-jsf-dev mailing list
wtp-jsf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-jsf-dev

_______________________________________________
wtp-jsf-dev mailing list
wtp-jsf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-jsf-dev


Index: plugin.xml
===================================================================
RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.pagedesigner.jsf.ui/plugin.xml,v
retrieving revision 1.5
diff -u -r1.5 plugin.xml
--- plugin.xml	30 Mar 2007 21:02:56 -0000	1.5
+++ plugin.xml	12 Mar 2008 13:39:07 -0000
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.2"?>
 <plugin>
+
+   <extension-point id="org.eclipse.jst.pagedesigner.contextMenu" name="contextMenu" schema="schema/org.eclipse.jst.contextMenu.exsd"/>
+
    <extension
          point="org.eclipse.jst.pagedesigner.pageDesignerExtension">
       <tagConverterFactory class="org.eclipse.jst.pagedesigner.jsf.ui.converter.jsfcore.JSFCoreConverterFactory"/>
@@ -690,4 +693,6 @@
             uri="http://java.sun.com/jsf/html";>
       </standardMetaDataFile>      
    </extension>
+
+ 
 </plugin>
Index: src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java
===================================================================
RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.pagedesigner.jsf.ui/src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java,v
retrieving revision 1.6
diff -u -r1.6 JSFAddActionGroup.java
--- src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java	16 Apr 2007 19:52:25 -0000	1.6
+++ src/org/eclipse/jst/pagedesigner/jsf/ui/actions/JSFAddActionGroup.java	12 Mar 2008 13:39:07 -0000
@@ -16,6 +16,10 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.action.IMenuListener;
@@ -35,13 +39,13 @@
  * @author mengbo
  * @version 1.5
  */
-public class JSFAddActionGroup {
+public class JSFAddActionGroup  {
 
 	private final static Action EMPTY_ACTION = new Action() {
         // TODO: why?
 	};
 
-
+	
 	/**
 	 * @param menu
 	 * @param element
@@ -71,6 +75,8 @@
 	 */
 	private void addJSFAddItems(IMenuManager submenu, IDOMElement element,
 			IJSFCoreSupport support) {
+		
+		IProject prj = null;
 		AddActionListenerAction actionListenerAction = new AddActionListenerAction(
 				element);
 		actionListenerAction.setEnabled(support.isActionSource());
@@ -80,12 +86,12 @@
 		attrAction.setEnabled(support.isUIComponent());
 		submenu.add(attrAction);
 
-		IProject prj = null;
+		
 		IFile file = StructuredModelUtil.getFileFor(element.getModel());
 		if (file != null) {
 			prj = file.getProject();
 		}
-
+       
 		IMenuManager converterMenu = new MenuManager(ActionsResources
 				.getString("Submenu.JSFAdd.Converter"));//$NON-NLS-1$
 		boolean supportConverter = support.isValueHolder();
@@ -112,7 +118,32 @@
 		AddParamAction addParamAction = new AddParamAction(element);
 		addParamAction.setEnabled(support.isUIComponent());
 		submenu.add(addParamAction);
+		///Adding Context Menu in JSF Components through extension points
+		
+		 IExtension[] extensions = Platform.getExtensionRegistry()
+	      .getExtensionPoint("org.eclipse.jst.pagedesigner.contextMenu").getExtensions();
+	   		  for (int i = 0; i < extensions.length; i++) {
+		      IConfigurationElement[] configElements =
+		         extensions[i].getConfigurationElements();
+		      for (int j = 0; j < configElements.length; j++) {
+
+		    	  try {
+		    		    String namOfMenu=configElements[j].getAttribute("Label");
+		    		    ContextMenuBase contextMenu = (ContextMenuBase)configElements[j].createExecutableExtension("callingClass");
+		    			JSFAddChildAction actionClass=contextMenu.getActionInstance(element,support.isEditableValueHolder(),prj.getName(),namOfMenu);
+		    			contextMenu.contextMenu(support, submenu,  actionClass);
+		    		} catch (InvalidRegistryObjectException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}  
+				catch(Exception e){
+					e.printStackTrace();
+				}
+		      }
+		   } 
 
+  ///Adding Context Menu in JSF Components
+		   
 		AddSelectItemAction selectItemAction = new AddSelectItemAction(element);
 		selectItemAction.setEnabled(support.supportSelectItems());
 		submenu.add(selectItemAction);
@@ -155,9 +186,7 @@
 		submenu.add(valueChangeAction);
 	}
 
-	/**
-	 * @return
-	 */
+	
 	private String[] getRegisteredValidatorIds(IProject project) 
     {
         String[] result = null;
@@ -182,9 +211,9 @@
         return result;
 	}
 
-	/**
-	 * @return
-	 */
+	
+ 
+
 	private String[] getRegisteredConverterIds(IProject project) 
     {
         String[] result = null;
@@ -208,4 +237,6 @@
         }
 		return result;
 	}
+	
+ 
 }
Index: src/org/eclipse/jst/pagedesigner/jsf/ui/actions/IContextMenu.java
===================================================================
RCS file: src/org/eclipse/jst/pagedesigner/jsf/ui/actions/IContextMenu.java
diff -N src/org/eclipse/jst/pagedesigner/jsf/ui/actions/IContextMenu.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/jst/pagedesigner/jsf/ui/actions/IContextMenu.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,19 @@
+package org.eclipse.jst.pagedesigner.jsf.ui.actions;
+
+import org.eclipse.jface.action.IMenuManager;
+
+/**
+ * This interface is to provide information of what action to add on the click of created context menu
+ * 
+ * 
+ * @author neeraj
+ * @version 1.0
+ */
+public interface IContextMenu {
+    /**
+     * @param support
+     * @param submenu
+     * @param actionClass
+     */
+    public void contextMenu(IJSFCoreSupport support,IMenuManager submenu,JSFAddChildAction actionClass);
+}
Index: src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ProjectClassLoader.java
===================================================================
RCS file: src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ProjectClassLoader.java
diff -N src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ProjectClassLoader.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ProjectClassLoader.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,123 @@
+package org.eclipse.jst.pagedesigner.jsf.ui.actions;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+
+/**
+ * @author neeraj
+ * This class is used to load the classes in the project created and not the plugin in classes
+ */
+public class ProjectClassLoader {
+	
+	/**
+	 * @param editor
+	 * @return URLClassLoader
+	 */
+	public static URLClassLoader getProjectClassLoader(IEditorPart editor) {
+		IEditorInput input = editor.getEditorInput();
+		if (input instanceof IFileEditorInput) {
+			IProject project = ((IFileEditorInput) input).getFile().getProject();
+			IJavaProject javaProject = JavaCore.create(project);
+			return getProjectClassLoader(javaProject);
+		}
+		return null;
+	}
+
+    /**
+     * @param project
+     * @return URLClassLoader
+     */
+    public static URLClassLoader getProjectClassLoader(IJavaProject project) {
+        List pathElements = getProjectClassPathURLs(project);
+        URL urlPaths[] = (URL[]) pathElements.toArray(new URL[pathElements.size()]);
+        return new URLClassLoader(urlPaths, Thread.currentThread().getContextClassLoader());
+    }
+
+    private static URL getRawLocationURL(IPath simplePath)
+            throws MalformedURLException {
+        File file = getRawLocationFile(simplePath);
+        return file.toURL();
+    }
+
+    private static File getRawLocationFile(IPath simplePath) {
+        IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(simplePath);
+        File file = null;
+        if (resource != null) {
+            file = ResourcesPlugin.getWorkspace().getRoot().findMember(
+                    simplePath).getRawLocation().toFile();
+        } else {
+            file = simplePath.toFile();
+        }
+        return file;
+    }
+
+    /**
+     * @param project
+     * @return Project class path list
+     */
+    public static List getProjectClassPathURLs(IJavaProject project) {
+        List pathElements = new ArrayList();
+        try {
+            IClasspathEntry[] paths = project.getResolvedClasspath(true);
+            if (paths != null) {
+                
+                for ( int i = 0; i < paths.length; i++ ) {
+                    IClasspathEntry path = paths[i];
+                    if (path.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
+                        URL url = getRawLocationURL(path.getPath());
+                        pathElements.add(url);
+                    }
+                }
+            }
+            IPath location = getProjectLocation(project.getProject());
+            IPath outputPath = location.append(project.getOutputLocation()
+                    .removeFirstSegments(1));
+            pathElements.add(outputPath.toFile().toURL());
+            
+            String[] names = project.getRequiredProjectNames();
+            for ( int i = 0; i < names.length; i++ ) {
+                String projectName = names[i];
+                IProject reqProject = project.getProject().getWorkspace()
+                    .getRoot().getProject(projectName);
+                if (reqProject != null) {
+                    IJavaProject reqJavaProject = JavaCore.create(reqProject);
+                    pathElements.addAll(getProjectClassPathURLs(reqJavaProject));
+                }
+            }
+        } catch (JavaModelException e) {
+           e.printStackTrace();
+        } catch (MalformedURLException e) {
+        	e.printStackTrace();
+        }
+        return pathElements;
+    }
+    
+    /**
+     * @param project
+     * @return IPath
+     */
+    public static IPath getProjectLocation(IProject project) {
+        if (project.getRawLocation() == null) {
+            return project.getLocation();
+        } else {
+            return project.getRawLocation();
+        }
+    }
+}
Index: schema/org.eclipse.jst.contextMenu.exsd
===================================================================
RCS file: schema/org.eclipse.jst.contextMenu.exsd
diff -N schema/org.eclipse.jst.contextMenu.exsd
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ schema/org.eclipse.jst.contextMenu.exsd	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,130 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.jst.pagedesigner.jsf.ui">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.jst.pagedesigner.jsf.ui" id="org.eclipse.jst.contextMenu" name="Context Menu "/>
+      </appInfo>
+      <documentation>
+         The context Menu plugin can be used to create context menu options in JSF HTML components in WTP JSF editor.
+This context menu extension point allows third-party plug-ins to define new context menu and the actions associated with the menu.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="contextMenu" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="contextMenu">
+      <complexType>
+         <attribute name="Label" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="callingClass" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.jsf.ui.actions.BeanMappingBase:"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         The following is an example
+of the context menu  extension point usage:
+&lt;p&gt;
+&lt;pre&gt;
+  
+   &lt;extension
+         point=&quot;org.eclipse.jst.pagedesigner.contextMenu&quot;&gt;
+      &lt;contextMenu
+            Label=&quot;Bean Mapping&quot;
+            callingClass=&quot;com.syfact.ace.wizard.BeanMapping&quot;&gt;
+      &lt;/contextMenu&gt;
+    &lt;/extension&gt;
+ &lt;/pre&gt;
+&lt;/p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         Plug-ins that want to extend this extension point must subclass
+&lt;samp&gt;org.eclipse.jface.action.IMenuManager.ContextMenuBase&lt;/samp&gt; and
+generates instance of class that extends &lt;samp&gt;org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFAddChildActiont&lt;/samp&gt;class
+
+The class which will extends &lt;samp&gt;org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFAddChildActiont&lt;/samp&gt;class should have a run method which will describe beahviour on click of created context menu.
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+</schema>
Index: src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ContextMenuBase.java
===================================================================
RCS file: src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ContextMenuBase.java
diff -N src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ContextMenuBase.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/jst/pagedesigner/jsf/ui/actions/ContextMenuBase.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,28 @@
+package org.eclipse.jst.pagedesigner.jsf.ui.actions;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+/**
+ * This abstract class is to be extended by the class which is using context menu extension
+ * It implements IContextMenu in case default implementation are to be passed for the users of context menu extension. 
+ * 
+ * 
+ * @author neeraj
+ * @version 1.0
+ */
+public abstract class ContextMenuBase implements IContextMenu {
+
+	public abstract void contextMenu(IJSFCoreSupport support, IMenuManager submenu,
+			JSFAddChildAction actionClass) ;
+	/**
+	 * @param parentNode - IDOM Element specifies the particular tag selected
+	 * @param editableelement - the component is editable or not
+	 * @param projname - Current project name on which the jsf editor is used
+	 * @param nameOfMenu - The label given in extension point
+	 * 
+	 * 
+	 *  
+	 */
+	public abstract JSFAddChildAction getActionInstance(IDOMElement parentNode, boolean editableelement,String projname,String nameOfMenu);
+	   
+}

Back to the top