Tabla de contenidos
import org.gjt.sp.jedit.*; import java.util.Vector; public class HelloWorldPlugin extends EditPlugin { public void createMenuItems(Vector menuItems) { menuItems.addElement(GUIUtilities.loadMenuItem("HelloWorld")); } }
iimport javax.swing.*; import org.gjt.sp.jedit.*; public class HelloWorld extends JDialog { // private members private View view; public HelloWorld(View view) { super(view,jEdit.getProperty("HelloWorld.title"),false); this.view = view; JPanel content = new JPanel(); setContentPane(content); JLabel caption = new JLabel(jEdit.getProperty("HelloWorld.caption")); content.add(caption); pack(); GUIUtilities.loadGeometry(this, "HelloWorld"); setDefaultCloseOperation(DISPOSE_ON_CLOSE); show(); } public void dispose() { view = null; GUIUtilities.saveGeometry(this, "HelloWorld"); super.dispose(); } }
<?xml version="1.0"?> <!DOCTYPE ACTIONS SYSTEM "actions.dtd"> <ACTIONS> <ACTION NAME="HelloWorld"> <CODE> new HelloWorld(view); </CODE> </ACTION> </ACTIONS>
# Plugin properties plugin.HelloWorldPlugin.name=Hello World ! plugin.HelloWorldPlugin.author=Jairo Martinez plugin.HelloWorldPlugin.version=1.0 plugin.HelloWorldPlugin.docs=HelloWorld.html # Menu item label HelloWorld.label=Hello World ! # HelloWorld window HelloWorld.title=Hello World plugin HelloWorld.caption=Hello World !