Package pivot.wtk.content

Examples of pivot.wtk.content.ListItem


    /**
     * Gets the query to issue to the server, authenticated if needed.
     */
    private Request getRequest() {
        ListButton protocolListButton = (ListButton)serializer.getObjectByID("request.protocol");
        ListItem protocolListItem = (ListItem)protocolListButton.getSelectedItem();
        Protocol protocol = Protocol.decode(protocolListItem.getText());
        boolean secure = protocol.isSecure();

        TextInput hostTextInput = (TextInput)serializer.getObjectByID("request.host");
        String host = hostTextInput.getText();

        TextInput portTextInput = (TextInput)serializer.getObjectByID("request.port");
        String portText = portTextInput.getText();
        int port;
        try {
            port = Integer.parseInt(portText);
        } catch (Exception ex) {
            port = secure ? 443 : 80;
        }

        TextInput pathTextInput = (TextInput)serializer.getObjectByID("request.path");
        String path = pathTextInput.getText();

        ListButton methodListButton = (ListButton)serializer.getObjectByID("request.method");
        ListItem methodListItem = (ListItem)methodListButton.getSelectedItem();

        // Construct the HTTP request
        Request httpRequest = new Request(methodListItem.getText(), protocol.toString(), host, port, path);

        TextArea textArea = (TextArea)serializer.getObjectByID("request.body");
        String body = textArea.getText();
        httpRequest.setBody(body.getBytes());

View Full Code Here


    /**
     * Gets the query to issue to the server, authenticated if needed.
     */
    private Request getRequest() {
        ListButton protocolListButton = (ListButton)serializer.getObjectByName("request.protocol");
        ListItem protocolListItem = (ListItem)protocolListButton.getSelectedItem();
        Protocol protocol = Protocol.decode(protocolListItem.getText());
        boolean secure = protocol.isSecure();

        TextInput hostTextInput = (TextInput)serializer.getObjectByName("request.host");
        String host = hostTextInput.getText();

        TextInput portTextInput = (TextInput)serializer.getObjectByName("request.port");
        String portText = portTextInput.getText();
        int port;
        try {
            port = Integer.parseInt(portText);
        } catch (Exception ex) {
            port = secure ? 443 : 80;
        }

        TextInput pathTextInput = (TextInput)serializer.getObjectByName("request.path");
        String path = pathTextInput.getText();

        ListButton methodListButton = (ListButton)serializer.getObjectByName("request.method");
        ListItem methodListItem = (ListItem)methodListButton.getSelectedItem();

        // Construct the HTTP request
        Request httpRequest = new Request(methodListItem.getText(), protocol.toString(), host, port, path);

        TextArea textArea = (TextArea)serializer.getObjectByName("request.body");
        String body = textArea.getText();
        httpRequest.setBody(body.getBytes());

View Full Code Here

TOP

Related Classes of pivot.wtk.content.ListItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.