150 likes | 251 Views
CRSX plug-in development. Prerequisites Software and Libraries. Eclipse RCP (3.5 or higher) Go http://www.eclipse.org/ Select “Download” Select “Eclipse for RCP/Plug-in Developers” Download an eclipse archive file. Uncompress the eclipse archive file. Jar file of CRSX
E N D
Prerequisites Software and Libraries • Eclipse RCP (3.5 or higher) • Go http://www.eclipse.org/ • Select “Download” • Select “Eclipse for RCP/Plug-in Developers” • Download an eclipse archive file. • Uncompress the eclipse archive file. • Jar file of CRSX • Go http://sourceforge.net/projects/crsx/ • Select “Download” • Download an archive file • Extract crsx.jar from the archive file • Jar files of Antlr • Go http://www.antlr.org/download • Download antlr-runtime-3.1.3.jar • Download antlr-3.1.3.jar
Register CRSX CVS server to eclipse • Start eclipse RCP • Open “CVS Repository Exploring” perspective • Add new location • Connection type: extssh • Host: crsx.cvs.sourceforge.net • Repository path: /cvsroot/crsx/
Check out projects • Start eclipse • Open “CVS repository exploring” perspective • Expand crsx location, Head, crsx-eclipse-plug-in • Check out “crsx-feature” project • Check out “crsx-plugin” project • Check out “crsx-update-site” project
Jar Files • Start eclipse • Set the following jar files to “lib” directory in “crsx-plugin” project • crsx.jar • antlr-runtime-3.1.3.jar • antlr-3.1.3.jar
Create jar file for the eclipse plug-in • Double click the “plugin.xml” in “crsx-plugin” project (Or open with “Plug-in Manifest Editor”) • Select “Overview” tab • Click “Export Wizard” link in “Exporting” section • Set Directory path in “Destination” tab in “Export” dialog • Click “Options” tab in “Export” dialog • Select “Use class files compiled in the workspace” • Click “Finish” button at the bottom of the dialog
Update plug-in version, and Upload jar for network installation • Open “plugin.xml” in “crsx-plugin” project • Click “Overview” tab, and fill the version number in “Version” text box in “General Information” section • Export jar file of “crsx-plugin” project • Open “feature.xml” in “crsx-feature” • Click “Overview” tab, and fill the version number in “Version” text box in “General Information” section • Click “Plug-ins” tab, and fill the version number in “Version” text box in “Plug-in Details” section • Open “site.xml” in “crsx-update-site” project • Select “net.sf.crsx.eclipse.plugin.category” in “Managing the Site” section • Click “Add Feature” button • Select “net.sf.crsx.eclipse.feature(x.x.x)” in “Feature Selection” dialog • Click “Build All” button • Go to the “crsx-update-site” with linux terminal • $rm plugins/net.sf.crsx.ruleEditor_0.23.1.jar • $ cp ../crsx-plugin/build/build/net.sf.crsx.ruleEditor_0.23.1.jar .plugin/ • $ chmod +x upload.sh • $ upload.sh USERNAME The plug-in jar file created by update-site project is broken if the source code include multi byte character. So we have to replace it manually by plug-in jar created by the plug-in project
Start another eclipse with plug-in • Right click the “crsx-plugin” project • Select “Run As” • Select “Eclipse Application”
Constant Values • net.sf.crsx.eclipseplugin.Constants • Characters and String values which are shared with many classes are in this class
User preference • CRSXRuleEditorPreferencePage • This class provides user level configurations. • Currently the following two items can be configured by uses • Allow eclipse plug-in to invoke CRSX or not • List-based outline view, or nested outline view by rule name
Rule Editor • CRSRuleEditor • Core implementation of rule editor. This class reads and write files • CRSRulePartitionScanner • This class splits rule file into some areas such as comment, embedded token • CRSRuleScanner • Highlighting syntax for crsx rule • CRSRuleEmbeddedScanner • Highlighting syntax for embedded token • CRSXCharacterPairMatcher • highlighting corresponding braces, brackets, and so on.
Communication between CRSX and plug-in • CRSXInvokeUtil • This class is the gateway class between CRSX and plug-in. All classes in plug-in invokes CRSX via this class.
Outline • CRSXOutlinePage • This class is the core implementation for outline view. • This class gets rule tree object from CRSXInvokeUtil
Iterative Rewriting • DebugView • This class is core implementation for iterative rewriting. • CRSXRunnerThread • Iterative rewriting is executed on a different thread from eclipse’s thread. • ObjectSharingObserver • This class is for sharing rule tree, and term with plug-in and CRSX whith are in different threads