CRSX plug-in development. Prerequisites Software and Libraries Eclipse RCP (3.5 or higher) –Go //...

15
CRSX plug-in development

Transcript of CRSX plug-in development. Prerequisites Software and Libraries Eclipse RCP (3.5 or higher) –Go //...

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 – 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 E

xploring” perspective• Add new location

– Connection type: extssh– Host: crsx.cvs.sourceforge.

net– Repository path: /cvsroot/cr

sx/

Check out projects

• Start eclipse• Open “CVS repository ex

ploring” perspective• Expand crsx location, He

ad, crsx-eclipse-plug-in• Check out “crsx-feature”

project• Check out “crsx-plugin” pr

oject• Check out “crsx-update-si

te” project

Jar Files

• Start eclipse• Set the following jar fil

es 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 “E

xporting” section• Set Directory path in “Destinati

on” tab in “Export” dialog• Click “Options” tab in “Export”

dialog• Select “Use class files compile

d in the workspace”• Click “Finish” button at the bott

om 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” sec

tion• 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” sec

tion• 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 Applic

ation”

Constant Values

• net.sf.crsx.eclipseplugin.Constants– Characters and String values which are share

d with many classes are in this class

User preference

• CRSXRuleEditorPreferencePage– This class provides user level configurations.– Currently the following two items can be confi

gured by uses• Allow eclipse plug-in to invoke CRSX or not• List-based outline view, or nested outline view by r

ule name

Rule Editor

• CRSRuleEditor– Core implementation of rule editor. This class reads and write fil

es

• CRSRulePartitionScanner– This class splits rule file into some areas such as comment, emb

edded 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 CRS

X and plug-in. All classes in plug-in invokes CRSX via this class.

Outline

• CRSXOutlinePage– This class is the core implementation for outlin

e view.– This class gets rule tree object from CRSXInv

okeUtil

Iterative Rewriting

• DebugView– This class is core implementation for iterative rewritin

g.

• CRSXRunnerThread– Iterative rewriting is executed on a different thread fro

m eclipse’s thread.

• ObjectSharingObserver– This class is for sharing rule tree, and term with plug-i

n and CRSX whith are in different threads