Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » 1:How to install and use the ve.examples ??? + 2:My Plugin
1:How to install and use the ve.examples ??? + 2:My Plugin [message #83082] Thu, 10 March 2005 08:51
Elena Demeter is currently offline Elena DemeterFriend
Messages: 152
Registered: July 2009
Senior Member
Hello,

1.
I extracted VE-examples-N20050303.zip to folder C:/XYZ because my
eclipse is
in C:/XYZ/eclipse.

In "About eclipse platform" I can see this plugin. But there are not
new
components or container on the palette. Also in "New | Examples"
examples
do not exist. And there is not "Advanced..." in the BuildPath.

2.
I tried to create my own plugin ("New | Plug-In Project...). I inserted
two
classes in the plugin: ButtonBar.jar and ButtonBarBeanInfo.jar, files:
myCat.xmi. And I changed the plugin.xml. I am not sure if I changed the
plugin.xml correctly. I would be so glad if somebody give me a tip
why my Component/Container does not appear on the palette.

****************** ButtonBar.java **************************
------------------------------------------------------------ --
import java.awt.Color;
import java.awt.FlowLayout;

public class ButtonBar extends java.awt.Panel {
private Color color = new Color(4);
/**
* ButtonBarOne constructor comment.
*/
public ButtonBar() {
super();
setLayout(new FlowLayout(FlowLayout.LEFT,5,5));
setBackground(color);
}
private Color getColor() {
return color;
}
private void setColor(Color color) {
this.color = color;
}

public void dummyMethod (String args) {

}
}
------------------------------------------------------------ --
****************** ButtonBarBeanInfo.java ******************
------------------------------------------------------------ --
import java.beans.*;
import java.lang.reflect.*;

public class ButtonBarBeanInfo extends SimpleBeanInfo {

public BeanDescriptor getBeanDescriptor(){
return new BeanDescriptor(ButtonBar.class);
}

public MethodDescriptor[] getMethodDescriptors () {
MethodDescriptor[] mDescriptor = null;
try {
Class stringArgs[] = { java.lang.String.class };

Method dummyMethod = ButtonBar.class.getMethod("dummyMethod",
stringArgs);
mDescriptor [0] = new MethodDescriptor(dummyMethod);

} catch (NoSuchMethodException e) {

}

return mDescriptor;
}
}
------------------------------------------------------------ --
*************************** myCat.xmi **********************
------------------------------------------------------------ --
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:palette="http:///org/eclipse/ve/internal/cde/palette.ecore"
xmlns:utility="http:///org/eclipse/ve/internal/cde/utility.ecore">
<palette:CategoryCmp xmi:id="cat1">
<categoryLabel xsi:type="utility:ConstantString" xmi:id="string0"
string="My Category"/>
<cmpGroups xsi:type="palette:GroupCmp" xmi:id="group1">
<cmpEntries xsi:type="palette:AnnotatedCreationEntry"
xmi:id="entry4"
icon16Name=" platform:/plugin/org.eclipse.ve.java.core/icons/full/obj16/j avabean_obj.gif ">
<objectCreationEntry xsi:type="palette:EMFCreationToolEntry"
xmi:id="entry7obj"
creationClassURI="java:/myjavabean#ButtonBar"/>
<entryLabel xsi:type="utility:ConstantString" xmi:id="string3"
string="ButtonBar"/>
</cmpEntries>
</cmpGroups>
</palette:CategoryCmp>
</xmi:XMI>
------------------------------------------------------------ --
*************************** plugin.xml **********************
------------------------------------------------------------ --
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="MyJavaBeanPlugin"
name="MyJavaBeanPlugin Plug-in"
version="1.0.0"
provider-name="">

<runtime>
<library name="ButtonBar.jar">
<export name="*"/>
</library>
</runtime>

<requires>
<import plugin="org.eclipse.ve.java.core"/>
<import plugin="org.eclipse.ui.views"/>
<import plugin="org.eclipse.ui.ide"/>
<import plugin="org.eclipse.jface"/>
<import plugin="org.eclipse.emf.ecore"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.jem"/>
<import plugin="org.eclipse.jem.proxy"/>
<import plugin="org.eclipse.ve.cde"/>
<import plugin="org.eclipse.gef"/>
<import plugin="org.eclipse.ve.propertysheet"/>
<import plugin="org.eclipse.jdt.launching"/>
<import plugin="org.eclipse.jem.beaninfo"/>
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.eclipse.core.runtime"/>

<extension
point="org.eclipse.ve.java.core.contributors">
<palette
container="MyBeans"
categories="myCat.xmi">
</palette>
</extension>

<extension
point="org.eclipse.jem.beaninfo.registrations">
<registration
container="MyBeans">
<beaninfo
path="ButtonBarBeanInfo.jar">
</beaninfo>
</registration>
</extension>

<extension
point="org.eclipse.ve.java.core.registrations">
<registration
container="MyBeans"
description="MyBeans">
<library
runtime = "ButtonBar.jar"
source = "ButtonBar.jar">
</library>
</registration>
</extension>

</plugin>
------------------------------------------------------------ -----------

Thank you :o)

Elena
Previous Topic:VE null pointer when creating a Visual Class
Next Topic:1:How to install and use the ve.examples ??? + 2:My Plugin
Goto Forum:
  


Current Time: Fri Apr 26 17:47:41 GMT 2024

Powered by FUDForum. Page generated in 0.02834 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top