VisualVM Action Template - plugin detail

Template for VisualVM Action Extensions

NetBeans Plugin - VisualVM Action Template
Plugin owner: geertjan
Website: https://visualvm.dev.java.net/api-quickstart.html
Added: 2008-05-28
License: CDDL
Category: NetBeans Rich Client Platform
Downloaded: 753 times
Rating:
 0, by 0 users

Plugin Log Show log

Versions available

Download plugin   Download size: 0.01 MB   Last Update: 2012-04-06

What's new in this version



Verifications for NetBeans versions

Plugin is not subject to any verification



Introduction

Creates a new template in the New File wizard's "Module Development" category, for new VisualVM explorer menu items. After installing the plugin, do the following:

Register VisualVM in Tools > NetBeans Platforms. Create a new module and make sure to set VisualVM as your platform. In the New File wizard, select the VisualVM Action template: Click Next and fill in a prefix (prefix of the generated action class) and the data source for which you're creating the menu item: Click Finish. Now you have a new action class: For example, if you selected "Application" above, you'll now have this: import com.sun.tools.visualvm.application.Application; import com.sun.tools.visualvm.core.ui.actions.SingleDataSourceAction; import java.awt.event.ActionEvent; import javax.swing.Action; import javax.swing.JOptionPane; public class DemoAction extends SingleDataSourceAction { public DemoAction() { super(Application.class); putValue(Action.NAME, "Demo"); putValue(Action.SHORT_DESCRIPTION, "Demoes a menu item"); } @Override protected void actionPerformed(Application arg0, ActionEvent arg1) { JOptionPane.showMessageDialog(null, "hello"); } //Here you can determine whether the menu item is enabled, //depending on the data source type that is selected. In this //example, the menu item is enabled for all types within //the current data source: @Override protected boolean isEnabled(Application arg0) { return true; } } You also have new entries in the layer.xml file: Run the module. A new instance of VisualVM starts up. Right-click the data source for which you created the action and there you'll see your menu item:

[ You have to be logged in to be able to comment. ]

User Comments

There are no comments yet.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo