<commit_before>/*
 * Created on Apr 6, 2004 by mschilli
 */
package alma.acs.commandcenter.gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.border.EmptyBorder;

import alma.acs.commandcenter.gui.thirdparty.SpringUtilities;




class EditContainerSettingsDialog extends JDialog implements
        ActionListener {

    private final CommandCenterGui master;

    JRadioButton btnGlobal, btnCustom;

    JTextField defaultScriptBaseF, defaultHostF, defaultAccountF,
            defaultPasswordF;

    JTextField customScriptBaseF, customHostF, customAccountF,
            customPasswordF;

    ButtonGroup buttonGroup;

    boolean okChosen; // this dialog's "return value"

    protected EditContainerSettingsDialog(CommandCenterGui gui, String title,
            String explanationText, String buttonText) {
        super(gui.frame, title, true);
        this.master = gui;
        this.getContentPane().setLayout(new BorderLayout());
        // need 'root' to be able to set a border
        JPanel root = new JPanel(new BorderLayout()); 
        root.setBorder(new EmptyBorder(10, 10, 10, 10));
        // --- content
        JPanel content = new JPanel();
        content.setLayout(new BorderLayout());
        JLabel north = new JLabel(explanationText);
        content.add(north, BorderLayout.NORTH);
        JPanel center = new JPanel();
        center.setLayout(new SpringLayout());
        center.add(btnGlobal = new JRadioButton("On same host as manager"));
        center.add(new JLabel("(see Common Settings)"));
        center.add(new JLabel("Acs Instance"));
        center.add(defaultScriptBaseF = new JTextField());
        center.add(new JLabel("Remote Host"));
        center.add(defaultHostF = new JTextField());
        center.add(new JLabel("Remote Username"));
        center.add(defaultAccountF = new JTextField());
        center.add(new JLabel("Remote Password"));
        center.add(defaultPasswordF = new JPasswordField());
        defaultScriptBaseF.setEditable(false);
        defaultHostF.setEditable(false);
        defaultAccountF.setEditable(false);
        defaultPasswordF.setEditable(false);
        center.add(btnCustom = new JRadioButton("On the following host"));
        center.add(new JLabel("")); // "(implies SSH connection)"
        center.add(new JLabel("Acs Instance"));
        center.add(customScriptBaseF = new JTextField());
        center.add(new JLabel("Remote Host"));
        center.add(customHostF = new JTextField());
        center.add(new JLabel("Remote Username"));
        center.add(customAccountF = new JTextField());
        center.add(new JLabel("Remote Password"));
        center.add(customPasswordF = new JPasswordField());
        SpringUtilities.makeCompactGrid(center, 0, 2);
        buttonGroup = new ButtonGroup();
        buttonGroup.add(btnGlobal);
        buttonGroup.add(btnCustom);
        btnGlobal.setSelected(true);
        content.add(center, BorderLayout.CENTER);
        root.add(content, BorderLayout.CENTER);
        // --- controls
        JPanel controls = new JPanel();
        JButton btnOk = new JButton(buttonText);
        controls.add(btnOk);
        btnOk.addActionListener(this);
        root.add(controls, BorderLayout.SOUTH);
        this.getContentPane().add(root);
        this.pack();
        
        btnGlobal.setName("rdb_Global");
        btnCustom.setName("rdb_Custom");
        defaultScriptBaseF.setName("txt_DefaultInstance");
        defaultHostF.setName("txt_DefaultHost");
        defaultAccountF.setName("txt_DefaultUser");
        defaultPasswordF.setName("txt_DefaultPassword");
        customScriptBaseF.setName("txt_CustomInstance");
        customHostF.setName("txt_CustomHost");
        customAccountF.setName("txt_CustomUser");
        customPasswordF.setName("txt_CustomPassword");
        btnOk.setName("btn_Ok");
    }

    public void bringUp() {
        this.okChosen = false;
        this.master.correctDialogLocation(this);
        super.setVisible(true);
    }

    public void actionPerformed(ActionEvent evt) {
        this.okChosen = true;
        setVisible(false);
    }
}
<commit_msg>added inputfield for "type modifiers'<commit_after>/*
 * Created on Apr 6, 2004 by mschilli
 */
package alma.acs.commandcenter.gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.border.EmptyBorder;

import alma.acs.commandcenter.gui.thirdparty.SpringUtilities;



class EditContainerSettingsDialog extends JDialog implements ActionListener {

	private final CommandCenterGui master;
	JRadioButton btnGlobal, btnCustom;
	JTextField modifF;
	JTextField defaultScriptBaseF, defaultHostF, defaultAccountF, defaultPasswordF;
	JTextField customScriptBaseF, customHostF, customAccountF, customPasswordF;
	ButtonGroup buttonGroup;
	boolean okChosen; // this dialog's "return value"

	protected EditContainerSettingsDialog(CommandCenterGui gui) {
		super(gui.frame, "Edit detail settings for container", true);
		this.master = gui;
		this.getContentPane().setLayout(new BorderLayout());
		
		// --- content
		JPanel content = new JPanel();
		content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));

		JPanel pnlModifiers = new JPanel();
		pnlModifiers.setBorder(master.createTitledBorder(" Tweak type of container "));
		pnlModifiers.setLayout(new SpringLayout());
		pnlModifiers.add(new JLabel("Type Modifiers"));
		pnlModifiers.add(modifF = new JTextField());
		modifF.setToolTipText("Enter comma-separated Modifiers, e.g. \"archiveContainer\"");
		SpringUtilities.makeCompactGrid(pnlModifiers, 0, 2);
		content.add(pnlModifiers);

		JPanel pnlLocation = new JPanel();
		pnlLocation.setBorder(master.createTitledBorder(" Where to run this container "));
		pnlLocation.setLayout(new SpringLayout());
		pnlLocation.add(btnGlobal = new JRadioButton("On same host as manager"));
		pnlLocation.add(new JLabel("(see Common Settings)"));
		pnlLocation.add(new JLabel("Acs Instance"));
		pnlLocation.add(defaultScriptBaseF = new JTextField());
		pnlLocation.add(new JLabel("Remote Host"));
		pnlLocation.add(defaultHostF = new JTextField());
		pnlLocation.add(new JLabel("Remote Username"));
		pnlLocation.add(defaultAccountF = new JTextField());
		pnlLocation.add(new JLabel("Remote Password"));
		pnlLocation.add(defaultPasswordF = new JPasswordField());
		defaultScriptBaseF.setEditable(false);
		defaultHostF.setEditable(false);
		defaultAccountF.setEditable(false);
		defaultPasswordF.setEditable(false);

		pnlLocation.add(btnCustom = new JRadioButton("On the following host"));
		pnlLocation.add(new JLabel("")); // "(implies SSH connection)"
		pnlLocation.add(new JLabel("Acs Instance"));
		pnlLocation.add(customScriptBaseF = new JTextField());
		pnlLocation.add(new JLabel("Remote Host"));
		pnlLocation.add(customHostF = new JTextField());
		pnlLocation.add(new JLabel("Remote Username"));
		pnlLocation.add(customAccountF = new JTextField());
		pnlLocation.add(new JLabel("Remote Password"));
		pnlLocation.add(customPasswordF = new JPasswordField());
		SpringUtilities.makeCompactGrid(pnlLocation, 0, 2);

		buttonGroup = new ButtonGroup();
		buttonGroup.add(btnGlobal);
		buttonGroup.add(btnCustom);
		btnGlobal.setSelected(true);
		content.add(pnlLocation);
		
		// --- controls
		JPanel controls = new JPanel();
		JButton btnOk = new JButton("Set");
		controls.add(btnOk);
		btnOk.addActionListener(this);

		
		// need 'root' to be able to set a border
		Box root = Box.createVerticalBox();
		root.setBorder(new EmptyBorder(10, 10, 10, 10));
		root.add(content);
		root.add(Box.createVerticalGlue());
		root.add(controls);
		this.getContentPane().add(root);
		this.pack();

		btnGlobal.setName("rdb_Global");
		btnCustom.setName("rdb_Custom");
		defaultScriptBaseF.setName("txt_DefaultInstance");
		defaultHostF.setName("txt_DefaultHost");
		defaultAccountF.setName("txt_DefaultUser");
		defaultPasswordF.setName("txt_DefaultPassword");
		customScriptBaseF.setName("txt_CustomInstance");
		customHostF.setName("txt_CustomHost");
		customAccountF.setName("txt_CustomUser");
		customPasswordF.setName("<PASSWORD>_CustomPassword");
		btnOk.setName("btn_Ok");
	}

	public void bringUp () {
		this.okChosen = false;
		this.master.correctDialogLocation(this);
		super.setVisible(true);
	}

	public void actionPerformed (ActionEvent evt) {
		this.okChosen = true;
		setVisible(false);
	}
}
{'fraction_non_alphanumeric': 0.11858797573083288, 'fraction_numerical': 0.003530060672917816, 'mean_word_length': 4.264808362369338, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5533102', 'n_tokens_mistral': 2803, 'n_tokens_neox': 2649, 'n_words': 532}