Practices for porting swing application development to eclipse + visual editor in JBuilder

Source: Internet
Author: User
Tags xmi file
Process report on migrating the ABC framework project from jbuilderx to eclipse3.1

The development environment of the current ABC framework fund financial system is based on JBuilder. According to the current level of JBuilder and future development prospects, it is not optimistic. Therefore, we recommend that you migrate the abcss project to eclipse. First, use eclipse to import the JBuilder project. Specifically, create a Java project and import the JBuilder file to the newly created Java project. Some files are dedicated to JBuilder projects. You can delete them, such as abcss. JPX and abcss. JPX. Local. 2. After importing eclipse, a bunch of errors will be prompted during the build workspace because two jar packages are missing, which are not reported in JBuilder. One is crimson. jar. This is because a Java file has imported the package to parse XML but it is not used. The other one is javaws. jar. This jar package is used when Web Start is used. This jar package can be found in "D:/Java/jre1.5.0/lib". After jdk5.0, installation of JRE does not create the Web Start icon, but the jar package is still in progress. 3. After importing the two jar packages above, the program compilation should be basically normal. Next we need to edit the Java swing program in eclipse, the first plug-in is visual editor (http://www.eclipse.org/vep/WebContent/main.php) because this plug-in is in the Eclipse project, and powerful, you can edit swing, AWT, SWT, and other programs. After downloading ve from the above site, we recommend that you use ve1.1 or later versions and install it according to the Eclipse plug-in installation method. Note that you need to install the EMF and GEF frameworks. Shows the appearance after installation. When opening a class, you can open the visual editing window through open with-> visual editor for the first time. After opening the visual window, you can open the view of Java Bean and properties through open view to view the controls and properties of the window, and you can adjust the control order by dragging. For more information, see the tutorial of using ve. 4. We cannot see the components of ABC from the opened window. We can use either of the two methods, or through the "choose bean…" on the floating canvas ..." Button to select the object to be used, which is troublesome, and the new user needs to remember the object name. Another way is to display the category of a floating panel. Here we use floating panel classification with choose bean. 5. Create a New floating panel category. Because we have already written bean and beaninfo, We can reuse these resources to create a plug-in project. ). The following describes the plug-in configuration. Plugin. xml <? XML version = "1.0" encoding = "UTF-8"?> <? Eclipse version = "3.0"?> <Plugin> <extension point = "org. eclipse. jdt. UI. classpathcontainerpage "> <classpathcontainerpage name =" ABC library "class =" org. eclipse. ve. internal. java. wizard. registeredclasspathcontainerwizardpage "id =" com. ABC. abccontainer "> class container Page name </classpathcontainerpage> </extension> <extension point =" org. eclipse. jdt. core. classpathcontainerinitializer "> <classpathcontainerinitializer class =" org. eclipse. ve. intern Al. java. core. registeredclasspathcontainerinitializer "id =" com. ABC. abccontainer "> </classpathcontainerinitializer> </extension> <extension point =" org. eclipse. ve. java. core. registrations "> the extension point registers the required jar package. You can register multiple packages here. the descriptor name is the name of the library in the Add library in the build path of the project, the canvas category of ABC components <registration Container = "com. ABC. abccontainer "Description =" ABC library "> <library runtime =" abc20.jar "/> </Re Gistration> </extension> <extension point = "org. eclipse. ve. java. core. contributors "> specifies the classification XMI (swap file) used by the canvas ABC container <palette Container =" com. ABC. abccontainer "categories =" ABC. XMI "/> </extension> <extension point =" org. eclipse. jem. beaninfo. registrations "> <registration iner =" com. ABC. abccontainer "> </registration> </extension> </plugin> ABC. content of the XMI file: This is a configuration snippet <XMI: version = "2.0" xmlns: XMI = "http :// Www.omg.org/xmi” xmlns: ecore = "http://www.eclipse.org/emf/2002/ecore” xmlns: palette =" http: // ORG/Eclipse/ve/Internal/CDE/palette. ecore "xmlns: utility =" http: // ORG/Eclipse/ve/Internal/CDE/utility. ecore "> <palette: categorycmp XMI: Id =" swtcat0 "> <categorylabel xsi: TYPE =" utility: constantstring "string =" ABC component "/> name of the category displayed on the panel <! -- Ebutton --> <cmpgroups xsi: TYPE = "palette: groupcmp"> <cmpentries xsi: TYPE = "palette: annotatedcreationentry" XMI: id = "entry1" each project requires a different XMI: Id icon16name = "Platform:/plugin/org. eclipse. ve. jfc/icons/full/clcl16/button_obj.gif "> icon position/plugin/org. eclipse. ve. jfc refers to the plug-in ID of the plug-in, not the path. The path is after "full". This can be seen from the plug-in details in the help. It can be found in abcplugin. set the image path in Java <objectcreationentry xsi: TYPE = "palette: emfcreationtoolentry" creationclassuri = "Java:/COM. ABC. ermsuite. platform. framework. looks. swing # ebutton "/> package path and class name, separated by # <entrylabel xsi: TYPE =" utility: constantstring "string =" ebutton "/> name of the control displayed on the panel </cmpentries> </cmpgroups> <! -- Etextfield --> <cmpgroups xsi: TYPE = "palette: groupcmp"> <cmpentries xsi: TYPE = "palette: annotatedcreationentry" XMI: Id = "entry3" icon16name = "Platform: /plugin/org. eclipse. ve. jfc/icons/full/clcl16/textfield_obj.gif "> <objectcreationentry xsi: TYPE =" palette: emfcreationtoolentry "creationclassuri =" Java:/COM. ABC. ermsuite. platform. framework. looks. swing # etextfield "/> <entrylabel xsi: TYPE =" utility: constantst Ring "string =" etextfield "/> </cmpentries> </cmpgroups> </palette: categorycmp> </XMI: XMI> 6, put these files into the eclipse directory as plug-ins. After startup, set build path, add library, and add ABC library in the project attribute.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.