* current release of the BlueJ Extensions API * This method must decide if this Extension is compatible with the Public void packageClosing(PackageEvent ev) ("Project " + ev.getPackage().getProject().getName() Public void packageOpened(PackageEvent ev) * The location of this file is given in the Help/About BlueJ dialog box. * System.out is redirected to the BlueJ debug log file. Print the name of the project it is part of. Listen for BlueJ events at the "package" level * When this method is called, the extension may start its work. Public class SimpleExtension extends Extension implements PackageListener * This is the starting point of a BlueJ Extension The class registers itself as a listener for Manager, so this class must have a no-args constructor (which this Allow external files to be shown in BlueJ and opened outside BlueJ.Īn extension needs to extend the Extension class exposed by the Extensions API.Īn object of this type will be constructed by the BlueJ extension.Adding UI for this extension in the BlueJ's Preferences panel,.Starting point: extending the Extension class,.This example covers the following functionalities for an extension: Here you should find the bluejext2.jar file you need to include in your compiler classpath, and the extensions2 folder into which you should place your extension's Jar file. On the BlueJ application icon, select "Show Package Contents" and Note to Mac users: To navigate to the libĭirectory of your BlueJ installation, right-click (or control-click) Or when you open the BlueJ project into which you installed the The extension should start when you next run BlueJ, Or into an extensions2 directory in your BlueJ userĬonfiguration directory ( /.bluej/extensions2Įxtensions2 directory in the single BlueJ project Lib/extensions2 directory of your BlueJ installation, Install the extension by copying the Jar file either into the.Jar cmf manifest.txt SimpleExtension.jar *.class This information can be included in the Jar file when it is created Main-Class: SimpleExtension ( ended with a line return) The simplest way toĭo this is to create a file (called, say, manifest.txt) Note that this does not mean that the extension Create a Jar file containing the classes of your extension,Īnd add a Main-Class attribute to the Manifest of.The same applies to JavaFX if your extension requires references to this framework (i.e. To ensure your extension is compatible with the version of BlueJ you are targeting, align the version of the Java SDK used to develop your extension with the version used by BlueJ. How you do this will depend on the tool you are using to develop your extension. Compile it, including lib/bluejext2.jar from yourīlueJ installation in the compiler classpath.The full source code for the extension is here. if any HTML and PDF files are included in the project repertory, they will be displayed as external file targets in BlueJ class diagramme and can be opened outside BlueJ.an entry in the Tools/Preferences/Extensions panel which prompts.The menus displayed for packages, classes and objects, including one whichĪdds a comment to the source code for an existing class, (fairly useless) menu entries to BlueJ's Tools menu, and to.an entry for it in the "Installed Extensions" panel of the.Of every BlueJ project opened by the user to System.outĪnd demonstrates the use of the other extension features. The following example implements an extension which logs the name The details of the required changes are provided in the Extensions upgrade to BlueJ 5.0.0 changes guidelines section. BlueJ 5.0.1 (with the extensions API v3.1) includes an new feature for extensions to expose a launcher for external file resources.Īs from BlueJ 5.0.0, extensions need to be updated because of the changes in the Extensions API breaking backward compatibility. Via a set of wrapper classes which behave in a similar way to the The BlueJ proxy object generatesĮvents when the user performs significant actions within BlueJ,Īnd provides access to its projects, packages, classes and objects The text in source files (for Java only). Panel, and interact with the BlueJ editor to retrieve and modify To Package, Class and Object menus, add a preference panel to the Tools/Preferences/Extensions Object, and to the classes and objects which BlueJ is manipulatingĪn extension can add a menu item to the BlueJ Tools menu, and Provides access for extensions to the BlueJ application via a proxy It is needed, avoiding user interface clutter and user confusion. Mechanism is a way of adding new functionality to BlueJ as and when
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |