use of javax.swing.JTextField in project jmeter by apache.
the class SearchTreePanel method init.
private void init() {
// WARNING: called from ctor so must not be overridden (i.e. must be private or final)
setLayout(new BorderLayout(10, 10));
//$NON-NLS-1$
searchTF = new JTextField(20);
InputMap im = searchTF.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
im.put(KeyStrokes.ENTER, SEARCH_TEXT_COMMAND);
ActionMap am = searchTF.getActionMap();
am.put(SEARCH_TEXT_COMMAND, new EnterAction());
//$NON-NLS-1$
isRegexpCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_regexp"), false);
//$NON-NLS-1$
isCaseSensitiveCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_case"), false);
isRegexpCB.setFont(FONT_SMALL);
isCaseSensitiveCB.setFont(FONT_SMALL);
//$NON-NLS-1$
searchButton = new JButton(JMeterUtils.getResString("search"));
searchButton.addActionListener(this);
//$NON-NLS-1$
resetButton = new JButton(JMeterUtils.getResString("reset"));
resetButton.addActionListener(this);
JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
searchPanel.add(new JLabel(JMeterUtils.getResString("search_text_field")));
searchPanel.add(searchTF);
searchPanel.add(isCaseSensitiveCB);
searchPanel.add(isRegexpCB);
searchPanel.add(searchButton);
searchPanel.add(resetButton);
add(searchPanel);
}
use of javax.swing.JTextField in project jmeter by apache.
the class GraphVisualizer method createInfoField.
/**
* Creates one of the fields used to display the graph's current values.
*
* @param color
* the color used to draw the value. By convention this is the
* same color that is used to draw the graph for this value and
* in the choose panel.
* @param length
* the number of digits which the field should be able to display
*
* @return a text field configured to display one of the current graph
* values
*/
private JTextField createInfoField(Color color, int length) {
JTextField field = new JTextField(length);
field.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
field.setEditable(false);
field.setForeground(color);
field.setBackground(getBackground());
// The text field should expand horizontally, but have
// a fixed height
field.setMaximumSize(new Dimension(field.getMaximumSize().width, field.getPreferredSize().height));
return field;
}
use of javax.swing.JTextField in project jmeter by apache.
the class MailerVisualizer method createSmtpSettings.
private JPanel createSmtpSettings() {
JPanel settingsPane = new JPanel(new BorderLayout());
settingsPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
JMeterUtils.getResString("mailer_title_smtpserver")));
JPanel hostPane = new JPanel(new BorderLayout());
hostPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
JPanel smtpHostPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
smtpHostPane.add(new JLabel(JMeterUtils.getResString("mailer_host")), BorderLayout.WEST);
smtpHostField = new JTextField(10);
smtpHostField.setEditable(true);
smtpHostPane.add(smtpHostField, BorderLayout.CENTER);
smtpHostPane.add(Box.createRigidArea(new Dimension(5, 0)), BorderLayout.EAST);
hostPane.add(smtpHostPane, BorderLayout.CENTER);
JPanel smtpPortPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
smtpPortPane.add(new JLabel(JMeterUtils.getResString("mailer_port")), BorderLayout.WEST);
smtpPortField = new JTextField(10);
smtpPortField.setEditable(true);
smtpPortPane.add(smtpPortField, BorderLayout.CENTER);
hostPane.add(smtpPortPane, BorderLayout.EAST);
JPanel authPane = new JPanel(new BorderLayout());
hostPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
JPanel smtpLoginPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
smtpLoginPane.add(new JLabel(JMeterUtils.getResString("mailer_login")), BorderLayout.WEST);
smtpLoginField = new JTextField(10);
smtpLoginField.setEditable(true);
smtpLoginPane.add(smtpLoginField, BorderLayout.CENTER);
smtpLoginPane.add(Box.createRigidArea(new Dimension(5, 0)), BorderLayout.EAST);
authPane.add(smtpLoginPane, BorderLayout.CENTER);
JPanel smtpPasswordPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
smtpPasswordPane.add(new JLabel(JMeterUtils.getResString("mailer_password")), BorderLayout.WEST);
smtpPasswordField = new JPasswordField(10);
smtpPasswordField.setEditable(true);
smtpPasswordPane.add(smtpPasswordField, BorderLayout.CENTER);
smtpPasswordPane.add(Box.createRigidArea(new Dimension(5, 0)), BorderLayout.EAST);
authPane.add(smtpPasswordPane, BorderLayout.EAST);
JPanel authTypePane = new JPanel(new BorderLayout());
// $NON-NLS-1$
authTypePane.add(new JLabel(JMeterUtils.getResString("mailer_connection_security")), BorderLayout.WEST);
authTypeCombo = new JComboBox<>(new String[] { MailerModel.MailAuthType.NONE.toString(), MailerModel.MailAuthType.SSL.toString(), MailerModel.MailAuthType.TLS.toString() });
// $NON-NLS-1$
authTypeCombo.setFont(new Font("SansSerif", Font.PLAIN, 10));
authTypePane.add(authTypeCombo, BorderLayout.CENTER);
JPanel credPane = new JPanel(new BorderLayout());
credPane.add(authPane, BorderLayout.CENTER);
credPane.add(authTypePane, BorderLayout.EAST);
settingsPane.add(hostPane, BorderLayout.NORTH);
settingsPane.add(credPane, BorderLayout.CENTER);
return settingsPane;
}
use of javax.swing.JTextField in project jmeter by apache.
the class MailerVisualizer method createMailingSettings.
private JPanel createMailingSettings() {
JPanel settingsPane = new JPanel(new BorderLayout());
settingsPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
JMeterUtils.getResString("mailer_title_message")));
JPanel headerPane = new JPanel(new BorderLayout());
headerPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
JPanel fromPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
fromPane.add(new JLabel(JMeterUtils.getResString("mailer_from")), BorderLayout.WEST);
fromField = new JTextField(25);
fromField.setEditable(true);
fromPane.add(fromField, BorderLayout.CENTER);
fromPane.add(Box.createRigidArea(new Dimension(5, 0)), BorderLayout.EAST);
headerPane.add(fromPane, BorderLayout.WEST);
JPanel addressPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
addressPane.add(new JLabel(JMeterUtils.getResString("mailer_addressees")), BorderLayout.WEST);
addressField = new JTextField(10);
addressField.setEditable(true);
addressPane.add(addressField, BorderLayout.CENTER);
headerPane.add(addressPane, BorderLayout.CENTER);
JPanel successPane = new JPanel(new BorderLayout());
successPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
JPanel succesSubjectPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
succesSubjectPane.add(new JLabel(JMeterUtils.getResString("mailer_success_subject")), BorderLayout.WEST);
successSubjectField = new JTextField(10);
successSubjectField.setEditable(true);
succesSubjectPane.add(successSubjectField, BorderLayout.CENTER);
succesSubjectPane.add(Box.createRigidArea(new Dimension(5, 0)), BorderLayout.EAST);
successPane.add(succesSubjectPane, BorderLayout.CENTER);
JPanel successLimitPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
successLimitPane.add(new JLabel(JMeterUtils.getResString("mailer_success_limit")), BorderLayout.WEST);
// $NON-NLS-1$
successLimitField = new JTextField("2", 5);
successLimitField.setEditable(true);
successLimitPane.add(successLimitField, BorderLayout.CENTER);
successPane.add(successLimitPane, BorderLayout.EAST);
JPanel failurePane = new JPanel(new BorderLayout());
failurePane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
JPanel failureSubjectPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
failureSubjectPane.add(new JLabel(JMeterUtils.getResString("mailer_failure_subject")), BorderLayout.WEST);
failureSubjectField = new JTextField(10);
failureSubjectField.setEditable(true);
failureSubjectPane.add(failureSubjectField, BorderLayout.CENTER);
failureSubjectPane.add(Box.createRigidArea(new Dimension(5, 0)), BorderLayout.EAST);
failurePane.add(failureSubjectPane, BorderLayout.CENTER);
JPanel failureLimitPane = new JPanel(new BorderLayout());
// $NON-NLS-1$
failureLimitPane.add(new JLabel(JMeterUtils.getResString("mailer_failure_limit")), BorderLayout.WEST);
// $NON-NLS-1$
failureLimitField = new JTextField("2", 5);
failureLimitField.setEditable(true);
failureLimitPane.add(failureLimitField, BorderLayout.CENTER);
failurePane.add(failureLimitPane, BorderLayout.EAST);
settingsPane.add(headerPane, BorderLayout.NORTH);
settingsPane.add(successPane, BorderLayout.CENTER);
settingsPane.add(failurePane, BorderLayout.SOUTH);
return settingsPane;
}
use of javax.swing.JTextField in project jadx by skylot.
the class SearchDialog method initUI.
private void initUI() {
JLabel findLabel = new JLabel(NLS.str("search_dialog.open_by_name"));
searchField = new JTextField();
searchField.setAlignmentX(LEFT_ALIGNMENT);
searchField.getDocument().addDocumentListener(new SearchFieldListener());
new TextStandardActions(searchField);
JCheckBox clsChBox = makeOptionsCheckBox(NLS.str("search_dialog.class"), SearchOptions.CLASS);
JCheckBox mthChBox = makeOptionsCheckBox(NLS.str("search_dialog.method"), SearchOptions.METHOD);
JCheckBox fldChBox = makeOptionsCheckBox(NLS.str("search_dialog.field"), SearchOptions.FIELD);
JCheckBox codeChBox = makeOptionsCheckBox(NLS.str("search_dialog.code"), SearchOptions.CODE);
JPanel searchOptions = new JPanel(new FlowLayout(FlowLayout.LEFT));
searchOptions.setBorder(BorderFactory.createTitledBorder(NLS.str("search_dialog.search_in")));
searchOptions.add(clsChBox);
searchOptions.add(mthChBox);
searchOptions.add(fldChBox);
searchOptions.add(codeChBox);
searchOptions.setAlignmentX(LEFT_ALIGNMENT);
JPanel searchPane = new JPanel();
searchPane.setLayout(new BoxLayout(searchPane, BoxLayout.PAGE_AXIS));
findLabel.setLabelFor(searchField);
searchPane.add(findLabel);
searchPane.add(Box.createRigidArea(new Dimension(0, 5)));
searchPane.add(searchField);
searchPane.add(Box.createRigidArea(new Dimension(0, 5)));
searchPane.add(searchOptions);
searchPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
initCommon();
JPanel resultsPanel = initResultsTable();
JPanel buttonPane = initButtonsPanel();
Container contentPane = getContentPane();
contentPane.add(searchPane, BorderLayout.PAGE_START);
contentPane.add(resultsPanel, BorderLayout.CENTER);
contentPane.add(buttonPane, BorderLayout.PAGE_END);
searchField.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (resultsModel.getRowCount() != 0) {
resultsTable.setRowSelectionInterval(0, 0);
}
resultsTable.requestFocus();
}
}
});
setTitle(NLS.str("menu.text_search"));
pack();
setSize(800, 500);
setLocationRelativeTo(null);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setModalityType(ModalityType.MODELESS);
}
Aggregations