home *** CD-ROM | disk | FTP | other *** search
- package printplugin;
-
- import devplugin.Plugin;
- import devplugin.PluginInfo;
- import devplugin.Version;
- import java.awt.print.PrinterException;
- import java.awt.print.PrinterJob;
- import java.util.Properties;
- import printplugin.dlgs.PrintDialog;
- import util.ui.Localizer;
- import util.ui.UiUtilities;
-
- public class PrintPlugin extends Plugin {
- private static final Localizer mLocalizer;
- // $FF: synthetic field
- static Class class$printplugin$PrintPlugin;
-
- public String getButtonIconName() {
- return "printplugin/imgs/Print16.gif";
- }
-
- public String getMarkIconName() {
- return "printplugin/imgs/Print16.gif";
- }
-
- public String getButtonText() {
- return mLocalizer.msg("printProgram", "Print program");
- }
-
- public PluginInfo getInfo() {
- String name = mLocalizer.msg("printProgram", "Print program");
- String desc = mLocalizer.msg("printdescription", "Allows printing programs.");
- String author = "Robert Inzinger, Martin Oberhauser";
- return new PluginInfo(name, desc, author, new Version(0, 5));
- }
-
- public void execute() {
- PrinterJob printJob = PrinterJob.getPrinterJob();
- PrintDialog dlg = new PrintDialog(this.getParentFrame(), printJob);
- UiUtilities.centerAndShow(dlg);
- Printer printer = dlg.getPrinter();
- if (printer != null) {
- printJob.setPrintable(printer, dlg.getPageFormat());
-
- try {
- printJob.print();
- } catch (PrinterException e) {
- e.printStackTrace();
- }
- }
-
- }
-
- public void loadSettings(Properties settings) {
- }
-
- // $FF: synthetic method
- static Class class$(String x0) {
- try {
- return Class.forName(x0);
- } catch (ClassNotFoundException x1) {
- throw new NoClassDefFoundError(x1.getMessage());
- }
- }
-
- static {
- mLocalizer = Localizer.getLocalizerFor(class$printplugin$PrintPlugin == null ? (class$printplugin$PrintPlugin = class$("printplugin.PrintPlugin")) : class$printplugin$PrintPlugin);
- }
- }
-