1. @ServiceProvider @ServiceProvider(service = MyPluginInterface.class) public class MyPluginImpl implements MyPluginInterface { } @Override public void mouseClicked(MouseEvent e) { } @ActionID( category = "File", id = "com.example.MyAction" ) @ActionRegistration( displayName = "My Action", iconBase = "com/example/myaction/icon.png", popupText = "Perform My Action" ) public class MyAction extends AbstractAction { public MyAction() { } @Override public void actionPerformed(ActionEvent e) { } } @ServiceProvider(service = EditorProvider.class) public class MyCustomEditorProvider implements EditorProvider { @Override public JEditorPane getEditorPane() { } @Override public String getFileType() { } @Override public String getDisplayName() { } } public class MyButton extends JButton { public MyButton() { } @Override public void setText(String text) { } @Override public void setEnabled(boolean enabled) { } } @ActionID( category = "File", id = "com.example.NewJavaClass" ) @ActionRegistration( displayName = "Add new Java class", iconBase = "com/example/newjavaclass/icon.png", popupText = "Add a new Java class" ) public class NewJavaClassAction extends AbstractAction { public NewJavaClassAction() { } @Override public void actionPerformed(ActionEvent e) { } }


上一篇:
下一篇:
切换中文