-
Notifications
You must be signed in to change notification settings - Fork 1
Developer Guide: Plugin
This guide assumes you meet the requirements described in our developer guide, and that you followed the setup instructions that appear there.
Plugin projects in Eclipse define their extension points and dependencies in a file called plugin.xml, which, in our case, is located in BugQueryPlugin/plugin.xml. Menus and keyboard shortcuts are also defined here, along with the ID and version of the plugin.
After a program crashes we want to take its output and forward it to dispatch. We can gather the trace using these methods:
- Using a command handler (defined in
plugin.xmlusingorg.eclipse.ui.handlersandorg.eclipse.ui.commands). The commands we currently support, defined incom.bugquery.actions:- The
Get Trace from Clipboardcommand, handled inFromClipboard.java. It uses the default toolkit to get the output from the system clipboard (functionfromClipboard()), or opens up aClipboardDialog(infromClipboardDialog()). AClipboardDialog, defined inClipboardDialog.java(in thecom.bugquery.stacktracepackage), is an extendedInputDialogthat automatically sendsctrl+vonce the text field is in focus. The handler collects the output and sends it toDispatch.query(String). - The
Get Trace from Consolecommand, handled inFromConsole.java. It looks for the latest terminated console in the console manager, and dispatches its content. - The
Get Trace from Input Windowcommand, handled inFromInputDialog.java. It opens a different extendedInputDialog, which supports multiple lines, defined inExtendedDialog.java. The handler takes the input from the user and forwards it toDispatch.query(String).
- The
- Using a button above the console, a behavior that's defined in the
com.bugquery.consolepackage. It uses theorg.eclipse.ui.console.consolePageParticipantsextension point forConsoleExtender.java, which initializes an action - the button defined inConsoleQuery.java.
After collecting the trace output, we send it to the website and initialize markers in the code. This is initiated in Dispatch.java, an interface with static functions, specifically public static void query(final String) that calls sendBugQuery(String).
sendBugQuery() uses a POST request to the address urlStr = "http://ssdlbugquery.cs.technion.ac.il/stacks", to get the address to which the user needs to be referred for answers. query() opens that link in the browser, and calls markersInit(String, String) that puts markers on the relevant lines.
To run the plugin in a separate environment, select the plugin project (BugQueryPlugin) in the project explorer, and select Run Configurations... from the Run menu.
In the Run Configurations window, locate Eclipse Application and select it. Press the New button (
Choose a name for the new configuration, then click Apply and Run.
The plugin should run in a new workspace now.
Update the version number in BugQueryPlugin\plugin.xml and BugQueryFeature\feature.xml (also category.xml).
Right click the feature project, and select Export...
Select Deployable features from Plug-in Development
Select a destination.
In the Options tab, select category.xml where it says Categorize repository:, and click Finish.
The feature project will be exported. To be safe, make sure you can add the destination as a repository; in the Help menu, select Install New Software..., and add your destination as a local repository. BugQuery should show up, categorized correctly - you can test install it too.

Next, replace the files in BugQueryServerSide/src/main/resources/static/feature with your destination folder, and push to git, and publish a new version of the site (see Developer Guide: Server).








