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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.getDisplayedTimezone | public static String getDisplayedTimezone(long startMillis, String localTimezone,
String eventTimezone) {
String tzDisplay = null;
if (!TextUtils.equals(localTimezone, eventTimezone)) {
// Figure out if this is in DST
TimeZone tz = Ti... | java | public static String getDisplayedTimezone(long startMillis, String localTimezone,
String eventTimezone) {
String tzDisplay = null;
if (!TextUtils.equals(localTimezone, eventTimezone)) {
// Figure out if this is in DST
TimeZone tz = Ti... | [
"public",
"static",
"String",
"getDisplayedTimezone",
"(",
"long",
"startMillis",
",",
"String",
"localTimezone",
",",
"String",
"eventTimezone",
")",
"{",
"String",
"tzDisplay",
"=",
"null",
";",
"if",
"(",
"!",
"TextUtils",
".",
"equals",
"(",
"localTimezone",... | Returns the timezone to display in the event info, if the local timezone is different
from the event timezone. Otherwise returns null. | [
"Returns",
"the",
"timezone",
"to",
"display",
"in",
"the",
"event",
"info",
"if",
"the",
"local",
"timezone",
"is",
"different",
"from",
"the",
"event",
"timezone",
".",
"Otherwise",
"returns",
"null",
"."
] | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L715-L730 | train |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.singleDayEvent | private static boolean singleDayEvent(long startMillis, long endMillis, long localGmtOffset) {
if (startMillis == endMillis) {
return true;
}
// An event ending at midnight should still be a single-day event, so check
// time end-1.
int startDay = Time.getJulianDay(s... | java | private static boolean singleDayEvent(long startMillis, long endMillis, long localGmtOffset) {
if (startMillis == endMillis) {
return true;
}
// An event ending at midnight should still be a single-day event, so check
// time end-1.
int startDay = Time.getJulianDay(s... | [
"private",
"static",
"boolean",
"singleDayEvent",
"(",
"long",
"startMillis",
",",
"long",
"endMillis",
",",
"long",
"localGmtOffset",
")",
"{",
"if",
"(",
"startMillis",
"==",
"endMillis",
")",
"{",
"return",
"true",
";",
"}",
"// An event ending at midnight shou... | Returns whether the specified time interval is in a single day. | [
"Returns",
"whether",
"the",
"specified",
"time",
"interval",
"is",
"in",
"a",
"single",
"day",
"."
] | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L735-L745 | train |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.isTodayOrTomorrow | private static int isTodayOrTomorrow(Resources r, long dayMillis,
long currentMillis, long localGmtOffset) {
int startDay = Time.getJulianDay(dayMillis, localGmtOffset);
int currentDay = Time.getJulianDay(currentMillis, localGmtOffset);
int days = startD... | java | private static int isTodayOrTomorrow(Resources r, long dayMillis,
long currentMillis, long localGmtOffset) {
int startDay = Time.getJulianDay(dayMillis, localGmtOffset);
int currentDay = Time.getJulianDay(currentMillis, localGmtOffset);
int days = startD... | [
"private",
"static",
"int",
"isTodayOrTomorrow",
"(",
"Resources",
"r",
",",
"long",
"dayMillis",
",",
"long",
"currentMillis",
",",
"long",
"localGmtOffset",
")",
"{",
"int",
"startDay",
"=",
"Time",
".",
"getJulianDay",
"(",
"dayMillis",
",",
"localGmtOffset",... | Returns TODAY or TOMORROW if applicable. Otherwise returns NONE. | [
"Returns",
"TODAY",
"or",
"TOMORROW",
"if",
"applicable",
".",
"Otherwise",
"returns",
"NONE",
"."
] | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L755-L768 | train |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.createEmailAttendeesIntent | public static Intent createEmailAttendeesIntent(Resources resources, String eventTitle,
String body, List<String> toEmails, List<String> ccEmails, String ownerAccount) {
List<String> toList = toEmails;
List<String> ccList = ccEmails;
if (toEmai... | java | public static Intent createEmailAttendeesIntent(Resources resources, String eventTitle,
String body, List<String> toEmails, List<String> ccEmails, String ownerAccount) {
List<String> toList = toEmails;
List<String> ccList = ccEmails;
if (toEmai... | [
"public",
"static",
"Intent",
"createEmailAttendeesIntent",
"(",
"Resources",
"resources",
",",
"String",
"eventTitle",
",",
"String",
"body",
",",
"List",
"<",
"String",
">",
"toEmails",
",",
"List",
"<",
"String",
">",
"ccEmails",
",",
"String",
"ownerAccount"... | Create an intent for emailing attendees of an event.
@param resources The resources for translating strings.
@param eventTitle The title of the event to use as the email subject.
@param body The default text for the email body.
@param toEmails The list of emails for the 'to' line.
@param ccEmails ... | [
"Create",
"an",
"intent",
"for",
"emailing",
"attendees",
"of",
"an",
"event",
"."
] | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L780-L860 | train |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.getVersionCode | public static String getVersionCode(Context context) {
if (sVersion == null) {
try {
sVersion = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
... | java | public static String getVersionCode(Context context) {
if (sVersion == null) {
try {
sVersion = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
... | [
"public",
"static",
"String",
"getVersionCode",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"sVersion",
"==",
"null",
")",
"{",
"try",
"{",
"sVersion",
"=",
"context",
".",
"getPackageManager",
"(",
")",
".",
"getPackageInfo",
"(",
"context",
".",
"get... | Return the app version code. | [
"Return",
"the",
"app",
"version",
"code",
"."
] | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L921-L932 | train |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.findNanpMatchEnd | private static int findNanpMatchEnd(CharSequence text, int startPos) {
/*
* A few interesting cases:
* 94043 # too short, ignore
* 123456789012 # too long, ignore
* +1 (650) 555-1212 # 11 digits, spaces... | java | private static int findNanpMatchEnd(CharSequence text, int startPos) {
/*
* A few interesting cases:
* 94043 # too short, ignore
* 123456789012 # too long, ignore
* +1 (650) 555-1212 # 11 digits, spaces... | [
"private",
"static",
"int",
"findNanpMatchEnd",
"(",
"CharSequence",
"text",
",",
"int",
"startPos",
")",
"{",
"/*\n * A few interesting cases:\n * 94043 # too short, ignore\n * 123456789012 # too long, ignore\n ... | Checks to see if there is a valid phone number in the input, starting at the specified
offset. If so, the index of the last character + 1 is returned. The input is assumed
to begin with a non-whitespace character.
@return Exclusive end position, or -1 if not a match. | [
"Checks",
"to",
"see",
"if",
"there",
"is",
"a",
"valid",
"phone",
"number",
"in",
"the",
"input",
"starting",
"at",
"the",
"specified",
"offset",
".",
"If",
"so",
"the",
"index",
"of",
"the",
"last",
"character",
"+",
"1",
"is",
"returned",
".",
"The"... | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L1184-L1254 | train |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.spanWillOverlap | private static boolean spanWillOverlap(Spannable spanText, URLSpan[] spanList, int start,
int end) {
if (start == end) {
// empty span, ignore
return false;
}
for (URLSpan span : spanList) {
int existingStart = spanTe... | java | private static boolean spanWillOverlap(Spannable spanText, URLSpan[] spanList, int start,
int end) {
if (start == end) {
// empty span, ignore
return false;
}
for (URLSpan span : spanList) {
int existingStart = spanTe... | [
"private",
"static",
"boolean",
"spanWillOverlap",
"(",
"Spannable",
"spanText",
",",
"URLSpan",
"[",
"]",
"spanList",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
"==",
"end",
")",
"{",
"// empty span, ignore",
"return",
"false",
... | Determines whether a new span at [start,end) will overlap with any existing span. | [
"Determines",
"whether",
"a",
"new",
"span",
"at",
"[",
"start",
"end",
")",
"will",
"overlap",
"with",
"any",
"existing",
"span",
"."
] | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L1259-L1279 | train |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/EventRecurrenceFormatter.java | EventRecurrenceFormatter.dayToUtilDay | private static int dayToUtilDay(int day) {
switch (day) {
case EventRecurrence.SU: return Calendar.SUNDAY;
case EventRecurrence.MO: return Calendar.MONDAY;
case EventRecurrence.TU: return Calendar.TUESDAY;
case EventRecurrence.WE: return Calendar.WEDNESDAY;
... | java | private static int dayToUtilDay(int day) {
switch (day) {
case EventRecurrence.SU: return Calendar.SUNDAY;
case EventRecurrence.MO: return Calendar.MONDAY;
case EventRecurrence.TU: return Calendar.TUESDAY;
case EventRecurrence.WE: return Calendar.WEDNESDAY;
... | [
"private",
"static",
"int",
"dayToUtilDay",
"(",
"int",
"day",
")",
"{",
"switch",
"(",
"day",
")",
"{",
"case",
"EventRecurrence",
".",
"SU",
":",
"return",
"Calendar",
".",
"SUNDAY",
";",
"case",
"EventRecurrence",
".",
"MO",
":",
"return",
"Calendar",
... | Converts EventRecurrence's day of week to DateUtil's day of week.
@param day of week as an EventRecurrence value
@return day of week as a DateUtil value. | [
"Converts",
"EventRecurrence",
"s",
"day",
"of",
"week",
"to",
"DateUtil",
"s",
"day",
"of",
"week",
"."
] | 4f0ae74482e4d46d57a8fb13b4b7980a8613f4af | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/EventRecurrenceFormatter.java#L160-L171 | train |
EasyPost/easypost-java | src/main/java/com/easypost/model/Report.java | Report.reportURL | protected static String reportURL(String type) throws EasyPostException {
try {
String urlType = URLEncoder.encode(type, "UTF-8").toLowerCase();
return String.format("%s/reports/%s/", EasyPost.API_BASE, urlType);
} catch (java.io.UnsupportedEncodingException e) {
throw new EasyPostException("U... | java | protected static String reportURL(String type) throws EasyPostException {
try {
String urlType = URLEncoder.encode(type, "UTF-8").toLowerCase();
return String.format("%s/reports/%s/", EasyPost.API_BASE, urlType);
} catch (java.io.UnsupportedEncodingException e) {
throw new EasyPostException("U... | [
"protected",
"static",
"String",
"reportURL",
"(",
"String",
"type",
")",
"throws",
"EasyPostException",
"{",
"try",
"{",
"String",
"urlType",
"=",
"URLEncoder",
".",
"encode",
"(",
"type",
",",
"\"UTF-8\"",
")",
".",
"toLowerCase",
"(",
")",
";",
"return",
... | generate report URL pattern | [
"generate",
"report",
"URL",
"pattern"
] | 323b4cece5fa0f607e80a7e66cb1ce20c9d5b844 | https://github.com/EasyPost/easypost-java/blob/323b4cece5fa0f607e80a7e66cb1ce20c9d5b844/src/main/java/com/easypost/model/Report.java#L121-L128 | train |
EasyPost/easypost-java | src/main/java/com/easypost/model/Item.java | Item.retrieveReference | public Item retrieveReference(String name, String value) throws EasyPostException {
return retrieveReference(name, value, null);
} | java | public Item retrieveReference(String name, String value) throws EasyPostException {
return retrieveReference(name, value, null);
} | [
"public",
"Item",
"retrieveReference",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"EasyPostException",
"{",
"return",
"retrieveReference",
"(",
"name",
",",
"value",
",",
"null",
")",
";",
"}"
] | retrieve by custom reference | [
"retrieve",
"by",
"custom",
"reference"
] | 323b4cece5fa0f607e80a7e66cb1ce20c9d5b844 | https://github.com/EasyPost/easypost-java/blob/323b4cece5fa0f607e80a7e66cb1ce20c9d5b844/src/main/java/com/easypost/model/Item.java#L147-L149 | train |
dbmdz/iiif-presentation-api | iiif-presentation-frontend-impl-springmvc/src/main/java/de/digitalcollections/iiif/presentation/frontend/impl/springmvc/controller/v2/IIIFPresentationApiController.java | IIIFPresentationApiController.getOriginalUri | private URI getOriginalUri(HttpServletRequest request) {
String requestUrl = request.getRequestURL().toString();
String incomingScheme = URI.create(requestUrl).getScheme();
String originalScheme = request.getHeader("X-Forwarded-Proto");
if (originalScheme != null && !incomingScheme.equals(originalScheme... | java | private URI getOriginalUri(HttpServletRequest request) {
String requestUrl = request.getRequestURL().toString();
String incomingScheme = URI.create(requestUrl).getScheme();
String originalScheme = request.getHeader("X-Forwarded-Proto");
if (originalScheme != null && !incomingScheme.equals(originalScheme... | [
"private",
"URI",
"getOriginalUri",
"(",
"HttpServletRequest",
"request",
")",
"{",
"String",
"requestUrl",
"=",
"request",
".",
"getRequestURL",
"(",
")",
".",
"toString",
"(",
")",
";",
"String",
"incomingScheme",
"=",
"URI",
".",
"create",
"(",
"requestUrl"... | Return the URL as it was originally received from a possible frontend proxy.
@param request Incoming request
@return URL as it was received at the frontend proxy | [
"Return",
"the",
"URL",
"as",
"it",
"was",
"originally",
"received",
"from",
"a",
"possible",
"frontend",
"proxy",
"."
] | 8b551d3717eed2620bc9e50b4c23f945b73b9cea | https://github.com/dbmdz/iiif-presentation-api/blob/8b551d3717eed2620bc9e50b4c23f945b73b9cea/iiif-presentation-frontend-impl-springmvc/src/main/java/de/digitalcollections/iiif/presentation/frontend/impl/springmvc/controller/v2/IIIFPresentationApiController.java#L163-L172 | train |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/authentication/strong/oath/totp/TOTP.java | TOTP.hmacSha | private static byte[] hmacSha(String crypto, byte[] keyBytes, byte[] text) {
try {
Mac hmac;
hmac = Mac.getInstance(crypto);
SecretKeySpec macKey = new SecretKeySpec(keyBytes, "RAW");
hmac.init(macKey);
return hmac.doFinal(text);
} catch (Gener... | java | private static byte[] hmacSha(String crypto, byte[] keyBytes, byte[] text) {
try {
Mac hmac;
hmac = Mac.getInstance(crypto);
SecretKeySpec macKey = new SecretKeySpec(keyBytes, "RAW");
hmac.init(macKey);
return hmac.doFinal(text);
} catch (Gener... | [
"private",
"static",
"byte",
"[",
"]",
"hmacSha",
"(",
"String",
"crypto",
",",
"byte",
"[",
"]",
"keyBytes",
",",
"byte",
"[",
"]",
"text",
")",
"{",
"try",
"{",
"Mac",
"hmac",
";",
"hmac",
"=",
"Mac",
".",
"getInstance",
"(",
"crypto",
")",
";",
... | This method uses the JCE to provide the crypto algorithm. HMAC computes a
Hashed Message Authentication Code with the crypto hash algorithm as a
parameter.
@param crypto
: the crypto algorithm (HmacSHA1, HmacSHA256, HmacSHA512)
@param keyBytes
: the bytes to use for the HMAC key
@param text
: the message or text to be... | [
"This",
"method",
"uses",
"the",
"JCE",
"to",
"provide",
"the",
"crypto",
"algorithm",
".",
"HMAC",
"computes",
"a",
"Hashed",
"Message",
"Authentication",
"Code",
"with",
"the",
"crypto",
"hash",
"algorithm",
"as",
"a",
"parameter",
"."
] | 9af2d4896e02d30622acec638539bfc41f45e480 | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/authentication/strong/oath/totp/TOTP.java#L35-L45 | train |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/authentication/strong/oath/totp/TOTP.java | TOTP.generateTOTP | public static int generateTOTP(byte[] key, long time, int digits, String crypto) {
byte[] msg = ByteBuffer.allocate(8).putLong(time).array();
byte[] hash = hmacSha(crypto, key, msg);
// put selected bytes into result int
int offset = hash[hash.length - 1] & 0xf;
int binary = (... | java | public static int generateTOTP(byte[] key, long time, int digits, String crypto) {
byte[] msg = ByteBuffer.allocate(8).putLong(time).array();
byte[] hash = hmacSha(crypto, key, msg);
// put selected bytes into result int
int offset = hash[hash.length - 1] & 0xf;
int binary = (... | [
"public",
"static",
"int",
"generateTOTP",
"(",
"byte",
"[",
"]",
"key",
",",
"long",
"time",
",",
"int",
"digits",
",",
"String",
"crypto",
")",
"{",
"byte",
"[",
"]",
"msg",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"8",
")",
".",
"putLong",
"(",
... | This method generates a TOTP value for the given set of parameters.
@param key
: the shared secret
@param time
: a value that reflects a time
@param digits
: number of digits to return
@param crypto
: the crypto function to use
@return digits | [
"This",
"method",
"generates",
"a",
"TOTP",
"value",
"for",
"the",
"given",
"set",
"of",
"parameters",
"."
] | 9af2d4896e02d30622acec638539bfc41f45e480 | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/authentication/strong/oath/totp/TOTP.java#L62-L75 | train |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/serviceregistry/JsonServiceRegistryDao.java | JsonServiceRegistryDao.loadServices | @SuppressWarnings("unchecked")
public final List<RegisteredService> loadServices() {
logger.info("Loading Registered Services from: [ {} ]...", this.servicesConfigFile);
final List<RegisteredService> resolvedServices = new ArrayList<RegisteredService>();
try {
... | java | @SuppressWarnings("unchecked")
public final List<RegisteredService> loadServices() {
logger.info("Loading Registered Services from: [ {} ]...", this.servicesConfigFile);
final List<RegisteredService> resolvedServices = new ArrayList<RegisteredService>();
try {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"List",
"<",
"RegisteredService",
">",
"loadServices",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Loading Registered Services from: [ {} ]...\"",
",",
"this",
".",
"servicesConfigFile",
")",
"... | This method is used as a Spring bean loadServices-method
as well as the reloading method when the change in the services definition resource is detected at runtime | [
"This",
"method",
"is",
"used",
"as",
"a",
"Spring",
"bean",
"loadServices",
"-",
"method",
"as",
"well",
"as",
"the",
"reloading",
"method",
"when",
"the",
"change",
"in",
"the",
"services",
"definition",
"resource",
"is",
"detected",
"at",
"runtime"
] | 9af2d4896e02d30622acec638539bfc41f45e480 | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/serviceregistry/JsonServiceRegistryDao.java#L112-L141 | train |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/persondir/JsonBackedComplexStubPersonAttributeDao.java | JsonBackedComplexStubPersonAttributeDao.init | public void init() throws Exception {
try {
unmarshalAndSetBackingMap();
}
//If we get to this point, the JSON file is well-formed, but its structure does not map into PersonDir backingMap generic type - fail fast.
catch (final ClassCastException ex) {
throw new B... | java | public void init() throws Exception {
try {
unmarshalAndSetBackingMap();
}
//If we get to this point, the JSON file is well-formed, but its structure does not map into PersonDir backingMap generic type - fail fast.
catch (final ClassCastException ex) {
throw new B... | [
"public",
"void",
"init",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"unmarshalAndSetBackingMap",
"(",
")",
";",
"}",
"//If we get to this point, the JSON file is well-formed, but its structure does not map into PersonDir backingMap generic type - fail fast.",
"catch",
"(",
... | Init method un-marshals JSON representation of the person attributes. | [
"Init",
"method",
"un",
"-",
"marshals",
"JSON",
"representation",
"of",
"the",
"person",
"attributes",
"."
] | 9af2d4896e02d30622acec638539bfc41f45e480 | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/persondir/JsonBackedComplexStubPersonAttributeDao.java#L50-L59 | train |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/persondir/JsonBackedComplexStubPersonAttributeDao.java | JsonBackedComplexStubPersonAttributeDao.onApplicationEvent | @Override
public void onApplicationEvent(final ResourceChangeDetectingEventNotifier.ResourceChangedEvent resourceChangedEvent) {
try {
if (!resourceChangedEvent.getResourceUri().equals(this.personAttributesConfigFile.getURI())) {
//Not our resource. Just get out of here.
... | java | @Override
public void onApplicationEvent(final ResourceChangeDetectingEventNotifier.ResourceChangedEvent resourceChangedEvent) {
try {
if (!resourceChangedEvent.getResourceUri().equals(this.personAttributesConfigFile.getURI())) {
//Not our resource. Just get out of here.
... | [
"@",
"Override",
"public",
"void",
"onApplicationEvent",
"(",
"final",
"ResourceChangeDetectingEventNotifier",
".",
"ResourceChangedEvent",
"resourceChangedEvent",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"resourceChangedEvent",
".",
"getResourceUri",
"(",
")",
".",
"equ... | Reload person attributes when JSON config is changed. In case of un-marshaling errors,
or any other errors, do not disturb running CAS server by propagating the exceptions,
but instead log the error and leave the previously cached person attributes state alone.
@param resourceChangedEvent event representing the resour... | [
"Reload",
"person",
"attributes",
"when",
"JSON",
"config",
"is",
"changed",
".",
"In",
"case",
"of",
"un",
"-",
"marshaling",
"errors",
"or",
"any",
"other",
"errors",
"do",
"not",
"disturb",
"running",
"CAS",
"server",
"by",
"propagating",
"the",
"exceptio... | 9af2d4896e02d30622acec638539bfc41f45e480 | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/persondir/JsonBackedComplexStubPersonAttributeDao.java#L69-L97 | train |
Unicon/cas-addons | src/main/java/net/unicon/cas/addons/authentication/handler/ShiroHashServicePasswordEncoder.java | ShiroHashServicePasswordEncoder.init | void init() throws Throwable {
if (this.digestAlgorithmName != null) {
this.hashService.setHashAlgorithmName(this.digestAlgorithmName);
}
if (this.hashIterations > 0) {
this.hashService.setHashIterations(this.hashIterations);
}
} | java | void init() throws Throwable {
if (this.digestAlgorithmName != null) {
this.hashService.setHashAlgorithmName(this.digestAlgorithmName);
}
if (this.hashIterations > 0) {
this.hashService.setHashIterations(this.hashIterations);
}
} | [
"void",
"init",
"(",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"this",
".",
"digestAlgorithmName",
"!=",
"null",
")",
"{",
"this",
".",
"hashService",
".",
"setHashAlgorithmName",
"(",
"this",
".",
"digestAlgorithmName",
")",
";",
"}",
"if",
"(",
"this",... | This method is only intended to be called by the infrastructure code managing instances of this class
once during initialization of this instance | [
"This",
"method",
"is",
"only",
"intended",
"to",
"be",
"called",
"by",
"the",
"infrastructure",
"code",
"managing",
"instances",
"of",
"this",
"class",
"once",
"during",
"initialization",
"of",
"this",
"instance"
] | 9af2d4896e02d30622acec638539bfc41f45e480 | https://github.com/Unicon/cas-addons/blob/9af2d4896e02d30622acec638539bfc41f45e480/src/main/java/net/unicon/cas/addons/authentication/handler/ShiroHashServicePasswordEncoder.java#L68-L75 | train |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java | OutlookMessageParser.parseMsg | public OutlookMessage parseMsg(@Nonnull final InputStream msgFileStream)
throws IOException {
// the .msg file, like a file system, contains directories and documents within this directories
// we now gain access to the root node and recursively go through the complete 'filesystem'.
final OutlookMessage msg = ... | java | public OutlookMessage parseMsg(@Nonnull final InputStream msgFileStream)
throws IOException {
// the .msg file, like a file system, contains directories and documents within this directories
// we now gain access to the root node and recursively go through the complete 'filesystem'.
final OutlookMessage msg = ... | [
"public",
"OutlookMessage",
"parseMsg",
"(",
"@",
"Nonnull",
"final",
"InputStream",
"msgFileStream",
")",
"throws",
"IOException",
"{",
"// the .msg file, like a file system, contains directories and documents within this directories",
"// we now gain access to the root node and recursi... | Parses a .msg file provided by an input stream.
@param msgFileStream The .msg file as a InputStream.
@return A {@link OutlookMessage} object representing the .msg file.
@throws IOException Thrown if the file could not be loaded or parsed. | [
"Parses",
"a",
".",
"msg",
"file",
"provided",
"by",
"an",
"input",
"stream",
"."
] | ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java#L97-L109 | train |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java | OutlookMessageParser.getBytesFromStream | private byte[] getBytesFromStream(final InputStream dstream)
throws IOException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final byte[] buffer = new byte[1024];
int read;
while ((read = dstream.read(buffer)) > 0) {
baos.write(buffer, 0, read);
}
return baos.toByteArray();
} | java | private byte[] getBytesFromStream(final InputStream dstream)
throws IOException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final byte[] buffer = new byte[1024];
int read;
while ((read = dstream.read(buffer)) > 0) {
baos.write(buffer, 0, read);
}
return baos.toByteArray();
} | [
"private",
"byte",
"[",
"]",
"getBytesFromStream",
"(",
"final",
"InputStream",
"dstream",
")",
"throws",
"IOException",
"{",
"final",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"final",
"byte",
"[",
"]",
"buffer",
"=",
... | Reads the bytes from the stream to a byte array.
@param dstream The stream to be read from.
@return An array of bytes.
@throws IOException If the stream cannot be read properly. | [
"Reads",
"the",
"bytes",
"from",
"the",
"stream",
"to",
"a",
"byte",
"array",
"."
] | ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java#L491-L500 | train |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/model/OutlookFileAttachment.java | OutlookFileAttachment.setProperty | public void setProperty(final OutlookMessageProperty msgProp) {
final String name = msgProp.getClazz();
final Object value = msgProp.getData();
if (name != null && value != null) {
switch (name) {
case "3701":
setSize(msgProp.getSize());
setData((byte[]) value);
break;
case "3704":
... | java | public void setProperty(final OutlookMessageProperty msgProp) {
final String name = msgProp.getClazz();
final Object value = msgProp.getData();
if (name != null && value != null) {
switch (name) {
case "3701":
setSize(msgProp.getSize());
setData((byte[]) value);
break;
case "3704":
... | [
"public",
"void",
"setProperty",
"(",
"final",
"OutlookMessageProperty",
"msgProp",
")",
"{",
"final",
"String",
"name",
"=",
"msgProp",
".",
"getClazz",
"(",
")",
";",
"final",
"Object",
"value",
"=",
"msgProp",
".",
"getData",
"(",
")",
";",
"if",
"(",
... | Sets the property specified by the name parameter. Unknown names are ignored. | [
"Sets",
"the",
"property",
"specified",
"by",
"the",
"name",
"parameter",
".",
"Unknown",
"names",
"are",
"ignored",
"."
] | ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/model/OutlookFileAttachment.java#L39-L65 | train |
WASdev/tool.accelerate.core | liberty-starter-common/src/main/java/com/ibm/liberty/starter/service/common/api/v1/ProviderEndpoint.java | ProviderEndpoint.getStringResource | private String getStringResource(String path) {
InputStream in = getClass().getResourceAsStream(path);
StringBuilder index = new StringBuilder();
char[] buffer = new char[1024];
int read = 0;
try(InputStreamReader reader = new InputStreamReader(in)){
while((read = reader.read(buffer... | java | private String getStringResource(String path) {
InputStream in = getClass().getResourceAsStream(path);
StringBuilder index = new StringBuilder();
char[] buffer = new char[1024];
int read = 0;
try(InputStreamReader reader = new InputStreamReader(in)){
while((read = reader.read(buffer... | [
"private",
"String",
"getStringResource",
"(",
"String",
"path",
")",
"{",
"InputStream",
"in",
"=",
"getClass",
"(",
")",
".",
"getResourceAsStream",
"(",
"path",
")",
";",
"StringBuilder",
"index",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"char",
"[",
... | read the description contained in the index.html file | [
"read",
"the",
"description",
"contained",
"in",
"the",
"index",
".",
"html",
"file"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-common/src/main/java/com/ibm/liberty/starter/service/common/api/v1/ProviderEndpoint.java#L46-L61 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/ServiceConnector.java | ServiceConnector.getServiceObjectFromId | public Service getServiceObjectFromId(String id) {
log.fine("Return service object for " + id);
Service service = null;
for (Service s : services.getServices()) {
if (id.equals(s.getId())) {
return s;
}
}
return service;
} | java | public Service getServiceObjectFromId(String id) {
log.fine("Return service object for " + id);
Service service = null;
for (Service s : services.getServices()) {
if (id.equals(s.getId())) {
return s;
}
}
return service;
} | [
"public",
"Service",
"getServiceObjectFromId",
"(",
"String",
"id",
")",
"{",
"log",
".",
"fine",
"(",
"\"Return service object for \"",
"+",
"id",
")",
";",
"Service",
"service",
"=",
"null",
";",
"for",
"(",
"Service",
"s",
":",
"services",
".",
"getServic... | Returns the service object associated with the given id | [
"Returns",
"the",
"service",
"object",
"associated",
"with",
"the",
"given",
"id"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/ServiceConnector.java#L72-L81 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/GitHubConnector.java | GitHubConnector.createGitRepository | public File createGitRepository(String repositoryName) throws IOException {
RepositoryService service = new RepositoryService();
service.getClient().setOAuth2Token(oAuthToken);
Repository repository = new Repository();
repository.setName(repositoryName);
repository = service.crea... | java | public File createGitRepository(String repositoryName) throws IOException {
RepositoryService service = new RepositoryService();
service.getClient().setOAuth2Token(oAuthToken);
Repository repository = new Repository();
repository.setName(repositoryName);
repository = service.crea... | [
"public",
"File",
"createGitRepository",
"(",
"String",
"repositoryName",
")",
"throws",
"IOException",
"{",
"RepositoryService",
"service",
"=",
"new",
"RepositoryService",
"(",
")",
";",
"service",
".",
"getClient",
"(",
")",
".",
"setOAuth2Token",
"(",
"oAuthTo... | Creates a repository on GitHub and in a local temporary directory. This is a one time operation as
once it is created on GitHub and locally it cannot be recreated. | [
"Creates",
"a",
"repository",
"on",
"GitHub",
"and",
"in",
"a",
"local",
"temporary",
"directory",
".",
"This",
"is",
"a",
"one",
"time",
"operation",
"as",
"once",
"it",
"is",
"created",
"on",
"GitHub",
"and",
"locally",
"it",
"cannot",
"be",
"recreated",... | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/GitHubConnector.java#L52-L70 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.hasChildNode | public static boolean hasChildNode(Node parentNode, String nodeName){
return getChildNode(parentNode, nodeName, null) != null ? true : false;
} | java | public static boolean hasChildNode(Node parentNode, String nodeName){
return getChildNode(parentNode, nodeName, null) != null ? true : false;
} | [
"public",
"static",
"boolean",
"hasChildNode",
"(",
"Node",
"parentNode",
",",
"String",
"nodeName",
")",
"{",
"return",
"getChildNode",
"(",
"parentNode",
",",
"nodeName",
",",
"null",
")",
"!=",
"null",
"?",
"true",
":",
"false",
";",
"}"
] | Determine if the parent node contains a child node with matching name
@param parentNode - the parent node
@param nodeName - name of child node to match
@return boolean value to indicate whether the parent node contains matching child node | [
"Determine",
"if",
"the",
"parent",
"node",
"contains",
"a",
"child",
"node",
"with",
"matching",
"name"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L39-L41 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.getChildNode | public static Node getChildNode(Node parentNode, String name, String value){
List<Node> matchingChildren = getChildren(parentNode, name, value);
return (matchingChildren.size() > 0) ? matchingChildren.get(0) : null;
} | java | public static Node getChildNode(Node parentNode, String name, String value){
List<Node> matchingChildren = getChildren(parentNode, name, value);
return (matchingChildren.size() > 0) ? matchingChildren.get(0) : null;
} | [
"public",
"static",
"Node",
"getChildNode",
"(",
"Node",
"parentNode",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"List",
"<",
"Node",
">",
"matchingChildren",
"=",
"getChildren",
"(",
"parentNode",
",",
"name",
",",
"value",
")",
";",
"retur... | Get the matching child node
@param parentNode - the parent node
@param name - name of child node to match
@param value - value of child node to match, specify null to not match value
@return the child node if a match was found, null otherwise | [
"Get",
"the",
"matching",
"child",
"node"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L50-L53 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.getGrandchildNode | public static Node getGrandchildNode(Node parentNode, String childNodeName, String grandChildNodeName, String grandChildNodeValue){
List<Node> matchingChildren = getChildren(parentNode, childNodeName, null);
for(Node child : matchingChildren){
Node matchingGrandCh... | java | public static Node getGrandchildNode(Node parentNode, String childNodeName, String grandChildNodeName, String grandChildNodeValue){
List<Node> matchingChildren = getChildren(parentNode, childNodeName, null);
for(Node child : matchingChildren){
Node matchingGrandCh... | [
"public",
"static",
"Node",
"getGrandchildNode",
"(",
"Node",
"parentNode",
",",
"String",
"childNodeName",
",",
"String",
"grandChildNodeName",
",",
"String",
"grandChildNodeValue",
")",
"{",
"List",
"<",
"Node",
">",
"matchingChildren",
"=",
"getChildren",
"(",
... | Get the matching grand child node
@param parentNode - the parent node
@param childNodeName - name of child node to match
@param grandChildNodeName - name of grand child node to match
@param grandChildNodeValue - value of grand child node to match
@return the grand child node if a match was found, null otherwise | [
"Get",
"the",
"matching",
"grand",
"child",
"node"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L63-L72 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.getChildren | private static List<Node> getChildren(Node parentNode, String name, String value){
List<Node> childNodes = new ArrayList<Node>();
if(parentNode == null || name == null){
return childNodes;
}
if (parentNode.getNodeType() == Node.ELE... | java | private static List<Node> getChildren(Node parentNode, String name, String value){
List<Node> childNodes = new ArrayList<Node>();
if(parentNode == null || name == null){
return childNodes;
}
if (parentNode.getNodeType() == Node.ELE... | [
"private",
"static",
"List",
"<",
"Node",
">",
"getChildren",
"(",
"Node",
"parentNode",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"List",
"<",
"Node",
">",
"childNodes",
"=",
"new",
"ArrayList",
"<",
"Node",
">",
"(",
")",
";",
"if",
... | Get all matching child nodes
@param parentNode - the parent node
@param name - name of child node to match
@param value - value of child node to match, specify null to not match value
@return matching child nodes | [
"Get",
"all",
"matching",
"child",
"nodes"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L81-L98 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.addChildNode | public static Node addChildNode(Document doc, Node parentNode, String childName, String childValue){
if(doc == null || parentNode == null || childName == null){
return null;
}
Node childNode = doc.createElement(childName);
if(childV... | java | public static Node addChildNode(Document doc, Node parentNode, String childName, String childValue){
if(doc == null || parentNode == null || childName == null){
return null;
}
Node childNode = doc.createElement(childName);
if(childV... | [
"public",
"static",
"Node",
"addChildNode",
"(",
"Document",
"doc",
",",
"Node",
"parentNode",
",",
"String",
"childName",
",",
"String",
"childValue",
")",
"{",
"if",
"(",
"doc",
"==",
"null",
"||",
"parentNode",
"==",
"null",
"||",
"childName",
"==",
"nu... | Add a child node
@param parentNode - the parent node
@param childName - name of child node to create
@param childValue - value of child node
@return the child node | [
"Add",
"a",
"child",
"node"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L107-L117 | train |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java | DomUtil.findOrAddChildNode | public static Node findOrAddChildNode(Document doc, Node parentNode, String childName, String childValue){
Node matchingChild = getChildNode(parentNode, childName, childValue);
return matchingChild != null ? matchingChild : addChildNode(doc, parentNode, childName, childValue);
} | java | public static Node findOrAddChildNode(Document doc, Node parentNode, String childName, String childValue){
Node matchingChild = getChildNode(parentNode, childName, childValue);
return matchingChild != null ? matchingChild : addChildNode(doc, parentNode, childName, childValue);
} | [
"public",
"static",
"Node",
"findOrAddChildNode",
"(",
"Document",
"doc",
",",
"Node",
"parentNode",
",",
"String",
"childName",
",",
"String",
"childValue",
")",
"{",
"Node",
"matchingChild",
"=",
"getChildNode",
"(",
"parentNode",
",",
"childName",
",",
"child... | Get the matching child node. Create a node if it doens't already exist
@param parentNode - the parent node
@param childName - name of child node to match
@param childValue - value of child node to match, specify null to not match value
@return the child node | [
"Get",
"the",
"matching",
"child",
"node",
".",
"Create",
"a",
"node",
"if",
"it",
"doens",
"t",
"already",
"exist"
] | 6511da654a69a25a76573eb76eefff349d9c4d80 | https://github.com/WASdev/tool.accelerate.core/blob/6511da654a69a25a76573eb76eefff349d9c4d80/liberty-starter-application/src/main/java/com/ibm/liberty/starter/build/maven/DomUtil.java#L126-L129 | train |
conductor-framework/conductor | src/main/java/io/ddavison/conductor/Locomotive.java | Locomotive.waitForElement | public WebElement waitForElement(By by) {
int attempts = 0;
int size = driver.findElements(by).size();
while (size == 0) {
size = driver.findElements(by).size();
if (attempts == MAX_ATTEMPTS) fail(String.format("Could not find %s after %d seconds",
... | java | public WebElement waitForElement(By by) {
int attempts = 0;
int size = driver.findElements(by).size();
while (size == 0) {
size = driver.findElements(by).size();
if (attempts == MAX_ATTEMPTS) fail(String.format("Could not find %s after %d seconds",
... | [
"public",
"WebElement",
"waitForElement",
"(",
"By",
"by",
")",
"{",
"int",
"attempts",
"=",
"0",
";",
"int",
"size",
"=",
"driver",
".",
"findElements",
"(",
"by",
")",
".",
"size",
"(",
")",
";",
"while",
"(",
"size",
"==",
"0",
")",
"{",
"size",... | Method that acts as an arbiter of implicit timeouts of sorts.. sort of like a Wait For Ajax method. | [
"Method",
"that",
"acts",
"as",
"an",
"arbiter",
"of",
"implicit",
"timeouts",
"of",
"sorts",
"..",
"sort",
"of",
"like",
"a",
"Wait",
"For",
"Ajax",
"method",
"."
] | fc9843cfd633c358ce4f0708672c0081e6ef3e22 | https://github.com/conductor-framework/conductor/blob/fc9843cfd633c358ce4f0708672c0081e6ef3e22/src/main/java/io/ddavison/conductor/Locomotive.java#L269-L290 | train |
conductor-framework/conductor | src/main/java/io/ddavison/conductor/LocomotiveConfig.java | LocomotiveConfig.url | @Override
public String url() {
String url = "";
if (!StringUtils.isEmpty(baseUrl())) {
url = baseUrl() + path();
} else {
if (!StringUtils.isEmpty(properties.getProperty(Constants.DEFAULT_PROPERTY_URL))) {
url = properties.getProperty(Constants.DEFAUL... | java | @Override
public String url() {
String url = "";
if (!StringUtils.isEmpty(baseUrl())) {
url = baseUrl() + path();
} else {
if (!StringUtils.isEmpty(properties.getProperty(Constants.DEFAULT_PROPERTY_URL))) {
url = properties.getProperty(Constants.DEFAUL... | [
"@",
"Override",
"public",
"String",
"url",
"(",
")",
"{",
"String",
"url",
"=",
"\"\"",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"baseUrl",
"(",
")",
")",
")",
"{",
"url",
"=",
"baseUrl",
"(",
")",
"+",
"path",
"(",
")",
";",
"... | Url that automated tests will be testing.
@return If a base url is provided it'll return the base url + path, otherwise it'll fallback to the normal url params. | [
"Url",
"that",
"automated",
"tests",
"will",
"be",
"testing",
"."
] | fc9843cfd633c358ce4f0708672c0081e6ef3e22 | https://github.com/conductor-framework/conductor/blob/fc9843cfd633c358ce4f0708672c0081e6ef3e22/src/main/java/io/ddavison/conductor/LocomotiveConfig.java#L34-L51 | train |
LinkedDataFragments/Server.Java | src/main/java/org/linkeddatafragments/datasource/DataSourceFactory.java | DataSourceFactory.create | public static IDataSource create(JsonObject config) throws DataSourceCreationException {
String title = config.getAsJsonPrimitive("title").getAsString();
String description = config.getAsJsonPrimitive("description").getAsString();
String typeName = config.getAsJsonPrimitive("type").getAsString()... | java | public static IDataSource create(JsonObject config) throws DataSourceCreationException {
String title = config.getAsJsonPrimitive("title").getAsString();
String description = config.getAsJsonPrimitive("description").getAsString();
String typeName = config.getAsJsonPrimitive("type").getAsString()... | [
"public",
"static",
"IDataSource",
"create",
"(",
"JsonObject",
"config",
")",
"throws",
"DataSourceCreationException",
"{",
"String",
"title",
"=",
"config",
".",
"getAsJsonPrimitive",
"(",
"\"title\"",
")",
".",
"getAsString",
"(",
")",
";",
"String",
"descripti... | Create a datasource using a JSON config
@param config
@return datasource interface
@throws DataSourceCreationException | [
"Create",
"a",
"datasource",
"using",
"a",
"JSON",
"config"
] | 15f72a0675cb761a986f0d0d40b36a83dd482b1e | https://github.com/LinkedDataFragments/Server.Java/blob/15f72a0675cb761a986f0d0d40b36a83dd482b1e/src/main/java/org/linkeddatafragments/datasource/DataSourceFactory.java#L21-L33 | train |
LinkedDataFragments/Server.Java | src/main/java/org/linkeddatafragments/servlet/LinkedDataFragmentServlet.java | LinkedDataFragmentServlet.getDataSource | private IDataSource getDataSource(HttpServletRequest request) throws DataSourceNotFoundException {
String contextPath = request.getContextPath();
String requestURI = request.getRequestURI();
String path = contextPath == null
? requestURI
: requestURI.substring(co... | java | private IDataSource getDataSource(HttpServletRequest request) throws DataSourceNotFoundException {
String contextPath = request.getContextPath();
String requestURI = request.getRequestURI();
String path = contextPath == null
? requestURI
: requestURI.substring(co... | [
"private",
"IDataSource",
"getDataSource",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"DataSourceNotFoundException",
"{",
"String",
"contextPath",
"=",
"request",
".",
"getContextPath",
"(",
")",
";",
"String",
"requestURI",
"=",
"request",
".",
"getRequestU... | Get the datasource
@param request
@return
@throws IOException | [
"Get",
"the",
"datasource"
] | 15f72a0675cb761a986f0d0d40b36a83dd482b1e | https://github.com/LinkedDataFragments/Server.Java/blob/15f72a0675cb761a986f0d0d40b36a83dd482b1e/src/main/java/org/linkeddatafragments/servlet/LinkedDataFragmentServlet.java#L132-L151 | train |
LinkedDataFragments/Server.Java | src/main/java/org/linkeddatafragments/fragments/LinkedDataFragmentBase.java | LinkedDataFragmentBase.addMetadata | public void addMetadata( final Model model )
{
final Resource datasetId = model.createResource( getDatasetURI() );
final Resource fragmentId = model.createResource( fragmentURL );
datasetId.addProperty( CommonResources.RDF_TYPE, CommonResources.VOID_DATASET );
datasetId.addProperty(... | java | public void addMetadata( final Model model )
{
final Resource datasetId = model.createResource( getDatasetURI() );
final Resource fragmentId = model.createResource( fragmentURL );
datasetId.addProperty( CommonResources.RDF_TYPE, CommonResources.VOID_DATASET );
datasetId.addProperty(... | [
"public",
"void",
"addMetadata",
"(",
"final",
"Model",
"model",
")",
"{",
"final",
"Resource",
"datasetId",
"=",
"model",
".",
"createResource",
"(",
"getDatasetURI",
"(",
")",
")",
";",
"final",
"Resource",
"fragmentId",
"=",
"model",
".",
"createResource",
... | Adds some basic metadata to the given RDF model.
This method may be overridden in subclasses.
@param model | [
"Adds",
"some",
"basic",
"metadata",
"to",
"the",
"given",
"RDF",
"model",
".",
"This",
"method",
"may",
"be",
"overridden",
"in",
"subclasses",
"."
] | 15f72a0675cb761a986f0d0d40b36a83dd482b1e | https://github.com/LinkedDataFragments/Server.Java/blob/15f72a0675cb761a986f0d0d40b36a83dd482b1e/src/main/java/org/linkeddatafragments/fragments/LinkedDataFragmentBase.java#L121-L135 | train |
LinkedDataFragments/Server.Java | src/main/java/org/linkeddatafragments/fragments/LinkedDataFragmentBase.java | LinkedDataFragmentBase.addControls | public void addControls( final Model model )
{
final URIBuilder pagedURL;
try {
pagedURL = new URIBuilder( fragmentURL );
}
catch ( URISyntaxException e ) {
throw new IllegalArgumentException( e );
}
final Resource fragmentId = model.createRes... | java | public void addControls( final Model model )
{
final URIBuilder pagedURL;
try {
pagedURL = new URIBuilder( fragmentURL );
}
catch ( URISyntaxException e ) {
throw new IllegalArgumentException( e );
}
final Resource fragmentId = model.createRes... | [
"public",
"void",
"addControls",
"(",
"final",
"Model",
"model",
")",
"{",
"final",
"URIBuilder",
"pagedURL",
";",
"try",
"{",
"pagedURL",
"=",
"new",
"URIBuilder",
"(",
"fragmentURL",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"thro... | Adds an RDF description of page links to the given RDF model.
This method may be overridden in subclasses.
@param model | [
"Adds",
"an",
"RDF",
"description",
"of",
"page",
"links",
"to",
"the",
"given",
"RDF",
"model",
".",
"This",
"method",
"may",
"be",
"overridden",
"in",
"subclasses",
"."
] | 15f72a0675cb761a986f0d0d40b36a83dd482b1e | https://github.com/LinkedDataFragments/Server.Java/blob/15f72a0675cb761a986f0d0d40b36a83dd482b1e/src/main/java/org/linkeddatafragments/fragments/LinkedDataFragmentBase.java#L142-L180 | train |
LinkedDataFragments/Server.Java | src/main/java/org/linkeddatafragments/datasource/hdt/HdtBasedRequestProcessorForTPFs.java | HdtBasedRequestProcessorForTPFs.toTriple | private Triple toTriple(TripleID tripleId) {
return new Triple(
dictionary.getNode(tripleId.getSubject(), TripleComponentRole.SUBJECT),
dictionary.getNode(tripleId.getPredicate(), TripleComponentRole.PREDICATE),
dictionary.getNode(tripleId.getObject(), TripleComponentRole.OBJ... | java | private Triple toTriple(TripleID tripleId) {
return new Triple(
dictionary.getNode(tripleId.getSubject(), TripleComponentRole.SUBJECT),
dictionary.getNode(tripleId.getPredicate(), TripleComponentRole.PREDICATE),
dictionary.getNode(tripleId.getObject(), TripleComponentRole.OBJ... | [
"private",
"Triple",
"toTriple",
"(",
"TripleID",
"tripleId",
")",
"{",
"return",
"new",
"Triple",
"(",
"dictionary",
".",
"getNode",
"(",
"tripleId",
".",
"getSubject",
"(",
")",
",",
"TripleComponentRole",
".",
"SUBJECT",
")",
",",
"dictionary",
".",
"getN... | Converts the HDT triple to a Jena Triple.
@param tripleId the HDT triple
@return the Jena triple | [
"Converts",
"the",
"HDT",
"triple",
"to",
"a",
"Jena",
"Triple",
"."
] | 15f72a0675cb761a986f0d0d40b36a83dd482b1e | https://github.com/LinkedDataFragments/Server.Java/blob/15f72a0675cb761a986f0d0d40b36a83dd482b1e/src/main/java/org/linkeddatafragments/datasource/hdt/HdtBasedRequestProcessorForTPFs.java#L172-L178 | train |
dadoonet/testcontainers-java-module-elasticsearch | src/main/java/fr/pilato/elasticsearch/containers/ElasticsearchContainer.java | ElasticsearchContainer.withSecureSetting | public ElasticsearchContainer withSecureSetting(String key, String value) {
securedKeys.put(key, value);
return this;
} | java | public ElasticsearchContainer withSecureSetting(String key, String value) {
securedKeys.put(key, value);
return this;
} | [
"public",
"ElasticsearchContainer",
"withSecureSetting",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"securedKeys",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Define the elasticsearch docker registry base url
@param key Key
@param value Value
@return this | [
"Define",
"the",
"elasticsearch",
"docker",
"registry",
"base",
"url"
] | 780eec66c2999a1e4814f039b2a4559d6a5da408 | https://github.com/dadoonet/testcontainers-java-module-elasticsearch/blob/780eec66c2999a1e4814f039b2a4559d6a5da408/src/main/java/fr/pilato/elasticsearch/containers/ElasticsearchContainer.java#L93-L96 | train |
dadoonet/testcontainers-java-module-elasticsearch | src/main/java/fr/pilato/elasticsearch/containers/ElasticsearchContainer.java | ElasticsearchContainer.withPluginDir | public ElasticsearchContainer withPluginDir(Path pluginDir) {
if (pluginDir == null) {
return this;
}
// When we have a plugin dir, we need to mount it in the docker instance
this.pluginDir = createVolumeDirectory(true);
// We create the volume that will be needed f... | java | public ElasticsearchContainer withPluginDir(Path pluginDir) {
if (pluginDir == null) {
return this;
}
// When we have a plugin dir, we need to mount it in the docker instance
this.pluginDir = createVolumeDirectory(true);
// We create the volume that will be needed f... | [
"public",
"ElasticsearchContainer",
"withPluginDir",
"(",
"Path",
"pluginDir",
")",
"{",
"if",
"(",
"pluginDir",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"// When we have a plugin dir, we need to mount it in the docker instance",
"this",
".",
"pluginDir",
"="... | Path to plugin dir which contains plugins that needs to be installed
@param pluginDir plugins dir
@return this | [
"Path",
"to",
"plugin",
"dir",
"which",
"contains",
"plugins",
"that",
"needs",
"to",
"be",
"installed"
] | 780eec66c2999a1e4814f039b2a4559d6a5da408 | https://github.com/dadoonet/testcontainers-java-module-elasticsearch/blob/780eec66c2999a1e4814f039b2a4559d6a5da408/src/main/java/fr/pilato/elasticsearch/containers/ElasticsearchContainer.java#L113-L142 | train |
rtyley/android-screenshot-lib | paparazzo/src/main/java/com/github/rtyley/android/screenshot/paparazzo/OnDemandScreenshotService.java | OnDemandScreenshotService.start | public void start() {
Thread thread = new Thread(new LogCatCommandExecutor());
thread.setName(getClass().getSimpleName() + " logcat for " + device.getSerialNumber());
thread.start();
try {
sleep(500); // ignore old output that logcat feeds us
} catch (InterruptedExce... | java | public void start() {
Thread thread = new Thread(new LogCatCommandExecutor());
thread.setName(getClass().getSimpleName() + " logcat for " + device.getSerialNumber());
thread.start();
try {
sleep(500); // ignore old output that logcat feeds us
} catch (InterruptedExce... | [
"public",
"void",
"start",
"(",
")",
"{",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new",
"LogCatCommandExecutor",
"(",
")",
")",
";",
"thread",
".",
"setName",
"(",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
"+",
"\" logcat for \"",
"+"... | Start receiving and acting on paparazzo requests from the device. | [
"Start",
"receiving",
"and",
"acting",
"on",
"paparazzo",
"requests",
"from",
"the",
"device",
"."
] | 8714d37ca3e62716953032cf8e55657bc2ed211b | https://github.com/rtyley/android-screenshot-lib/blob/8714d37ca3e62716953032cf8e55657bc2ed211b/paparazzo/src/main/java/com/github/rtyley/android/screenshot/paparazzo/OnDemandScreenshotService.java#L33-L44 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/css/RGBColor.java | RGBColor.rgb | public static RGBColor rgb(int r, int g, int b) {
return new RGBColor(makeRgb(r, g, b));
} | java | public static RGBColor rgb(int r, int g, int b) {
return new RGBColor(makeRgb(r, g, b));
} | [
"public",
"static",
"RGBColor",
"rgb",
"(",
"int",
"r",
",",
"int",
"g",
",",
"int",
"b",
")",
"{",
"return",
"new",
"RGBColor",
"(",
"makeRgb",
"(",
"r",
",",
"g",
",",
"b",
")",
")",
";",
"}"
] | RGB color as r,g,b triple. | [
"RGB",
"color",
"as",
"r",
"g",
"b",
"triple",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/css/RGBColor.java#L70-L72 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java | DocumentStyleImpl.cur | public double cur(Element elem, String prop, boolean force) {
if (JsUtils.isWindow(elem)) {
if ("width".equals(prop)) {
return getContentDocument(elem).getClientWidth();
}
if ("height".equals(prop)) {
return getContentDocument(elem).getClientHeight();
}
elem = GQuery.bo... | java | public double cur(Element elem, String prop, boolean force) {
if (JsUtils.isWindow(elem)) {
if ("width".equals(prop)) {
return getContentDocument(elem).getClientWidth();
}
if ("height".equals(prop)) {
return getContentDocument(elem).getClientHeight();
}
elem = GQuery.bo... | [
"public",
"double",
"cur",
"(",
"Element",
"elem",
",",
"String",
"prop",
",",
"boolean",
"force",
")",
"{",
"if",
"(",
"JsUtils",
".",
"isWindow",
"(",
"elem",
")",
")",
"{",
"if",
"(",
"\"width\"",
".",
"equals",
"(",
"prop",
")",
")",
"{",
"retu... | Returns the numeric value of a css property.
The parameter force has a special meaning:
- When force is false, returns the value of the css property defined
in the set of style attributes.
- Otherwise it returns the real computed value. | [
"Returns",
"the",
"numeric",
"value",
"of",
"a",
"css",
"property",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java#L46-L77 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java | DocumentStyleImpl.curCSS | public String curCSS(Element elem, String name, boolean force) {
if (elem == null) {
return "";
}
name = fixPropertyName(name);
// value defined in the element style
String ret = elem.getStyle().getProperty(name);
if (force) {
Element toDetach = null;
if (JsUtils.isDetached(e... | java | public String curCSS(Element elem, String name, boolean force) {
if (elem == null) {
return "";
}
name = fixPropertyName(name);
// value defined in the element style
String ret = elem.getStyle().getProperty(name);
if (force) {
Element toDetach = null;
if (JsUtils.isDetached(e... | [
"public",
"String",
"curCSS",
"(",
"Element",
"elem",
",",
"String",
"name",
",",
"boolean",
"force",
")",
"{",
"if",
"(",
"elem",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"name",
"=",
"fixPropertyName",
"(",
"name",
")",
";",
"// value defi... | Return the string value of a css property of an element.
The parameter force has a special meaning:
- When force is false, returns the value of the css property defined
in the set of style attributes.
- Otherwise it returns the real computed value.
For instance if you do not define 'display=none' in the element style... | [
"Return",
"the",
"string",
"value",
"of",
"a",
"css",
"property",
"of",
"an",
"element",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java#L91-L122 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java | DocumentStyleImpl.fixInlineElement | private void fixInlineElement(Element e) {
if (e.getClientHeight() == 0 && e.getClientWidth() == 0
&& "inline".equals(curCSS(e, "display", true))) {
setStyleProperty(e, "display", "inline-block");
setStyleProperty(e, "width", "auto");
setStyleProperty(e, "height", "auto");
}
} | java | private void fixInlineElement(Element e) {
if (e.getClientHeight() == 0 && e.getClientWidth() == 0
&& "inline".equals(curCSS(e, "display", true))) {
setStyleProperty(e, "display", "inline-block");
setStyleProperty(e, "width", "auto");
setStyleProperty(e, "height", "auto");
}
} | [
"private",
"void",
"fixInlineElement",
"(",
"Element",
"e",
")",
"{",
"if",
"(",
"e",
".",
"getClientHeight",
"(",
")",
"==",
"0",
"&&",
"e",
".",
"getClientWidth",
"(",
")",
"==",
"0",
"&&",
"\"inline\"",
".",
"equals",
"(",
"curCSS",
"(",
"e",
",",... | inline elements do not have width nor height unless we set it to inline-block | [
"inline",
"elements",
"do",
"not",
"have",
"width",
"nor",
"height",
"unless",
"we",
"set",
"it",
"to",
"inline",
"-",
"block"
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java#L170-L177 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java | DocumentStyleImpl.setStyleProperty | public void setStyleProperty(Element e, String prop, String val) {
if (e == null || prop == null) {
return;
}
prop = fixPropertyName(prop);
// put it in lower-case only when all letters are upper-case, to avoid
// modifying already camelized properties
if (prop.matches("^[A-Z]+$")) {
... | java | public void setStyleProperty(Element e, String prop, String val) {
if (e == null || prop == null) {
return;
}
prop = fixPropertyName(prop);
// put it in lower-case only when all letters are upper-case, to avoid
// modifying already camelized properties
if (prop.matches("^[A-Z]+$")) {
... | [
"public",
"void",
"setStyleProperty",
"(",
"Element",
"e",
",",
"String",
"prop",
",",
"String",
"val",
")",
"{",
"if",
"(",
"e",
"==",
"null",
"||",
"prop",
"==",
"null",
")",
"{",
"return",
";",
"}",
"prop",
"=",
"fixPropertyName",
"(",
"prop",
")"... | Set the value of a style property of an element. | [
"Set",
"the",
"value",
"of",
"a",
"style",
"property",
"of",
"an",
"element",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java#L236-L255 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java | DocumentStyleImpl.defaultDisplay | public String defaultDisplay(String tagName) {
String ret = elemdisplay.get(tagName);
if (ret == null) {
Element e = DOM.createElement(tagName);
Document.get().getBody().appendChild(e);
ret = curCSS(e, "display", false);
e.removeFromParent();
if (ret == null || ret.matches("(|none)... | java | public String defaultDisplay(String tagName) {
String ret = elemdisplay.get(tagName);
if (ret == null) {
Element e = DOM.createElement(tagName);
Document.get().getBody().appendChild(e);
ret = curCSS(e, "display", false);
e.removeFromParent();
if (ret == null || ret.matches("(|none)... | [
"public",
"String",
"defaultDisplay",
"(",
"String",
"tagName",
")",
"{",
"String",
"ret",
"=",
"elemdisplay",
".",
"get",
"(",
"tagName",
")",
";",
"if",
"(",
"ret",
"==",
"null",
")",
"{",
"Element",
"e",
"=",
"DOM",
".",
"createElement",
"(",
"tagNa... | Returns the default display value for each html tag. | [
"Returns",
"the",
"default",
"display",
"value",
"for",
"each",
"html",
"tag",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImpl.java#L270-L283 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/model/BatchResponse.java | BatchResponse.setItems | public void setItems(java.util.Collection<java.util.Map<String,AttributeValue>> items) {
if (items == null) {
this.items = null;
return;
}
java.util.List<java.util.Map<String,AttributeValue>> itemsCopy = new java.util.ArrayList<java.util.Map<String,AttributeValue>>(items... | java | public void setItems(java.util.Collection<java.util.Map<String,AttributeValue>> items) {
if (items == null) {
this.items = null;
return;
}
java.util.List<java.util.Map<String,AttributeValue>> itemsCopy = new java.util.ArrayList<java.util.Map<String,AttributeValue>>(items... | [
"public",
"void",
"setItems",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
">",
"items",
")",
"{",
"if",
"(",
"items",
"==",
"null",
")",
"{",
"this",
".",
"items",
"=... | Sets the value of the Items property for this object.
@param items The new value for the Items property for this object. | [
"Sets",
"the",
"value",
"of",
"the",
"Items",
"property",
"for",
"this",
"object",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/model/BatchResponse.java#L55-L64 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java | Effects.queueAnimation | public void queueAnimation(final GQAnimation anim, final int duration) {
if (isOff()) {
anim.onStart();
anim.onComplete();
} else {
queue(anim.e, DEFAULT_NAME, new Function() {
public void cancel(Element e) {
Animation anim = (Animation) data(e, GQAnimation.ACTUAL_ANIMATION, ... | java | public void queueAnimation(final GQAnimation anim, final int duration) {
if (isOff()) {
anim.onStart();
anim.onComplete();
} else {
queue(anim.e, DEFAULT_NAME, new Function() {
public void cancel(Element e) {
Animation anim = (Animation) data(e, GQAnimation.ACTUAL_ANIMATION, ... | [
"public",
"void",
"queueAnimation",
"(",
"final",
"GQAnimation",
"anim",
",",
"final",
"int",
"duration",
")",
"{",
"if",
"(",
"isOff",
"(",
")",
")",
"{",
"anim",
".",
"onStart",
"(",
")",
";",
"anim",
".",
"onComplete",
"(",
")",
";",
"}",
"else",
... | Queue an animation for an element.
The goal of this method is to reuse animations.
@param e
@param anim
@param duration | [
"Queue",
"an",
"animation",
"for",
"an",
"element",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java#L122-L140 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java | Effects.vendorProperty | public static String vendorProperty(String prop) {
return vendorPropNames.get(prop) != null ? vendorPropNames.get(prop) : prop;
} | java | public static String vendorProperty(String prop) {
return vendorPropNames.get(prop) != null ? vendorPropNames.get(prop) : prop;
} | [
"public",
"static",
"String",
"vendorProperty",
"(",
"String",
"prop",
")",
"{",
"return",
"vendorPropNames",
".",
"get",
"(",
"prop",
")",
"!=",
"null",
"?",
"vendorPropNames",
".",
"get",
"(",
"prop",
")",
":",
"prop",
";",
"}"
] | Get the cached vendor property name. | [
"Get",
"the",
"cached",
"vendor",
"property",
"name",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java#L166-L168 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java | Effects.slideToggle | public Effects slideToggle(Function... f) {
return as(Effects).slideToggle(Speed.DEFAULT, f);
} | java | public Effects slideToggle(Function... f) {
return as(Effects).slideToggle(Speed.DEFAULT, f);
} | [
"public",
"Effects",
"slideToggle",
"(",
"Function",
"...",
"f",
")",
"{",
"return",
"as",
"(",
"Effects",
")",
".",
"slideToggle",
"(",
"Speed",
".",
"DEFAULT",
",",
"f",
")",
";",
"}"
] | Toggle the visibility of all matched elements by adjusting their height and firing an optional
callback after completion. Only the height is adjusted for this animation, causing all matched
elements to be hidden or shown in a "sliding" manner | [
"Toggle",
"the",
"visibility",
"of",
"all",
"matched",
"elements",
"by",
"adjusting",
"their",
"height",
"and",
"firing",
"an",
"optional",
"callback",
"after",
"completion",
".",
"Only",
"the",
"height",
"is",
"adjusted",
"for",
"this",
"animation",
"causing",
... | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java#L582-L584 | train |
ArcBees/gwtquery | samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java | GwtQueryBenchModule.initResultsTable | private void initResultsTable(DeferredSelector[] dg, Benchmark... benchs) {
int numRows = dg.length;
grid = new FlexTable();
grid.addStyleName("resultstable");
RootPanel.get("results").clear();
RootPanel.get("results").add(grid);
grid.setText(0, 0, "Selector");
for (int i=0; i < benchs.leng... | java | private void initResultsTable(DeferredSelector[] dg, Benchmark... benchs) {
int numRows = dg.length;
grid = new FlexTable();
grid.addStyleName("resultstable");
RootPanel.get("results").clear();
RootPanel.get("results").add(grid);
grid.setText(0, 0, "Selector");
for (int i=0; i < benchs.leng... | [
"private",
"void",
"initResultsTable",
"(",
"DeferredSelector",
"[",
"]",
"dg",
",",
"Benchmark",
"...",
"benchs",
")",
"{",
"int",
"numRows",
"=",
"dg",
".",
"length",
";",
"grid",
"=",
"new",
"FlexTable",
"(",
")",
";",
"grid",
".",
"addStyleName",
"("... | Reset the result table | [
"Reset",
"the",
"result",
"table"
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java#L413-L431 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java | Callbacks.add | public Callbacks add(com.google.gwt.core.client.Callback<?, ?>... c) {
addAll((Object[]) c);
return this;
} | java | public Callbacks add(com.google.gwt.core.client.Callback<?, ?>... c) {
addAll((Object[]) c);
return this;
} | [
"public",
"Callbacks",
"add",
"(",
"com",
".",
"google",
".",
"gwt",
".",
"core",
".",
"client",
".",
"Callback",
"<",
"?",
",",
"?",
">",
"...",
"c",
")",
"{",
"addAll",
"(",
"(",
"Object",
"[",
"]",
")",
"c",
")",
";",
"return",
"this",
";",
... | Add a Callback or a collection of callbacks to a callback list. | [
"Add",
"a",
"Callback",
"or",
"a",
"collection",
"of",
"callbacks",
"to",
"a",
"callback",
"list",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java#L76-L79 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java | Callbacks.fire | public Callbacks fire(Object... o) {
if (!done) {
done = isOnce;
if (isMemory) {
memory = new ArrayList<>(Arrays.asList(o));
}
if (stack != null)
for (Object c : stack) {
if (!run(c, o) && stopOnFalse) {
break;
}
}
}
return this... | java | public Callbacks fire(Object... o) {
if (!done) {
done = isOnce;
if (isMemory) {
memory = new ArrayList<>(Arrays.asList(o));
}
if (stack != null)
for (Object c : stack) {
if (!run(c, o) && stopOnFalse) {
break;
}
}
}
return this... | [
"public",
"Callbacks",
"fire",
"(",
"Object",
"...",
"o",
")",
"{",
"if",
"(",
"!",
"done",
")",
"{",
"done",
"=",
"isOnce",
";",
"if",
"(",
"isMemory",
")",
"{",
"memory",
"=",
"new",
"ArrayList",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"o",
")... | Call all of the callbacks with the given arguments. | [
"Call",
"all",
"of",
"the",
"callbacks",
"with",
"the",
"given",
"arguments",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Callbacks.java#L112-L126 | train |
mboudreau/Alternator | src/main/java/com/michelboudreau/alternator/AlternatorDBHandler.java | AlternatorDBHandler.save | public synchronized void save(String persistence) {
try {
createObjectMapper().writeValue(new File(persistence), tableList);
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
} | java | public synchronized void save(String persistence) {
try {
createObjectMapper().writeValue(new File(persistence), tableList);
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
} | [
"public",
"synchronized",
"void",
"save",
"(",
"String",
"persistence",
")",
"{",
"try",
"{",
"createObjectMapper",
"(",
")",
".",
"writeValue",
"(",
"new",
"File",
"(",
"persistence",
")",
",",
"tableList",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",... | Maybe save automatically on destroy? | [
"Maybe",
"save",
"automatically",
"on",
"destroy?"
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/michelboudreau/alternator/AlternatorDBHandler.java#L129-L135 | train |
mboudreau/Alternator | src/main/java/com/michelboudreau/alternator/AlternatorDBHandler.java | AlternatorDBHandler.createObjectMapper | public ObjectMapper createObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
.setVisibility(PropertyAccessor.CREATOR, JsonAutoDetect.Visibility.ANY)
.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.NONE)
... | java | public ObjectMapper createObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
.setVisibility(PropertyAccessor.CREATOR, JsonAutoDetect.Visibility.ANY)
.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.NONE)
... | [
"public",
"ObjectMapper",
"createObjectMapper",
"(",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"setVisibility",
"(",
"PropertyAccessor",
".",
"FIELD",
",",
"JsonAutoDetect",
".",
"Visibility",
".",
"ANY",
")",
... | Not sure about this. If correct and only need one, only create one instance | [
"Not",
"sure",
"about",
"this",
".",
"If",
"correct",
"and",
"only",
"need",
"one",
"only",
"create",
"one",
"instance"
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/michelboudreau/alternator/AlternatorDBHandler.java#L156-L167 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/model/AttributeValue.java | AttributeValue.setSS | public void setSS(java.util.Collection<String> sS) {
if (sS == null) {
this.sS = null;
return;
}
java.util.List<String> sSCopy = new java.util.ArrayList<String>(sS.size());
sSCopy.addAll(sS);
this.sS = sSCopy;
} | java | public void setSS(java.util.Collection<String> sS) {
if (sS == null) {
this.sS = null;
return;
}
java.util.List<String> sSCopy = new java.util.ArrayList<String>(sS.size());
sSCopy.addAll(sS);
this.sS = sSCopy;
} | [
"public",
"void",
"setSS",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"sS",
")",
"{",
"if",
"(",
"sS",
"==",
"null",
")",
"{",
"this",
".",
"sS",
"=",
"null",
";",
"return",
";",
"}",
"java",
".",
"util",
".",
"List",
"<",... | A set of strings.
@param sS A set of strings. | [
"A",
"set",
"of",
"strings",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/model/AttributeValue.java#L243-L252 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/model/AttributeValue.java | AttributeValue.setNS | public void setNS(java.util.Collection<String> nS) {
if (nS == null) {
this.nS = null;
return;
}
java.util.List<String> nSCopy = new java.util.ArrayList<String>(nS.size());
nSCopy.addAll(nS);
this.nS = nSCopy;
} | java | public void setNS(java.util.Collection<String> nS) {
if (nS == null) {
this.nS = null;
return;
}
java.util.List<String> nSCopy = new java.util.ArrayList<String>(nS.size());
nSCopy.addAll(nS);
this.nS = nSCopy;
} | [
"public",
"void",
"setNS",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"nS",
")",
"{",
"if",
"(",
"nS",
"==",
"null",
")",
"{",
"this",
".",
"nS",
"=",
"null",
";",
"return",
";",
"}",
"java",
".",
"util",
".",
"List",
"<",... | A set of numbers.
@param nS A set of numbers. | [
"A",
"set",
"of",
"numbers",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/model/AttributeValue.java#L309-L318 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/model/AttributeValue.java | AttributeValue.setBS | public void setBS(java.util.Collection<java.nio.ByteBuffer> bS) {
if (bS == null) {
this.bS = null;
return;
}
java.util.List<java.nio.ByteBuffer> bSCopy = new java.util.ArrayList<java.nio.ByteBuffer>(bS.size());
bSCopy.addAll(bS);
this.bS = bSCopy;
} | java | public void setBS(java.util.Collection<java.nio.ByteBuffer> bS) {
if (bS == null) {
this.bS = null;
return;
}
java.util.List<java.nio.ByteBuffer> bSCopy = new java.util.ArrayList<java.nio.ByteBuffer>(bS.size());
bSCopy.addAll(bS);
this.bS = bSCopy;
} | [
"public",
"void",
"setBS",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"nio",
".",
"ByteBuffer",
">",
"bS",
")",
"{",
"if",
"(",
"bS",
"==",
"null",
")",
"{",
"this",
".",
"bS",
"=",
"null",
";",
"return",
";",
"}",
"java",
"... | A set of binary attributes.
@param bS A set of binary attributes. | [
"A",
"set",
"of",
"binary",
"attributes",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/model/AttributeValue.java#L375-L384 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Deferred.java | Deferred.when | public static Promise when(Object... d) {
int l = d.length;
Promise[] p = new Promise[l];
for (int i = 0; i < l; i++) {
p[i] = makePromise(d[i]);
}
return when(p);
} | java | public static Promise when(Object... d) {
int l = d.length;
Promise[] p = new Promise[l];
for (int i = 0; i < l; i++) {
p[i] = makePromise(d[i]);
}
return when(p);
} | [
"public",
"static",
"Promise",
"when",
"(",
"Object",
"...",
"d",
")",
"{",
"int",
"l",
"=",
"d",
".",
"length",
";",
"Promise",
"[",
"]",
"p",
"=",
"new",
"Promise",
"[",
"l",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"l",
... | Provides a way to execute callback functions based on one or more objects,
usually Deferred objects that represent asynchronous events.
Returns the Promise from a new "master" Deferred object that tracks the aggregate
state of all the Deferreds passed. The method will resolve its master
Deferred as soon as all the Def... | [
"Provides",
"a",
"way",
"to",
"execute",
"callback",
"functions",
"based",
"on",
"one",
"or",
"more",
"objects",
"usually",
"Deferred",
"objects",
"that",
"represent",
"asynchronous",
"events",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/Deferred.java#L279-L286 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/UiPlugin.java | UiPlugin.trigger | protected void trigger(GwtEvent<?> e, Function callback, Element element) {
trigger(e, callback, element, eventBus);
} | java | protected void trigger(GwtEvent<?> e, Function callback, Element element) {
trigger(e, callback, element, eventBus);
} | [
"protected",
"void",
"trigger",
"(",
"GwtEvent",
"<",
"?",
">",
"e",
",",
"Function",
"callback",
",",
"Element",
"element",
")",
"{",
"trigger",
"(",
"e",
",",
"callback",
",",
"element",
",",
"eventBus",
")",
";",
"}"
] | fire event and call callback function. | [
"fire",
"event",
"and",
"call",
"callback",
"function",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/UiPlugin.java#L172-L174 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/PaginatedList.java | PaginatedList.iterator | @Override
public Iterator<T> iterator() {
/*
* We make a copy of the allResults list to iterate over in order to
* avoid ConcurrentModificationExceptions caused by other methods
* loading more results into the list while someone iterates over it.
* This is a more... | java | @Override
public Iterator<T> iterator() {
/*
* We make a copy of the allResults list to iterate over in order to
* avoid ConcurrentModificationExceptions caused by other methods
* loading more results into the list while someone iterates over it.
* This is a more... | [
"@",
"Override",
"public",
"Iterator",
"<",
"T",
">",
"iterator",
"(",
")",
"{",
"/*\n * We make a copy of the allResults list to iterate over in order to\n * avoid ConcurrentModificationExceptions caused by other methods\n * loading more results into the list while som... | Returns an iterator over this list that lazily initializes results as
necessary. | [
"Returns",
"an",
"iterator",
"over",
"this",
"list",
"that",
"lazily",
"initializes",
"results",
"as",
"necessary",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/PaginatedList.java#L143-L199 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/PaginatedList.java | PaginatedList.subList | @Override
public List<T> subList(int arg0, int arg1) {
while ( allResults.size() < arg1 && nextResultsAvailable() ) {
moveNextResults();
}
return Collections.unmodifiableList(allResults.subList(arg0, arg1));
} | java | @Override
public List<T> subList(int arg0, int arg1) {
while ( allResults.size() < arg1 && nextResultsAvailable() ) {
moveNextResults();
}
return Collections.unmodifiableList(allResults.subList(arg0, arg1));
} | [
"@",
"Override",
"public",
"List",
"<",
"T",
">",
"subList",
"(",
"int",
"arg0",
",",
"int",
"arg1",
")",
"{",
"while",
"(",
"allResults",
".",
"size",
"(",
")",
"<",
"arg1",
"&&",
"nextResultsAvailable",
"(",
")",
")",
"{",
"moveNextResults",
"(",
"... | Returns a sub-list in the range specified, loading more results as
necessary. | [
"Returns",
"a",
"sub",
"-",
"list",
"in",
"the",
"range",
"specified",
"loading",
"more",
"results",
"as",
"necessary",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/PaginatedList.java#L247-L254 | train |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/PaginatedList.java | PaginatedList.indexOf | @Override
public int indexOf(Object arg0) {
int indexOf = allResults.indexOf(arg0);
if ( indexOf >= 0 )
return indexOf;
while ( nextResultsAvailable() ) {
indexOf = nextResults.indexOf(arg0);
int size = allResults.size();
moveNextResults();
... | java | @Override
public int indexOf(Object arg0) {
int indexOf = allResults.indexOf(arg0);
if ( indexOf >= 0 )
return indexOf;
while ( nextResultsAvailable() ) {
indexOf = nextResults.indexOf(arg0);
int size = allResults.size();
moveNextResults();
... | [
"@",
"Override",
"public",
"int",
"indexOf",
"(",
"Object",
"arg0",
")",
"{",
"int",
"indexOf",
"=",
"allResults",
".",
"indexOf",
"(",
"arg0",
")",
";",
"if",
"(",
"indexOf",
">=",
"0",
")",
"return",
"indexOf",
";",
"while",
"(",
"nextResultsAvailable"... | Returns the first index of the object given in the list. Additional
results are loaded incrementally as necessary. | [
"Returns",
"the",
"first",
"index",
"of",
"the",
"object",
"given",
"in",
"the",
"list",
".",
"Additional",
"results",
"are",
"loaded",
"incrementally",
"as",
"necessary",
"."
] | 4b230ac843494cb10e46ddc2848f5b5d377d7b72 | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/PaginatedList.java#L260-L275 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java | Transform.supportsTransform3d | private static boolean supportsTransform3d() {
if (transform == null) {
return false;
}
String rotate = "rotateY(1deg)";
divStyle.setProperty(transform, rotate);
rotate = divStyle.getProperty(transform);
return rotate != null && !rotate.isEmpty();
} | java | private static boolean supportsTransform3d() {
if (transform == null) {
return false;
}
String rotate = "rotateY(1deg)";
divStyle.setProperty(transform, rotate);
rotate = divStyle.getProperty(transform);
return rotate != null && !rotate.isEmpty();
} | [
"private",
"static",
"boolean",
"supportsTransform3d",
"(",
")",
"{",
"if",
"(",
"transform",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
"rotate",
"=",
"\"rotateY(1deg)\"",
";",
"divStyle",
".",
"setProperty",
"(",
"transform",
",",
"rota... | Some browsers like HTMLUnit only support 2d transformations | [
"Some",
"browsers",
"like",
"HTMLUnit",
"only",
"support",
"2d",
"transformations"
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java#L75-L83 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java | Transform.getVendorPropertyName | public static String getVendorPropertyName(String prop) {
// we prefer vendor specific names by default
String vendorProp = JsUtils.camelize("-" + prefix + "-" + prop);
if (JsUtils.hasProperty(divStyle, vendorProp)) {
return vendorProp;
}
if (JsUtils.hasProperty(divStyle, prop)) {
retur... | java | public static String getVendorPropertyName(String prop) {
// we prefer vendor specific names by default
String vendorProp = JsUtils.camelize("-" + prefix + "-" + prop);
if (JsUtils.hasProperty(divStyle, vendorProp)) {
return vendorProp;
}
if (JsUtils.hasProperty(divStyle, prop)) {
retur... | [
"public",
"static",
"String",
"getVendorPropertyName",
"(",
"String",
"prop",
")",
"{",
"// we prefer vendor specific names by default",
"String",
"vendorProp",
"=",
"JsUtils",
".",
"camelize",
"(",
"\"-\"",
"+",
"prefix",
"+",
"\"-\"",
"+",
"prop",
")",
";",
"if"... | Compute the correct CSS property name for a specific browser vendor. | [
"Compute",
"the",
"correct",
"CSS",
"property",
"name",
"for",
"a",
"specific",
"browser",
"vendor",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java#L88-L102 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java | Transform.getInstance | public static Transform getInstance(Element e, String initial) {
Transform t = GQuery.data(e, TRANSFORM);
if (t == null || initial != null) {
if (initial == null) {
initial = GQuery.getSelectorEngine().getDocumentStyleImpl().curCSS(e, transform, false);
}
t = new Transform(initial);
... | java | public static Transform getInstance(Element e, String initial) {
Transform t = GQuery.data(e, TRANSFORM);
if (t == null || initial != null) {
if (initial == null) {
initial = GQuery.getSelectorEngine().getDocumentStyleImpl().curCSS(e, transform, false);
}
t = new Transform(initial);
... | [
"public",
"static",
"Transform",
"getInstance",
"(",
"Element",
"e",
",",
"String",
"initial",
")",
"{",
"Transform",
"t",
"=",
"GQuery",
".",
"data",
"(",
"e",
",",
"TRANSFORM",
")",
";",
"if",
"(",
"t",
"==",
"null",
"||",
"initial",
"!=",
"null",
... | Return the Transform dictionary object of an element, but reseting
historical values and setting them to the initial value passed. | [
"Return",
"the",
"Transform",
"dictionary",
"object",
"of",
"an",
"element",
"but",
"reseting",
"historical",
"values",
"and",
"setting",
"them",
"to",
"the",
"initial",
"value",
"passed",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java#L123-L133 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java | Transform.parse | private void parse(String s) {
if (s != null) {
for (MatchResult r = transformParseRegex.exec(s); r != null; r = transformParseRegex.exec(s)) {
setFromString(vendorProperty(r.getGroup(1)), r.getGroup(2));
}
}
} | java | private void parse(String s) {
if (s != null) {
for (MatchResult r = transformParseRegex.exec(s); r != null; r = transformParseRegex.exec(s)) {
setFromString(vendorProperty(r.getGroup(1)), r.getGroup(2));
}
}
} | [
"private",
"void",
"parse",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"for",
"(",
"MatchResult",
"r",
"=",
"transformParseRegex",
".",
"exec",
"(",
"s",
")",
";",
"r",
"!=",
"null",
";",
"r",
"=",
"transformParseRegex",
... | Parse a transform value as string and fills the dictionary map. | [
"Parse",
"a",
"transform",
"value",
"as",
"string",
"and",
"fills",
"the",
"dictionary",
"map",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java#L163-L169 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java | Transform.setFromString | public void setFromString(String prop, String ...val) {
if (val.length == 1) {
String[] vals = val[0].split("[\\s,]+");
set(prop, vals);
} else {
set(prop, val);
}
} | java | public void setFromString(String prop, String ...val) {
if (val.length == 1) {
String[] vals = val[0].split("[\\s,]+");
set(prop, vals);
} else {
set(prop, val);
}
} | [
"public",
"void",
"setFromString",
"(",
"String",
"prop",
",",
"String",
"...",
"val",
")",
"{",
"if",
"(",
"val",
".",
"length",
"==",
"1",
")",
"{",
"String",
"[",
"]",
"vals",
"=",
"val",
"[",
"0",
"]",
".",
"split",
"(",
"\"[\\\\s,]+\"",
")",
... | Set a transform multi-value giving either a set of strings or
just an string of values separated by comma. | [
"Set",
"a",
"transform",
"multi",
"-",
"value",
"giving",
"either",
"a",
"set",
"of",
"strings",
"or",
"just",
"an",
"string",
"of",
"values",
"separated",
"by",
"comma",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java#L182-L189 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.clearQueue | @SuppressWarnings("unchecked")
public T clearQueue(String name) {
for (Element e : elements()) {
queue(e, name, null).clear();
}
return (T) this;
} | java | @SuppressWarnings("unchecked")
public T clearQueue(String name) {
for (Element e : elements()) {
queue(e, name, null).clear();
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"clearQueue",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"Element",
"e",
":",
"elements",
"(",
")",
")",
"{",
"queue",
"(",
"e",
",",
"name",
",",
"null",
")",
".",
"clear",
"(",
... | remove all queued function from the named queue. | [
"remove",
"all",
"queued",
"function",
"from",
"the",
"named",
"queue",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L94-L100 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.delay | @SuppressWarnings("unchecked")
public T delay(int milliseconds, String name, Function... funcs) {
for (Element e : elements()) {
queue(e, name, new DelayFunction(e, name, milliseconds, funcs));
}
return (T) this;
} | java | @SuppressWarnings("unchecked")
public T delay(int milliseconds, String name, Function... funcs) {
for (Element e : elements()) {
queue(e, name, new DelayFunction(e, name, milliseconds, funcs));
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"delay",
"(",
"int",
"milliseconds",
",",
"String",
"name",
",",
"Function",
"...",
"funcs",
")",
"{",
"for",
"(",
"Element",
"e",
":",
"elements",
"(",
")",
")",
"{",
"queue",
"(",
"e"... | Add a delay in the named queue. | [
"Add",
"a",
"delay",
"in",
"the",
"named",
"queue",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L112-L118 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.dequeue | @SuppressWarnings("unchecked")
public T dequeue(String name) {
for (Element e : elements()) {
dequeueCurrentAndRunNext(e, name);
}
return (T) this;
} | java | @SuppressWarnings("unchecked")
public T dequeue(String name) {
for (Element e : elements()) {
dequeueCurrentAndRunNext(e, name);
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"dequeue",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"Element",
"e",
":",
"elements",
"(",
")",
")",
"{",
"dequeueCurrentAndRunNext",
"(",
"e",
",",
"name",
")",
";",
"}",
"return",
... | Removes a queued function from the front of the named queue and executes it. | [
"Removes",
"a",
"queued",
"function",
"from",
"the",
"front",
"of",
"the",
"named",
"queue",
"and",
"executes",
"it",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L130-L136 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.promise | public Promise promise(final String name) {
final Promise.Deferred dfd = Deferred();
// This is the unique instance of the resolve function which will be added to each element.
final Function resolve = new Function() {
// Because it is an inner function, the counter cannot final outside the function
... | java | public Promise promise(final String name) {
final Promise.Deferred dfd = Deferred();
// This is the unique instance of the resolve function which will be added to each element.
final Function resolve = new Function() {
// Because it is an inner function, the counter cannot final outside the function
... | [
"public",
"Promise",
"promise",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"Promise",
".",
"Deferred",
"dfd",
"=",
"Deferred",
"(",
")",
";",
"// This is the unique instance of the resolve function which will be added to each element.",
"final",
"Function",
"resol... | Returns a dynamically generated Promise that is resolved once all actions
in the named queue have ended. | [
"Returns",
"a",
"dynamically",
"generated",
"Promise",
"that",
"is",
"resolved",
"once",
"all",
"actions",
"in",
"the",
"named",
"queue",
"have",
"ended",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L150-L179 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.queue | public int queue(String name) {
Queue<?> q = isEmpty() ? null : queue(get(0), name, null);
return q == null ? 0 : q.size();
} | java | public int queue(String name) {
Queue<?> q = isEmpty() ? null : queue(get(0), name, null);
return q == null ? 0 : q.size();
} | [
"public",
"int",
"queue",
"(",
"String",
"name",
")",
"{",
"Queue",
"<",
"?",
">",
"q",
"=",
"isEmpty",
"(",
")",
"?",
"null",
":",
"queue",
"(",
"get",
"(",
"0",
")",
",",
"name",
",",
"null",
")",
";",
"return",
"q",
"==",
"null",
"?",
"0",... | Show the number of functions to be executed on the first matched element
in the named queue. | [
"Show",
"the",
"number",
"of",
"functions",
"to",
"be",
"executed",
"on",
"the",
"first",
"matched",
"element",
"in",
"the",
"named",
"queue",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L193-L196 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.queue | @SuppressWarnings("unchecked")
public T queue(Function... funcs) {
for (Element e : elements()) {
for (Function f : funcs) {
queue(e, DEFAULT_NAME, f);
}
}
return (T) this;
} | java | @SuppressWarnings("unchecked")
public T queue(Function... funcs) {
for (Element e : elements()) {
for (Function f : funcs) {
queue(e, DEFAULT_NAME, f);
}
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"queue",
"(",
"Function",
"...",
"funcs",
")",
"{",
"for",
"(",
"Element",
"e",
":",
"elements",
"(",
")",
")",
"{",
"for",
"(",
"Function",
"f",
":",
"funcs",
")",
"{",
"queue",
"(",... | Adds new functions, to be executed, onto the end of the effects
queue of all matched elements. | [
"Adds",
"new",
"functions",
"to",
"be",
"executed",
"onto",
"the",
"end",
"of",
"the",
"effects",
"queue",
"of",
"all",
"matched",
"elements",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L202-L210 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.queue | @SuppressWarnings("unchecked")
public T queue(final String name, Function... funcs) {
for (final Function f : funcs) {
for (Element e : elements()) {
queue(e, name, f);
}
}
return (T) this;
} | java | @SuppressWarnings("unchecked")
public T queue(final String name, Function... funcs) {
for (final Function f : funcs) {
for (Element e : elements()) {
queue(e, name, f);
}
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"queue",
"(",
"final",
"String",
"name",
",",
"Function",
"...",
"funcs",
")",
"{",
"for",
"(",
"final",
"Function",
"f",
":",
"funcs",
")",
"{",
"for",
"(",
"Element",
"e",
":",
"eleme... | Adds new functions, to be executed, onto the end of the named
queue of all matched elements. | [
"Adds",
"new",
"functions",
"to",
"be",
"executed",
"onto",
"the",
"end",
"of",
"the",
"named",
"queue",
"of",
"all",
"matched",
"elements",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L216-L224 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.queue | @SuppressWarnings("unchecked")
public T queue(String name, Queue<?> queue) {
for (Element e : elements()) {
replacequeue(e, name, queue);
}
return (T) this;
} | java | @SuppressWarnings("unchecked")
public T queue(String name, Queue<?> queue) {
for (Element e : elements()) {
replacequeue(e, name, queue);
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"queue",
"(",
"String",
"name",
",",
"Queue",
"<",
"?",
">",
"queue",
")",
"{",
"for",
"(",
"Element",
"e",
":",
"elements",
"(",
")",
")",
"{",
"replacequeue",
"(",
"e",
",",
"name",... | Replaces the current named queue with the given queue on all matched elements. | [
"Replaces",
"the",
"current",
"named",
"queue",
"with",
"the",
"given",
"queue",
"on",
"all",
"matched",
"elements",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L236-L242 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.dequeueIfNotDoneYet | public void dequeueIfNotDoneYet(Element elem, String name, Object object) {
@SuppressWarnings("rawtypes")
Queue queue = queue(elem, name, null);
if (queue != null && object.equals(queue.peek())) {
dequeueCurrentAndRunNext(elem, name);
}
} | java | public void dequeueIfNotDoneYet(Element elem, String name, Object object) {
@SuppressWarnings("rawtypes")
Queue queue = queue(elem, name, null);
if (queue != null && object.equals(queue.peek())) {
dequeueCurrentAndRunNext(elem, name);
}
} | [
"public",
"void",
"dequeueIfNotDoneYet",
"(",
"Element",
"elem",
",",
"String",
"name",
",",
"Object",
"object",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"Queue",
"queue",
"=",
"queue",
"(",
"elem",
",",
"name",
",",
"null",
")",
";",
... | Dequeue the object and run the next if it is the first
in the queue. | [
"Dequeue",
"the",
"object",
"and",
"run",
"the",
"next",
"if",
"it",
"is",
"the",
"first",
"in",
"the",
"queue",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L357-L363 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/FunctionDeferred.java | FunctionDeferred.f | public final Object f(Object... args) {
return dfd != null &&
(cache == CacheType.ALL ||
cache == CacheType.RESOLVED && dfd.promise().isResolved() ||
cache == CacheType.REJECTED && dfd.promise().isRejected())
? dfd.promise()
: new PromiseFunction() {
public void... | java | public final Object f(Object... args) {
return dfd != null &&
(cache == CacheType.ALL ||
cache == CacheType.RESOLVED && dfd.promise().isResolved() ||
cache == CacheType.REJECTED && dfd.promise().isRejected())
? dfd.promise()
: new PromiseFunction() {
public void... | [
"public",
"final",
"Object",
"f",
"(",
"Object",
"...",
"args",
")",
"{",
"return",
"dfd",
"!=",
"null",
"&&",
"(",
"cache",
"==",
"CacheType",
".",
"ALL",
"||",
"cache",
"==",
"CacheType",
".",
"RESOLVED",
"&&",
"dfd",
".",
"promise",
"(",
")",
".",... | This function is called when the previous promise in the pipe
is resolved. | [
"This",
"function",
"is",
"called",
"when",
"the",
"previous",
"promise",
"in",
"the",
"pipe",
"is",
"resolved",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/FunctionDeferred.java#L71-L85 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.getArgumentJSO | @SuppressWarnings("unchecked")
public <T extends JavaScriptObject> T getArgumentJSO(int argIdx, int pos) {
return (T) getArgument(argIdx, pos, JavaScriptObject.class);
} | java | @SuppressWarnings("unchecked")
public <T extends JavaScriptObject> T getArgumentJSO(int argIdx, int pos) {
return (T) getArgument(argIdx, pos, JavaScriptObject.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"JavaScriptObject",
">",
"T",
"getArgumentJSO",
"(",
"int",
"argIdx",
",",
"int",
"pos",
")",
"{",
"return",
"(",
"T",
")",
"getArgument",
"(",
"argIdx",
",",
"pos",
",",
... | Utility method for safety getting a JavaScriptObject present at a certain
position in the list of arguments composed by arrays. | [
"Utility",
"method",
"for",
"safety",
"getting",
"a",
"JavaScriptObject",
"present",
"at",
"a",
"certain",
"position",
"in",
"the",
"list",
"of",
"arguments",
"composed",
"by",
"arrays",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L148-L151 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.getArgumentArray | public Object[] getArgumentArray(int idx) {
Object o = idx < 0 ? arguments : getArgument(idx);
if (o != null) {
return o.getClass().isArray() ? (Object[]) o : new Object[] {o};
} else if (idx == 0) {
return arguments;
}
return new Object[0];
} | java | public Object[] getArgumentArray(int idx) {
Object o = idx < 0 ? arguments : getArgument(idx);
if (o != null) {
return o.getClass().isArray() ? (Object[]) o : new Object[] {o};
} else if (idx == 0) {
return arguments;
}
return new Object[0];
} | [
"public",
"Object",
"[",
"]",
"getArgumentArray",
"(",
"int",
"idx",
")",
"{",
"Object",
"o",
"=",
"idx",
"<",
"0",
"?",
"arguments",
":",
"getArgument",
"(",
"idx",
")",
";",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"return",
"o",
".",
"getClass",
... | Utility method for safety getting an array present at a certain
position in the list of arguments.
Useful for Deferred chains where result of each resolved
promise is set as an array in the arguments list.
Always returns an array. | [
"Utility",
"method",
"for",
"safety",
"getting",
"an",
"array",
"present",
"at",
"a",
"certain",
"position",
"in",
"the",
"list",
"of",
"arguments",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L170-L178 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.getArgument | public <T> T getArgument(int idx, Class<? extends T> type) {
return getArgument(-1, idx, type);
} | java | public <T> T getArgument(int idx, Class<? extends T> type) {
return getArgument(-1, idx, type);
} | [
"public",
"<",
"T",
">",
"T",
"getArgument",
"(",
"int",
"idx",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"type",
")",
"{",
"return",
"getArgument",
"(",
"-",
"1",
",",
"idx",
",",
"type",
")",
";",
"}"
] | Safety return the argument in the position idx.
If the element class is not of the requested type it returns null and
you don't get casting exeption. | [
"Safety",
"return",
"the",
"argument",
"in",
"the",
"position",
"idx",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L221-L223 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.getArgument | @SuppressWarnings("unchecked")
public <T> T getArgument(int argIdx, int pos, Class<? extends T> type) {
Object[] objs = getArgumentArray(argIdx);
Object o = objs.length > pos ? objs[pos] : null;
if (o != null && (
// When type is null we don't safety check
type == null ||
// Th... | java | @SuppressWarnings("unchecked")
public <T> T getArgument(int argIdx, int pos, Class<? extends T> type) {
Object[] objs = getArgumentArray(argIdx);
Object o = objs.length > pos ? objs[pos] : null;
if (o != null && (
// When type is null we don't safety check
type == null ||
// Th... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getArgument",
"(",
"int",
"argIdx",
",",
"int",
"pos",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"type",
")",
"{",
"Object",
"[",
"]",
"objs",
"=",
"getArgumentArray"... | Utility method for safety getting an object present at a certain
position in the list of arguments composed by arrays.
Useful for Deferred chains where result of each resolved
promise is set as an array in the arguments list.
When the object found in the array doesn't match the type required it returns a null.
Note:... | [
"Utility",
"method",
"for",
"safety",
"getting",
"an",
"object",
"present",
"at",
"a",
"certain",
"position",
"in",
"the",
"list",
"of",
"arguments",
"composed",
"by",
"arrays",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L238-L253 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.f | public Object f(Widget w, int i) {
setElement(w.getElement());
setIndex(i);
f(w);
return null;
} | java | public Object f(Widget w, int i) {
setElement(w.getElement());
setIndex(i);
f(w);
return null;
} | [
"public",
"Object",
"f",
"(",
"Widget",
"w",
",",
"int",
"i",
")",
"{",
"setElement",
"(",
"w",
".",
"getElement",
"(",
")",
")",
";",
"setIndex",
"(",
"i",
")",
";",
"f",
"(",
"w",
")",
";",
"return",
"null",
";",
"}"
] | Override this for GQuery methods which loop over matched widgets and
invoke a callback on each widget.
NOTE: If your query has non-widget elements you might need to override
'public void f()' or 'public void f(Element e)' to handle these elements and
avoid a runtime exception. | [
"Override",
"this",
"for",
"GQuery",
"methods",
"which",
"loop",
"over",
"matched",
"widgets",
"and",
"invoke",
"a",
"callback",
"on",
"each",
"widget",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L385-L390 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.f | public void f(int i, Object... args) {
setIndex(i);
setArguments(args);
if (args.length == 1 && args[0] instanceof JavaScriptObject) {
if (JsUtils.isElement((JavaScriptObject) args[0])) {
setElement((com.google.gwt.dom.client.Element) args[0]);
f(getElement(), i);
} else if (JsUt... | java | public void f(int i, Object... args) {
setIndex(i);
setArguments(args);
if (args.length == 1 && args[0] instanceof JavaScriptObject) {
if (JsUtils.isElement((JavaScriptObject) args[0])) {
setElement((com.google.gwt.dom.client.Element) args[0]);
f(getElement(), i);
} else if (JsUt... | [
"public",
"void",
"f",
"(",
"int",
"i",
",",
"Object",
"...",
"args",
")",
"{",
"setIndex",
"(",
"i",
")",
";",
"setArguments",
"(",
"args",
")",
";",
"if",
"(",
"args",
".",
"length",
"==",
"1",
"&&",
"args",
"[",
"0",
"]",
"instanceof",
"JavaSc... | Override this method for bound callbacks. | [
"Override",
"this",
"method",
"for",
"bound",
"callbacks",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L411-L425 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.f | public boolean f(Event e, Object... arg) {
setArguments(arg);
setEvent(e);
return f(e);
} | java | public boolean f(Event e, Object... arg) {
setArguments(arg);
setEvent(e);
return f(e);
} | [
"public",
"boolean",
"f",
"(",
"Event",
"e",
",",
"Object",
"...",
"arg",
")",
"{",
"setArguments",
"(",
"arg",
")",
";",
"setEvent",
"(",
"e",
")",
";",
"return",
"f",
"(",
"e",
")",
";",
"}"
] | Override this method for bound event handlers if you wish to deal with
per-handler user data.
@return boolean false means stop propagation and prevent default | [
"Override",
"this",
"method",
"for",
"bound",
"event",
"handlers",
"if",
"you",
"wish",
"to",
"deal",
"with",
"per",
"-",
"handler",
"user",
"data",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L433-L437 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | Function.f | public void f(Widget w) {
setElement(w.getElement());
if (loop) {
loop = false;
f();
} else {
f(w.getElement().<com.google.gwt.dom.client.Element> cast());
}
} | java | public void f(Widget w) {
setElement(w.getElement());
if (loop) {
loop = false;
f();
} else {
f(w.getElement().<com.google.gwt.dom.client.Element> cast());
}
} | [
"public",
"void",
"f",
"(",
"Widget",
"w",
")",
"{",
"setElement",
"(",
"w",
".",
"getElement",
"(",
")",
")",
";",
"if",
"(",
"loop",
")",
"{",
"loop",
"=",
"false",
";",
"f",
"(",
")",
";",
"}",
"else",
"{",
"f",
"(",
"w",
".",
"getElement"... | Override this for GQuery methods which take a callback, but do not expect a
return value, apply to a single widget.
NOTE: If your query has non-widget elements you might need to override
'public void f()' or 'public void f(Element e)' to handle these elements and
avoid a runtime exception. | [
"Override",
"this",
"for",
"GQuery",
"methods",
"which",
"take",
"a",
"callback",
"but",
"do",
"not",
"expect",
"a",
"return",
"value",
"apply",
"to",
"a",
"single",
"widget",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java#L490-L498 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java | Ajax.ajax | public static Promise ajax(Settings settings) {
resolveSettings(settings);
final Function onSuccess = settings.getSuccess();
if (onSuccess != null) {
onSuccess.setElement(settings.getContext());
}
final Function onError = settings.getError();
if (onError != null) {
onError.setEleme... | java | public static Promise ajax(Settings settings) {
resolveSettings(settings);
final Function onSuccess = settings.getSuccess();
if (onSuccess != null) {
onSuccess.setElement(settings.getContext());
}
final Function onError = settings.getError();
if (onError != null) {
onError.setEleme... | [
"public",
"static",
"Promise",
"ajax",
"(",
"Settings",
"settings",
")",
"{",
"resolveSettings",
"(",
"settings",
")",
";",
"final",
"Function",
"onSuccess",
"=",
"settings",
".",
"getSuccess",
"(",
")",
";",
"if",
"(",
"onSuccess",
"!=",
"null",
")",
"{",... | Perform an ajax request to the server.
Example:
<pre>
import static com.google.gwt.query.client.GQ.*
...
Properties properties = $$("dataType: xml, type: post; data: {q: 'gwt'}, headers: {X-Powered-By: GQuery}");
ajax("test.php", new Function() {
public void f() {
Element xmlElem = getData()[0];
System.out.println($(... | [
"Perform",
"an",
"ajax",
"request",
"to",
"the",
"server",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java#L162-L228 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java | JsCache.checkNull | public static final <T extends JavaScriptObject> T checkNull(T js) {
if (!GWT.isProdMode() && js == null) {
throw new NullPointerException();
}
return js;
} | java | public static final <T extends JavaScriptObject> T checkNull(T js) {
if (!GWT.isProdMode() && js == null) {
throw new NullPointerException();
}
return js;
} | [
"public",
"static",
"final",
"<",
"T",
"extends",
"JavaScriptObject",
">",
"T",
"checkNull",
"(",
"T",
"js",
")",
"{",
"if",
"(",
"!",
"GWT",
".",
"isProdMode",
"(",
")",
"&&",
"js",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
... | Throw a NPE when a js is null. | [
"Throw",
"a",
"NPE",
"when",
"a",
"js",
"is",
"null",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java#L259-L264 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.prop | public static <T> T prop(JavaScriptObject o, Object id, Class<? extends T> type) {
return o == null ? null : o.<JsCache> cast().get(id, type);
} | java | public static <T> T prop(JavaScriptObject o, Object id, Class<? extends T> type) {
return o == null ? null : o.<JsCache> cast().get(id, type);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"prop",
"(",
"JavaScriptObject",
"o",
",",
"Object",
"id",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"type",
")",
"{",
"return",
"o",
"==",
"null",
"?",
"null",
":",
"o",
".",
"<",
"JsCache",
">",
"cast"... | Returns a property present in a javascript object. | [
"Returns",
"a",
"property",
"present",
"in",
"a",
"javascript",
"object",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L211-L213 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.prop | public static void prop(JavaScriptObject o, Object id, Object val) {
if (o != null) {
o.<JsCache> cast().put(id, val);
}
} | java | public static void prop(JavaScriptObject o, Object id, Object val) {
if (o != null) {
o.<JsCache> cast().put(id, val);
}
} | [
"public",
"static",
"void",
"prop",
"(",
"JavaScriptObject",
"o",
",",
"Object",
"id",
",",
"Object",
"val",
")",
"{",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"o",
".",
"<",
"JsCache",
">",
"cast",
"(",
")",
".",
"put",
"(",
"id",
",",
"val",
"... | Set a property to a javascript object. | [
"Set",
"a",
"property",
"to",
"a",
"javascript",
"object",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L225-L229 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.exec | public static <T> T exec(JavaScriptObject jsFunction, Object... args) {
assert isFunction(jsFunction);
return jsni(jsFunction, "call", jsFunction, args);
} | java | public static <T> T exec(JavaScriptObject jsFunction, Object... args) {
assert isFunction(jsFunction);
return jsni(jsFunction, "call", jsFunction, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"exec",
"(",
"JavaScriptObject",
"jsFunction",
",",
"Object",
"...",
"args",
")",
"{",
"assert",
"isFunction",
"(",
"jsFunction",
")",
";",
"return",
"jsni",
"(",
"jsFunction",
",",
"\"call\"",
",",
"jsFunction",
","... | Execute a native javascript function. | [
"Execute",
"a",
"native",
"javascript",
"function",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L234-L237 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.export | public static void export(String name, Function f) {
export(GQuery.window, name, f);
} | java | public static void export(String name, Function f) {
export(GQuery.window, name, f);
} | [
"public",
"static",
"void",
"export",
"(",
"String",
"name",
",",
"Function",
"f",
")",
"{",
"export",
"(",
"GQuery",
".",
"window",
",",
"name",
",",
"f",
")",
";",
"}"
] | Assign a function to a property of the window object. | [
"Assign",
"a",
"function",
"to",
"a",
"property",
"of",
"the",
"window",
"object",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L242-L244 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.export | public static void export(JavaScriptObject o, String name, Function f) {
prop(o, name, (Object)(f != null ? wrapFunction(f) : null));
} | java | public static void export(JavaScriptObject o, String name, Function f) {
prop(o, name, (Object)(f != null ? wrapFunction(f) : null));
} | [
"public",
"static",
"void",
"export",
"(",
"JavaScriptObject",
"o",
",",
"String",
"name",
",",
"Function",
"f",
")",
"{",
"prop",
"(",
"o",
",",
"name",
",",
"(",
"Object",
")",
"(",
"f",
"!=",
"null",
"?",
"wrapFunction",
"(",
"f",
")",
":",
"nul... | Export a function as a property of a javascript object. | [
"Export",
"a",
"function",
"as",
"a",
"property",
"of",
"a",
"javascript",
"object",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L249-L251 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.copyNodeList | public static NodeList<Element> copyNodeList(NodeList<Element> oldNodes,
NodeList<Element> newNodes, boolean create) {
NodeList<Element> ret = oldNodes == null || create ? JsNodeArray.create()
: oldNodes;
JsCache idlist = JsCache.create();
for (int i = 0; oldNodes != null && i < oldNodes.getLe... | java | public static NodeList<Element> copyNodeList(NodeList<Element> oldNodes,
NodeList<Element> newNodes, boolean create) {
NodeList<Element> ret = oldNodes == null || create ? JsNodeArray.create()
: oldNodes;
JsCache idlist = JsCache.create();
for (int i = 0; oldNodes != null && i < oldNodes.getLe... | [
"public",
"static",
"NodeList",
"<",
"Element",
">",
"copyNodeList",
"(",
"NodeList",
"<",
"Element",
">",
"oldNodes",
",",
"NodeList",
"<",
"Element",
">",
"newNodes",
",",
"boolean",
"create",
")",
"{",
"NodeList",
"<",
"Element",
">",
"ret",
"=",
"oldNo... | Merge the oldNodes list into the newNodes one. If oldNodes is null, a new
list will be created and returned. If oldNodes is not null, a new list will
be created depending on the create flag. | [
"Merge",
"the",
"oldNodes",
"list",
"into",
"the",
"newNodes",
"one",
".",
"If",
"oldNodes",
"is",
"null",
"a",
"new",
"list",
"will",
"be",
"created",
"and",
"returned",
".",
"If",
"oldNodes",
"is",
"not",
"null",
"a",
"new",
"list",
"will",
"be",
"cr... | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L268-L287 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.getOwnerDocument | public static Document getOwnerDocument(Node n) {
return n == null || !isElement(n) ? null : n.getNodeType() == Node.DOCUMENT_NODE
? n.<Document> cast() : n.getOwnerDocument();
} | java | public static Document getOwnerDocument(Node n) {
return n == null || !isElement(n) ? null : n.getNodeType() == Node.DOCUMENT_NODE
? n.<Document> cast() : n.getOwnerDocument();
} | [
"public",
"static",
"Document",
"getOwnerDocument",
"(",
"Node",
"n",
")",
"{",
"return",
"n",
"==",
"null",
"||",
"!",
"isElement",
"(",
"n",
")",
"?",
"null",
":",
"n",
".",
"getNodeType",
"(",
")",
"==",
"Node",
".",
"DOCUMENT_NODE",
"?",
"n",
"."... | Returns the owner document element of an element. | [
"Returns",
"the",
"owner",
"document",
"element",
"of",
"an",
"element",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L315-L318 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.isDetached | public static boolean isDetached(Node n) {
assert n != null;
if ("html".equalsIgnoreCase(n.getNodeName())) {
return false;
}
return !getOwnerDocument(n).getBody().isOrHasChild(n);
} | java | public static boolean isDetached(Node n) {
assert n != null;
if ("html".equalsIgnoreCase(n.getNodeName())) {
return false;
}
return !getOwnerDocument(n).getBody().isOrHasChild(n);
} | [
"public",
"static",
"boolean",
"isDetached",
"(",
"Node",
"n",
")",
"{",
"assert",
"n",
"!=",
"null",
";",
"if",
"(",
"\"html\"",
".",
"equalsIgnoreCase",
"(",
"n",
".",
"getNodeName",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"... | Return whether a node is detached to the DOM.
Be careful : This method works only on node that should be inserted within the body node. | [
"Return",
"whether",
"a",
"node",
"is",
"detached",
"to",
"the",
"DOM",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L384-L392 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.isXML | public static boolean isXML(Node o) {
return o == null ? false
: !"HTML".equals(getOwnerDocument(o).getDocumentElement().getNodeName());
} | java | public static boolean isXML(Node o) {
return o == null ? false
: !"HTML".equals(getOwnerDocument(o).getDocumentElement().getNodeName());
} | [
"public",
"static",
"boolean",
"isXML",
"(",
"Node",
"o",
")",
"{",
"return",
"o",
"==",
"null",
"?",
"false",
":",
"!",
"\"HTML\"",
".",
"equals",
"(",
"getOwnerDocument",
"(",
"o",
")",
".",
"getDocumentElement",
"(",
")",
".",
"getNodeName",
"(",
")... | Check if an element is a DOM or a XML node. | [
"Check",
"if",
"an",
"element",
"is",
"a",
"DOM",
"or",
"a",
"XML",
"node",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L434-L437 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.parseJSON | public static Properties parseJSON(String json) {
try {
return utilsImpl.parseJSON(json);
} catch (Exception e) {
if (!GWT.isProdMode()) {
System.err.println("Error while parsing json: " + e.getMessage() + ".\n" + json);
}
return Properties.create();
}
} | java | public static Properties parseJSON(String json) {
try {
return utilsImpl.parseJSON(json);
} catch (Exception e) {
if (!GWT.isProdMode()) {
System.err.println("Error while parsing json: " + e.getMessage() + ".\n" + json);
}
return Properties.create();
}
} | [
"public",
"static",
"Properties",
"parseJSON",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"return",
"utilsImpl",
".",
"parseJSON",
"(",
"json",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"!",
"GWT",
".",
"isProdMode",
"(",
... | Parses a json string returning a Object with useful method to get the
content. | [
"Parses",
"a",
"json",
"string",
"returning",
"a",
"Object",
"with",
"useful",
"method",
"to",
"get",
"the",
"content",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L474-L483 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.jsni | public static <T> T jsni(JavaScriptObject jso, String meth, Object... args) {
return runJavascriptFunction(jso, meth, args);
} | java | public static <T> T jsni(JavaScriptObject jso, String meth, Object... args) {
return runJavascriptFunction(jso, meth, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"jsni",
"(",
"JavaScriptObject",
"jso",
",",
"String",
"meth",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"runJavascriptFunction",
"(",
"jso",
",",
"meth",
",",
"args",
")",
";",
"}"
] | Call any arbitrary function present in a Javascript object.
It checks the existence of the function and object hierarchy before executing it.
It's very useful in order to avoid writing jsni blocks for very simple snippets.
Note that GWT 3.0 jsinterop will come with a method similar, so we might deprecate
this in the f... | [
"Call",
"any",
"arbitrary",
"function",
"present",
"in",
"a",
"Javascript",
"object",
".",
"It",
"checks",
"the",
"existence",
"of",
"the",
"function",
"and",
"object",
"hierarchy",
"before",
"executing",
"it",
".",
"It",
"s",
"very",
"useful",
"in",
"order"... | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L538-L540 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.jsni | public static <T> T jsni(String meth, Object... args) {
return runJavascriptFunction(null, meth, args);
} | java | public static <T> T jsni(String meth, Object... args) {
return runJavascriptFunction(null, meth, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"jsni",
"(",
"String",
"meth",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"runJavascriptFunction",
"(",
"null",
",",
"meth",
",",
"args",
")",
";",
"}"
] | Run any arbitrary function in javascript scope using the window as the base object.
It checks the existence of the function and object hierarchy before executing it.
It's very useful in order to avoid writing jsni blocks for very simple snippets.
Note that GWT 3.0 jsinterop will come with a method similar, so we might... | [
"Run",
"any",
"arbitrary",
"function",
"in",
"javascript",
"scope",
"using",
"the",
"window",
"as",
"the",
"base",
"object",
".",
"It",
"checks",
"the",
"existence",
"of",
"the",
"function",
"and",
"object",
"hierarchy",
"before",
"executing",
"it",
".",
"It... | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L566-L568 | train |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.runJavascriptFunction | public static <T> T runJavascriptFunction(JavaScriptObject o, String meth, Object... args) {
return runJavascriptFunctionImpl(o, meth, JsObjectArray.create().add(args).<JsArrayMixed>cast());
} | java | public static <T> T runJavascriptFunction(JavaScriptObject o, String meth, Object... args) {
return runJavascriptFunctionImpl(o, meth, JsObjectArray.create().add(args).<JsArrayMixed>cast());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"runJavascriptFunction",
"(",
"JavaScriptObject",
"o",
",",
"String",
"meth",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"runJavascriptFunctionImpl",
"(",
"o",
",",
"meth",
",",
"JsObjectArray",
".",
"create",
"... | Call via jsni any arbitrary function present in a Javascript object.
It's thought for avoiding to create jsni methods to call external functions and
facilitate the writing of js wrappers.
Example
<pre>
// Create a svg node in our document.
Element svg = runJavascriptFunction(document, "createElementNS", "http://www.w... | [
"Call",
"via",
"jsni",
"any",
"arbitrary",
"function",
"present",
"in",
"a",
"Javascript",
"object",
"."
] | 93e02bc8eb030081061c56134ebee1f585981107 | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L593-L595 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.