// **********************************************************************
//
// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
package IceGridGUI.Application;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import com.jgoodies.forms.builder.DefaultFormBuilder;
import com.jgoodies.forms.layout.CellConstraints;
import IceGrid.*;
import IceGridGUI.*;
class ServerSubEditor extends CommunicatorSubEditor
{
ServerSubEditor(Editor mainEditor)
{
super(mainEditor);
_id.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_id.setToolTipText("Must be unique within this IceGrid deployment");
_exe.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_exe.setToolTipText("Path to this server's executable, e.g.: "
+ "icebox "
+ "java "
+ "myHelloServer "
+ "C:\\testbed\\hello\\server");
_iceVersion.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_iceVersion.setToolTipText("The Ice version used by this server; "
+ "blank means 'same version as the IceGrid registry'.");
_pwd.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_pwd.setToolTipText(
"If not set, the server will start in "
+ "node data dir/servers/server-id; "
+ "relative directories are relative to the current directory"
+ " of the icegridnode process.");
_options.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_options.setToolTipText(
"Command-line arguments for this server. "
+ "Use whitespace as separator; use double-quotes around arguments containing whitespaces");
_user.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_user.setToolTipText(
"Run the server using this user account. "
+ "This feature is only available on Unix/Linux, when the IceGrid node runs as root.");
_envs = new SimpleMapField(mainEditor, true, "Name", "Value");
_activation = new JComboBox(new String[]{ALWAYS, MANUAL, ON_DEMAND, SESSION});
_activation.setToolTipText("always: IceGrid starts and keeps the server up all the time "
+ "manual: you start the server yourself "
+ "on-demand: IceGrid starts the server when a client needs it "
+ "session: IceGrid starts and shuts down the server for each session");
JTextField activationTextField = (JTextField)_activation.getEditor().getEditorComponent();
activationTextField.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_activationTimeout.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_activationTimeout.setToolTipText("Number of seconds; if not set or set to 0, "
+ "the IceGrid Node uses the value of its "
+ "IceGrid.Node.WaitTime property");
_deactivationTimeout.getDocument().addDocumentListener(_mainEditor.getUpdateListener());
_deactivationTimeout.setToolTipText("Number of seconds; if not set or set to 0, "
+ "the IceGrid Node uses the value of its "
+ "IceGrid.Node.WaitTime property");
Action allocatable = new AbstractAction("Allocatable")
{
public void actionPerformed(ActionEvent e)
{
_mainEditor.updated();
}
};
allocatable.putValue(Action.SHORT_DESCRIPTION,
"Check this box to ensure that the well-known objects "
+ "of this server can only be allocated by one session at a time.");
_allocatable = new JCheckBox(allocatable);
Action appDistrib = new AbstractAction("Depends on the application distribution")
{
public void actionPerformed(ActionEvent e)
{
_mainEditor.updated();
}
};
appDistrib.putValue(Action.SHORT_DESCRIPTION,
"Check this box if this server needs to be restarted "
+ "each time the distribution for your application is refreshed.");
_applicationDistrib = new JCheckBox(appDistrib);
_distrib = new JComboBox