id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,000 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.stripBraceAndQuotation | public static String stripBraceAndQuotation(Object o) {
if (null == o) return "";
String s = stripBrace(o);
s = stripQuotation(s);
return s;
} | java | public static String stripBraceAndQuotation(Object o) {
if (null == o) return "";
String s = stripBrace(o);
s = stripQuotation(s);
return s;
} | [
"public",
"static",
"String",
"stripBraceAndQuotation",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"null",
"==",
"o",
")",
"return",
"\"\"",
";",
"String",
"s",
"=",
"stripBrace",
"(",
"o",
")",
";",
"s",
"=",
"stripQuotation",
"(",
"s",
")",
";",
"ret... | Strip off both brace and quotation
@param o
@return the string result | [
"Strip",
"off",
"both",
"brace",
"and",
"quotation"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L769-L774 |
3,001 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.shrinkSpace | public static String shrinkSpace(Object o) {
if (null == o) return "";
return o.toString().replaceAll("[\r\n]+", "\n").replaceAll("[ \\t\\x0B\\f]+", " ");
} | java | public static String shrinkSpace(Object o) {
if (null == o) return "";
return o.toString().replaceAll("[\r\n]+", "\n").replaceAll("[ \\t\\x0B\\f]+", " ");
} | [
"public",
"static",
"String",
"shrinkSpace",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"null",
"==",
"o",
")",
"return",
"\"\"",
";",
"return",
"o",
".",
"toString",
"(",
")",
".",
"replaceAll",
"(",
"\"[\\r\\n]+\"",
",",
"\"\\n\"",
")",
".",
"replaceAl... | Shrink spaces in an object's string representation by merge multiple
spaces, tabs into one space, and multiple line breaks into one line break
@param o
@return the string result | [
"Shrink",
"spaces",
"in",
"an",
"object",
"s",
"string",
"representation",
"by",
"merge",
"multiple",
"spaces",
"tabs",
"into",
"one",
"space",
"and",
"multiple",
"line",
"breaks",
"into",
"one",
"line",
"break"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L783-L786 |
3,002 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.isDigitsOrAlphabetic | public static boolean isDigitsOrAlphabetic(char c) {
int i = (int)c;
return digits.include(i) || uppers.include(i) || lowers.include(i);
} | java | public static boolean isDigitsOrAlphabetic(char c) {
int i = (int)c;
return digits.include(i) || uppers.include(i) || lowers.include(i);
} | [
"public",
"static",
"boolean",
"isDigitsOrAlphabetic",
"(",
"char",
"c",
")",
"{",
"int",
"i",
"=",
"(",
"int",
")",
"c",
";",
"return",
"digits",
".",
"include",
"(",
"i",
")",
"||",
"uppers",
".",
"include",
"(",
"i",
")",
"||",
"lowers",
".",
"i... | check the given char to be a digit or alphabetic
@param c
@return true if this is a digit an upper case char or a lowercase char | [
"check",
"the",
"given",
"char",
"to",
"be",
"a",
"digit",
"or",
"alphabetic"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L797-L800 |
3,003 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.capitalizeWords | @Transformer
public static String capitalizeWords(Object o) {
if (null == o) return "";
String source = o.toString();
char prevc = ' '; // first char of source is capitalized
StringBuilder sb = new StringBuilder();
for (int i = 0; i < source.length(); i++) {
char ... | java | @Transformer
public static String capitalizeWords(Object o) {
if (null == o) return "";
String source = o.toString();
char prevc = ' '; // first char of source is capitalized
StringBuilder sb = new StringBuilder();
for (int i = 0; i < source.length(); i++) {
char ... | [
"@",
"Transformer",
"public",
"static",
"String",
"capitalizeWords",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"null",
"==",
"o",
")",
"return",
"\"\"",
";",
"String",
"source",
"=",
"o",
".",
"toString",
"(",
")",
";",
"char",
"prevc",
"=",
"'",
"'",... | Capitalize the first character of every word of the specified object's
string representation. Words are separated by space
@param o
@return the string result | [
"Capitalize",
"the",
"first",
"character",
"of",
"every",
"word",
"of",
"the",
"specified",
"object",
"s",
"string",
"representation",
".",
"Words",
"are",
"separated",
"by",
"space"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L809-L825 |
3,004 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.lowerFirst | @Transformer
public static String lowerFirst(Object o) {
if (null == o) return "";
String string = o.toString();
if (string.length() == 0) {
return string;
}
return ("" + string.charAt(0)).toLowerCase() + string.substring(1);
} | java | @Transformer
public static String lowerFirst(Object o) {
if (null == o) return "";
String string = o.toString();
if (string.length() == 0) {
return string;
}
return ("" + string.charAt(0)).toLowerCase() + string.substring(1);
} | [
"@",
"Transformer",
"public",
"static",
"String",
"lowerFirst",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"null",
"==",
"o",
")",
"return",
"\"\"",
";",
"String",
"string",
"=",
"o",
".",
"toString",
"(",
")",
";",
"if",
"(",
"string",
".",
"length",
... | Make the first character be lowercase of the given object's string representation
@param o
@return the string result | [
"Make",
"the",
"first",
"character",
"be",
"lowercase",
"of",
"the",
"given",
"object",
"s",
"string",
"representation"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L847-L855 |
3,005 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.capFirst | @Transformer
public static String capFirst(Object o) {
if (null == o) return "";
String string = o.toString();
if (string.length() == 0) {
return string;
}
return ("" + string.charAt(0)).toUpperCase() + string.substring(1);
} | java | @Transformer
public static String capFirst(Object o) {
if (null == o) return "";
String string = o.toString();
if (string.length() == 0) {
return string;
}
return ("" + string.charAt(0)).toUpperCase() + string.substring(1);
} | [
"@",
"Transformer",
"public",
"static",
"String",
"capFirst",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"null",
"==",
"o",
")",
"return",
"\"\"",
";",
"String",
"string",
"=",
"o",
".",
"toString",
"(",
")",
";",
"if",
"(",
"string",
".",
"length",
... | Make the first character be uppercase of the given object's string representation
@param o
@return the string result | [
"Make",
"the",
"first",
"character",
"be",
"uppercase",
"of",
"the",
"given",
"object",
"s",
"string",
"representation"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L863-L871 |
3,006 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.camelCase | @Transformer
public static String camelCase(Object obj) {
if (null == obj) return "";
String string = obj.toString();
//string = noAccents(string);
//string = string.replaceAll("[^\\w ]", "");
StringBuilder result = new StringBuilder(string.length());
String[] sa = st... | java | @Transformer
public static String camelCase(Object obj) {
if (null == obj) return "";
String string = obj.toString();
//string = noAccents(string);
//string = string.replaceAll("[^\\w ]", "");
StringBuilder result = new StringBuilder(string.length());
String[] sa = st... | [
"@",
"Transformer",
"public",
"static",
"String",
"camelCase",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"null",
"==",
"obj",
")",
"return",
"\"\"",
";",
"String",
"string",
"=",
"obj",
".",
"toString",
"(",
")",
";",
"//string = noAccents(string);",
"//s... | Turn an object's String representation into Camel Case
@param obj
@return the string result | [
"Turn",
"an",
"object",
"s",
"String",
"representation",
"into",
"Camel",
"Case"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L879-L895 |
3,007 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.len | @Transformer
public static int len(Object o) {
if (o instanceof Collection) {
return ((Collection)o).size();
} else if (o instanceof Map) {
return ((Map)o).size();
} else if (o.getClass().isArray()) {
return Array.getLength(o);
} else {
... | java | @Transformer
public static int len(Object o) {
if (o instanceof Collection) {
return ((Collection)o).size();
} else if (o instanceof Map) {
return ((Map)o).size();
} else if (o.getClass().isArray()) {
return Array.getLength(o);
} else {
... | [
"@",
"Transformer",
"public",
"static",
"int",
"len",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Collection",
")",
"{",
"return",
"(",
"(",
"Collection",
")",
"o",
")",
".",
"size",
"(",
")",
";",
"}",
"else",
"if",
"(",
"o",
"i... | get length of specified object
<ul>
<li>If o is a Collection or Map, then return size of it</li>
<li>If o is an array, then return length of it</li>
<li>Otherwise return length() of String representation of the object</li>
</ul>
@param o
@return length | [
"get",
"length",
"of",
"specified",
"object"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L939-L950 |
3,008 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.urlEncode | @Transformer
public static String urlEncode(Object data) {
if (null == data) return "";
String entity = data.toString();
try {
String encoding = "utf-8";
return URLEncoder.encode(entity, encoding);
} catch (UnsupportedEncodingException e) {
Logger.... | java | @Transformer
public static String urlEncode(Object data) {
if (null == data) return "";
String entity = data.toString();
try {
String encoding = "utf-8";
return URLEncoder.encode(entity, encoding);
} catch (UnsupportedEncodingException e) {
Logger.... | [
"@",
"Transformer",
"public",
"static",
"String",
"urlEncode",
"(",
"Object",
"data",
")",
"{",
"if",
"(",
"null",
"==",
"data",
")",
"return",
"\"\"",
";",
"String",
"entity",
"=",
"data",
".",
"toString",
"(",
")",
";",
"try",
"{",
"String",
"encodin... | encode using utf-8
@param data
@return encoded | [
"encode",
"using",
"utf",
"-",
"8"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L996-L1007 |
3,009 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.format | public static String format(ITemplate template, Number number) {
return format(template, number, null, null);
} | java | public static String format(ITemplate template, Number number) {
return format(template, number, null, null);
} | [
"public",
"static",
"String",
"format",
"(",
"ITemplate",
"template",
",",
"Number",
"number",
")",
"{",
"return",
"format",
"(",
"template",
",",
"number",
",",
"null",
",",
"null",
")",
";",
"}"
] | Format number with specified template
@param template
@param number
@return the formatted string | [
"Format",
"number",
"with",
"specified",
"template"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1024-L1026 |
3,010 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.format | @Transformer(requireTemplate = true)
public static String format(Number number, String pattern, Locale locale) {
return format(null, number, pattern, locale);
} | java | @Transformer(requireTemplate = true)
public static String format(Number number, String pattern, Locale locale) {
return format(null, number, pattern, locale);
} | [
"@",
"Transformer",
"(",
"requireTemplate",
"=",
"true",
")",
"public",
"static",
"String",
"format",
"(",
"Number",
"number",
",",
"String",
"pattern",
",",
"Locale",
"locale",
")",
"{",
"return",
"format",
"(",
"null",
",",
"number",
",",
"pattern",
",",... | Format the number with specified pattern, language and locale
@param number
@param pattern
@param locale
@return the formatted String
@see DecimalFormatSymbols | [
"Format",
"the",
"number",
"with",
"specified",
"pattern",
"language",
"and",
"locale"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1036-L1039 |
3,011 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.format | public static String format(ITemplate template, Number number, String pattern, Locale locale) {
if (null == number) {
throw new NullPointerException();
}
if (null == locale) {
locale = I18N.locale(template);
}
NumberFormat nf;
if (null == ... | java | public static String format(ITemplate template, Number number, String pattern, Locale locale) {
if (null == number) {
throw new NullPointerException();
}
if (null == locale) {
locale = I18N.locale(template);
}
NumberFormat nf;
if (null == ... | [
"public",
"static",
"String",
"format",
"(",
"ITemplate",
"template",
",",
"Number",
"number",
",",
"String",
"pattern",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"null",
"==",
"number",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
... | Format the number with specified template, pattern, language and locale
@param number
@param pattern
@param locale
@return the formatted String
@see DecimalFormatSymbols | [
"Format",
"the",
"number",
"with",
"specified",
"template",
"pattern",
"language",
"and",
"locale"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1049-L1065 |
3,012 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.format | @Transformer(requireTemplate = true)
public static String format(Date date) {
return format(date, null, null, null);
} | java | @Transformer(requireTemplate = true)
public static String format(Date date) {
return format(date, null, null, null);
} | [
"@",
"Transformer",
"(",
"requireTemplate",
"=",
"true",
")",
"public",
"static",
"String",
"format",
"(",
"Date",
"date",
")",
"{",
"return",
"format",
"(",
"date",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Format a date with engine's default format corresponding
to the engine's locale configured
@param date
@return the formatted String | [
"Format",
"a",
"date",
"with",
"engine",
"s",
"default",
"format",
"corresponding",
"to",
"the",
"engine",
"s",
"locale",
"configured"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1107-L1110 |
3,013 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.format | public static String format(ITemplate template, Date date) {
return format(template, date, null, null, null);
} | java | public static String format(ITemplate template, Date date) {
return format(template, date, null, null, null);
} | [
"public",
"static",
"String",
"format",
"(",
"ITemplate",
"template",
",",
"Date",
"date",
")",
"{",
"return",
"format",
"(",
"template",
",",
"date",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Format a date with specified engine's default format corresponding
to the engine's locale configured
@param date
@return the formatted String | [
"Format",
"a",
"date",
"with",
"specified",
"engine",
"s",
"default",
"format",
"corresponding",
"to",
"the",
"engine",
"s",
"locale",
"configured"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1130-L1132 |
3,014 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.format | public static String format(ITemplate template, Date date, String pattern, Locale locale, String timezone) {
if (null == date) throw new NullPointerException();
RythmEngine engine = null == template ? RythmEngine.get() : template.__engine();
DateFormat df = (null == engine ? IDateFormatFactory.... | java | public static String format(ITemplate template, Date date, String pattern, Locale locale, String timezone) {
if (null == date) throw new NullPointerException();
RythmEngine engine = null == template ? RythmEngine.get() : template.__engine();
DateFormat df = (null == engine ? IDateFormatFactory.... | [
"public",
"static",
"String",
"format",
"(",
"ITemplate",
"template",
",",
"Date",
"date",
",",
"String",
"pattern",
",",
"Locale",
"locale",
",",
"String",
"timezone",
")",
"{",
"if",
"(",
"null",
"==",
"date",
")",
"throw",
"new",
"NullPointerException",
... | Format a date with specified pattern, lang, locale and timezone. The locale
comes from the engine instance specified
@param template
@param date
@param pattern
@param locale
@param timezone
@return format result | [
"Format",
"a",
"date",
"with",
"specified",
"pattern",
"lang",
"locale",
"and",
"timezone",
".",
"The",
"locale",
"comes",
"from",
"the",
"engine",
"instance",
"specified"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1363-L1369 |
3,015 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.formatCurrency | @Transformer(requireTemplate = true)
public static String formatCurrency(Object data) {
return formatCurrency(null, data, null, null);
} | java | @Transformer(requireTemplate = true)
public static String formatCurrency(Object data) {
return formatCurrency(null, data, null, null);
} | [
"@",
"Transformer",
"(",
"requireTemplate",
"=",
"true",
")",
"public",
"static",
"String",
"formatCurrency",
"(",
"Object",
"data",
")",
"{",
"return",
"formatCurrency",
"(",
"null",
",",
"data",
",",
"null",
",",
"null",
")",
";",
"}"
] | Transformer method. Format given data into currency
@param data
@return the currency
See {@link #formatCurrency(org.rythmengine.template.ITemplate,Object,String,java.util.Locale)} | [
"Transformer",
"method",
".",
"Format",
"given",
"data",
"into",
"currency"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1445-L1448 |
3,016 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.formatCurrency | public static String formatCurrency(ITemplate template, Object data, String currencyCode) {
return formatCurrency(template, data, currencyCode, null);
} | java | public static String formatCurrency(ITemplate template, Object data, String currencyCode) {
return formatCurrency(template, data, currencyCode, null);
} | [
"public",
"static",
"String",
"formatCurrency",
"(",
"ITemplate",
"template",
",",
"Object",
"data",
",",
"String",
"currencyCode",
")",
"{",
"return",
"formatCurrency",
"(",
"template",
",",
"data",
",",
"currencyCode",
",",
"null",
")",
";",
"}"
] | Transformer method. Format currency using specified parameters
@param template
@param data
@param currencyCode
@return the currency string
See {@link #formatCurrency(org.rythmengine.template.ITemplate, Object, String, java.util.Locale)} | [
"Transformer",
"method",
".",
"Format",
"currency",
"using",
"specified",
"parameters"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1482-L1484 |
3,017 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.formatCurrency | public static String formatCurrency(ITemplate template, Object data, String currencyCode, Locale locale) {
if (null == data) throw new NullPointerException();
Number number;
if (data instanceof Number) {
number = (Number)data;
} else {
number = Double.parseDouble(... | java | public static String formatCurrency(ITemplate template, Object data, String currencyCode, Locale locale) {
if (null == data) throw new NullPointerException();
Number number;
if (data instanceof Number) {
number = (Number)data;
} else {
number = Double.parseDouble(... | [
"public",
"static",
"String",
"formatCurrency",
"(",
"ITemplate",
"template",
",",
"Object",
"data",
",",
"String",
"currencyCode",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"null",
"==",
"data",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";"... | Format give data into currency using locale info from the engine specified
<p>The method accept any data type. When <code>null</code> is found then
<code>NullPointerException</code> will be thrown out; if an <code>Number</code>
is passed in, it will be type cast to <code>Number</code>; otherwise
a <code>Double.valueOf... | [
"Format",
"give",
"data",
"into",
"currency",
"using",
"locale",
"info",
"from",
"the",
"engine",
"specified"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1513-L1567 |
3,018 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.i18n | @Transformer(requireTemplate = true)
public static String i18n(Object key, Object... args) {
return i18n(null, key, args);
} | java | @Transformer(requireTemplate = true)
public static String i18n(Object key, Object... args) {
return i18n(null, key, args);
} | [
"@",
"Transformer",
"(",
"requireTemplate",
"=",
"true",
")",
"public",
"static",
"String",
"i18n",
"(",
"Object",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"i18n",
"(",
"null",
",",
"key",
",",
"args",
")",
";",
"}"
] | Transformer method. Return i18n message of a given key and args.
@param key
@param args
@return the i18n message | [
"Transformer",
"method",
".",
"Return",
"i18n",
"message",
"of",
"a",
"given",
"key",
"and",
"args",
"."
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1657-L1660 |
3,019 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/S.java | S.random | public static String random(int len) {
final char[] chars = {'0', '1', '2', '3', '4',
'5', '6', '7', '8', '9', '$', '#', '^', '&', '_',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w... | java | public static String random(int len) {
final char[] chars = {'0', '1', '2', '3', '4',
'5', '6', '7', '8', '9', '$', '#', '^', '&', '_',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w... | [
"public",
"static",
"String",
"random",
"(",
"int",
"len",
")",
"{",
"final",
"char",
"[",
"]",
"chars",
"=",
"{",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"... | Generate random string.
The generated string is safe to be used as filename
@param len
@return a random string with specified length | [
"Generate",
"random",
"string",
"."
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/S.java#L1679-L1698 |
3,020 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__render | protected RawData __render(String template) {
if (null == template) return new RawData("");
return S.raw(__engine.sandbox().render(template, __renderArgs));
} | java | protected RawData __render(String template) {
if (null == template) return new RawData("");
return S.raw(__engine.sandbox().render(template, __renderArgs));
} | [
"protected",
"RawData",
"__render",
"(",
"String",
"template",
")",
"{",
"if",
"(",
"null",
"==",
"template",
")",
"return",
"new",
"RawData",
"(",
"\"\"",
")",
";",
"return",
"S",
".",
"raw",
"(",
"__engine",
".",
"sandbox",
"(",
")",
".",
"render",
... | Render another template from within this template. Using the renderArgs
of this template.
@param template
@return render result as {@link org.rythmengine.utils.RawData}
@see #__render(String, Object...) | [
"Render",
"another",
"template",
"from",
"within",
"this",
"template",
".",
"Using",
"the",
"renderArgs",
"of",
"this",
"template",
"."
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L293-L296 |
3,021 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__addLayoutSection | private void __addLayoutSection(String name, String section, boolean def) {
Map<String, String> m = def ? layoutSections0 : layoutSections;
if (m.containsKey(name)) return;
m.put(name, section);
} | java | private void __addLayoutSection(String name, String section, boolean def) {
Map<String, String> m = def ? layoutSections0 : layoutSections;
if (m.containsKey(name)) return;
m.put(name, section);
} | [
"private",
"void",
"__addLayoutSection",
"(",
"String",
"name",
",",
"String",
"section",
",",
"boolean",
"def",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"m",
"=",
"def",
"?",
"layoutSections0",
":",
"layoutSections",
";",
"if",
"(",
"m",
".",... | Add layout section. Should not be used in user application or template
@param name
@param section | [
"Add",
"layout",
"section",
".",
"Should",
"not",
"be",
"used",
"in",
"user",
"application",
"or",
"template"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L313-L317 |
3,022 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__startSection | protected void __startSection(String name) {
if (null == name) throw new NullPointerException("section name cannot be null");
if (null != tmpOut) throw new IllegalStateException("section cannot be nested");
tmpCaller = __caller;
__caller = null;
tmpOut = __buffer;
__buffe... | java | protected void __startSection(String name) {
if (null == name) throw new NullPointerException("section name cannot be null");
if (null != tmpOut) throw new IllegalStateException("section cannot be nested");
tmpCaller = __caller;
__caller = null;
tmpOut = __buffer;
__buffe... | [
"protected",
"void",
"__startSection",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"null",
"==",
"name",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"section name cannot be null\"",
")",
";",
"if",
"(",
"null",
"!=",
"tmpOut",
")",
"throw",
"new",
"I... | Start a layout section. Not to be used in user application or template
@param name | [
"Start",
"a",
"layout",
"section",
".",
"Not",
"to",
"be",
"used",
"in",
"user",
"application",
"or",
"template"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L328-L336 |
3,023 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__endSection | protected void __endSection(boolean def) {
if (null == tmpOut && null == tmpCaller) throw new IllegalStateException("section has not been started");
__addLayoutSection(section, __buffer.toString(), def);
__buffer = tmpOut;
__caller = tmpCaller;
tmpOut = null;
tmpCaller = ... | java | protected void __endSection(boolean def) {
if (null == tmpOut && null == tmpCaller) throw new IllegalStateException("section has not been started");
__addLayoutSection(section, __buffer.toString(), def);
__buffer = tmpOut;
__caller = tmpCaller;
tmpOut = null;
tmpCaller = ... | [
"protected",
"void",
"__endSection",
"(",
"boolean",
"def",
")",
"{",
"if",
"(",
"null",
"==",
"tmpOut",
"&&",
"null",
"==",
"tmpCaller",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"section has not been started\"",
")",
";",
"__addLayoutSection",
"(",
... | End a layout section with a boolean flag mark if it is a default content or not.
Not to be used in user application or template
@param def | [
"End",
"a",
"layout",
"section",
"with",
"a",
"boolean",
"flag",
"mark",
"if",
"it",
"is",
"a",
"default",
"content",
"or",
"not",
".",
"Not",
"to",
"be",
"used",
"in",
"user",
"application",
"or",
"template"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L351-L358 |
3,024 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__pLayoutSection | protected void __pLayoutSection(String name) {
String s = layoutSections.get(name);
if (null == s) s = layoutSections0.get(name);
else {
String s0 = layoutSections0.get(name);
if (s0 == null) s0 = "";
s = s.replace("\u0000\u0000inherited\u0000\u0000", s0);
... | java | protected void __pLayoutSection(String name) {
String s = layoutSections.get(name);
if (null == s) s = layoutSections0.get(name);
else {
String s0 = layoutSections0.get(name);
if (s0 == null) s0 = "";
s = s.replace("\u0000\u0000inherited\u0000\u0000", s0);
... | [
"protected",
"void",
"__pLayoutSection",
"(",
"String",
"name",
")",
"{",
"String",
"s",
"=",
"layoutSections",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"null",
"==",
"s",
")",
"s",
"=",
"layoutSections0",
".",
"get",
"(",
"name",
")",
";",
"els... | Print a layout section by name. Not to be used in user application or template
@param name | [
"Print",
"a",
"layout",
"section",
"by",
"name",
".",
"Not",
"to",
"be",
"used",
"in",
"user",
"application",
"or",
"template"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L365-L374 |
3,025 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__getTemplateClass | public TemplateClass __getTemplateClass(boolean useCaller) {
TemplateClass tc = __templateClass;
if (useCaller && null == tc) {
TemplateBase caller = __caller();
if (null != caller) return caller.__getTemplateClass(true);
}
return tc;
} | java | public TemplateClass __getTemplateClass(boolean useCaller) {
TemplateClass tc = __templateClass;
if (useCaller && null == tc) {
TemplateBase caller = __caller();
if (null != caller) return caller.__getTemplateClass(true);
}
return tc;
} | [
"public",
"TemplateClass",
"__getTemplateClass",
"(",
"boolean",
"useCaller",
")",
"{",
"TemplateClass",
"tc",
"=",
"__templateClass",
";",
"if",
"(",
"useCaller",
"&&",
"null",
"==",
"tc",
")",
"{",
"TemplateBase",
"caller",
"=",
"__caller",
"(",
")",
";",
... | Get the template class of this template. Not to be used in user application or template
@param useCaller
@return a <code>TemplateClass</code> | [
"Get",
"the",
"template",
"class",
"of",
"this",
"template",
".",
"Not",
"to",
"be",
"used",
"in",
"user",
"application",
"or",
"template"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L522-L529 |
3,026 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__setOutput | protected void __setOutput(String path) {
try {
w_ = new BufferedWriter(new FileWriter(path));
} catch (Exception e) {
throw new FastRuntimeException(e.getMessage());
}
} | java | protected void __setOutput(String path) {
try {
w_ = new BufferedWriter(new FileWriter(path));
} catch (Exception e) {
throw new FastRuntimeException(e.getMessage());
}
} | [
"protected",
"void",
"__setOutput",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"w_",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"path",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"FastRuntimeExceptio... | Set output file path
@param path | [
"Set",
"output",
"file",
"path"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L625-L631 |
3,027 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__setOutput | protected void __setOutput(File file) {
try {
w_ = new BufferedWriter(new FileWriter(file));
} catch (Exception e) {
throw new FastRuntimeException(e.getMessage());
}
} | java | protected void __setOutput(File file) {
try {
w_ = new BufferedWriter(new FileWriter(file));
} catch (Exception e) {
throw new FastRuntimeException(e.getMessage());
}
} | [
"protected",
"void",
"__setOutput",
"(",
"File",
"file",
")",
"{",
"try",
"{",
"w_",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"file",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"FastRuntimeException"... | Set output file
@param file | [
"Set",
"output",
"file"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L638-L644 |
3,028 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__getAs | protected final <T> T __getAs(String name, Class<T> c) {
Object o = __getRenderArg(name);
if (null == o) return null;
return (T) o;
} | java | protected final <T> T __getAs(String name, Class<T> c) {
Object o = __getRenderArg(name);
if (null == o) return null;
return (T) o;
} | [
"protected",
"final",
"<",
"T",
">",
"T",
"__getAs",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"Object",
"o",
"=",
"__getRenderArg",
"(",
"name",
")",
";",
"if",
"(",
"null",
"==",
"o",
")",
"return",
"null",
";",
"return... | Get render arg and do type cast to the class specified
@param name
@param c
@param <T>
@return a render argument | [
"Get",
"render",
"arg",
"and",
"do",
"type",
"cast",
"to",
"the",
"class",
"specified"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L1065-L1069 |
3,029 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__getRenderPropertyAs | protected final <T> T __getRenderPropertyAs(String name, T def) {
Object o = __getRenderProperty(name, def);
return null == o ? def : (T) o;
} | java | protected final <T> T __getRenderPropertyAs(String name, T def) {
Object o = __getRenderProperty(name, def);
return null == o ? def : (T) o;
} | [
"protected",
"final",
"<",
"T",
">",
"T",
"__getRenderPropertyAs",
"(",
"String",
"name",
",",
"T",
"def",
")",
"{",
"Object",
"o",
"=",
"__getRenderProperty",
"(",
"name",
",",
"def",
")",
";",
"return",
"null",
"==",
"o",
"?",
"def",
":",
"(",
"T",... | Get render property by name and do type cast to the specified default value.
If the render property cannot be found by name, then return the default value
@param name
@param def
@param <T>
@return a render property
@see #__getRenderProperty(String) | [
"Get",
"render",
"property",
"by",
"name",
"and",
"do",
"type",
"cast",
"to",
"the",
"specified",
"default",
"value",
".",
"If",
"the",
"render",
"property",
"cannot",
"be",
"found",
"by",
"name",
"then",
"return",
"the",
"default",
"value"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L1108-L1111 |
3,030 | rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__handleTemplateExecutionException | protected final void __handleTemplateExecutionException(Exception e) {
try {
if (!RythmEvents.ON_RENDER_EXCEPTION.trigger(__engine(), F.T2(this, e))) {
throw e;
}
} catch (RuntimeException e0) {
throw e0;
} catch (Exception e1) {
th... | java | protected final void __handleTemplateExecutionException(Exception e) {
try {
if (!RythmEvents.ON_RENDER_EXCEPTION.trigger(__engine(), F.T2(this, e))) {
throw e;
}
} catch (RuntimeException e0) {
throw e0;
} catch (Exception e1) {
th... | [
"protected",
"final",
"void",
"__handleTemplateExecutionException",
"(",
"Exception",
"e",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"RythmEvents",
".",
"ON_RENDER_EXCEPTION",
".",
"trigger",
"(",
"__engine",
"(",
")",
",",
"F",
".",
"T2",
"(",
"this",
",",
"e... | Handle template execution exception. Not to be called in user application or template
@param e | [
"Handle",
"template",
"execution",
"exception",
".",
"Not",
"to",
"be",
"called",
"in",
"user",
"application",
"or",
"template"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L1133-L1143 |
3,031 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/compiler/TemplateClassLoader.java | TemplateClassLoader.getClassDefinition | protected byte[] getClassDefinition(final String name0) {
if (typeNotFound(name0)) return null;
byte[] ba = null;
String name = name0.replace(".", "/") + ".class";
InputStream is = getResourceAsStream(name);
if (null != is) {
try {
ByteArrayOutputStrea... | java | protected byte[] getClassDefinition(final String name0) {
if (typeNotFound(name0)) return null;
byte[] ba = null;
String name = name0.replace(".", "/") + ".class";
InputStream is = getResourceAsStream(name);
if (null != is) {
try {
ByteArrayOutputStrea... | [
"protected",
"byte",
"[",
"]",
"getClassDefinition",
"(",
"final",
"String",
"name0",
")",
"{",
"if",
"(",
"typeNotFound",
"(",
"name0",
")",
")",
"return",
"null",
";",
"byte",
"[",
"]",
"ba",
"=",
"null",
";",
"String",
"name",
"=",
"name0",
".",
"... | Search for the byte code of the given class. | [
"Search",
"for",
"the",
"byte",
"code",
"of",
"the",
"given",
"class",
"."
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/compiler/TemplateClassLoader.java#L394-L428 |
3,032 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/compiler/TemplateClassLoader.java | TemplateClassLoader.detectChanges | public void detectChanges() {
if (engine.isProdMode()) return;
// Now check for file modification
List<TemplateClass> modifieds = new ArrayList<TemplateClass>();
for (TemplateClass tc : engine.classes().all()) {
if (tc.refresh()) modifieds.add(tc);
}
Set<Templ... | java | public void detectChanges() {
if (engine.isProdMode()) return;
// Now check for file modification
List<TemplateClass> modifieds = new ArrayList<TemplateClass>();
for (TemplateClass tc : engine.classes().all()) {
if (tc.refresh()) modifieds.add(tc);
}
Set<Templ... | [
"public",
"void",
"detectChanges",
"(",
")",
"{",
"if",
"(",
"engine",
".",
"isProdMode",
"(",
")",
")",
"return",
";",
"// Now check for file modification",
"List",
"<",
"TemplateClass",
">",
"modifieds",
"=",
"new",
"ArrayList",
"<",
"TemplateClass",
">",
"(... | Detect Template changes | [
"Detect",
"Template",
"changes"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/compiler/TemplateClassLoader.java#L444-L489 |
3,033 | operasoftware/operaprestodriver | src/com/opera/core/systems/QuickWidget.java | QuickWidget.intersection | private Point intersection(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
double dem = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
// Solve the intersect point
double xi = ((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) / dem;
double yi = ((x1 * y2 - y1 * x2) *... | java | private Point intersection(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
double dem = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
// Solve the intersect point
double xi = ((x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)) / dem;
double yi = ((x1 * y2 - y1 * x2) *... | [
"private",
"Point",
"intersection",
"(",
"int",
"x1",
",",
"int",
"y1",
",",
"int",
"x2",
",",
"int",
"y2",
",",
"int",
"x3",
",",
"int",
"y3",
",",
"int",
"x4",
",",
"int",
"y4",
")",
"{",
"double",
"dem",
"=",
"(",
"x1",
"-",
"x2",
")",
"*"... | Intersect two lines | [
"Intersect",
"two",
"lines"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/QuickWidget.java#L78-L91 |
3,034 | operasoftware/operaprestodriver | src/com/opera/core/systems/QuickWidget.java | QuickWidget.intersection | private Point intersection(int x1, int y1, int x2, int y2, DesktopWindowRect rect) {
Point
bottom =
intersection(x1, y1, x2, y2, rect.getX(), rect.getY(), rect.getX() + rect.getHeight(),
rect.getY());
if (bottom != null) {
return bottom;
}
Point
right ... | java | private Point intersection(int x1, int y1, int x2, int y2, DesktopWindowRect rect) {
Point
bottom =
intersection(x1, y1, x2, y2, rect.getX(), rect.getY(), rect.getX() + rect.getHeight(),
rect.getY());
if (bottom != null) {
return bottom;
}
Point
right ... | [
"private",
"Point",
"intersection",
"(",
"int",
"x1",
",",
"int",
"y1",
",",
"int",
"x2",
",",
"int",
"y2",
",",
"DesktopWindowRect",
"rect",
")",
"{",
"Point",
"bottom",
"=",
"intersection",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"rect",
... | Intersect a line and a DesktopWindowRect | [
"Intersect",
"a",
"line",
"and",
"a",
"DesktopWindowRect"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/QuickWidget.java#L94-L128 |
3,035 | operasoftware/operaprestodriver | src/com/opera/core/systems/QuickWidget.java | QuickWidget.dragAndDropOn | public void dragAndDropOn(QuickWidget widget, DropPosition dropPos) {
/*
* FIXME: Handle MousePosition
*/
Point currentLocation = getCenterLocation();
Point dropPoint = getDropPoint(widget, dropPos);
List<ModifierPressed> alist = new ArrayList<ModifierP... | java | public void dragAndDropOn(QuickWidget widget, DropPosition dropPos) {
/*
* FIXME: Handle MousePosition
*/
Point currentLocation = getCenterLocation();
Point dropPoint = getDropPoint(widget, dropPos);
List<ModifierPressed> alist = new ArrayList<ModifierP... | [
"public",
"void",
"dragAndDropOn",
"(",
"QuickWidget",
"widget",
",",
"DropPosition",
"dropPos",
")",
"{",
"/*\n * FIXME: Handle MousePosition\n */",
"Point",
"currentLocation",
"=",
"getCenterLocation",
"(",
")",
";",
"Point",
... | Drags this widget onto the specified widget at the given drop position
@param widget the widget to drop this widget onto
@param dropPos the position to drop this widget into, CENTER, EDGE or BETWEEN | [
"Drags",
"this",
"widget",
"onto",
"the",
"specified",
"widget",
"at",
"the",
"given",
"drop",
"position"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/QuickWidget.java#L136-L149 |
3,036 | operasoftware/operaprestodriver | src/com/opera/core/systems/QuickWidget.java | QuickWidget.getDropPoint | private Point getDropPoint(QuickWidget element, DropPosition pos) {
Point dropPoint = new Point(element.getCenterLocation().x, element.getCenterLocation().y);
if (pos == DropPosition.CENTER) {
return dropPoint;
}
Point dragPoint = new Point(this.getCenterLocation().x, this.getCenterLocation().y);... | java | private Point getDropPoint(QuickWidget element, DropPosition pos) {
Point dropPoint = new Point(element.getCenterLocation().x, element.getCenterLocation().y);
if (pos == DropPosition.CENTER) {
return dropPoint;
}
Point dragPoint = new Point(this.getCenterLocation().x, this.getCenterLocation().y);... | [
"private",
"Point",
"getDropPoint",
"(",
"QuickWidget",
"element",
",",
"DropPosition",
"pos",
")",
"{",
"Point",
"dropPoint",
"=",
"new",
"Point",
"(",
"element",
".",
"getCenterLocation",
"(",
")",
".",
"x",
",",
"element",
".",
"getCenterLocation",
"(",
"... | The drop point is on the quick widget passed in | [
"The",
"drop",
"point",
"is",
"on",
"the",
"quick",
"widget",
"passed",
"in"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/QuickWidget.java#L153-L183 |
3,037 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/compiler/TemplateClassManager.java | TemplateClassManager.getByClassName | public TemplateClass getByClassName(String name) {
TemplateClass tc = clsNameIdx.get(name);
checkUpdate(tc);
return tc;
} | java | public TemplateClass getByClassName(String name) {
TemplateClass tc = clsNameIdx.get(name);
checkUpdate(tc);
return tc;
} | [
"public",
"TemplateClass",
"getByClassName",
"(",
"String",
"name",
")",
"{",
"TemplateClass",
"tc",
"=",
"clsNameIdx",
".",
"get",
"(",
"name",
")",
";",
"checkUpdate",
"(",
"tc",
")",
";",
"return",
"tc",
";",
"}"
] | Get a class by name
@param name The fully qualified class name
@return The TemplateClass or null | [
"Get",
"a",
"class",
"by",
"name"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/compiler/TemplateClassManager.java#L75-L79 |
3,038 | operasoftware/operaprestodriver | src/com/opera/core/systems/internal/WatirUtils.java | WatirUtils.getSystemDoubleClickTimeMs | public static Integer getSystemDoubleClickTimeMs() {
Integer DEFAULT_INTERVAL_MS = 500;
Toolkit t = Toolkit.getDefaultToolkit();
if (t == null) {
return DEFAULT_INTERVAL_MS;
}
Object o = t.getDesktopProperty("awt.multiClickInterval");
if (o == null) {
return DEFAULT_INTERVAL_MS;
... | java | public static Integer getSystemDoubleClickTimeMs() {
Integer DEFAULT_INTERVAL_MS = 500;
Toolkit t = Toolkit.getDefaultToolkit();
if (t == null) {
return DEFAULT_INTERVAL_MS;
}
Object o = t.getDesktopProperty("awt.multiClickInterval");
if (o == null) {
return DEFAULT_INTERVAL_MS;
... | [
"public",
"static",
"Integer",
"getSystemDoubleClickTimeMs",
"(",
")",
"{",
"Integer",
"DEFAULT_INTERVAL_MS",
"=",
"500",
";",
"Toolkit",
"t",
"=",
"Toolkit",
".",
"getDefaultToolkit",
"(",
")",
";",
"if",
"(",
"t",
"==",
"null",
")",
"{",
"return",
"DEFAULT... | Returns the platform double click timeout, that is the time that separates two clicks treated
as a double click from two clicks treated as two single clicks. | [
"Returns",
"the",
"platform",
"double",
"click",
"timeout",
"that",
"is",
"the",
"time",
"that",
"separates",
"two",
"clicks",
"treated",
"as",
"a",
"double",
"click",
"from",
"two",
"clicks",
"treated",
"as",
"two",
"single",
"clicks",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/internal/WatirUtils.java#L42-L56 |
3,039 | operasoftware/operaprestodriver | src/com/opera/core/systems/internal/WatirUtils.java | WatirUtils.textMatchesWithANY | public static boolean textMatchesWithANY(String haystack, String needle) {
haystack = haystack.trim();
needle = needle.trim();
// Make sure we escape every character that is considered to be a special character inside a
// regular expression. Matcher.quoteReplacement() takes care of '\\' and '$'.
... | java | public static boolean textMatchesWithANY(String haystack, String needle) {
haystack = haystack.trim();
needle = needle.trim();
// Make sure we escape every character that is considered to be a special character inside a
// regular expression. Matcher.quoteReplacement() takes care of '\\' and '$'.
... | [
"public",
"static",
"boolean",
"textMatchesWithANY",
"(",
"String",
"haystack",
",",
"String",
"needle",
")",
"{",
"haystack",
"=",
"haystack",
".",
"trim",
"(",
")",
";",
"needle",
"=",
"needle",
".",
"trim",
"(",
")",
";",
"// Make sure we escape every chara... | Compares haystack and needle taking into the account that the needle may contain any number of
ANY_MATCHER occurrences, that will be matched to any substring in haystack, i.e. "Show _ANY_
more..." will match anything like "Show 1 more...", "Show 2 more..." and so on.
@param haystack the text that will be compared, may... | [
"Compares",
"haystack",
"and",
"needle",
"taking",
"into",
"the",
"account",
"that",
"the",
"needle",
"may",
"contain",
"any",
"number",
"of",
"ANY_MATCHER",
"occurrences",
"that",
"will",
"be",
"matched",
"to",
"any",
"substring",
"in",
"haystack",
"i",
".",
... | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/internal/WatirUtils.java#L133-L152 |
3,040 | operasoftware/operaprestodriver | src/com/opera/core/systems/scope/stp/services/ScopeEcmascriptDebugger.java | ScopeEcmascriptDebugger.parseEvalReply | protected Object parseEvalReply(EvalResult result) {
String status = result.getStatus();
if (!status.equals("completed")) {
if (status.equals("unhandled-exception")) {
// Would be great give the JS error here, but it appears that by the
// time we callFunctionOnObject the error object has... | java | protected Object parseEvalReply(EvalResult result) {
String status = result.getStatus();
if (!status.equals("completed")) {
if (status.equals("unhandled-exception")) {
// Would be great give the JS error here, but it appears that by the
// time we callFunctionOnObject the error object has... | [
"protected",
"Object",
"parseEvalReply",
"(",
"EvalResult",
"result",
")",
"{",
"String",
"status",
"=",
"result",
".",
"getStatus",
"(",
")",
";",
"if",
"(",
"!",
"status",
".",
"equals",
"(",
"\"completed\"",
")",
")",
"{",
"if",
"(",
"status",
".",
... | Parses a reply and returns the following types String presentation of number, boolean or
string. | [
"Parses",
"a",
"reply",
"and",
"returns",
"the",
"following",
"types",
"String",
"presentation",
"of",
"number",
"boolean",
"or",
"string",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/stp/services/ScopeEcmascriptDebugger.java#L330-L350 |
3,041 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/Eval.java | Eval.eval | public static boolean eval(String s) {
if (S.isEmpty(s)) return false;
if ("false".equalsIgnoreCase(s)) return false;
if ("no".equalsIgnoreCase(s)) return false;
return true;
} | java | public static boolean eval(String s) {
if (S.isEmpty(s)) return false;
if ("false".equalsIgnoreCase(s)) return false;
if ("no".equalsIgnoreCase(s)) return false;
return true;
} | [
"public",
"static",
"boolean",
"eval",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"S",
".",
"isEmpty",
"(",
"s",
")",
")",
"return",
"false",
";",
"if",
"(",
"\"false\"",
".",
"equalsIgnoreCase",
"(",
"s",
")",
")",
"return",
"false",
";",
"if",
"(",... | Return true if the specified string does not equals, ignore case, to "false" or "no"
@param s
@return boolean result | [
"Return",
"true",
"if",
"the",
"specified",
"string",
"does",
"not",
"equals",
"ignore",
"case",
"to",
"false",
"or",
"no"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/Eval.java#L89-L94 |
3,042 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/Eval.java | Eval.locale | public static Locale locale(String language) {
if (language.contains("_")) {
String[] sa = language.split("_");
if (sa.length > 2) {
return new Locale(sa[0], sa[1], sa[2]);
} else if (sa.length > 1) {
return new Locale(sa[0], sa[1]);
... | java | public static Locale locale(String language) {
if (language.contains("_")) {
String[] sa = language.split("_");
if (sa.length > 2) {
return new Locale(sa[0], sa[1], sa[2]);
} else if (sa.length > 1) {
return new Locale(sa[0], sa[1]);
... | [
"public",
"static",
"Locale",
"locale",
"(",
"String",
"language",
")",
"{",
"if",
"(",
"language",
".",
"contains",
"(",
"\"_\"",
")",
")",
"{",
"String",
"[",
"]",
"sa",
"=",
"language",
".",
"split",
"(",
"\"_\"",
")",
";",
"if",
"(",
"sa",
".",... | Eval locale from language string
@param language
@return new Locale constructed from the language | [
"Eval",
"locale",
"from",
"language",
"string"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/Eval.java#L221-L233 |
3,043 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/Eval.java | Eval.locale | public static Locale locale(String language, String region, String variant) {
return new Locale(language, region, variant);
} | java | public static Locale locale(String language, String region, String variant) {
return new Locale(language, region, variant);
} | [
"public",
"static",
"Locale",
"locale",
"(",
"String",
"language",
",",
"String",
"region",
",",
"String",
"variant",
")",
"{",
"return",
"new",
"Locale",
"(",
"language",
",",
"region",
",",
"variant",
")",
";",
"}"
] | Eval locale from language, region and variant
@param language
@param region
@param variant
@return the new Locale constructed | [
"Eval",
"locale",
"from",
"language",
"region",
"and",
"variant"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/Eval.java#L252-L254 |
3,044 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaUIElement.java | OperaUIElement.verifyText | public boolean verifyText(String stringId) {
String text = desktopUtils.getString(stringId, true /* skipAmpersand */);
return getText().equals(text);
} | java | public boolean verifyText(String stringId) {
String text = desktopUtils.getString(stringId, true /* skipAmpersand */);
return getText().equals(text);
} | [
"public",
"boolean",
"verifyText",
"(",
"String",
"stringId",
")",
"{",
"String",
"text",
"=",
"desktopUtils",
".",
"getString",
"(",
"stringId",
",",
"true",
"/* skipAmpersand */",
")",
";",
"return",
"getText",
"(",
")",
".",
"equals",
"(",
"text",
")",
... | Checks if widget text equals the text specified by the given string id
@return true if text specified by stringId equals widget text | [
"Checks",
"if",
"widget",
"text",
"equals",
"the",
"text",
"specified",
"by",
"the",
"given",
"string",
"id"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaUIElement.java#L104-L108 |
3,045 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaUIElement.java | OperaUIElement.verifyContainsText | public boolean verifyContainsText(String stringId) {
String text = desktopUtils.getString(stringId, true);
return getText().indexOf(text) >= 0;
} | java | public boolean verifyContainsText(String stringId) {
String text = desktopUtils.getString(stringId, true);
return getText().indexOf(text) >= 0;
} | [
"public",
"boolean",
"verifyContainsText",
"(",
"String",
"stringId",
")",
"{",
"String",
"text",
"=",
"desktopUtils",
".",
"getString",
"(",
"stringId",
",",
"true",
")",
";",
"return",
"getText",
"(",
")",
".",
"indexOf",
"(",
"text",
")",
">=",
"0",
"... | Checks if widget text contains the text specified by the given string id
@param stringId String id of string
@return true if text specified by stringId is contained in widget text | [
"Checks",
"if",
"widget",
"text",
"contains",
"the",
"text",
"specified",
"by",
"the",
"given",
"string",
"id"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaUIElement.java#L116-L119 |
3,046 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/compiler/TemplateClass.java | TemplateClass.compile | public synchronized byte[] compile() {
long start = System.currentTimeMillis();
try {
if (null != javaByteCode) {
return javaByteCode;
}
if (null == javaSource) {
throw new IllegalStateException("Cannot find java source when compiling "... | java | public synchronized byte[] compile() {
long start = System.currentTimeMillis();
try {
if (null != javaByteCode) {
return javaByteCode;
}
if (null == javaSource) {
throw new IllegalStateException("Cannot find java source when compiling "... | [
"public",
"synchronized",
"byte",
"[",
"]",
"compile",
"(",
")",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"try",
"{",
"if",
"(",
"null",
"!=",
"javaByteCode",
")",
"{",
"return",
"javaByteCode",
";",
"}",
"if",
"(",... | Compile the class from Java source
@return the bytes that comprise the class file | [
"Compile",
"the",
"class",
"from",
"Java",
"source"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/compiler/TemplateClass.java#L664-L707 |
3,047 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/compiler/TemplateClass.java | TemplateClass.compiled | public void compiled(byte[] code) {
javaByteCode = code;
//enhancedByteCode = code;
compiled = true;
RythmEvents.COMPILED.trigger(engine(), code);
enhance();
//compiled(code, false);
} | java | public void compiled(byte[] code) {
javaByteCode = code;
//enhancedByteCode = code;
compiled = true;
RythmEvents.COMPILED.trigger(engine(), code);
enhance();
//compiled(code, false);
} | [
"public",
"void",
"compiled",
"(",
"byte",
"[",
"]",
"code",
")",
"{",
"javaByteCode",
"=",
"code",
";",
"//enhancedByteCode = code;",
"compiled",
"=",
"true",
";",
"RythmEvents",
".",
"COMPILED",
".",
"trigger",
"(",
"engine",
"(",
")",
",",
"code",
")",
... | Call back when a class is compiled.
@param code The bytecode. | [
"Call",
"back",
"when",
"a",
"class",
"is",
"compiled",
"."
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/compiler/TemplateClass.java#L780-L787 |
3,048 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/compiler/TemplateClass.java | TemplateClass.toCanonicalName | private static String toCanonicalName(String key, String root) {
if (key.startsWith("/") || key.startsWith("\\")) {
key = key.substring(1);
}
if (key.startsWith(root)) {
key = key.replace(root, "");
}
if (key.startsWith("/") || key.startsWith("\\")) {
... | java | private static String toCanonicalName(String key, String root) {
if (key.startsWith("/") || key.startsWith("\\")) {
key = key.substring(1);
}
if (key.startsWith(root)) {
key = key.replace(root, "");
}
if (key.startsWith("/") || key.startsWith("\\")) {
... | [
"private",
"static",
"String",
"toCanonicalName",
"(",
"String",
"key",
",",
"String",
"root",
")",
"{",
"if",
"(",
"key",
".",
"startsWith",
"(",
"\"/\"",
")",
"||",
"key",
".",
"startsWith",
"(",
"\"\\\\\"",
")",
")",
"{",
"key",
"=",
"key",
".",
"... | Convert the key to canonical template name
@param key the resource key
@param root the resource loader root path
@return the canonical name | [
"Convert",
"the",
"key",
"to",
"canonical",
"template",
"name"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/compiler/TemplateClass.java#L845-L858 |
3,049 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaMouse.java | OperaMouse.tripleClick | public void tripleClick(Coordinates where) {
Point p = getPoint(where, "triple click");
exec.mouseAction(p.x, p.y, 3, OperaMouseKeys.LEFT);
} | java | public void tripleClick(Coordinates where) {
Point p = getPoint(where, "triple click");
exec.mouseAction(p.x, p.y, 3, OperaMouseKeys.LEFT);
} | [
"public",
"void",
"tripleClick",
"(",
"Coordinates",
"where",
")",
"{",
"Point",
"p",
"=",
"getPoint",
"(",
"where",
",",
"\"triple click\"",
")",
";",
"exec",
".",
"mouseAction",
"(",
"p",
".",
"x",
",",
"p",
".",
"y",
",",
"3",
",",
"OperaMouseKeys",... | Triple click is an Opera specific way of selecting a sentence.
@param where to click | [
"Triple",
"click",
"is",
"an",
"Opera",
"specific",
"way",
"of",
"selecting",
"a",
"sentence",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaMouse.java#L57-L60 |
3,050 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaProxy.java | OperaProxy.setHttpsProxy | public void setHttpsProxy(String host) {
setProxyValue(HTTPS_SERVER, host);
setProxyValue(USE_HTTPS, host != null);
} | java | public void setHttpsProxy(String host) {
setProxyValue(HTTPS_SERVER, host);
setProxyValue(USE_HTTPS, host != null);
} | [
"public",
"void",
"setHttpsProxy",
"(",
"String",
"host",
")",
"{",
"setProxyValue",
"(",
"HTTPS_SERVER",
",",
"host",
")",
";",
"setProxyValue",
"(",
"USE_HTTPS",
",",
"host",
"!=",
"null",
")",
";",
"}"
] | Specify which proxy to use for HTTPS connections.
@param host the proxy host, expected format is <code>hostname:1234</code> | [
"Specify",
"which",
"proxy",
"to",
"use",
"for",
"HTTPS",
"connections",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaProxy.java#L121-L124 |
3,051 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.initDesktopDriver | private void initDesktopDriver() {
// super.init();
setServices();
setPrefsPaths();
// Start Opera if it is not already running
// If the Opera Binary isn't set we are assuming Opera is up and we
// can ask it for the location of itself
if (settings.getBinary() == null && !settings.noRest... | java | private void initDesktopDriver() {
// super.init();
setServices();
setPrefsPaths();
// Start Opera if it is not already running
// If the Opera Binary isn't set we are assuming Opera is up and we
// can ask it for the location of itself
if (settings.getBinary() == null && !settings.noRest... | [
"private",
"void",
"initDesktopDriver",
"(",
")",
"{",
"// super.init();",
"setServices",
"(",
")",
";",
"setPrefsPaths",
"(",
")",
";",
"// Start Opera if it is not already running",
"// If the Opera Binary isn't set we are assuming Opera is up and we",
"// can ask it for the loca... | Initializes services and starts Opera.
If OperaBinaryLocation is not set, the binary location is retrieved from the connected Opera
instance, before shutting it down, waiting for it to quit properly, and then restarting it
under the control of the {@link OperaLauncherRunner}. | [
"Initializes",
"services",
"and",
"starts",
"Opera",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L116-L156 |
3,052 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.getQuickWidgetList | public List<QuickWidget> getQuickWidgetList(String windowName) {
int id = getQuickWindowID(windowName);
if (id >= 0 || windowName.isEmpty()) {
return getQuickWidgetList(id);
}
return Collections.emptyList();
} | java | public List<QuickWidget> getQuickWidgetList(String windowName) {
int id = getQuickWindowID(windowName);
if (id >= 0 || windowName.isEmpty()) {
return getQuickWidgetList(id);
}
return Collections.emptyList();
} | [
"public",
"List",
"<",
"QuickWidget",
">",
"getQuickWidgetList",
"(",
"String",
"windowName",
")",
"{",
"int",
"id",
"=",
"getQuickWindowID",
"(",
"windowName",
")",
";",
"if",
"(",
"id",
">=",
"0",
"||",
"windowName",
".",
"isEmpty",
"(",
")",
")",
"{",... | Gets a list of all widgets in the window with the given window name.
@param windowName name of window to list widgets inside
@return list of widgets in the window with name windowName If windowName is empty, it gets the
widgets in the active window | [
"Gets",
"a",
"list",
"of",
"all",
"widgets",
"in",
"the",
"window",
"with",
"the",
"given",
"window",
"name",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L232-L239 |
3,053 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.findWidgetByName | public QuickWidget findWidgetByName(QuickWidgetType type, int windowId, String widgetName) {
return desktopWindowManager.getQuickWidget(type, windowId, QuickWidgetSearchType.NAME,
widgetName);
} | java | public QuickWidget findWidgetByName(QuickWidgetType type, int windowId, String widgetName) {
return desktopWindowManager.getQuickWidget(type, windowId, QuickWidgetSearchType.NAME,
widgetName);
} | [
"public",
"QuickWidget",
"findWidgetByName",
"(",
"QuickWidgetType",
"type",
",",
"int",
"windowId",
",",
"String",
"widgetName",
")",
"{",
"return",
"desktopWindowManager",
".",
"getQuickWidget",
"(",
"type",
",",
"windowId",
",",
"QuickWidgetSearchType",
".",
"NAM... | Finds widget by name in the window specified by windowId.
@param windowId window id of parent window
@param widgetName name of widget to find
@return QuickWidget with the given name in the window with id windowId, or null if no such
widget exists. | [
"Finds",
"widget",
"by",
"name",
"in",
"the",
"window",
"specified",
"by",
"windowId",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L322-L325 |
3,054 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.findWidgetByText | public QuickWidget findWidgetByText(QuickWidgetType type, int windowId, String text) {
return desktopWindowManager.getQuickWidget(type, windowId, QuickWidgetSearchType.TEXT, text);
} | java | public QuickWidget findWidgetByText(QuickWidgetType type, int windowId, String text) {
return desktopWindowManager.getQuickWidget(type, windowId, QuickWidgetSearchType.TEXT, text);
} | [
"public",
"QuickWidget",
"findWidgetByText",
"(",
"QuickWidgetType",
"type",
",",
"int",
"windowId",
",",
"String",
"text",
")",
"{",
"return",
"desktopWindowManager",
".",
"getQuickWidget",
"(",
"type",
",",
"windowId",
",",
"QuickWidgetSearchType",
".",
"TEXT",
... | Finds widget with the text specified in the window with the given window id.
Note, if there are several widgets in this window with the same text, the widget returned can
be any one of those
@param windowId - id of parent window
@param text - text of widget
@return QuickWidget with the given text in the specified... | [
"Finds",
"widget",
"with",
"the",
"text",
"specified",
"in",
"the",
"window",
"with",
"the",
"given",
"window",
"id",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L353-L355 |
3,055 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.findWidgetByStringId | public QuickWidget findWidgetByStringId(QuickWidgetType type, int windowId, String stringId) {
String text = desktopUtils.getString(stringId, true);
return findWidgetByText(type, windowId, text);
} | java | public QuickWidget findWidgetByStringId(QuickWidgetType type, int windowId, String stringId) {
String text = desktopUtils.getString(stringId, true);
return findWidgetByText(type, windowId, text);
} | [
"public",
"QuickWidget",
"findWidgetByStringId",
"(",
"QuickWidgetType",
"type",
",",
"int",
"windowId",
",",
"String",
"stringId",
")",
"{",
"String",
"text",
"=",
"desktopUtils",
".",
"getString",
"(",
"stringId",
",",
"true",
")",
";",
"return",
"findWidgetBy... | Finds widget with the text specified by string id in the window with the given id.
@param windowId id of parent window
@param stringId string id of the widget
@return QuickWidget or null if no matching widget found | [
"Finds",
"widget",
"with",
"the",
"text",
"specified",
"by",
"string",
"id",
"in",
"the",
"window",
"with",
"the",
"given",
"id",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L379-L383 |
3,056 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.getQuickMenuItemByStringId | public QuickMenuItem getQuickMenuItemByStringId(String stringId) {
String text = desktopUtils.getString(stringId, true);
return desktopWindowManager.getQuickMenuItemByText(text);
} | java | public QuickMenuItem getQuickMenuItemByStringId(String stringId) {
String text = desktopUtils.getString(stringId, true);
return desktopWindowManager.getQuickMenuItemByText(text);
} | [
"public",
"QuickMenuItem",
"getQuickMenuItemByStringId",
"(",
"String",
"stringId",
")",
"{",
"String",
"text",
"=",
"desktopUtils",
".",
"getString",
"(",
"stringId",
",",
"true",
")",
";",
"return",
"desktopWindowManager",
".",
"getQuickMenuItemByText",
"(",
"text... | Get an item in a language independent way from its stringId.
@param stringId StringId as found in standard_menu.ini | [
"Get",
"an",
"item",
"in",
"a",
"language",
"independent",
"way",
"from",
"its",
"stringId",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L515-L518 |
3,057 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.keyPress | public void keyPress(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyPress(key, modifiers);
} | java | public void keyPress(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyPress(key, modifiers);
} | [
"public",
"void",
"keyPress",
"(",
"String",
"key",
",",
"List",
"<",
"ModifierPressed",
">",
"modifiers",
")",
"{",
"systemInputManager",
".",
"keyPress",
"(",
"key",
",",
"modifiers",
")",
";",
"}"
] | Press Key with modifiers held down.
@param key key to press
@param modifiers modifiers held | [
"Press",
"Key",
"with",
"modifiers",
"held",
"down",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L600-L602 |
3,058 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.keyUp | public void keyUp(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyUp(key, modifiers);
} | java | public void keyUp(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyUp(key, modifiers);
} | [
"public",
"void",
"keyUp",
"(",
"String",
"key",
",",
"List",
"<",
"ModifierPressed",
">",
"modifiers",
")",
"{",
"systemInputManager",
".",
"keyUp",
"(",
"key",
",",
"modifiers",
")",
";",
"}"
] | Release key.
@param key key to press
@param modifiers modifiers held | [
"Release",
"key",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L610-L612 |
3,059 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.keyDown | public void keyDown(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyDown(key, modifiers);
} | java | public void keyDown(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyDown(key, modifiers);
} | [
"public",
"void",
"keyDown",
"(",
"String",
"key",
",",
"List",
"<",
"ModifierPressed",
">",
"modifiers",
")",
"{",
"systemInputManager",
".",
"keyDown",
"(",
"key",
",",
"modifiers",
")",
";",
"}"
] | Press Key.
@param key key to press
@param modifiers modifiers held | [
"Press",
"Key",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L620-L622 |
3,060 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.operaDesktopAction | public void operaDesktopAction(String using, int data, String dataString,
String dataStringParam) {
getScopeServices().getExec().action(using, data, dataString, dataStringParam);
} | java | public void operaDesktopAction(String using, int data, String dataString,
String dataStringParam) {
getScopeServices().getExec().action(using, data, dataString, dataStringParam);
} | [
"public",
"void",
"operaDesktopAction",
"(",
"String",
"using",
",",
"int",
"data",
",",
"String",
"dataString",
",",
"String",
"dataStringParam",
")",
"{",
"getScopeServices",
"(",
")",
".",
"getExec",
"(",
")",
".",
"action",
"(",
"using",
",",
"data",
"... | Executes an opera action.
@param using - action_name
@param data - data parameter
@param dataString - data string parameter
@param dataStringParam - parameter to data string | [
"Executes",
"an",
"opera",
"action",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L641-L644 |
3,061 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForWindowShown | public int waitForWindowShown(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices()
.waitForDesktopWindowShown(windowName, OperaIntervals.WI... | java | public int waitForWindowShown(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices()
.waitForDesktopWindowShown(windowName, OperaIntervals.WI... | [
"public",
"int",
"waitForWindowShown",
"(",
"String",
"windowName",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a window failed because Opera... | Waits until the window is shown, and then returns the window id of the window
@param windowName - window to wait for shown event on
@return id of window | [
"Waits",
"until",
"the",
"window",
"is",
"shown",
"and",
"then",
"returns",
"the",
"window",
"id",
"of",
"the",
"window"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L688-L696 |
3,062 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForWindowUpdated | public int waitForWindowUpdated(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowUpdated(windowName,
... | java | public int waitForWindowUpdated(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowUpdated(windowName,
... | [
"public",
"int",
"waitForWindowUpdated",
"(",
"String",
"windowName",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a window failed because Ope... | Waits until the window is updated, and then returns the window id of the window.
@param windowName - window to wait for shown event on
@return id of window | [
"Waits",
"until",
"the",
"window",
"is",
"updated",
"and",
"then",
"returns",
"the",
"window",
"id",
"of",
"the",
"window",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L704-L713 |
3,063 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForWindowActivated | public int waitForWindowActivated(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowActivated(windowName,
... | java | public int waitForWindowActivated(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowActivated(windowName,
... | [
"public",
"int",
"waitForWindowActivated",
"(",
"String",
"windowName",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a window failed because O... | Waits until the window is activated, and then returns the window id of the window.
@param windowName - window to wait for shown event on
@return id of window | [
"Waits",
"until",
"the",
"window",
"is",
"activated",
"and",
"then",
"returns",
"the",
"window",
"id",
"of",
"the",
"window",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L721-L731 |
3,064 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForWindowClose | public int waitForWindowClose(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowClosed(windowName,
... | java | public int waitForWindowClose(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowClosed(windowName,
... | [
"public",
"int",
"waitForWindowClose",
"(",
"String",
"windowName",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a window failed because Opera... | Waits until the window is closed, and then returns the window id of the window.
@param windowName - window to wait for shown event on
@return id of window | [
"Waits",
"until",
"the",
"window",
"is",
"closed",
"and",
"then",
"returns",
"the",
"window",
"id",
"of",
"the",
"window",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L739-L748 |
3,065 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForWindowPageChanged | public int waitForWindowPageChanged(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowPageChanged(windowName,
... | java | public int waitForWindowPageChanged(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowPageChanged(windowName,
... | [
"public",
"int",
"waitForWindowPageChanged",
"(",
"String",
"windowName",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a window failed because... | Waits until new page is shown in the window is shown, and then returns the window id of the
window
@param windowName - window to wait for shown event on
@return id of window | [
"Waits",
"until",
"new",
"page",
"is",
"shown",
"in",
"the",
"window",
"is",
"shown",
"and",
"then",
"returns",
"the",
"window",
"id",
"of",
"the",
"window"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L759-L768 |
3,066 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForWindowLoaded | public int waitForWindowLoaded(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowLoaded(windowName,
... | java | public int waitForWindowLoaded(String windowName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices().waitForDesktopWindowLoaded(windowName,
... | [
"public",
"int",
"waitForWindowLoaded",
"(",
"String",
"windowName",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a window failed because Oper... | Waits until the window is loaded and then returns the window id of the window.
@param windowName - window to wait for shown event on
@return id of window | [
"Waits",
"until",
"the",
"window",
"is",
"loaded",
"and",
"then",
"returns",
"the",
"window",
"id",
"of",
"the",
"window",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L776-L784 |
3,067 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForMenuShown | public String waitForMenuShown(String menuName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices()
.waitForMenuShown(menuName, OperaIntervals.MENU_EVENT_TIM... | java | public String waitForMenuShown(String menuName) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a window failed because Opera is not connected.");
}
return getScopeServices()
.waitForMenuShown(menuName, OperaIntervals.MENU_EVENT_TIM... | [
"public",
"String",
"waitForMenuShown",
"(",
"String",
"menuName",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a window failed because Opera ... | Waits until the menu is shown, and then returns the name of the window
@param menuName window to wait for shown event on
@return id of window | [
"Waits",
"until",
"the",
"menu",
"is",
"shown",
"and",
"then",
"returns",
"the",
"name",
"of",
"the",
"window"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L792-L800 |
3,068 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.waitForMenuItemPressed | public String waitForMenuItemPressed(String menuItemText) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a menu item to be pressed failed because Opera is not connected.");
}
return getScopeServices().waitForMenuItemPressed(menuItemText,
... | java | public String waitForMenuItemPressed(String menuItemText) {
if (getScopeServices().getConnection() == null) {
throw new CommunicationException(
"waiting for a menu item to be pressed failed because Opera is not connected.");
}
return getScopeServices().waitForMenuItemPressed(menuItemText,
... | [
"public",
"String",
"waitForMenuItemPressed",
"(",
"String",
"menuItemText",
")",
"{",
"if",
"(",
"getScopeServices",
"(",
")",
".",
"getConnection",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"CommunicationException",
"(",
"\"waiting for a menu item to be pr... | Waits until the menu item is pressed and then returns the text of the menu item pressed
@param menuItemText - window to wait for shown event on
@return text of the menu item | [
"Waits",
"until",
"the",
"menu",
"item",
"is",
"pressed",
"and",
"then",
"returns",
"the",
"text",
"of",
"the",
"menu",
"item",
"pressed"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L825-L833 |
3,069 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.resetOperaPrefs | public void resetOperaPrefs(String newPrefs) {
// Always delete and copy over a test profile except for when running
// the first test which doesn't have a profile to copy over
if (!firstTestRun || new File(newPrefs).exists()) {
if (!profileUtils.isMainProfile(smallPreferencesPath) &&
!profi... | java | public void resetOperaPrefs(String newPrefs) {
// Always delete and copy over a test profile except for when running
// the first test which doesn't have a profile to copy over
if (!firstTestRun || new File(newPrefs).exists()) {
if (!profileUtils.isMainProfile(smallPreferencesPath) &&
!profi... | [
"public",
"void",
"resetOperaPrefs",
"(",
"String",
"newPrefs",
")",
"{",
"// Always delete and copy over a test profile except for when running",
"// the first test which doesn't have a profile to copy over",
"if",
"(",
"!",
"firstTestRun",
"||",
"new",
"File",
"(",
"newPrefs",
... | meaning operaBinaryLocation will be set already | [
"meaning",
"operaBinaryLocation",
"will",
"be",
"set",
"already"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L850-L895 |
3,070 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.deleteOperaPrefs | public void deleteOperaPrefs() {
// Only delete if Opera is currently not running
// Don't delete in no-launcher mode
if (runner != null && !runner.isOperaRunning()) {
// Will only delete profile if it's not a default main profile
if (!profileUtils.deleteProfile()) {
logger.severe("Could... | java | public void deleteOperaPrefs() {
// Only delete if Opera is currently not running
// Don't delete in no-launcher mode
if (runner != null && !runner.isOperaRunning()) {
// Will only delete profile if it's not a default main profile
if (!profileUtils.deleteProfile()) {
logger.severe("Could... | [
"public",
"void",
"deleteOperaPrefs",
"(",
")",
"{",
"// Only delete if Opera is currently not running",
"// Don't delete in no-launcher mode",
"if",
"(",
"runner",
"!=",
"null",
"&&",
"!",
"runner",
".",
"isOperaRunning",
"(",
")",
")",
"{",
"// Will only delete profile ... | Deletes the profile for the connected Opera instance.
Should only be called after the given Opera instance has quit | [
"Deletes",
"the",
"profile",
"for",
"the",
"connected",
"Opera",
"instance",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L902-L913 |
3,071 | operasoftware/operaprestodriver | src/com/opera/core/systems/common/hash/MD5.java | MD5.sum | public static String sum(byte[] bytes) {
String result = "";
for (byte b : bytes) {
result += Integer.toString((b & 0xff) + 0x100, 16).substring(1);
}
return result;
} | java | public static String sum(byte[] bytes) {
String result = "";
for (byte b : bytes) {
result += Integer.toString((b & 0xff) + 0x100, 16).substring(1);
}
return result;
} | [
"public",
"static",
"String",
"sum",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"for",
"(",
"byte",
"b",
":",
"bytes",
")",
"{",
"result",
"+=",
"Integer",
".",
"toString",
"(",
"(",
"b",
"&",
"0xff",
")",
"+"... | Return the MD5 HEX sum of a hashed MD5 byte array.
@param bytes the hashed MD5 byte array
@return HEX version of the byte array | [
"Return",
"the",
"MD5",
"HEX",
"sum",
"of",
"a",
"hashed",
"MD5",
"byte",
"array",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/common/hash/MD5.java#L33-L39 |
3,072 | operasoftware/operaprestodriver | src/com/opera/core/systems/common/hash/MD5.java | MD5.hash | public static byte[] hash(File file) throws IOException {
return Files.hash(file, Hashing.md5()).asBytes();
} | java | public static byte[] hash(File file) throws IOException {
return Files.hash(file, Hashing.md5()).asBytes();
} | [
"public",
"static",
"byte",
"[",
"]",
"hash",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"Files",
".",
"hash",
"(",
"file",
",",
"Hashing",
".",
"md5",
"(",
")",
")",
".",
"asBytes",
"(",
")",
";",
"}"
] | Get the MD5 hash of the given file.
@param file file to compute a hash on
@return a byte array of the MD5 hash
@throws IOException if file cannot be found | [
"Get",
"the",
"MD5",
"hash",
"of",
"the",
"given",
"file",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/common/hash/MD5.java#L59-L61 |
3,073 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/Time.java | Time.parseDuration | public static int parseDuration(String duration) {
if (duration == null) {
return 60 * 60 * 24 * 30;
}
Integer toAdd = null;
if (days.matcher(duration).matches()) {
Matcher matcher = days.matcher(duration);
matcher.matches();
toAdd = Intege... | java | public static int parseDuration(String duration) {
if (duration == null) {
return 60 * 60 * 24 * 30;
}
Integer toAdd = null;
if (days.matcher(duration).matches()) {
Matcher matcher = days.matcher(duration);
matcher.matches();
toAdd = Intege... | [
"public",
"static",
"int",
"parseDuration",
"(",
"String",
"duration",
")",
"{",
"if",
"(",
"duration",
"==",
"null",
")",
"{",
"return",
"60",
"*",
"60",
"*",
"24",
"*",
"30",
";",
"}",
"Integer",
"toAdd",
"=",
"null",
";",
"if",
"(",
"days",
".",... | Parse a duration
@param duration 3h, 2mn, 7s
@return The number of seconds | [
"Parse",
"a",
"duration"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/Time.java#L34-L62 |
3,074 | operasoftware/operaprestodriver | src/com/opera/core/systems/OperaBinary.java | OperaBinary.find | public static File find(OperaProduct product) {
File binary = findBinaryBasedOnEnvironmentVariable();
if (binary != null) {
return binary;
}
return findBinaryBasedOnPlatform(product);
} | java | public static File find(OperaProduct product) {
File binary = findBinaryBasedOnEnvironmentVariable();
if (binary != null) {
return binary;
}
return findBinaryBasedOnPlatform(product);
} | [
"public",
"static",
"File",
"find",
"(",
"OperaProduct",
"product",
")",
"{",
"File",
"binary",
"=",
"findBinaryBasedOnEnvironmentVariable",
"(",
")",
";",
"if",
"(",
"binary",
"!=",
"null",
")",
"{",
"return",
"binary",
";",
"}",
"return",
"findBinaryBasedOnP... | Locate the binary of the given product on the local system. If no binary is found, null is
returned.
Some products, such as {@link OperaProduct#DESKTOP} offers multiple configurations of the same
product (Opera and Opera Next), in which case the first is preferred.
@param product the product to find the binary of
@r... | [
"Locate",
"the",
"binary",
"of",
"the",
"given",
"product",
"on",
"the",
"local",
"system",
".",
"If",
"no",
"binary",
"is",
"found",
"null",
"is",
"returned",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaBinary.java#L78-L84 |
3,075 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/parser/build_in/ExpressionParser.java | ExpressionParser.assertBasic | public static String assertBasic(String symbol, IContext context) {
if (symbol.contains("_utils.sep(\"")) return symbol;// Rythm builtin expression TODO: generalize
//String s = Token.stripJavaExtension(symbol, context);
//s = S.stripBrace(s);
String s = symbol;
boolean isSimple ... | java | public static String assertBasic(String symbol, IContext context) {
if (symbol.contains("_utils.sep(\"")) return symbol;// Rythm builtin expression TODO: generalize
//String s = Token.stripJavaExtension(symbol, context);
//s = S.stripBrace(s);
String s = symbol;
boolean isSimple ... | [
"public",
"static",
"String",
"assertBasic",
"(",
"String",
"symbol",
",",
"IContext",
"context",
")",
"{",
"if",
"(",
"symbol",
".",
"contains",
"(",
"\"_utils.sep(\\\"\"",
")",
")",
"return",
"symbol",
";",
"// Rythm builtin expression TODO: generalize",
"//String... | Return symbol with transformer extension stripped off
@param symbol
@param context
@return the symbol | [
"Return",
"symbol",
"with",
"transformer",
"extension",
"stripped",
"off"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/parser/build_in/ExpressionParser.java#L33-L44 |
3,076 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/inprocess/ScreenCapture.java | ScreenCapture.take | public void take() throws AWTException {
Rectangle area = new Rectangle(dimensions);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(area);
data = getByteArray(image);
} | java | public void take() throws AWTException {
Rectangle area = new Rectangle(dimensions);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(area);
data = getByteArray(image);
} | [
"public",
"void",
"take",
"(",
")",
"throws",
"AWTException",
"{",
"Rectangle",
"area",
"=",
"new",
"Rectangle",
"(",
"dimensions",
")",
";",
"Robot",
"robot",
"=",
"new",
"Robot",
"(",
")",
";",
"BufferedImage",
"image",
"=",
"robot",
".",
"createScreenCa... | Takes the screen capture of the designated area. If no dimensions are specified, it will take
a screenshot of the full screen by default. | [
"Takes",
"the",
"screen",
"capture",
"of",
"the",
"designated",
"area",
".",
"If",
"no",
"dimensions",
"are",
"specified",
"it",
"will",
"take",
"a",
"screenshot",
"of",
"the",
"full",
"screen",
"by",
"default",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/inprocess/ScreenCapture.java#L62-L68 |
3,077 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/inprocess/ScreenCapture.java | ScreenCapture.getMd5 | public String getMd5() throws IOException {
checkCaptureTaken();
try {
return MD5.of(getData());
} catch (IOException e) {
throw new IOException("Unable to open stream or file: " + e.getMessage(), e);
}
} | java | public String getMd5() throws IOException {
checkCaptureTaken();
try {
return MD5.of(getData());
} catch (IOException e) {
throw new IOException("Unable to open stream or file: " + e.getMessage(), e);
}
} | [
"public",
"String",
"getMd5",
"(",
")",
"throws",
"IOException",
"{",
"checkCaptureTaken",
"(",
")",
";",
"try",
"{",
"return",
"MD5",
".",
"of",
"(",
"getData",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"IO... | Get the MD5 hash sum of the byte array of the data of the screen capture.
@return the MD5 hash sum of this capture
@throws IOException if an I/O exception occurs | [
"Get",
"the",
"MD5",
"hash",
"sum",
"of",
"the",
"byte",
"array",
"of",
"the",
"data",
"of",
"the",
"screen",
"capture",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/inprocess/ScreenCapture.java#L76-L84 |
3,078 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/inprocess/ScreenCapture.java | ScreenCapture.of | public static ScreenCapture of(Dimension dimensions) throws IOException {
ScreenCapture capture = new ScreenCapture(dimensions);
try {
capture.take();
} catch (AWTException e) {
throw new IOException(e);
}
return capture;
} | java | public static ScreenCapture of(Dimension dimensions) throws IOException {
ScreenCapture capture = new ScreenCapture(dimensions);
try {
capture.take();
} catch (AWTException e) {
throw new IOException(e);
}
return capture;
} | [
"public",
"static",
"ScreenCapture",
"of",
"(",
"Dimension",
"dimensions",
")",
"throws",
"IOException",
"{",
"ScreenCapture",
"capture",
"=",
"new",
"ScreenCapture",
"(",
"dimensions",
")",
";",
"try",
"{",
"capture",
".",
"take",
"(",
")",
";",
"}",
"catch... | Takes a screen capture of the given dimensions.
@param dimensions the dimensions of which to take a screen capture
@return a capture of the designated dimensions
@throws IOException if an I/O exception occurs | [
"Takes",
"a",
"screen",
"capture",
"of",
"the",
"given",
"dimensions",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/inprocess/ScreenCapture.java#L117-L127 |
3,079 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/inprocess/ScreenCapture.java | ScreenCapture.getByteArray | private static byte[] getByteArray(BufferedImage image) {
checkNotNull(image);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
try {
ImageIO.write(image, "png", stream);
} catch (IOException e) {
throw new IllegalStateException(e);
}
return stream.toByteArray();
} | java | private static byte[] getByteArray(BufferedImage image) {
checkNotNull(image);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
try {
ImageIO.write(image, "png", stream);
} catch (IOException e) {
throw new IllegalStateException(e);
}
return stream.toByteArray();
} | [
"private",
"static",
"byte",
"[",
"]",
"getByteArray",
"(",
"BufferedImage",
"image",
")",
"{",
"checkNotNull",
"(",
"image",
")",
";",
"ByteArrayOutputStream",
"stream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{",
"ImageIO",
".",
"write",
... | Get a byte array of the data of a buffered image.
@param image the image to retrieve a byte array of
@return a byte array of the buffered image's data | [
"Get",
"a",
"byte",
"array",
"of",
"the",
"data",
"of",
"a",
"buffered",
"image",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/inprocess/ScreenCapture.java#L135-L146 |
3,080 | operasoftware/operaprestodriver | src/com/opera/core/systems/internal/ProfileUtils.java | ProfileUtils.deleteProfile | public boolean deleteProfile() {
String[] profileDirs = {smallPrefsFolder, largePrefsFolder, cachePrefsFolder};
// Assuming if any of those are main profile, skip the whole delete
for (String profileDir : profileDirs) {
if (isMainProfile(profileDir)) {
logger.finer("Skipping profile deletion ... | java | public boolean deleteProfile() {
String[] profileDirs = {smallPrefsFolder, largePrefsFolder, cachePrefsFolder};
// Assuming if any of those are main profile, skip the whole delete
for (String profileDir : profileDirs) {
if (isMainProfile(profileDir)) {
logger.finer("Skipping profile deletion ... | [
"public",
"boolean",
"deleteProfile",
"(",
")",
"{",
"String",
"[",
"]",
"profileDirs",
"=",
"{",
"smallPrefsFolder",
",",
"largePrefsFolder",
",",
"cachePrefsFolder",
"}",
";",
"// Assuming if any of those are main profile, skip the whole delete",
"for",
"(",
"String",
... | Deletes prefs folders for Does nothing if prefs folders are default main user profile | [
"Deletes",
"prefs",
"folders",
"for",
"Does",
"nothing",
"if",
"prefs",
"folders",
"are",
"default",
"main",
"user",
"profile"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/internal/ProfileUtils.java#L126-L181 |
3,081 | operasoftware/operaprestodriver | src/com/opera/core/systems/scope/stp/services/ScopeWindowManager.java | ScopeWindowManager.initializeWindows | private void initializeWindows() {
clearFilter();
Response response = executeMessage(WindowManagerMessage.LIST_WINDOWS, null);
WindowList.Builder builder = WindowList.newBuilder();
buildPayload(response, builder);
WindowList list = builder.build();
List<WindowInfo> windowsList = list.getWindow... | java | private void initializeWindows() {
clearFilter();
Response response = executeMessage(WindowManagerMessage.LIST_WINDOWS, null);
WindowList.Builder builder = WindowList.newBuilder();
buildPayload(response, builder);
WindowList list = builder.build();
List<WindowInfo> windowsList = list.getWindow... | [
"private",
"void",
"initializeWindows",
"(",
")",
"{",
"clearFilter",
"(",
")",
";",
"Response",
"response",
"=",
"executeMessage",
"(",
"WindowManagerMessage",
".",
"LIST_WINDOWS",
",",
"null",
")",
";",
"WindowList",
".",
"Builder",
"builder",
"=",
"WindowList... | Set the filter to include all windows so we can get a list and maintain a list of windows. | [
"Set",
"the",
"filter",
"to",
"include",
"all",
"windows",
"so",
"we",
"can",
"get",
"a",
"list",
"and",
"maintain",
"a",
"list",
"of",
"windows",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/stp/services/ScopeWindowManager.java#L160-L176 |
3,082 | operasoftware/operaprestodriver | src/com/opera/core/systems/common/lang/OperaStrings.java | OperaStrings.isDouble | public static boolean isDouble(String string) {
if (string == null) {
return false;
}
try {
Double.parseDouble(string);
} catch (NumberFormatException e) {
return false;
}
return true;
} | java | public static boolean isDouble(String string) {
if (string == null) {
return false;
}
try {
Double.parseDouble(string);
} catch (NumberFormatException e) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isDouble",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"Double",
".",
"parseDouble",
"(",
"string",
")",
";",
"}",
"catch",
"(",
"NumberFormatE... | Checks whether given string has a double value.
@param string the string to check
@return true if string resembles a double value, false otherwise | [
"Checks",
"whether",
"given",
"string",
"has",
"a",
"double",
"value",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/common/lang/OperaStrings.java#L45-L57 |
3,083 | operasoftware/operaprestodriver | src/com/opera/core/systems/common/lang/OperaStrings.java | OperaStrings.isInteger | public static boolean isInteger(String string) {
if (string == null) {
return false;
}
try {
Integer.parseInt(string);
} catch (NumberFormatException e) {
return false;
}
return true;
} | java | public static boolean isInteger(String string) {
if (string == null) {
return false;
}
try {
Integer.parseInt(string);
} catch (NumberFormatException e) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isInteger",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"Integer",
".",
"parseInt",
"(",
"string",
")",
";",
"}",
"catch",
"(",
"NumberFormatEx... | Checks whether the given string has an integer value.
@param string the string to check
@return true if string resembles an integer value, false otherwise | [
"Checks",
"whether",
"the",
"given",
"string",
"has",
"an",
"integer",
"value",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/common/lang/OperaStrings.java#L65-L77 |
3,084 | operasoftware/operaprestodriver | src/com/opera/core/systems/common/lang/OperaStrings.java | OperaStrings.escapeJsString | public static String escapeJsString(String string, String quote) {
// This should be expanded to match all invalid characters (e.g. newlines) but for the moment
// we'll trust we'll only get quotes.
Pattern escapePattern = Pattern.compile("([^\\\\])" + quote);
// Prepend a space so that the regex can m... | java | public static String escapeJsString(String string, String quote) {
// This should be expanded to match all invalid characters (e.g. newlines) but for the moment
// we'll trust we'll only get quotes.
Pattern escapePattern = Pattern.compile("([^\\\\])" + quote);
// Prepend a space so that the regex can m... | [
"public",
"static",
"String",
"escapeJsString",
"(",
"String",
"string",
",",
"String",
"quote",
")",
"{",
"// This should be expanded to match all invalid characters (e.g. newlines) but for the moment",
"// we'll trust we'll only get quotes.",
"Pattern",
"escapePattern",
"=",
"Pat... | Escape characters for safe insertion in a JavaScript string.
@param string the string to escape
@param quote the type of quote to escape. Either " or '
@return the escaped string | [
"Escape",
"characters",
"for",
"safe",
"insertion",
"in",
"a",
"JavaScript",
"string",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/common/lang/OperaStrings.java#L96-L115 |
3,085 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java | OperaLauncherRunner.captureScreen | public ScreenCaptureReply captureScreen(long timeout, List<String> knownMD5s)
throws OperaRunnerException {
assertLauncherAlive();
String resultMd5;
byte[] resultBytes;
boolean blank = false;
try {
LauncherScreenshotRequest.Builder request = LauncherScreenshotRequest.newBuilder();
... | java | public ScreenCaptureReply captureScreen(long timeout, List<String> knownMD5s)
throws OperaRunnerException {
assertLauncherAlive();
String resultMd5;
byte[] resultBytes;
boolean blank = false;
try {
LauncherScreenshotRequest.Builder request = LauncherScreenshotRequest.newBuilder();
... | [
"public",
"ScreenCaptureReply",
"captureScreen",
"(",
"long",
"timeout",
",",
"List",
"<",
"String",
">",
"knownMD5s",
")",
"throws",
"OperaRunnerException",
"{",
"assertLauncherAlive",
"(",
")",
";",
"String",
"resultMd5",
";",
"byte",
"[",
"]",
"resultBytes",
... | Take screenshot using external program. Will not trigger a screen repaint.
@throws OperaRunnerException if runner is shutdown or not running
@inheritDoc | [
"Take",
"screenshot",
"using",
"external",
"program",
".",
"Will",
"not",
"trigger",
"a",
"screen",
"repaint",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java#L354-L389 |
3,086 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java | OperaLauncherRunner.handleStatusMessage | private StatusType handleStatusMessage(GeneratedMessage msg) {
LauncherStatusResponse response = (LauncherStatusResponse) msg;
// LOG RESULT!
logger.finest("[LAUNCHER] Status: " + response.getStatus().toString());
if (response.hasExitcode()) {
logger.finest("[LAUNCHER] Status: exitCode=" + respo... | java | private StatusType handleStatusMessage(GeneratedMessage msg) {
LauncherStatusResponse response = (LauncherStatusResponse) msg;
// LOG RESULT!
logger.finest("[LAUNCHER] Status: " + response.getStatus().toString());
if (response.hasExitcode()) {
logger.finest("[LAUNCHER] Status: exitCode=" + respo... | [
"private",
"StatusType",
"handleStatusMessage",
"(",
"GeneratedMessage",
"msg",
")",
"{",
"LauncherStatusResponse",
"response",
"=",
"(",
"LauncherStatusResponse",
")",
"msg",
";",
"// LOG RESULT!",
"logger",
".",
"finest",
"(",
"\"[LAUNCHER] Status: \"",
"+",
"response... | Handle status message, and updates state. | [
"Handle",
"status",
"message",
"and",
"updates",
"state",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java#L394-L438 |
3,087 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java | OperaLauncherRunner.assertLauncherGood | public static void assertLauncherGood(File launcher) throws IOException {
if (!launcher.exists()) {
throw new IOException("Unknown file: " + launcher.getPath());
}
if (!launcher.isFile()) {
throw new IOException("Not a real file: " + launcher.getPath());
}
if (!FileHandler.canExecute(l... | java | public static void assertLauncherGood(File launcher) throws IOException {
if (!launcher.exists()) {
throw new IOException("Unknown file: " + launcher.getPath());
}
if (!launcher.isFile()) {
throw new IOException("Not a real file: " + launcher.getPath());
}
if (!FileHandler.canExecute(l... | [
"public",
"static",
"void",
"assertLauncherGood",
"(",
"File",
"launcher",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"launcher",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Unknown file: \"",
"+",
"launcher",
".",
"getP... | Asserts whether given launcher exists, is a file and that it's executable.
@param launcher the launcher to assert
@throws IOException if there is a problem with the provided launcher | [
"Asserts",
"whether",
"given",
"launcher",
"exists",
"is",
"a",
"file",
"and",
"that",
"it",
"s",
"executable",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java#L492-L504 |
3,088 | operasoftware/operaprestodriver | src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java | OperaLauncherRunner.launcherNameForOS | private static String launcherNameForOS() {
// TODO(andreastt): It would be nice for OperaLaunchers and OperaDriver to both use Platform
switch (Platform.getCurrent()) {
case LINUX:
case UNIX:
// TODO(andreastt): It would be _really nice_ if OperaLaunchers and OperaDriver could both use Arch... | java | private static String launcherNameForOS() {
// TODO(andreastt): It would be nice for OperaLaunchers and OperaDriver to both use Platform
switch (Platform.getCurrent()) {
case LINUX:
case UNIX:
// TODO(andreastt): It would be _really nice_ if OperaLaunchers and OperaDriver could both use Arch... | [
"private",
"static",
"String",
"launcherNameForOS",
"(",
")",
"{",
"// TODO(andreastt): It would be nice for OperaLaunchers and OperaDriver to both use Platform",
"switch",
"(",
"Platform",
".",
"getCurrent",
"(",
")",
")",
"{",
"case",
"LINUX",
":",
"case",
"UNIX",
":",
... | Get the launcher's binary file name based on what flavour of operating system and what kind of
architecture the user is using.
@return the launcher's binary file name | [
"Get",
"the",
"launcher",
"s",
"binary",
"file",
"name",
"based",
"on",
"what",
"flavour",
"of",
"operating",
"system",
"and",
"what",
"kind",
"of",
"architecture",
"the",
"user",
"is",
"using",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/launcher/OperaLauncherRunner.java#L512-L542 |
3,089 | operasoftware/operaprestodriver | src/com/opera/core/systems/common/lang/OperaBoolean.java | OperaBoolean.isBoolesque | public static boolean isBoolesque(String string) {
checkNotNull(string);
assertBoolesque(string);
return isFalsy(string) || isTruthy(string);
} | java | public static boolean isBoolesque(String string) {
checkNotNull(string);
assertBoolesque(string);
return isFalsy(string) || isTruthy(string);
} | [
"public",
"static",
"boolean",
"isBoolesque",
"(",
"String",
"string",
")",
"{",
"checkNotNull",
"(",
"string",
")",
";",
"assertBoolesque",
"(",
"string",
")",
";",
"return",
"isFalsy",
"(",
"string",
")",
"||",
"isTruthy",
"(",
"string",
")",
";",
"}"
] | Whether string holds a boolean-like value. It should equal "0", "1", "true" or "false". This
method says nothing about whether the object is true or false.
@param string string to check
@return true if value is "boolesque", false otherwise
@throws IllegalArgumentException if parameter is not a boolesque value ("1", ... | [
"Whether",
"string",
"holds",
"a",
"boolean",
"-",
"like",
"value",
".",
"It",
"should",
"equal",
"0",
"1",
"true",
"or",
"false",
".",
"This",
"method",
"says",
"nothing",
"about",
"whether",
"the",
"object",
"is",
"true",
"or",
"false",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/common/lang/OperaBoolean.java#L54-L58 |
3,090 | rythmengine/rythmengine | src/main/java/org/rythmengine/internal/ExtensionManager.java | ExtensionManager.isJavaExtension | public boolean isJavaExtension(String s) {
for (IJavaExtension ext : _extensions) {
if (S.isEqual(s, ext.methodName())) {
return true;
}
}
return false;
} | java | public boolean isJavaExtension(String s) {
for (IJavaExtension ext : _extensions) {
if (S.isEqual(s, ext.methodName())) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"isJavaExtension",
"(",
"String",
"s",
")",
"{",
"for",
"(",
"IJavaExtension",
"ext",
":",
"_extensions",
")",
"{",
"if",
"(",
"S",
".",
"isEqual",
"(",
"s",
",",
"ext",
".",
"methodName",
"(",
")",
")",
")",
"{",
"return",
"true... | Is a specified method name a java extension?
@param s
@return true if the name is a java extension | [
"Is",
"a",
"specified",
"method",
"name",
"a",
"java",
"extension?"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/internal/ExtensionManager.java#L46-L53 |
3,091 | rythmengine/rythmengine | src/main/java/org/rythmengine/utils/NamedParams.java | NamedParams.from | public static Map<String, Object> from(Pair... pairs) {
Map<String, Object> map = new HashMap<String, Object>(pairs.length);
for (Pair p : pairs) {
map.put(p.key, p.value);
}
return map;
} | java | public static Map<String, Object> from(Pair... pairs) {
Map<String, Object> map = new HashMap<String, Object>(pairs.length);
for (Pair p : pairs) {
map.put(p.key, p.value);
}
return map;
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"from",
"(",
"Pair",
"...",
"pairs",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
"pairs",
".",
"length",
")"... | construct me from the given pairs
@param pairs
@return the map | [
"construct",
"me",
"from",
"the",
"given",
"pairs"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/NamedParams.java#L59-L65 |
3,092 | operasoftware/operaprestodriver | src/com/opera/core/systems/scope/stp/services/desktop/ScopeDesktopUtils.java | ScopeDesktopUtils.getSubstitutedString | public String getSubstitutedString(String[] args, boolean stripAmpersand) {
String stringId = args[0];
String rawString = getString(stringId, stripAmpersand);
logger.finer(String.format("String \"%s\" fetched as \"%s\"", stringId, rawString));
StringBuffer buf = new StringBuffer();
int curArg = 0;... | java | public String getSubstitutedString(String[] args, boolean stripAmpersand) {
String stringId = args[0];
String rawString = getString(stringId, stripAmpersand);
logger.finer(String.format("String \"%s\" fetched as \"%s\"", stringId, rawString));
StringBuffer buf = new StringBuffer();
int curArg = 0;... | [
"public",
"String",
"getSubstitutedString",
"(",
"String",
"[",
"]",
"args",
",",
"boolean",
"stripAmpersand",
")",
"{",
"String",
"stringId",
"=",
"args",
"[",
"0",
"]",
";",
"String",
"rawString",
"=",
"getString",
"(",
"stringId",
",",
"stripAmpersand",
"... | Fetches a translated string fetched basing on a string id and substitutes the printf formatters
in it. Each substitution argument needs to be a string. The printf formatter types are
ignored, and the given string argument is substituted.
The method distinguishes between ordered substitution (i.e. %1, %2) and a standa... | [
"Fetches",
"a",
"translated",
"string",
"fetched",
"basing",
"on",
"a",
"string",
"id",
"and",
"substitutes",
"the",
"printf",
"formatters",
"in",
"it",
".",
"Each",
"substitution",
"argument",
"needs",
"to",
"be",
"a",
"string",
".",
"The",
"printf",
"forma... | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/stp/services/desktop/ScopeDesktopUtils.java#L100-L174 |
3,093 | operasoftware/operaprestodriver | src/com/opera/core/systems/internal/StackHashMap.java | StackHashMap.putIfAbsent | public V putIfAbsent(K k, V v) {
synchronized (map) {
if (!containsKey(k)) {
list.addFirst(k);
return map.put(k, v);
} else {
list.remove(k);
}
list.addFirst(k);
return null;
}
} | java | public V putIfAbsent(K k, V v) {
synchronized (map) {
if (!containsKey(k)) {
list.addFirst(k);
return map.put(k, v);
} else {
list.remove(k);
}
list.addFirst(k);
return null;
}
} | [
"public",
"V",
"putIfAbsent",
"(",
"K",
"k",
",",
"V",
"v",
")",
"{",
"synchronized",
"(",
"map",
")",
"{",
"if",
"(",
"!",
"containsKey",
"(",
"k",
")",
")",
"{",
"list",
".",
"addFirst",
"(",
"k",
")",
";",
"return",
"map",
".",
"put",
"(",
... | Puts a key to top of the map if absent if the key is present in stack it is removed
@return the value if it is not contained, null otherwise | [
"Puts",
"a",
"key",
"to",
"top",
"of",
"the",
"map",
"if",
"absent",
"if",
"the",
"key",
"is",
"present",
"in",
"stack",
"it",
"is",
"removed"
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/internal/StackHashMap.java#L168-L179 |
3,094 | rythmengine/rythmengine | src/main/java/org/rythmengine/exception/CompileException.java | CompileException.compilerException | public static CompilerException compilerException(String className, int line, String message) {
CompilerException e = new CompilerException();
e.javaLineNumber = line;
e.message = ExpressionParser.reversePositionPlaceHolder(message);
e.className = className;
return e;
} | java | public static CompilerException compilerException(String className, int line, String message) {
CompilerException e = new CompilerException();
e.javaLineNumber = line;
e.message = ExpressionParser.reversePositionPlaceHolder(message);
e.className = className;
return e;
} | [
"public",
"static",
"CompilerException",
"compilerException",
"(",
"String",
"className",
",",
"int",
"line",
",",
"String",
"message",
")",
"{",
"CompilerException",
"e",
"=",
"new",
"CompilerException",
"(",
")",
";",
"e",
".",
"javaLineNumber",
"=",
"line",
... | create a compiler exception for the given className, line number and message
@param className
@param line
@param message
@return the CompilerException | [
"create",
"a",
"compiler",
"exception",
"for",
"the",
"given",
"className",
"line",
"number",
"and",
"message"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/exception/CompileException.java#L43-L49 |
3,095 | rythmengine/rythmengine | src/main/java/org/rythmengine/Sandbox.java | Sandbox.turnOffSandbox | public static void turnOffSandbox(String code) {
if (!sandboxLive) return;
rsm().forbiddenIfCodeNotMatch(code);
sandboxLive = false;
System.setSecurityManager(null);
} | java | public static void turnOffSandbox(String code) {
if (!sandboxLive) return;
rsm().forbiddenIfCodeNotMatch(code);
sandboxLive = false;
System.setSecurityManager(null);
} | [
"public",
"static",
"void",
"turnOffSandbox",
"(",
"String",
"code",
")",
"{",
"if",
"(",
"!",
"sandboxLive",
")",
"return",
";",
"rsm",
"(",
")",
".",
"forbiddenIfCodeNotMatch",
"(",
"code",
")",
";",
"sandboxLive",
"=",
"false",
";",
"System",
".",
"se... | Turn off sandbox mode. Used by Rythm unit testing program
@param code | [
"Turn",
"off",
"sandbox",
"mode",
".",
"Used",
"by",
"Rythm",
"unit",
"testing",
"program"
] | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/Sandbox.java#L40-L45 |
3,096 | operasoftware/operaprestodriver | src/com/opera/core/systems/arguments/OperaArgument.java | OperaArgument.sanitize | private static String sanitize(String key) {
for (OperaArgumentSign sign : OperaArgumentSign.values()) {
if (hasSwitch(key, sign.sign)) {
return key.substring(sign.sign.length());
}
}
return key;
} | java | private static String sanitize(String key) {
for (OperaArgumentSign sign : OperaArgumentSign.values()) {
if (hasSwitch(key, sign.sign)) {
return key.substring(sign.sign.length());
}
}
return key;
} | [
"private",
"static",
"String",
"sanitize",
"(",
"String",
"key",
")",
"{",
"for",
"(",
"OperaArgumentSign",
"sign",
":",
"OperaArgumentSign",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"hasSwitch",
"(",
"key",
",",
"sign",
".",
"sign",
")",
")",
"{"... | Sanitizes an argument that contains a sign. By default we sanitize all added arguments,
meaning "-foo" will be sanitized to "foo".
@param key the argument key to sanitize
@return a sanitized argument key | [
"Sanitizes",
"an",
"argument",
"that",
"contains",
"a",
"sign",
".",
"By",
"default",
"we",
"sanitize",
"all",
"added",
"arguments",
"meaning",
"-",
"foo",
"will",
"be",
"sanitized",
"to",
"foo",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/arguments/OperaArgument.java#L119-L127 |
3,097 | operasoftware/operaprestodriver | src/com/opera/core/systems/arguments/OperaArgument.java | OperaArgument.hasSwitch | private static Boolean hasSwitch(String key, String sign) {
return (key.length() > sign.length()) && key.substring(0, sign.length()).equals(sign);
} | java | private static Boolean hasSwitch(String key, String sign) {
return (key.length() > sign.length()) && key.substring(0, sign.length()).equals(sign);
} | [
"private",
"static",
"Boolean",
"hasSwitch",
"(",
"String",
"key",
",",
"String",
"sign",
")",
"{",
"return",
"(",
"key",
".",
"length",
"(",
")",
">",
"sign",
".",
"length",
"(",
")",
")",
"&&",
"key",
".",
"substring",
"(",
"0",
",",
"sign",
".",... | Determines whether given argument key contains given argument sign.
@param key the argument key to check
@param sign the sign to check for
@return true if key contains sign as first characters, false otherwise
@see OperaArgumentSign | [
"Determines",
"whether",
"given",
"argument",
"key",
"contains",
"given",
"argument",
"sign",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/arguments/OperaArgument.java#L137-L139 |
3,098 | operasoftware/operaprestodriver | src/com/opera/core/systems/scope/stp/services/ScopeExec.java | ScopeExec.executeScreenWatcher | private ScreenWatcherResult executeScreenWatcher(ScreenWatcher.Builder builder, long timeout) {
if (timeout <= 0) {
timeout = 1;
}
// TODO(andreastt): Unsafe long to int cast
builder.setTimeOut((int) timeout);
builder.setWindowID(services.getWindowManager().getActiveWindowId());
Respons... | java | private ScreenWatcherResult executeScreenWatcher(ScreenWatcher.Builder builder, long timeout) {
if (timeout <= 0) {
timeout = 1;
}
// TODO(andreastt): Unsafe long to int cast
builder.setTimeOut((int) timeout);
builder.setWindowID(services.getWindowManager().getActiveWindowId());
Respons... | [
"private",
"ScreenWatcherResult",
"executeScreenWatcher",
"(",
"ScreenWatcher",
".",
"Builder",
"builder",
",",
"long",
"timeout",
")",
"{",
"if",
"(",
"timeout",
"<=",
"0",
")",
"{",
"timeout",
"=",
"1",
";",
"}",
"// TODO(andreastt): Unsafe long to int cast",
"b... | Executes a screenwatcher with the given timeout and returns the result. | [
"Executes",
"a",
"screenwatcher",
"with",
"the",
"given",
"timeout",
"and",
"returns",
"the",
"result",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/stp/services/ScopeExec.java#L242-L260 |
3,099 | operasoftware/operaprestodriver | src/com/opera/core/systems/scope/AbstractEcmascriptService.java | AbstractEcmascriptService.buildEvalString | protected String buildEvalString(List<WebElement> elements, String script, Object... params) {
String toSend;
if (params != null && params.length > 0) {
StringBuilder builder = new StringBuilder();
for (Object object : params) {
if (builder.toString().length() > 0) {
builder.appe... | java | protected String buildEvalString(List<WebElement> elements, String script, Object... params) {
String toSend;
if (params != null && params.length > 0) {
StringBuilder builder = new StringBuilder();
for (Object object : params) {
if (builder.toString().length() > 0) {
builder.appe... | [
"protected",
"String",
"buildEvalString",
"(",
"List",
"<",
"WebElement",
">",
"elements",
",",
"String",
"script",
",",
"Object",
"...",
"params",
")",
"{",
"String",
"toSend",
";",
"if",
"(",
"params",
"!=",
"null",
"&&",
"params",
".",
"length",
">",
... | Build the script to send with arguments.
@param elements the web elements to send with the script as argument
@param script the script to execute, can have references to argument(s)
@param params params to send with the script, will be parsed in to arguments
@return the script to be sent to Eval command for execut... | [
"Build",
"the",
"script",
"to",
"send",
"with",
"arguments",
"."
] | 1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01 | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/AbstractEcmascriptService.java#L105-L143 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.