FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I...
Transcript of FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I...
![Page 1: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/1.jpg)
FeatureIDE: Development
Thomas Thum, Jens MeinickeMarch 4, 2015
![Page 2: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/2.jpg)
Installing Eclipse
1. Download Eclipse: http://www.eclipse.org/downloads/I 4.3 (Kepler) is recommended (works also with 3.4 and newer)I Choose ”Eclipse for RCP and RAP Developers” that you can
access sources of Eclipse standard plug-ins2. Unzip Eclipse
I Make sure that you have all permissions for the directory (donot use Windows’ program files folder)
3. Create a shortcut, add VM arguments: .../eclipse.exe-vmargs -Duser.name="Name Surname" -Xmx1024M
I Eclipse can automatically insert your name as authorI Avoids OutOfMemoryException
4. Start Eclipse and create a new workspace
Thomas Thum, Jens Meinicke FeatureIDE: Development 2
![Page 3: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/3.jpg)
Installing EGit, CDT and FindBugs
5. Install Git plugin such as EGit using Eclipse updatemechanism http://download.eclipse.org/egit/updates
6. Install CDT (can be skipped if you not intend to work withthe FeatureC++ plugin) http://download.eclipse.org/tools/cdt/releases/8.4
Thomas Thum, Jens Meinicke FeatureIDE: Development 3
![Page 4: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/4.jpg)
Installing EGit, CDT and FindBugs
5. Install Git plugin such as EGit using Eclipse updatemechanism http://download.eclipse.org/egit/updates
6. Install CDT (can be skipped if you not intend to work withthe FeatureC++ plugin) http://download.eclipse.org/tools/cdt/releases/8.4
Thomas Thum, Jens Meinicke FeatureIDE: Development 3
![Page 5: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/5.jpg)
Checkout FeatureIDE Sources7. Download FeatureIDE plugins from our Git repository
https://github.com/tthuem/FeatureIDE.gitI no login credentials required for checkout
Thomas Thum, Jens Meinicke FeatureIDE: Development 4
![Page 6: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/6.jpg)
Checkout FeatureIDE Sources7. Download FeatureIDE plugins from our Git repository
https://github.com/tthuem/FeatureIDE.gitI no login credentials required for checkout
Thomas Thum, Jens Meinicke FeatureIDE: Development 4
![Page 7: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/7.jpg)
Checkout FeatureIDE Sources7. Download FeatureIDE plugins from our Git repository
https://github.com/tthuem/FeatureIDE.gitI no login credentials required for checkout
Thomas Thum, Jens Meinicke FeatureIDE: Development 4
![Page 8: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/8.jpg)
Creating a Run Configuration
8. Create a new run configuration for Eclipse Applications andenable debug tracing for all FeatureIDE plugins (namedde.ovgu.featureide.*)
9. Also add VM arguments to avoid OutOfMemory Exceptions:-Dosgi.requiredJavaVersion=1.6 -Xmx512M-XX:MaxPermSize=256M
Thomas Thum, Jens Meinicke FeatureIDE: Development 5
![Page 9: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/9.jpg)
Creating a Run Configuration
8. Create a new run configuration for Eclipse Applications andenable debug tracing for all FeatureIDE plugins (namedde.ovgu.featureide.*)
9. Also add VM arguments to avoid OutOfMemory Exceptions:-Dosgi.requiredJavaVersion=1.6 -Xmx512M-XX:MaxPermSize=256M
Thomas Thum, Jens Meinicke FeatureIDE: Development 5
![Page 10: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/10.jpg)
Structure of the Repository
plugins/ Source Code of the FeatureIDE plugins
deploy/ FeatureIDE features, update site project,and plugin builder project
lib/ Extensions of AHEAD used in FeatureIDE
featuremodels/ Example FeatureIDE projects, feature modelwithout code
tests/ JUnit test plugins
experimental/ Non-stable implementations
Thomas Thum, Jens Meinicke FeatureIDE: Development 6
![Page 11: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/11.jpg)
FeatureIDE Features
1. Feature Modeling:de.ovgu.featureide.featuremodeling
2. FeatureIDE (requires 1.):de.ovgu.featureide
3. FeatureIDE extension for FeatureHouse (requires 2.):de.ovgu.featureide.featurehouse
4. FeatureIDE extension for FeatureC++ (requires 2.):de.ovgu.featureide.featurecpp
5. FeatureIDE extension for Antenna (requires 2.):de.ovgu.featureide.antenna
Thomas Thum, Jens Meinicke FeatureIDE: Development 7
![Page 12: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/12.jpg)
FeatureIDE Features
6. FeatureIDE extension for AspectJ (requires 2.):de.ovgu.featureide.aspectj
7. FeatureIDE extension for DeltaJ (requires 2.):de.ovgu.featureide.deltaj
8. FeatureIDE extension for Munge (requires 2.):de.ovgu.featureide.munge
9. Unit-Tests for FeatureIDE
10. FeatureIDE example projects
Thomas Thum, Jens Meinicke FeatureIDE: Development 8
![Page 13: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/13.jpg)
1. Feature Modeling
Plugins in Feature de.ovgu.featureide.featuremodeling:I de.ovgu.featureide.fm.core
I Abstract models for feature models and configurationsI Parser and writer for feature models and configurationsI Automated analysis for feature models and configurationsI Classification of feature model edits
I de.ovgu.featureide.fm.uiI Feature Model EditorI Error markers for feature models and configurationsI Feature Model Edit ViewI Feature Model Outline ViewI Import, export, and printing of feature models
Thomas Thum, Jens Meinicke FeatureIDE: Development 9
![Page 14: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/14.jpg)
2. FeatureIDE
Core plugins in Feature de.ovgu.featureide:I de.ovgu.featureide.core
I Abstract feature projectI Extensible builderI Abstract FSTModel
I de.ovgu.featureide.core.aheadI Builder extension to compose Jak filesI Full FSTModel for Jak filesI Localization of Jak errors in source files
Thomas Thum, Jens Meinicke FeatureIDE: Development 10
![Page 15: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/15.jpg)
2. FeatureIDE
UI plugins in Feature de.ovgu.featureide:I de.ovgu.featureide.ui
I FeatureIDE perspectiveI Decorators, buttons, and menu itemsI Collaboration DiagramI Collaboration Outline ViewI Feature Statistics ViewI Wizards for FeatureIDE projects, configurations and filesI Builder to create all valid or current products
I de.ovgu.featureide.ui.aheadI Jak editor with content assist and outline view
I de.ovgu.featureide.ui.docI Cheat sheet and FeatureIDE introduction page
Thomas Thum, Jens Meinicke FeatureIDE: Development 11
![Page 16: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/16.jpg)
3./4. FeatureHouse and FeatureC++ Extension
Plugins in Feature de.ovgu.featureide.featurehouse:I de.ovgu.featureide.core.featurehouse
I Builder extension to compose FeatureHouse filesI Error Propagation for Feature House filesI FSTModel for the actual ConfigurationI Support for contracts in JML
Plugins in Feature de.ovgu.featureide.featurecpp:I de.ovgu.featureide.core.featurecpp
I Builder extension to compose FeatureC++ filesI FSTModel for the actual Configuration
Thomas Thum, Jens Meinicke FeatureIDE: Development 12
![Page 17: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/17.jpg)
5./6. Antenna and AspectJ Extension
Plugins in Feature de.ovgu.featureide.antenna:I de.ovgu.featureide.core.antenna
I Preprocessor extension using AntennaI FSTModel with preprocessor annotations
Plugins in Feature de.ovgu.featureide.aspectj:I de.ovgu.featureide.core.aspectj
I Builder extension using AspectJ
Thomas Thum, Jens Meinicke FeatureIDE: Development 13
![Page 18: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/18.jpg)
7./8. DeltaJ and Munge Extension
Plugins in Feature de.ovgu.featureide.deltaj:I de.ovgu.featureide.core.deltaj
I Builder extension using DeltaJ
Plugins in Feature de.ovgu.featureide.munge:I de.ovgu.featureide.core.munge
I Preprocessor extension using MungeI FSTModel with preprocessor annotationsI Error propagation
Thomas Thum, Jens Meinicke FeatureIDE: Development 14
![Page 19: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/19.jpg)
9./10. JUnit Tests and Examples
Plugins in Feature de.ovgu.featureide.test:I de.ovgu.featureide.*-test
I Several JUnit tests
Plugins in Feature de.ovgu.featureide.examples:I de.ovgu.featureide.examples
I Example projects for several composition tools
Thomas Thum, Jens Meinicke FeatureIDE: Development 15
![Page 20: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/20.jpg)
Extension Points
You can extend FeatureIDE with your own functionality, by usingthe provided extension points named:
1. de.ovgu.featureide.core.composers
2. de.ovgu.featureide.fm.core.FMComposer
3. de.ovgu.featureide.fm.ui.FeatureDiagram
4. de.ovgu.featureide.fm.ui.FeatureModelEditor
5. de.ovgu.featureide.ui.ConfigurationEditor
Thomas Thum, Jens Meinicke FeatureIDE: Development 16
![Page 21: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/21.jpg)
Integrate a Composition ToolCreate a new Plug-in Project (open the Plug-in Project wizard)
I Set the projects nameI Disable activator generationI Press Finish
Thomas Thum, Jens Meinicke FeatureIDE: Development 17
![Page 22: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/22.jpg)
Integrate a Composition ToolCreate a new Plug-in Project (open the Plug-in Project wizard)
I Set the projects nameI Disable activator generationI Press Finish
Thomas Thum, Jens Meinicke FeatureIDE: Development 17
![Page 23: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/23.jpg)
Setup the Plug-in ProjectAfter creating the project, the plugin manifest will be opened
I Select the Dependencies page and add following requiredplug-ins
I org.eclipse.uiI org.eclipse.core.runtimeI org.eclipse.core.resourcesI de.ovgu.featureide.coreI de.ovgu.featureide.fm.core
Thomas Thum, Jens Meinicke FeatureIDE: Development 18
![Page 24: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/24.jpg)
Setup the Plug-in Project
Select the Overview PageI enable plug-in-activation when a class is loadedI left-click “Activator:“ to create the activator class
Thomas Thum, Jens Meinicke FeatureIDE: Development 19
![Page 25: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/25.jpg)
Create the Activator Class
I Set the Activators nameI Set the package (not deafault package)I Set the Superclass:
I de.ovgu.featureide.fm.core.AbstractCorePluginI Press Finish
Thomas Thum, Jens Meinicke FeatureIDE: Development 20
![Page 26: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/26.jpg)
Create the Activator Class
The new activator class should look like the activator classes of theother composer plug-ins. e.g. look at AheadCorePlugin of theAHEAD plug-in.
Thomas Thum, Jens Meinicke FeatureIDE: Development 21
![Page 27: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/27.jpg)
Set Extension PointSelect the Extensions Page
I add the following extension pointI de.ovgu.featureide.core.composers
I Specify the Extension Element Details on the rightI left-click “class*:“ to create the composer class
I the file wizard is auto-filled, so only press finish
Thomas Thum, Jens Meinicke FeatureIDE: Development 22
![Page 28: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/28.jpg)
Set Extension PointSelect the Extensions Page
I add the following extension pointI de.ovgu.featureide.core.composers
I Specify the Extension Element Details on the rightI left-click “class*:“ to create the composer class
I the file wizard is auto-filled, so only press finish
Thomas Thum, Jens Meinicke FeatureIDE: Development 22
![Page 29: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/29.jpg)
Composer Integration
To integrate your composition tool you need to implement thenewly created class. The most methods got defaultimplementations. To adjust FeatureIDE to your composer,implement the provided methods. For further informations seetheir Javadoc.
Thomas Thum, Jens Meinicke FeatureIDE: Development 23
![Page 30: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/30.jpg)
FMComposer ExtensionFor some Feature Model specific extensions (e.g. renamings andfeature order.) you need to extend the following extension point.
I de.ovgu.featureide.fm.core.FMComposerCreate and implement the class of this extension point
Thomas Thum, Jens Meinicke FeatureIDE: Development 24
![Page 31: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/31.jpg)
FMComposer ExtensionFor some Feature Model specific extensions (e.g. renamings andfeature order.) you need to extend the following extension point.
I de.ovgu.featureide.fm.core.FMComposerCreate and implement the class of this extension point
Thomas Thum, Jens Meinicke FeatureIDE: Development 24
![Page 32: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/32.jpg)
FMComposer ExtensionFor some Feature Model specific extensions (e.g. renamings andfeature order.) you need to extend the following extension point.
I de.ovgu.featureide.fm.core.FMComposerCreate and implement the class of this extension point
Thomas Thum, Jens Meinicke FeatureIDE: Development 24
![Page 33: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/33.jpg)
DebuggingTo get debugging information you need to create a file named“.options” at your plug-in project. Set the files content to“plug-in-id”/debug=true Now you can do outputs to the errorlogby calling:
I ActivatorClass.getDefault().log. . . ();
Thomas Thum, Jens Meinicke FeatureIDE: Development 25
![Page 34: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/34.jpg)
DebuggingTo get debugging information you need to create a file named“.options” at your plug-in project. Set the files content to“plug-in-id”/debug=true Now you can do outputs to the errorlogby calling:
I ActivatorClass.getDefault().log. . . ();
Thomas Thum, Jens Meinicke FeatureIDE: Development 25
![Page 35: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/35.jpg)
Debugging with FindBugsFindBugs is a static analyzation tool for Java. It shows errorscomparable to the Java compiler but it is much more powerful.
I Install Findbugs via updatesite:http://findbugs.cs.umd.edu/eclipse
See also: http://findbugs.sourceforge.net/Thomas Thum, Jens Meinicke FeatureIDE: Development 26
![Page 36: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/36.jpg)
Run FindBugsI Run manual
I Open the context menu of a java projectI Open the submenu of ’Find Bugs’I Run ’Find Bugs’
I Run automaticallyI Open the property page of a Java Project.I Open the entry for FindBugs.I Activate ’Run Automatically’
Thomas Thum, Jens Meinicke FeatureIDE: Development 27
![Page 37: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/37.jpg)
Run FindBugsI Run manual
I Open the context menu of a java projectI Open the submenu of ’Find Bugs’I Run ’Find Bugs’
I Run automaticallyI Open the property page of a Java Project.I Open the entry for FindBugs.I Activate ’Run Automatically’
Thomas Thum, Jens Meinicke FeatureIDE: Development 27
![Page 38: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/38.jpg)
Configure FindBugs
I Open the property page of a Java Project.I Open the entry for FindBugs.I Select ’Configure Workspace Settings’ at the upper right
corner.I Here you can specify settings for the whole workspce.
Thomas Thum, Jens Meinicke FeatureIDE: Development 28
![Page 39: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/39.jpg)
Configure FindBugs
I Open the property page of a Java Project.I Open the entry for FindBugs.I Select ’Configure Workspace Settings’ at the upper right
corner.I Here you can specify settings for the whole workspce.
Thomas Thum, Jens Meinicke FeatureIDE: Development 28
![Page 40: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/40.jpg)
Configure FindBugsTo use FindBugs more efficient you need to integrate a jar filenamed fb-contrib which provides some additional bug patterns.
I Select the tab ’Plugins and misc. Settings’.I The link will lead you to the website where you can download
the jar file.I Copy the fb-contrib jar into
’../eclipse/plugins/edu.umd../plugin/’I Activate ’fb-contib plugin’
Thomas Thum, Jens Meinicke FeatureIDE: Development 29
![Page 41: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/41.jpg)
FindBugs-ViewsFindBugs provided some additional views
I Bug ExplorerI An additional view comparable to the Problems view
I Bug InfoI Shows additional information about the bug
Thomas Thum, Jens Meinicke FeatureIDE: Development 30
![Page 42: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/42.jpg)
FindBugs-ViewsFindBugs provided some additional views
I Bug ExplorerI An additional view comparable to the Problems view
I Bug InfoI Shows additional information about the bug
Thomas Thum, Jens Meinicke FeatureIDE: Development 30
![Page 43: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/43.jpg)
FindBugs-@Annotations
To find some more bugs, FindBugs provides some annotations.To use these annotations add the corresponding jar files to thebuild path
I jsr305.jarYou will find them at the ’*.fm.core plugin’ or at the FindBugsinstallation folder/lib.
Thomas Thum, Jens Meinicke FeatureIDE: Development 31
![Page 44: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/44.jpg)
FindBugs-@Annotations
Specify the return value or a parameter of a method with anannotation e.g.:
I @NonnullI The value will never be nullI You need to be sure that the return value is never null or your
method does not support null as an argumentI No unnecessary null checks
I @CheckForNullI The value can be null and should be checked
These annotations are important because the most errors areNullPointer and they can be prevented with these annotations.Examples:
I @CheckForNull Object canBeNull(){}I void checkParameter(@CheckForNull Object parameter){}
Thomas Thum, Jens Meinicke FeatureIDE: Development 32
![Page 45: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/45.jpg)
Extension Point Architecture
Figure: A simplyfied model of the composer extension points
Thomas Thum, Jens Meinicke FeatureIDE: Development 33
![Page 46: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/46.jpg)
Preprocessor Integration
To integrate a Preprocessor into FeatureIDE there are Classes withspecial functionality for Preprocessors
I PPComposerExtensionClassI Abstract class to integrate the preprocessorI ComposerExtensionClass with predefined functions
I PPModelBuilderI Builds a special FSTModel for PreporcessorsI Shows the occurence of a feature in a classI Adds preprocessor directives to the model
Thomas Thum, Jens Meinicke FeatureIDE: Development 34
![Page 47: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/47.jpg)
Preprocessor Integration
Figure: A simplyfied model of Preprocessor Integration
Thomas Thum, Jens Meinicke FeatureIDE: Development 35
![Page 48: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/48.jpg)
Feature Model Editor Extension
To extend the feature model editor you need to use the ExtensionPoint:
I de.ovgu.featureide.fm.ui.FeatureModelEditor
With this extension you canI add new pages to the feature model editor
Thomas Thum, Jens Meinicke FeatureIDE: Development 36
![Page 49: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/49.jpg)
Feature Model Editor Extension
Figure: A simplyfied model of the Feature Model Editor extension pointThomas Thum, Jens Meinicke FeatureIDE: Development 37
![Page 50: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/50.jpg)
Feature Diagram Extension
To extend the feature diagram you need to use the ExtensionPoint:
I de.ovgu.featureide.fm.ui.FeatureDiagram
With this extension you canI extend tooltipsI extend the context menu
Thomas Thum, Jens Meinicke FeatureIDE: Development 38
![Page 51: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/51.jpg)
Feature Diagram Extension
Figure: A simplyfied model of the Feature Diagram extension pointThomas Thum, Jens Meinicke FeatureIDE: Development 39
![Page 52: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/52.jpg)
Configuration Editor Extension
To extend the configuration editor you need to use the ExtensionPoint:
I de.ovgu.featureide.ui.ConfigurationEditor
With this extension you canI add new pages to the configuration editor
Thomas Thum, Jens Meinicke FeatureIDE: Development 40
![Page 53: FeatureIDE: Development · 2. FeatureIDE UI plugins in Feature de.ovgu.featureide: I de.ovgu.featureide.ui I FeatureIDE perspective I Decorators, buttons, and menu items I Collaboration](https://reader030.fdocuments.in/reader030/viewer/2022040706/5e062eddf69d607ef66fea46/html5/thumbnails/53.jpg)
Configuration Editor Extension
Figure: A simplyfied model of the Configuration Editor extension point
Thomas Thum, Jens Meinicke FeatureIDE: Development 41