|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun * Microsystems, Inc. All Rights Reserved. */ /* * * */ package org.netbeans.modules.j2ee.deployment.impl.ui.actions; import org.openide.nodes.*; import org.openide.util.actions.*; import org.openide.*; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.netbeans.modules.j2ee.deployment.impl.*; import org.netbeans.modules.j2ee.deployment.impl.ui.FindServerPanel; import org.netbeans.modules.j2ee.deployment.impl.ui.ServerRegistryNode; import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceCreationException; import java.io.IOException; import java.text.MessageFormat; import javax.swing.SwingUtilities; import org.openide.awt.StatusDisplayer; import org.openide.windows.TopComponent; import org.openide.explorer.ExplorerManager; /** * @author George FinKlang */ public class FindDeploymentManagerAction extends CallableSystemAction { public HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; } public String getName() { return NbBundle.getMessage(FindDeploymentManagerAction.class, "LBL_Add_Server_Instance"); } public void performAction() { SwingUtilities.invokeLater (new Runnable () { public void run () { StatusDisplayer.getDefault().setStatusText(""); //NOI18N FindServerPanel panel = new FindServerPanel (); if (panel.showDialog (null, null)) { String url = panel.getUrl(); String username = panel.getUsername(); String pw = panel.getPassword(); try { InstanceProperties.createInstanceProperties(url, username, pw); } catch (InstanceCreationException e) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(e.getMessage(), NotifyDescriptor.ERROR_MESSAGE)); return; } ServerInstance instance = ServerRegistry.getInstance().getServerInstance(url); if (instance != null) { StatusDisplayer.getDefault().setStatusText( MessageFormat.format(NbBundle.getMessage(FindDeploymentManagerAction.class, "MSG_Server_Instance_Added"), new Object[] {instance.getDisplayName()})); } } } }); } protected boolean asynchronous() { return false; } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.