1 19 package org.netbeans.modules.j2ee.deployment.devmodules.api; 20 21 import java.awt.Dialog ; 22 import org.openide.DialogDescriptor; 23 import org.openide.DialogDisplayer; 24 import org.openide.util.HelpCtx; 25 import org.openide.util.NbBundle; 26 import javax.swing.JButton ; 27 import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; 28 import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; 29 import org.netbeans.modules.j2ee.deployment.impl.ui.ServersCustomizer; 30 31 37 public final class ServerManager { 38 39 40 private ServerManager() { 41 } 42 43 51 public static void showCustomizer(String serverInstanceID) { 52 ServerInstance instance = ServerRegistry.getInstance().getServerInstance(serverInstanceID); 53 ServersCustomizer customizer = new ServersCustomizer(instance); 54 JButton close = new JButton (NbBundle.getMessage(ServerManager.class,"CTL_Close")); 55 close.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ServerManager.class,"AD_Close")); 56 DialogDescriptor descriptor = new DialogDescriptor ( 57 customizer, 58 NbBundle.getMessage(ServerManager.class, "TXT_ServerManager"), 59 true, 60 new Object [] {close}, 61 close, 62 DialogDescriptor.DEFAULT_ALIGN, 63 new HelpCtx(ServerManager.class), 64 null); 65 Dialog dlg = null; 66 try { 67 dlg = DialogDisplayer.getDefault().createDialog(descriptor); 68 dlg.setVisible(true); 69 } finally { 70 if (dlg != null) { 71 dlg.dispose(); 72 } 73 } 74 } 75 } 76 | Popular Tags |