org.apache.jorphan.gui.JLabeledTextField Java Examples

The following examples show how to use org.apache.jorphan.gui.JLabeledTextField. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HonoCommanderSamplerUI.java    From hono with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Creates a new UI that provides means to configure the Command & Control endpoint to connect to for sending
 * commands and receiving command responses.
 */
public HonoCommanderSamplerUI() {
    honoServerOptions = new ServerOptionsPanel("Hono connection options");
    reconnectAttempts = new JLabeledTextField("Max reconnect attempts");
    tenant = new JLabeledTextField("Tenant");
    command = new JLabeledTextArea("Command");
    commandPayload = new JLabeledTextArea("Command payload");
    commandTimeOut = new JLabeledTextField("Command Timeout In Milliseconds");
    triggerType = new JComboBox(new String[] { "device", "sampler" });
    triggerTypeDescription = new JTextArea();
    addOption(honoServerOptions);
    addOption(reconnectAttempts);
    addOption(tenant);
    addOption(command);
    addOption(commandPayload);
    addOption(commandTimeOut);
    addOption(getTriggerTypePanel());
}
 
Example #2
Source File: HonoReceiverSamplerUI.java    From hono with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Creates a new UI that provides means to configure
 * the northbound Telemetry & Event API endpoint to connect to
 * for receiving messages.
 */
public HonoReceiverSamplerUI() {

    honoServerOptions = new ServerOptionsPanel("Telemetry & Event Endpoint");
    tenant = new JLabeledTextField("Tenant");
    container = new JLabeledTextField("Name");
    endpoint = new JLabeledChoice("Endpoint",
            Stream.of(HonoSampler.Endpoint.values()).map(HonoSampler.Endpoint::name).toArray(String[]::new));
    endpoint.setToolTipText("<html>The name of the endpoint to send the AMQP message to.</html>");
    useSenderTime = new JCheckBox("Use sender time");
    senderTimeInProperty = new JRadioButton("Sender time in property");
    senderTimeInProperty.setToolTipText("<html>If set, the sending time is retrieved from the message's application property <em>timeStamp</em>.</html>");
    senderTimeInPayload = new JRadioButton("Sender time in JSON payload");
    final ButtonGroup group = new ButtonGroup();
    group.add(senderTimeInProperty);
    group.add(senderTimeInPayload);
    senderTimeInProperty.setSelected(true);
    senderTimeVariableName = new JLabeledTextField("JSON value key");
    senderTimeVariableName.setEnabled(false);
    prefetch = new JLabeledTextField("Prefetch");
    reconnectAttempts = new JLabeledTextField("Max reconnect attempts");

    addOption(honoServerOptions);
    addOption(tenant);
    addOption(container);
    addOption(getWrapperPanelToFixAlignment(endpoint));
    addOption(prefetch);
    addOption(reconnectAttempts);
    addOption(createTimeStampPanel());
}
 
Example #3
Source File: JSONToXMLConverterGui.java    From jmeter-plugins with Apache License 2.0 5 votes vote down vote up
private void init() {
    setLayout(new BorderLayout());
    setBorder(makeBorder());
    add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);

    VerticalPanel panel = new VerticalPanel();
    panel.setBorder(BorderFactory.createEtchedBorder());
    jsonInputTextField = new JLabeledTextField("JSON input");
    panel.add(jsonInputTextField);
    add(panel, BorderLayout.CENTER);
}
 
Example #4
Source File: JSONPathAssertionGui.java    From jmeter-plugins with Apache License 2.0 5 votes vote down vote up
public void init() {
    setLayout(new BorderLayout());
    setBorder(makeBorder());
    add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE), BorderLayout.NORTH);

    VerticalPanel panel = new VerticalPanel();
    panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));

    JPanel groupPanel = new HorizontalPanel();
    inputJSON.setActionCommand(JSONPathAssertion.INPUT_JSON);
    inputYAML.setActionCommand(JSONPathAssertion.INPUT_YAML);
    inputFormatGroup.add(inputJSON);
    inputFormatGroup.add(inputYAML);
    groupPanel.add(inputJSON);
    groupPanel.add(inputYAML);
    JPanel inputFormatPanel = new HorizontalPanel();
    inputFormatPanel.add(new JLabel("Input Format: "));
    inputFormatPanel.add(groupPanel);

    jsonPath = new JLabeledTextField("Assert JSON Path exists: ");
    jsonValidation = new JCheckBox("Additionally assert value");
    isRegex = new JCheckBox("Match as regular expression");
    jsonValue = new JLabeledTextArea("Expected Value: ");
    expectNull = new JCheckBox("Expect null");
    invert = new JCheckBox("Invert assertion (will fail if above conditions met)");

    jsonValidation.addChangeListener(this);
    expectNull.addChangeListener(this);

    panel.add(inputFormatPanel);
    panel.add(jsonPath);
    panel.add(jsonValidation);
    panel.add(isRegex);
    panel.add(jsonValue);
    panel.add(expectNull);
    panel.add(invert);

    add(panel, BorderLayout.CENTER);
}
 
Example #5
Source File: HonoSenderSamplerUI.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Creates a new UI that provides means to configure
 * the southbound Telemetry &amp; Event API endpoint to connect to
 * for sending messages and an (optional) Device Registration service
 * endpoint for retrieving registration assertions.
 */
public HonoSenderSamplerUI() {

    honoServerOptions = new ServerOptionsPanel("Telemetry & Event Endpoint");
    tenant = new JLabeledTextField("Tenant");
    container = new JLabeledTextField("Name");
    endpoint = new JLabeledChoice("Endpoint",
            Stream.of(HonoSampler.Endpoint.values()).map(HonoSampler.Endpoint::name).toArray(String[]::new));
    endpoint.setToolTipText("<html>The name of the endpoint to send the AMQP message to.</html>");
    deviceId = new JLabeledTextField("Device ID");
    deviceId.setToolTipText("<html>The device identifier to put into the <em>device_id</em> application property of the AMQP message to send.</html>");
    contentType = new JLabeledTextField("Content type");
    data = new JLabeledTextArea("Message data");
    waitForDeliveryResult = new JCheckBox("Wait for delivery result");
    waitForDeliveryResult.setToolTipText("<html>Deselecting this option increases sender throughput, especially of <em>event</em> messages, " +
            "at the expense of not finding out about rejected messages. <br>For this, the number of messages at the receiver end has to be checked.</html>");
    setSenderTime = new JCheckBox("Set sender time in property");
    setSenderTime.setToolTipText(new StringBuilder()
            .append("<html>")
            .append("When checked, the messages being sent will contain a timestamp (millis since epoch start) ")
            .append("in the <em>timeStamp</em> application property.")
            .append("</html>")
            .toString());
    waitForReceivers = new JLabeledTextField(
            "Number of receivers to wait for (e.g. from other threads)");
    waitForReceiversTimeout = new JLabeledTextField(
            "Max time (millis) to wait for receivers");
    sampleSendTimeout = new JLabeledTextField("Max time (millis) for sending a message");
    msgCountPerSamplerRun = new JLabeledTextField("Number of messages per sampler run");

    addOption(honoServerOptions);
    addOption(tenant);
    addOption(container);
    addOption(getWrapperPanelToFixAlignment(endpoint));
    addOption(deviceId);
    addOption(contentType);
    addOption(data);
    addOption(waitForDeliveryResult);
    addOption(setSenderTime);
    addOption(waitForReceivers);
    addOption(waitForReceiversTimeout);
    addOption(sampleSendTimeout);
    addOption(msgCountPerSamplerRun);
}
 
Example #6
Source File: OAuthSamplerGui.java    From jmeter-plugins with Apache License 2.0 4 votes vote down vote up
private JPanel getResourceConfigPanel() {
    consumerKey = new JLabeledTextField("Consumer Key", 25);
    consumerSecret = new JLabeledTextField("Consumer Secret", 25);
    automaticRedirect = new JCheckBox(JMeterUtils.getResString("follow_redirects"));
    httpMethods = new JLabeledChoice("Method", new String[]{"GET", "POST", "PUT", "DELETE", "PATCH"});
    httpMethods.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            JLabeledChoice c = (JLabeledChoice) e.getSource();
            String text = c.getText();
            if ("PUT".equals(text) || "POST".equals(text) || "PATCH".equals(text)) {
                automaticRedirect.setSelected(false);
                automaticRedirect.setEnabled(false);
            } else {
                automaticRedirect.setEnabled(true);
            }
        }
    });
    useKeepAlive = new JCheckBox(JMeterUtils.getResString("use_keepalive"));
    hostBaseUrl = new JLabeledTextField("Base Url", 25);
    resource = new JLabeledTextField("Resource", 20);
    port = new JLabeledTextField("Port", 10);
    VerticalPanel resourceConfigPanel = new VerticalPanel();
    HorizontalPanel oAuthPanel = new HorizontalPanel();
    oAuthPanel.add(consumerKey);
    oAuthPanel.add(consumerSecret);
    HorizontalPanel panel1 = new HorizontalPanel();
    panel1.add(httpMethods);
    panel1.add(useKeepAlive);
    panel1.add(automaticRedirect);
    HorizontalPanel panel2 = new HorizontalPanel();
    panel2.add(hostBaseUrl);
    panel2.add(port);
    HorizontalPanel panel3 = new HorizontalPanel();
    panel3.add(resource);
    resourceConfigPanel.add(panel1);
    resourceConfigPanel.add(oAuthPanel);
    resourceConfigPanel.add(panel2);
    resourceConfigPanel.add(panel3);
    return resourceConfigPanel;
}