1 19 20 package org.netbeans.editor; 21 22 import java.awt.Dialog ; 23 import java.awt.event.*; 24 import javax.swing.*; 25 26 37 public class DialogSupport { 38 39 40 private DialogSupport() { 41 } 42 43 59 public static Dialog createDialog( String title, JPanel panel, boolean modal, 60 JButton[] buttons, boolean sidebuttons, int defaultIndex, int cancelIndex, 61 ActionListener listener 62 ) { 63 return org.netbeans.modules.editor.lib2.DialogSupport.getInstance().createDialog( 64 title, panel, modal, buttons, sidebuttons, defaultIndex, cancelIndex, listener 65 ); 66 } 67 68 78 public static void setDialogFactory( DialogFactory factory ) { 79 org.netbeans.modules.editor.lib2.DialogSupport.getInstance().setExternalDialogFactory(new Wrapper(factory)); 80 } 81 82 88 public static interface DialogFactory { 89 90 106 public Dialog createDialog( String title, JPanel panel, boolean modal, 107 JButton[] buttons, boolean sidebuttons, int defaultIndex, 108 int cancelIndex, ActionListener listener ); 109 } 111 private static final class Wrapper implements org.netbeans.spi.editor.DialogFactory { 112 113 private DialogFactory origFactory; 114 115 public Wrapper(DialogFactory origFactory) { 116 this.origFactory = origFactory; 117 } 118 119 public Dialog createDialog( 120 String title, JPanel panel, boolean modal, 121 JButton[] buttons, boolean sidebuttons, int defaultIndex, 122 int cancelIndex, ActionListener listener) 123 { 124 return origFactory.createDialog(title, panel, modal, 125 buttons, sidebuttons, defaultIndex, cancelIndex, listener); 126 } 127 } 129 } 130 | Popular Tags |