@Override public String toString() { return HttpUtil.getFormattedContentType(contentType, charset); } }
@Override public String getContentTypeCharsetFormatted() { return HttpUtil.getFormattedContentType(contentType); }
@Override public void changed(String contentType, String charset) { final String formatted = HttpUtil.getFormattedContentType(contentType, charset); jtf_content_type_charset.setText(formatted); } });
public static String getFormattedContentType(final String contentType, final Charset charset){ return getFormattedContentType(contentType, (charset!=null? charset.name(): null)); }
@Override public void setContentTypeCharset(String contentType, Charset charset) { jd.setContentType(contentType); if(charset != null) { jd.setCharset(charset); } jtf_content_type_charset.setText( HttpUtil.getFormattedContentType(contentType, charset)); }
@Override public void setContentType(String contentType) { jd.setContentType(contentType); String charset = jd.getCharsetString(); jtf_content_type_charset.setText( HttpUtil.getFormattedContentType(contentType, charset)); }
@Override public void setCharset(Charset charset) { jd.setCharset(charset); jtf_content_type_charset.setText( HttpUtil.getFormattedContentType( jd.getContentType(), charset)); }
public static String getFormattedContentType(final ContentType contentType){ return getFormattedContentType(contentType.getContentType(), contentType.getCharset()); }