Examples of IGlobalOptions


Examples of org.wiztools.restclient.IGlobalOptions

        String indentStr = options.getProperty(INDENT_KEY);
        return indentStr==null? false: (indentStr.equals("true")? true: false);
    }

    private boolean isResponseSyntaxSetInGlobalOptions() {
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
        String syntaxResponse = options.getProperty(SYNTAX_COLOR_RESPONSE);
        return syntaxResponse==null? true: Boolean.valueOf(syntaxResponse);
    }
View Full Code Here

Examples of org.wiztools.restclient.IGlobalOptions

        String syntaxResponse = options.getProperty(SYNTAX_COLOR_RESPONSE);
        return syntaxResponse==null? true: Boolean.valueOf(syntaxResponse);
    }

    private boolean isRequestSyntaxSetInGlobalOptions() {
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
        String syntaxRequest = options.getProperty(SYNTAX_COLOR_REQUEST);
        return syntaxRequest==null? true: Boolean.valueOf(syntaxRequest);
    }
View Full Code Here

Examples of org.wiztools.restclient.IGlobalOptions

        return null;
    }

    @Override
    public boolean saveOptions() {
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
        options.setProperty(INDENT_KEY, String.valueOf(jcb_indentResponse.isSelected()));

        options.setProperty(SYNTAX_COLOR_REQUEST, String.valueOf(jcb_syntaxRequest.isSelected()));
        options.setProperty(SYNTAX_COLOR_RESPONSE, String.valueOf(jcb_syntaxResponse.isSelected()));

        options.setProperty(SCROLL_SPEED, String.valueOf(js_scrollSpeed.getValue()));
        ServiceLocator.getInstance(RESTViewImpl.class).setTextAreaScrollSpeed(getScrollSpeed());
        return true;
    }
View Full Code Here

Examples of org.wiztools.restclient.IGlobalOptions

                isHTML = true;
            }
        }
       
        // Get the options:
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
       
        // Set syntax color:
        if(options.isPropertyTrue("response.body.syntax.color")) {
            if(isXml) {
                se_response.setSyntax(TextEditorSyntax.XML);
            }
            if(isJson) {
                se_response.setSyntax(TextEditorSyntax.JSON);
            }
            if(isHTML) {
                se_response.setSyntax(TextEditorSyntax.HTML);
            }
        }
        else { // No syntax!
            se_response.setSyntax(TextEditorSyntax.NONE);
        }
       
        // Find if you need to indent
        final String responseBody = new String(getBody(), HttpUtil.getCharsetDefault(type));
        if(options.isPropertyTrue("response.body.indent")) {
            if(isXml){
                try{
                    String indentedResponseBody = XMLIndentUtil.getIndented(responseBody);
                    se_response.setText(indentedResponseBody);
                }
View Full Code Here

Examples of org.wiztools.restclient.IGlobalOptions

            reqTimeout = 1000 * reqTimeout;
            ok_type = SECONDS;
        }
        ok_value = reqTimeout;
       
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
        options.setProperty("request-timeout-in-millis", String.valueOf(reqTimeout));
       
        return true;
    }
View Full Code Here

Examples of org.wiztools.restclient.IGlobalOptions

        return true;
    }

    @Override
    public void initOptions() {
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
        try{
            String t = options.getProperty(PROP_PREFIX + "type");
            ok_type = t==null? ok_type: t;
            ok_value = Integer.parseInt(options.getProperty(PROP_PREFIX + "value"));
            // ok_value is always stored in milli-secs, so convertion is necessary:
            if(SECONDS.equals(ok_type)){
                lastSelected = SECONDS;
                ok_value = ok_value / 1000;
            }
View Full Code Here

Examples of org.wiztools.restclient.IGlobalOptions

        }
    }

    @Override
    public void shutdownOptions() {
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
        options.setProperty(PROP_PREFIX + "type", ok_type);
        options.setProperty(PROP_PREFIX + "value", String.valueOf(ok_value));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.