id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
117,000 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/SuperclassIterable.java | SuperclassIterable.of | public static <T> SuperclassIterable<T> of(Class<T> type) {
return new SuperclassIterable<>(type, false);
} | java | public static <T> SuperclassIterable<T> of(Class<T> type) {
return new SuperclassIterable<>(type, false);
} | [
"public",
"static",
"<",
"T",
">",
"SuperclassIterable",
"<",
"T",
">",
"of",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"new",
"SuperclassIterable",
"<>",
"(",
"type",
",",
"false",
")",
";",
"}"
] | Factory method for a SuperlcassIterator that iterates over type's
superclasses, excluding itself and excluding Object.
@param type The class over whose superclasses to iterate.
@param <T> Type parameter for type.
@return A SuperclassIterator. | [
"Factory",
"method",
"for",
"a",
"SuperlcassIterator",
"that",
"iterates",
"over",
"type",
"s",
"superclasses",
"excluding",
"itself",
"and",
"excluding",
"Object",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/SuperclassIterable.java#L31-L33 |
117,001 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/SuperclassIterable.java | SuperclassIterable.ofIncludeSelf | public static <T> SuperclassIterable<T> ofIncludeSelf(Class<T> type) {
return new SuperclassIterable<>(type, true);
} | java | public static <T> SuperclassIterable<T> ofIncludeSelf(Class<T> type) {
return new SuperclassIterable<>(type, true);
} | [
"public",
"static",
"<",
"T",
">",
"SuperclassIterable",
"<",
"T",
">",
"ofIncludeSelf",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"new",
"SuperclassIterable",
"<>",
"(",
"type",
",",
"true",
")",
";",
"}"
] | Factory method for a SuperlcassIterator that iterates over type's
superclasses, including itself but excluding Object.
@param type The class over whose superclasses to iterate.
@param <T> Type parameter for type.
@return A SuperclassIterator. | [
"Factory",
"method",
"for",
"a",
"SuperlcassIterator",
"that",
"iterates",
"over",
"type",
"s",
"superclasses",
"including",
"itself",
"but",
"excluding",
"Object",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/SuperclassIterable.java#L43-L45 |
117,002 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/EqualsVerifier.java | EqualsVerifier.forRelaxedEqualExamples | @SafeVarargs
public static <T> RelaxedEqualsVerifierApi<T> forRelaxedEqualExamples(T first, T second, T... more) {
List<T> examples = ListBuilders.buildListOfAtLeastTwo(first, second, more);
@SuppressWarnings("unchecked")
Class<T> type = (Class<T>)first.getClass();
return new Relax... | java | @SafeVarargs
public static <T> RelaxedEqualsVerifierApi<T> forRelaxedEqualExamples(T first, T second, T... more) {
List<T> examples = ListBuilders.buildListOfAtLeastTwo(first, second, more);
@SuppressWarnings("unchecked")
Class<T> type = (Class<T>)first.getClass();
return new Relax... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"RelaxedEqualsVerifierApi",
"<",
"T",
">",
"forRelaxedEqualExamples",
"(",
"T",
"first",
",",
"T",
"second",
",",
"T",
"...",
"more",
")",
"{",
"List",
"<",
"T",
">",
"examples",
"=",
"ListBuilders",
... | Factory method. Asks for a list of equal, but not identical, instances
of T.
For use when T is a class which has relaxed equality
rules. This happens when two instances of T are equal even though the
its internal state is different.
This could happen, for example, in a Rational class that doesn't
normalize: new Ratio... | [
"Factory",
"method",
".",
"Asks",
"for",
"a",
"list",
"of",
"equal",
"but",
"not",
"identical",
"instances",
"of",
"T",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/EqualsVerifier.java#L85-L93 |
117,003 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java | FieldAccessor.get | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "Only called in test code, not production.")
public Object get() {
field.setAccessible(true);
try {
return field.get(object);
}
catch (IllegalAccessException e) {
throw new ReflectionExc... | java | @SuppressFBWarnings(value = "DP_DO_INSIDE_DO_PRIVILEGED", justification = "Only called in test code, not production.")
public Object get() {
field.setAccessible(true);
try {
return field.get(object);
}
catch (IllegalAccessException e) {
throw new ReflectionExc... | [
"@",
"SuppressFBWarnings",
"(",
"value",
"=",
"\"DP_DO_INSIDE_DO_PRIVILEGED\"",
",",
"justification",
"=",
"\"Only called in test code, not production.\"",
")",
"public",
"Object",
"get",
"(",
")",
"{",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"try",
"{... | Tries to get the field's value.
@return The field's value.
@throws ReflectionException If the operation fails. | [
"Tries",
"to",
"get",
"the",
"field",
"s",
"value",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java#L99-L108 |
117,004 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java | FieldAccessor.copyTo | public void copyTo(Object to) {
modify(() -> field.set(to, field.get(object)), false);
} | java | public void copyTo(Object to) {
modify(() -> field.set(to, field.get(object)), false);
} | [
"public",
"void",
"copyTo",
"(",
"Object",
"to",
")",
"{",
"modify",
"(",
"(",
")",
"->",
"field",
".",
"set",
"(",
"to",
",",
"field",
".",
"get",
"(",
"object",
")",
")",
",",
"false",
")",
";",
"}"
] | Copies field's value to the corresponding field in the specified object.
Ignores static fields and fields that can't be modified reflectively.
@param to The object into which to copy the field.
@throws ReflectionException If the operation fails. | [
"Copies",
"field",
"s",
"value",
"to",
"the",
"corresponding",
"field",
"in",
"the",
"specified",
"object",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java#L182-L184 |
117,005 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java | FieldAccessor.changeField | public void changeField(PrefabValues prefabValues, TypeTag enclosingType) {
modify(() -> {
Object newValue = prefabValues.giveOther(TypeTag.of(field, enclosingType), field.get(object));
field.set(object, newValue);
}, false);
} | java | public void changeField(PrefabValues prefabValues, TypeTag enclosingType) {
modify(() -> {
Object newValue = prefabValues.giveOther(TypeTag.of(field, enclosingType), field.get(object));
field.set(object, newValue);
}, false);
} | [
"public",
"void",
"changeField",
"(",
"PrefabValues",
"prefabValues",
",",
"TypeTag",
"enclosingType",
")",
"{",
"modify",
"(",
"(",
")",
"->",
"{",
"Object",
"newValue",
"=",
"prefabValues",
".",
"giveOther",
"(",
"TypeTag",
".",
"of",
"(",
"field",
",",
... | Changes the field's value to something else. The new value will never be
null. Other than that, the precise value is undefined.
Ignores static fields and fields that can't be modified reflectively.
@param prefabValues If the field is of a type contained within
prefabValues, the new value will be taken from it.
@param... | [
"Changes",
"the",
"field",
"s",
"value",
"to",
"something",
"else",
".",
"The",
"new",
"value",
"will",
"never",
"be",
"null",
".",
"Other",
"than",
"that",
"the",
"precise",
"value",
"is",
"undefined",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java#L198-L203 |
117,006 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java | FieldAccessor.canBeModifiedReflectively | public boolean canBeModifiedReflectively() {
if (field.isSynthetic()) {
return false;
}
int modifiers = field.getModifiers();
if (Modifier.isFinal(modifiers) && Modifier.isStatic(modifiers)) {
return false;
}
return true;
} | java | public boolean canBeModifiedReflectively() {
if (field.isSynthetic()) {
return false;
}
int modifiers = field.getModifiers();
if (Modifier.isFinal(modifiers) && Modifier.isStatic(modifiers)) {
return false;
}
return true;
} | [
"public",
"boolean",
"canBeModifiedReflectively",
"(",
")",
"{",
"if",
"(",
"field",
".",
"isSynthetic",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"int",
"modifiers",
"=",
"field",
".",
"getModifiers",
"(",
")",
";",
"if",
"(",
"Modifier",
".",
... | Determines whether the field can be modified using reflection.
@return Whether or not the field can be modified reflectively. | [
"Determines",
"whether",
"the",
"field",
"can",
"be",
"modified",
"using",
"reflection",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java#L232-L241 |
117,007 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/EqualsVerifierApi.java | EqualsVerifierApi.withIgnoredAnnotations | public EqualsVerifierApi<T> withIgnoredAnnotations(Class<?>... annotations) {
Validations.validateGivenAnnotations(annotations);
for (Class<?> ignoredAnnotation : annotations) {
ignoredAnnotationClassNames.add(ignoredAnnotation.getCanonicalName());
}
return this;
} | java | public EqualsVerifierApi<T> withIgnoredAnnotations(Class<?>... annotations) {
Validations.validateGivenAnnotations(annotations);
for (Class<?> ignoredAnnotation : annotations) {
ignoredAnnotationClassNames.add(ignoredAnnotation.getCanonicalName());
}
return this;
} | [
"public",
"EqualsVerifierApi",
"<",
"T",
">",
"withIgnoredAnnotations",
"(",
"Class",
"<",
"?",
">",
"...",
"annotations",
")",
"{",
"Validations",
".",
"validateGivenAnnotations",
"(",
"annotations",
")",
";",
"for",
"(",
"Class",
"<",
"?",
">",
"ignoredAnnot... | Signals that all given annotations are to be ignored by EqualsVerifier.
For instance, EqualsVerifier normally doesn't perform null verifications
on fields marked with an {@code @Nonnull} annotation. However, if this
method is called with a {@code Nonnull.class} parameter, the null
verifications will be performed after... | [
"Signals",
"that",
"all",
"given",
"annotations",
"are",
"to",
"be",
"ignored",
"by",
"EqualsVerifier",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/EqualsVerifierApi.java#L213-L219 |
117,008 | jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/util/Formatter.java | Formatter.format | public String format() {
String result = message;
for (Object object : objects) {
String s = result.replaceFirst("%%", Matcher.quoteReplacement(stringify(object)));
if (result.equals(s)) {
throw new IllegalStateException("Too many parameters");
}
... | java | public String format() {
String result = message;
for (Object object : objects) {
String s = result.replaceFirst("%%", Matcher.quoteReplacement(stringify(object)));
if (result.equals(s)) {
throw new IllegalStateException("Too many parameters");
}
... | [
"public",
"String",
"format",
"(",
")",
"{",
"String",
"result",
"=",
"message",
";",
"for",
"(",
"Object",
"object",
":",
"objects",
")",
"{",
"String",
"s",
"=",
"result",
".",
"replaceFirst",
"(",
"\"%%\"",
",",
"Matcher",
".",
"quoteReplacement",
"("... | Formats the message with the given objects.
@return The message, with the given objects's string representations
inserted into it.
@throws IllegalStateException if the number of %%'s in the message does
not match the number of objects. | [
"Formats",
"the",
"message",
"with",
"the",
"given",
"objects",
"."
] | 25d73c9cb801c8b20b257d1d1283ac6e0585ef1d | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/util/Formatter.java#L54-L67 |
117,009 | johncarl81/parceler | parceler-api/src/main/java/org/parceler/InjectionUtil.java | InjectionUtil.callConstructor | public static <T> T callConstructor(Class<T> targetClass, Class[] argClasses, Object[] args) {
T output;
try {
Constructor classConstructor = targetClass.getDeclaredConstructor(argClasses);
output = AccessController.doPrivileged(
new SetConstructorPrivileged... | java | public static <T> T callConstructor(Class<T> targetClass, Class[] argClasses, Object[] args) {
T output;
try {
Constructor classConstructor = targetClass.getDeclaredConstructor(argClasses);
output = AccessController.doPrivileged(
new SetConstructorPrivileged... | [
"public",
"static",
"<",
"T",
">",
"T",
"callConstructor",
"(",
"Class",
"<",
"T",
">",
"targetClass",
",",
"Class",
"[",
"]",
"argClasses",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"T",
"output",
";",
"try",
"{",
"Constructor",
"classConstructor",
"... | Instantiates a class by calling the constructor.
@param targetClass instance type to construct
@param argClasses argument types accepted by the constructor
@param args constructor argument values
@param <T> relating type parameter
@return instance created by constructor | [
"Instantiates",
"a",
"class",
"by",
"calling",
"the",
"constructor",
"."
] | 39624b2b71e2f06e1c556e9d9d198afb9a705912 | https://github.com/johncarl81/parceler/blob/39624b2b71e2f06e1c556e9d9d198afb9a705912/parceler-api/src/main/java/org/parceler/InjectionUtil.java#L190-L207 |
117,010 | johncarl81/parceler | parceler-api/src/main/java/org/parceler/MapsUtil.java | MapsUtil.initialHashMapCapacity | public static int initialHashMapCapacity(int expectedSize) {
if (expectedSize < 0) {
throw new ParcelerRuntimeException("Expected size must be non-negative");
}
if (expectedSize < 3) {
return expectedSize + 1;
}
if (expectedSize < MAX_POWER_OF_TWO) {
... | java | public static int initialHashMapCapacity(int expectedSize) {
if (expectedSize < 0) {
throw new ParcelerRuntimeException("Expected size must be non-negative");
}
if (expectedSize < 3) {
return expectedSize + 1;
}
if (expectedSize < MAX_POWER_OF_TWO) {
... | [
"public",
"static",
"int",
"initialHashMapCapacity",
"(",
"int",
"expectedSize",
")",
"{",
"if",
"(",
"expectedSize",
"<",
"0",
")",
"{",
"throw",
"new",
"ParcelerRuntimeException",
"(",
"\"Expected size must be non-negative\"",
")",
";",
"}",
"if",
"(",
"expected... | Copy of capacity method from Guava Maps utility.
Returns a capacity that is sufficient to keep the map from being resized as long as it grows no
larger than expectedSize and the load factor is ≥ its default (0.75).
@param expectedSize
@return HashMap capacity that avoids rehashing. | [
"Copy",
"of",
"capacity",
"method",
"from",
"Guava",
"Maps",
"utility",
"."
] | 39624b2b71e2f06e1c556e9d9d198afb9a705912 | https://github.com/johncarl81/parceler/blob/39624b2b71e2f06e1c556e9d9d198afb9a705912/parceler-api/src/main/java/org/parceler/MapsUtil.java#L40-L54 |
117,011 | jirutka/spring-rest-exception-handler | src/main/java/cz/jirutka/spring/exhandler/RestHandlerExceptionResolverBuilder.java | RestHandlerExceptionResolverBuilder.defaultContentType | public RestHandlerExceptionResolverBuilder defaultContentType(String mediaType) {
defaultContentType( hasText(mediaType) ? MediaType.parseMediaType(mediaType) : null );
return this;
} | java | public RestHandlerExceptionResolverBuilder defaultContentType(String mediaType) {
defaultContentType( hasText(mediaType) ? MediaType.parseMediaType(mediaType) : null );
return this;
} | [
"public",
"RestHandlerExceptionResolverBuilder",
"defaultContentType",
"(",
"String",
"mediaType",
")",
"{",
"defaultContentType",
"(",
"hasText",
"(",
"mediaType",
")",
"?",
"MediaType",
".",
"parseMediaType",
"(",
"mediaType",
")",
":",
"null",
")",
";",
"return",... | The default content type that will be used as a fallback when the requested content type is
not supported. | [
"The",
"default",
"content",
"type",
"that",
"will",
"be",
"used",
"as",
"a",
"fallback",
"when",
"the",
"requested",
"content",
"type",
"is",
"not",
"supported",
"."
] | f171956e59fe866f1a853c7d38444f136acc7a3b | https://github.com/jirutka/spring-rest-exception-handler/blob/f171956e59fe866f1a853c7d38444f136acc7a3b/src/main/java/cz/jirutka/spring/exhandler/RestHandlerExceptionResolverBuilder.java#L174-L177 |
117,012 | jirutka/spring-rest-exception-handler | src/main/java/cz/jirutka/spring/exhandler/RestHandlerExceptionResolverBuilder.java | RestHandlerExceptionResolverBuilder.addHandler | public <E extends Exception> RestHandlerExceptionResolverBuilder addHandler(
Class<? extends E> exceptionClass, RestExceptionHandler<E, ?> exceptionHandler) {
exceptionHandlers.put(exceptionClass, exceptionHandler);
return this;
} | java | public <E extends Exception> RestHandlerExceptionResolverBuilder addHandler(
Class<? extends E> exceptionClass, RestExceptionHandler<E, ?> exceptionHandler) {
exceptionHandlers.put(exceptionClass, exceptionHandler);
return this;
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"RestHandlerExceptionResolverBuilder",
"addHandler",
"(",
"Class",
"<",
"?",
"extends",
"E",
">",
"exceptionClass",
",",
"RestExceptionHandler",
"<",
"E",
",",
"?",
">",
"exceptionHandler",
")",
"{",
"exceptionHandl... | Registers the given exception handler for the specified exception type. This handler will be
also used for all the exception subtypes, when no more specific mapping is found.
@param exceptionClass The exception type handled by the given handler.
@param exceptionHandler An instance of the exception handler for the spec... | [
"Registers",
"the",
"given",
"exception",
"handler",
"for",
"the",
"specified",
"exception",
"type",
".",
"This",
"handler",
"will",
"be",
"also",
"used",
"for",
"all",
"the",
"exception",
"subtypes",
"when",
"no",
"more",
"specific",
"mapping",
"is",
"found",... | f171956e59fe866f1a853c7d38444f136acc7a3b | https://github.com/jirutka/spring-rest-exception-handler/blob/f171956e59fe866f1a853c7d38444f136acc7a3b/src/main/java/cz/jirutka/spring/exhandler/RestHandlerExceptionResolverBuilder.java#L187-L192 |
117,013 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java | Ghprb.getSkipBuildPhrases | public Set<String> getSkipBuildPhrases() {
return new HashSet<String>(Arrays.asList(getTrigger().getSkipBuildPhrase().split("[\\r\\n]+")));
} | java | public Set<String> getSkipBuildPhrases() {
return new HashSet<String>(Arrays.asList(getTrigger().getSkipBuildPhrase().split("[\\r\\n]+")));
} | [
"public",
"Set",
"<",
"String",
">",
"getSkipBuildPhrases",
"(",
")",
"{",
"return",
"new",
"HashSet",
"<",
"String",
">",
"(",
"Arrays",
".",
"asList",
"(",
"getTrigger",
"(",
")",
".",
"getSkipBuildPhrase",
"(",
")",
".",
"split",
"(",
"\"[\\\\r\\\\n]+\"... | Returns skip build phrases from Jenkins global configuration
@return skip build phrases | [
"Returns",
"skip",
"build",
"phrases",
"from",
"Jenkins",
"global",
"configuration"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java#L117-L119 |
117,014 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java | Ghprb.checkBlackListCommitAuthor | public String checkBlackListCommitAuthor(String author) {
Set<String> authors = getBlacklistedCommitAuthors();
authors.remove("");
Map<Pattern, String> skipPatterns = new HashMap<Pattern, String>();
for (String s : authors) {
s = s.trim();
if (compilePattern(s).m... | java | public String checkBlackListCommitAuthor(String author) {
Set<String> authors = getBlacklistedCommitAuthors();
authors.remove("");
Map<Pattern, String> skipPatterns = new HashMap<Pattern, String>();
for (String s : authors) {
s = s.trim();
if (compilePattern(s).m... | [
"public",
"String",
"checkBlackListCommitAuthor",
"(",
"String",
"author",
")",
"{",
"Set",
"<",
"String",
">",
"authors",
"=",
"getBlacklistedCommitAuthors",
"(",
")",
";",
"authors",
".",
"remove",
"(",
"\"\"",
")",
";",
"Map",
"<",
"Pattern",
",",
"String... | Checks for skip build commit author.
@param author The GitHub commit author
@return the skip sender or null if should not skip | [
"Checks",
"for",
"skip",
"build",
"commit",
"author",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java#L131-L143 |
117,015 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java | Ghprb.checkSkipBuildPhrase | public String checkSkipBuildPhrase(GHIssue issue) {
Set<String> skipBuildPhrases = getSkipBuildPhrases();
skipBuildPhrases.remove("");
Map<Pattern, String> skipPatterns = new HashMap<Pattern, String>();
for (String skipBuildPhrase : skipBuildPhrases) {
skipBuildPhrase = skip... | java | public String checkSkipBuildPhrase(GHIssue issue) {
Set<String> skipBuildPhrases = getSkipBuildPhrases();
skipBuildPhrases.remove("");
Map<Pattern, String> skipPatterns = new HashMap<Pattern, String>();
for (String skipBuildPhrase : skipBuildPhrases) {
skipBuildPhrase = skip... | [
"public",
"String",
"checkSkipBuildPhrase",
"(",
"GHIssue",
"issue",
")",
"{",
"Set",
"<",
"String",
">",
"skipBuildPhrases",
"=",
"getSkipBuildPhrases",
"(",
")",
";",
"skipBuildPhrases",
".",
"remove",
"(",
"\"\"",
")",
";",
"Map",
"<",
"Pattern",
",",
"St... | Checks for skip build phrase in pull request title and body. If present it updates shouldRun as false.
@param issue The GitHub issue
@return the skip phrase or null if should not skip | [
"Checks",
"for",
"skip",
"build",
"phrase",
"in",
"pull",
"request",
"title",
"and",
"body",
".",
"If",
"present",
"it",
"updates",
"shouldRun",
"as",
"false",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java#L151-L175 |
117,016 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java | Ghprb.checkSkipBuildInString | private String checkSkipBuildInString(Map<Pattern, String> patterns, String string) {
// check for skip build phrase in the passed string
if (!patterns.isEmpty() && StringUtils.isNotBlank(string)) {
for (Map.Entry<Pattern, String> e : patterns.entrySet()) {
if (e.getKey().mat... | java | private String checkSkipBuildInString(Map<Pattern, String> patterns, String string) {
// check for skip build phrase in the passed string
if (!patterns.isEmpty() && StringUtils.isNotBlank(string)) {
for (Map.Entry<Pattern, String> e : patterns.entrySet()) {
if (e.getKey().mat... | [
"private",
"String",
"checkSkipBuildInString",
"(",
"Map",
"<",
"Pattern",
",",
"String",
">",
"patterns",
",",
"String",
"string",
")",
"{",
"// check for skip build phrase in the passed string",
"if",
"(",
"!",
"patterns",
".",
"isEmpty",
"(",
")",
"&&",
"String... | Checks for skip pattern in the passed string
@param patterns The map of Patter to String values
@param string The string we're looking for the phrase in
@return the skip value or null if we don't find it | [
"Checks",
"for",
"skip",
"pattern",
"in",
"the",
"passed",
"string"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java#L184-L194 |
117,017 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatusListener.java | GhprbUpstreamStatusListener.returnEnvironmentVars | private Map<String, String> returnEnvironmentVars(AbstractBuild<?, ?> build, TaskListener listener) {
Map<String, String> envVars = Ghprb.getEnvVars(build, listener);
if (!envVars.containsKey("ghprbUpstreamStatus")) {
return null;
}
GhprbGitHubAuth auth = GhprbTrigger.getDs... | java | private Map<String, String> returnEnvironmentVars(AbstractBuild<?, ?> build, TaskListener listener) {
Map<String, String> envVars = Ghprb.getEnvVars(build, listener);
if (!envVars.containsKey("ghprbUpstreamStatus")) {
return null;
}
GhprbGitHubAuth auth = GhprbTrigger.getDs... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"returnEnvironmentVars",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
",",
"TaskListener",
"listener",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"envVars",
"=",
"Ghprb",
".",
"getE... | Gets all the custom env vars needed to send information to GitHub | [
"Gets",
"all",
"the",
"custom",
"env",
"vars",
"needed",
"to",
"send",
"information",
"to",
"GitHub"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatusListener.java#L41-L60 |
117,018 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatusListener.java | GhprbUpstreamStatusListener.setUpEnvironment | @Override
public Environment setUpEnvironment(@SuppressWarnings("rawtypes") AbstractBuild build, Launcher launcher, BuildListener listener) {
Map<String, String> envVars = returnEnvironmentVars(build, listener);
if (envVars != null) {
LOGGER.log(Level.FINE, "Job: " + build.getFullDisplay... | java | @Override
public Environment setUpEnvironment(@SuppressWarnings("rawtypes") AbstractBuild build, Launcher launcher, BuildListener listener) {
Map<String, String> envVars = returnEnvironmentVars(build, listener);
if (envVars != null) {
LOGGER.log(Level.FINE, "Job: " + build.getFullDisplay... | [
"@",
"Override",
"public",
"Environment",
"setUpEnvironment",
"(",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"AbstractBuild",
"build",
",",
"Launcher",
"launcher",
",",
"BuildListener",
"listener",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"en... | Sets the status as pending when the job starts and then calls the createCommitStatus method to send it to GitHub | [
"Sets",
"the",
"status",
"as",
"pending",
"when",
"the",
"job",
"starts",
"and",
"then",
"calls",
"the",
"createCommitStatus",
"method",
"to",
"send",
"it",
"to",
"GitHub"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatusListener.java#L83-L98 |
117,019 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatusListener.java | GhprbUpstreamStatusListener.onCompleted | @Override
public void onCompleted(AbstractBuild<?, ?> build, TaskListener listener) {
Map<String, String> envVars = returnEnvironmentVars(build, listener);
if (envVars == null) {
return;
}
try {
returnGhprbSimpleStatus(envVars).onBuildComplete(build, listener... | java | @Override
public void onCompleted(AbstractBuild<?, ?> build, TaskListener listener) {
Map<String, String> envVars = returnEnvironmentVars(build, listener);
if (envVars == null) {
return;
}
try {
returnGhprbSimpleStatus(envVars).onBuildComplete(build, listener... | [
"@",
"Override",
"public",
"void",
"onCompleted",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
",",
"TaskListener",
"listener",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"envVars",
"=",
"returnEnvironmentVars",
"(",
"build",
",",
"list... | Sets the status to the build result when the job is done, and then calls the createCommitStatus method to send it to GitHub | [
"Sets",
"the",
"status",
"to",
"the",
"build",
"result",
"when",
"the",
"job",
"is",
"done",
"and",
"then",
"calls",
"the",
"createCommitStatus",
"method",
"to",
"send",
"it",
"to",
"GitHub"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatusListener.java#L115-L127 |
117,020 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/manager/impl/downstreambuilds/BuildFlowBuildManager.java | BuildFlowBuildManager.calculateBuildUrl | @SuppressWarnings("unchecked")
@Override
public String calculateBuildUrl(String publishedURL) {
Iterator<JobInvocation> iterator = (Iterator<JobInvocation>) downstreamProjects();
StringBuilder sb = new StringBuilder();
while (iterator.hasNext()) {
JobInvocation jobInvocatio... | java | @SuppressWarnings("unchecked")
@Override
public String calculateBuildUrl(String publishedURL) {
Iterator<JobInvocation> iterator = (Iterator<JobInvocation>) downstreamProjects();
StringBuilder sb = new StringBuilder();
while (iterator.hasNext()) {
JobInvocation jobInvocatio... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"String",
"calculateBuildUrl",
"(",
"String",
"publishedURL",
")",
"{",
"Iterator",
"<",
"JobInvocation",
">",
"iterator",
"=",
"(",
"Iterator",
"<",
"JobInvocation",
">",
")",
"downs... | Calculate the build URL of a build of BuildFlow type, traversing its downstream builds graph
@return the build URL of a BuildFlow build, with all its downstream builds | [
"Calculate",
"the",
"build",
"URL",
"of",
"a",
"build",
"of",
"BuildFlow",
"type",
"traversing",
"its",
"downstream",
"builds",
"graph"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/manager/impl/downstreambuilds/BuildFlowBuildManager.java#L35-L54 |
117,021 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/manager/impl/downstreambuilds/BuildFlowBuildManager.java | BuildFlowBuildManager.downstreamProjects | @Override
public Iterator<?> downstreamProjects() {
FlowRun flowRun = (FlowRun) build;
DirectedGraph<JobInvocation, FlowRun.JobEdge> directedGraph = flowRun.getJobsGraph();
return directedGraph.vertexSet().iterator();
} | java | @Override
public Iterator<?> downstreamProjects() {
FlowRun flowRun = (FlowRun) build;
DirectedGraph<JobInvocation, FlowRun.JobEdge> directedGraph = flowRun.getJobsGraph();
return directedGraph.vertexSet().iterator();
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"?",
">",
"downstreamProjects",
"(",
")",
"{",
"FlowRun",
"flowRun",
"=",
"(",
"FlowRun",
")",
"build",
";",
"DirectedGraph",
"<",
"JobInvocation",
",",
"FlowRun",
".",
"JobEdge",
">",
"directedGraph",
"=",
"flowRu... | Return a downstream iterator of a build of default type. This will be overriden by specific build types.
@return the downstream builds as an iterator | [
"Return",
"a",
"downstream",
"iterator",
"of",
"a",
"build",
"of",
"default",
"type",
".",
"This",
"will",
"be",
"overriden",
"by",
"specific",
"build",
"types",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/manager/impl/downstreambuilds/BuildFlowBuildManager.java#L61-L68 |
117,022 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java | GhprbExtensionContext.commitStatus | void commitStatus(Runnable closure) {
GhprbSimpleStatusContext context = new GhprbSimpleStatusContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbSimpleStatus(
context.showMatrixStatus,
context.context,
con... | java | void commitStatus(Runnable closure) {
GhprbSimpleStatusContext context = new GhprbSimpleStatusContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbSimpleStatus(
context.showMatrixStatus,
context.context,
con... | [
"void",
"commitStatus",
"(",
"Runnable",
"closure",
")",
"{",
"GhprbSimpleStatusContext",
"context",
"=",
"new",
"GhprbSimpleStatusContext",
"(",
")",
";",
"ContextExtensionPoint",
".",
"executeInContext",
"(",
"closure",
",",
"context",
")",
";",
"extensions",
".",... | Updates the commit status during the build. | [
"Updates",
"the",
"commit",
"status",
"during",
"the",
"build",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java#L20-L33 |
117,023 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java | GhprbExtensionContext.buildStatus | void buildStatus(Runnable closure) {
GhprbBuildStatusContext context = new GhprbBuildStatusContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbBuildStatus(context.getCompletedStatus()));
} | java | void buildStatus(Runnable closure) {
GhprbBuildStatusContext context = new GhprbBuildStatusContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbBuildStatus(context.getCompletedStatus()));
} | [
"void",
"buildStatus",
"(",
"Runnable",
"closure",
")",
"{",
"GhprbBuildStatusContext",
"context",
"=",
"new",
"GhprbBuildStatusContext",
"(",
")",
";",
"ContextExtensionPoint",
".",
"executeInContext",
"(",
"closure",
",",
"context",
")",
";",
"extensions",
".",
... | Adds build result messages | [
"Adds",
"build",
"result",
"messages"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java#L38-L43 |
117,024 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java | GhprbExtensionContext.commentFilePath | void commentFilePath(Runnable closure) {
GhprbCommentFilePathContext context = new GhprbCommentFilePathContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbCommentFile(context.getCommentFilePath()));
} | java | void commentFilePath(Runnable closure) {
GhprbCommentFilePathContext context = new GhprbCommentFilePathContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbCommentFile(context.getCommentFilePath()));
} | [
"void",
"commentFilePath",
"(",
"Runnable",
"closure",
")",
"{",
"GhprbCommentFilePathContext",
"context",
"=",
"new",
"GhprbCommentFilePathContext",
"(",
")",
";",
"ContextExtensionPoint",
".",
"executeInContext",
"(",
"closure",
",",
"context",
")",
";",
"extensions... | Adds comment file path handling | [
"Adds",
"comment",
"file",
"path",
"handling"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java#L48-L53 |
117,025 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java | GhprbExtensionContext.cancelBuildsOnUpdate | void cancelBuildsOnUpdate(Runnable closure) {
GhprbCancelBuildsOnUpdateContext context = new GhprbCancelBuildsOnUpdateContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbCancelBuildsOnUpdate(context.getOverrideGlobal()));
} | java | void cancelBuildsOnUpdate(Runnable closure) {
GhprbCancelBuildsOnUpdateContext context = new GhprbCancelBuildsOnUpdateContext();
ContextExtensionPoint.executeInContext(closure, context);
extensions.add(new GhprbCancelBuildsOnUpdate(context.getOverrideGlobal()));
} | [
"void",
"cancelBuildsOnUpdate",
"(",
"Runnable",
"closure",
")",
"{",
"GhprbCancelBuildsOnUpdateContext",
"context",
"=",
"new",
"GhprbCancelBuildsOnUpdateContext",
"(",
")",
";",
"ContextExtensionPoint",
".",
"executeInContext",
"(",
"closure",
",",
"context",
")",
";"... | Overrides global settings for cancelling builds when a PR was updated | [
"Overrides",
"global",
"settings",
"for",
"cancelling",
"builds",
"when",
"a",
"PR",
"was",
"updated"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbExtensionContext.java#L58-L63 |
117,026 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatus.java | GhprbUpstreamStatus.makeBuildVariables | @Override
public void makeBuildVariables(@SuppressWarnings("rawtypes") AbstractBuild build, Map<String, String> variables) {
variables.put("ghprbShowMatrixStatus", Boolean.toString(getShowMatrixStatus()));
variables.put("ghprbUpstreamStatus", "true");
variables.put("ghprbCommitStatusContext"... | java | @Override
public void makeBuildVariables(@SuppressWarnings("rawtypes") AbstractBuild build, Map<String, String> variables) {
variables.put("ghprbShowMatrixStatus", Boolean.toString(getShowMatrixStatus()));
variables.put("ghprbUpstreamStatus", "true");
variables.put("ghprbCommitStatusContext"... | [
"@",
"Override",
"public",
"void",
"makeBuildVariables",
"(",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"AbstractBuild",
"build",
",",
"Map",
"<",
"String",
",",
"String",
">",
"variables",
")",
"{",
"variables",
".",
"put",
"(",
"\"ghprbShowMatrixStatu... | sets the context and message as env vars so that they are available in the Listener class | [
"sets",
"the",
"context",
"and",
"message",
"as",
"env",
"vars",
"so",
"that",
"they",
"are",
"available",
"in",
"the",
"Listener",
"class"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/upstream/GhprbUpstreamStatus.java#L42-L71 |
117,027 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/extensions/GhprbExtensionDescriptor.java | GhprbExtensionDescriptor.getExtensions | private static List<GhprbExtensionDescriptor> getExtensions() {
List<GhprbExtensionDescriptor> list = new ArrayList<GhprbExtensionDescriptor>();
list.addAll(getExtensionList());
return list;
} | java | private static List<GhprbExtensionDescriptor> getExtensions() {
List<GhprbExtensionDescriptor> list = new ArrayList<GhprbExtensionDescriptor>();
list.addAll(getExtensionList());
return list;
} | [
"private",
"static",
"List",
"<",
"GhprbExtensionDescriptor",
">",
"getExtensions",
"(",
")",
"{",
"List",
"<",
"GhprbExtensionDescriptor",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"GhprbExtensionDescriptor",
">",
"(",
")",
";",
"list",
".",
"addAll",
"(",
"... | Don't mutate the list from Jenkins, they will persist;
@return list of extensions | [
"Don",
"t",
"mutate",
"the",
"list",
"from",
"Jenkins",
"they",
"will",
"persist",
";"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/extensions/GhprbExtensionDescriptor.java#L51-L55 |
117,028 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbTriggerContext.java | GhprbTriggerContext.whiteListTargetBranches | public void whiteListTargetBranches(Iterable<String> branches) {
for (String branch : branches) {
whiteListTargetBranches.add(new GhprbBranch(branch));
}
} | java | public void whiteListTargetBranches(Iterable<String> branches) {
for (String branch : branches) {
whiteListTargetBranches.add(new GhprbBranch(branch));
}
} | [
"public",
"void",
"whiteListTargetBranches",
"(",
"Iterable",
"<",
"String",
">",
"branches",
")",
"{",
"for",
"(",
"String",
"branch",
":",
"branches",
")",
"{",
"whiteListTargetBranches",
".",
"add",
"(",
"new",
"GhprbBranch",
"(",
"branch",
")",
")",
";",... | Add branch names whose they are considered whitelisted for this specific job | [
"Add",
"branch",
"names",
"whose",
"they",
"are",
"considered",
"whitelisted",
"for",
"this",
"specific",
"job"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbTriggerContext.java#L118-L122 |
117,029 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbTriggerContext.java | GhprbTriggerContext.blackListTargetBranches | public void blackListTargetBranches(Iterable<String> branches) {
for (String branch : branches) {
blackListTargetBranches.add(new GhprbBranch(branch));
}
} | java | public void blackListTargetBranches(Iterable<String> branches) {
for (String branch : branches) {
blackListTargetBranches.add(new GhprbBranch(branch));
}
} | [
"public",
"void",
"blackListTargetBranches",
"(",
"Iterable",
"<",
"String",
">",
"branches",
")",
"{",
"for",
"(",
"String",
"branch",
":",
"branches",
")",
"{",
"blackListTargetBranches",
".",
"add",
"(",
"new",
"GhprbBranch",
"(",
"branch",
")",
")",
";",... | Add branch names whose they are considered blacklisted for this specific job | [
"Add",
"branch",
"names",
"whose",
"they",
"are",
"considered",
"blacklisted",
"for",
"this",
"specific",
"job"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbTriggerContext.java#L127-L131 |
117,030 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java | GhprbPullRequest.setUpdated | private boolean setUpdated(Date lastUpdateTime) {
// Because there is no gaurantee of order of delivery,
// we want to ensure that we do not set the updated time if it was
// earlier than the current updated time
if (updated == null || updated.compareTo(lastUpdateTime) < 0) {
... | java | private boolean setUpdated(Date lastUpdateTime) {
// Because there is no gaurantee of order of delivery,
// we want to ensure that we do not set the updated time if it was
// earlier than the current updated time
if (updated == null || updated.compareTo(lastUpdateTime) < 0) {
... | [
"private",
"boolean",
"setUpdated",
"(",
"Date",
"lastUpdateTime",
")",
"{",
"// Because there is no gaurantee of order of delivery,",
"// we want to ensure that we do not set the updated time if it was",
"// earlier than the current updated time",
"if",
"(",
"updated",
"==",
"null",
... | return true, false otherwise. | [
"return",
"true",
"false",
"otherwise",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L122-L131 |
117,031 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java | GhprbPullRequest.containsComment | private boolean containsComment(GHPullRequest ghPullRequest, String expectedBody) {
List<GHIssueComment> prComments;
try {
prComments = ghPullRequest.getComments();
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to get comments for PR " + ghPullRequest, e);
... | java | private boolean containsComment(GHPullRequest ghPullRequest, String expectedBody) {
List<GHIssueComment> prComments;
try {
prComments = ghPullRequest.getComments();
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to get comments for PR " + ghPullRequest, e);
... | [
"private",
"boolean",
"containsComment",
"(",
"GHPullRequest",
"ghPullRequest",
",",
"String",
"expectedBody",
")",
"{",
"List",
"<",
"GHIssueComment",
">",
"prComments",
";",
"try",
"{",
"prComments",
"=",
"ghPullRequest",
".",
"getComments",
"(",
")",
";",
"}"... | Checks whether the specific PR contains a comment with the expected body.
@return true if the PR contains comment with the specified body, otherwise false | [
"Checks",
"whether",
"the",
"specific",
"PR",
"contains",
"a",
"comment",
"with",
"the",
"expected",
"body",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L185-L200 |
117,032 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java | GhprbPullRequest.check | public void check(GHPullRequest ghpr, boolean isWebhook) {
if (helper.isProjectDisabled()) {
LOGGER.log(Level.FINE, "Project is disabled, ignoring pull request");
return;
}
// Call update PR with the update PR info and no comment
updatePR(ghpr, null /*GHIssueComme... | java | public void check(GHPullRequest ghpr, boolean isWebhook) {
if (helper.isProjectDisabled()) {
LOGGER.log(Level.FINE, "Project is disabled, ignoring pull request");
return;
}
// Call update PR with the update PR info and no comment
updatePR(ghpr, null /*GHIssueComme... | [
"public",
"void",
"check",
"(",
"GHPullRequest",
"ghpr",
",",
"boolean",
"isWebhook",
")",
"{",
"if",
"(",
"helper",
".",
"isProjectDisabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"Project is disabled, ignoring pull reque... | Checks this Pull Request representation against a GitHub version of the Pull Request, and triggers a build if
necessary.
@param ghpr the pull request from github
@param isWebhook whether this is from a webhook or not | [
"Checks",
"this",
"Pull",
"Request",
"representation",
"against",
"a",
"GitHub",
"version",
"of",
"the",
"Pull",
"Request",
"and",
"triggers",
"a",
"build",
"if",
"necessary",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L215-L227 |
117,033 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java | GhprbPullRequest.isAllowedTargetBranch | public boolean isAllowedTargetBranch() {
List<GhprbBranch> whiteListBranches = helper.getWhiteListTargetBranches();
List<GhprbBranch> blackListBranches = helper.getBlackListTargetBranches();
String target = getTarget();
// First check if it matches any whitelist branch. It matches if
... | java | public boolean isAllowedTargetBranch() {
List<GhprbBranch> whiteListBranches = helper.getWhiteListTargetBranches();
List<GhprbBranch> blackListBranches = helper.getBlackListTargetBranches();
String target = getTarget();
// First check if it matches any whitelist branch. It matches if
... | [
"public",
"boolean",
"isAllowedTargetBranch",
"(",
")",
"{",
"List",
"<",
"GhprbBranch",
">",
"whiteListBranches",
"=",
"helper",
".",
"getWhiteListTargetBranches",
"(",
")",
";",
"List",
"<",
"GhprbBranch",
">",
"blackListBranches",
"=",
"helper",
".",
"getBlackL... | but NOT any branches in the blacklist. | [
"but",
"NOT",
"any",
"branches",
"in",
"the",
"blacklist",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L412-L441 |
117,034 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java | GhprbPullRequest.checkCommit | private boolean checkCommit(GHPullRequest pr) {
GHCommitPointer head = pr.getHead();
GHCommitPointer base = pr.getBase();
String headSha = head.getSha();
String baseSha = base.getSha();
if (StringUtils.equals(headSha, this.head) && StringUtils.equals(baseSha, this.base)) {
... | java | private boolean checkCommit(GHPullRequest pr) {
GHCommitPointer head = pr.getHead();
GHCommitPointer base = pr.getBase();
String headSha = head.getSha();
String baseSha = base.getSha();
if (StringUtils.equals(headSha, this.head) && StringUtils.equals(baseSha, this.base)) {
... | [
"private",
"boolean",
"checkCommit",
"(",
"GHPullRequest",
"pr",
")",
"{",
"GHCommitPointer",
"head",
"=",
"pr",
".",
"getHead",
"(",
")",
";",
"GHCommitPointer",
"base",
"=",
"pr",
".",
"getBase",
"(",
")",
";",
"String",
"headSha",
"=",
"head",
".",
"g... | returns false if no new commit | [
"returns",
"false",
"if",
"no",
"new",
"commit"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L559-L581 |
117,035 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java | GhprbPullRequest.getPullRequest | public GHPullRequest getPullRequest(boolean force) throws IOException {
if (this.pr == null || force) {
setPullRequest(repo.getActualPullRequest(this.id));
}
return pr;
} | java | public GHPullRequest getPullRequest(boolean force) throws IOException {
if (this.pr == null || force) {
setPullRequest(repo.getActualPullRequest(this.id));
}
return pr;
} | [
"public",
"GHPullRequest",
"getPullRequest",
"(",
"boolean",
"force",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"pr",
"==",
"null",
"||",
"force",
")",
"{",
"setPullRequest",
"(",
"repo",
".",
"getActualPullRequest",
"(",
"this",
".",
"id",
... | Get the PullRequest object for this PR
@param force If true, forces retrieval of the PR info from the github API. Use sparingly.
@return a copy of the pull request
@throws IOException if unable to connect to GitHub | [
"Get",
"the",
"PullRequest",
"object",
"for",
"this",
"PR"
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L825-L830 |
117,036 | jenkinsci/ghprb-plugin | src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java | GhprbPullRequest.getAuthorEmail | public String getAuthorEmail() {
if (StringUtils.isEmpty(authorEmail)) {
try {
GHUser user = getPullRequestAuthor();
authorEmail = user.getEmail();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Unable to fetch author info for " + id);... | java | public String getAuthorEmail() {
if (StringUtils.isEmpty(authorEmail)) {
try {
GHUser user = getPullRequestAuthor();
authorEmail = user.getEmail();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Unable to fetch author info for " + id);... | [
"public",
"String",
"getAuthorEmail",
"(",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"authorEmail",
")",
")",
"{",
"try",
"{",
"GHUser",
"user",
"=",
"getPullRequestAuthor",
"(",
")",
";",
"authorEmail",
"=",
"user",
".",
"getEmail",
"(",
... | Email address is collected from GitHub as extra information, so lets cache it.
@return The PR authors email address | [
"Email",
"address",
"is",
"collected",
"from",
"GitHub",
"as",
"extra",
"information",
"so",
"lets",
"cache",
"it",
"."
] | b972d3b94ebbe6d40542c2771407e297bff8430b | https://github.com/jenkinsci/ghprb-plugin/blob/b972d3b94ebbe6d40542c2771407e297bff8430b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L865-L876 |
117,037 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java | OptionHandlerRegistry.initHandlers | private void initHandlers() {
registerHandler(Boolean.class,BooleanOptionHandler.class);
registerHandler(boolean.class,BooleanOptionHandler.class);
registerHandler(File.class,FileOptionHandler.class);
registerHandler(URL.class, URLOptionHandler.class);
registerHandler(URI.class, ... | java | private void initHandlers() {
registerHandler(Boolean.class,BooleanOptionHandler.class);
registerHandler(boolean.class,BooleanOptionHandler.class);
registerHandler(File.class,FileOptionHandler.class);
registerHandler(URL.class, URLOptionHandler.class);
registerHandler(URI.class, ... | [
"private",
"void",
"initHandlers",
"(",
")",
"{",
"registerHandler",
"(",
"Boolean",
".",
"class",
",",
"BooleanOptionHandler",
".",
"class",
")",
";",
"registerHandler",
"(",
"boolean",
".",
"class",
",",
"BooleanOptionHandler",
".",
"class",
")",
";",
"regis... | Registers the default handlers. | [
"Registers",
"the",
"default",
"handlers",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java#L71-L103 |
117,038 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java | OptionHandlerRegistry.getConstructor | private static Constructor<? extends OptionHandler> getConstructor(Class<? extends OptionHandler> handlerClass) {
try {
return handlerClass.getConstructor(CmdLineParser.class, OptionDef.class, Setter.class);
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException(M... | java | private static Constructor<? extends OptionHandler> getConstructor(Class<? extends OptionHandler> handlerClass) {
try {
return handlerClass.getConstructor(CmdLineParser.class, OptionDef.class, Setter.class);
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException(M... | [
"private",
"static",
"Constructor",
"<",
"?",
"extends",
"OptionHandler",
">",
"getConstructor",
"(",
"Class",
"<",
"?",
"extends",
"OptionHandler",
">",
"handlerClass",
")",
"{",
"try",
"{",
"return",
"handlerClass",
".",
"getConstructor",
"(",
"CmdLineParser",
... | Finds the constructor for an option handler. | [
"Finds",
"the",
"constructor",
"for",
"an",
"option",
"handler",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java#L107-L113 |
117,039 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/spi/MapOptionHandler.java | MapOptionHandler.addToMap | protected void addToMap(String argument, Map m) throws CmdLineException {
if (String.valueOf(argument).indexOf('=') == -1) {
throw new CmdLineException(owner,Messages.FORMAT_ERROR_FOR_MAP);
}
String mapKey;
String mapValue;
//Splitting off the key from the value
int idx = argument.indexO... | java | protected void addToMap(String argument, Map m) throws CmdLineException {
if (String.valueOf(argument).indexOf('=') == -1) {
throw new CmdLineException(owner,Messages.FORMAT_ERROR_FOR_MAP);
}
String mapKey;
String mapValue;
//Splitting off the key from the value
int idx = argument.indexO... | [
"protected",
"void",
"addToMap",
"(",
"String",
"argument",
",",
"Map",
"m",
")",
"throws",
"CmdLineException",
"{",
"if",
"(",
"String",
".",
"valueOf",
"(",
"argument",
")",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
")",
"{",
"throw",
"ne... | Encapsulates how a single string argument gets converted into key and value. | [
"Encapsulates",
"how",
"a",
"single",
"string",
"argument",
"gets",
"converted",
"into",
"key",
"and",
"value",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/spi/MapOptionHandler.java#L60-L86 |
117,040 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/spi/MapOptionHandler.java | MapOptionHandler.addToMap | protected void addToMap(Map m, String key, String value) {
m.put(key,value);
} | java | protected void addToMap(Map m, String key, String value) {
m.put(key,value);
} | [
"protected",
"void",
"addToMap",
"(",
"Map",
"m",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"m",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | This is the opportunity to convert values to some typed objects. | [
"This",
"is",
"the",
"opportunity",
"to",
"convert",
"values",
"to",
"some",
"typed",
"objects",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/spi/MapOptionHandler.java#L91-L93 |
117,041 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/spi/ArrayFieldSetter.java | ArrayFieldSetter.trySetDefault | private void trySetDefault(Object bean1) throws IllegalAccessError {
try {
doSetDefault(bean1);
} catch (IllegalAccessException ex) {
try {
// try again
f.setAccessible(true);
doSetDefault(bean1);
}catch (IllegalAccessEx... | java | private void trySetDefault(Object bean1) throws IllegalAccessError {
try {
doSetDefault(bean1);
} catch (IllegalAccessException ex) {
try {
// try again
f.setAccessible(true);
doSetDefault(bean1);
}catch (IllegalAccessEx... | [
"private",
"void",
"trySetDefault",
"(",
"Object",
"bean1",
")",
"throws",
"IllegalAccessError",
"{",
"try",
"{",
"doSetDefault",
"(",
"bean1",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"ex",
")",
"{",
"try",
"{",
"// try again",
"f",
".",
"setA... | Remember default so we throw away the default when adding user values. | [
"Remember",
"default",
"so",
"we",
"throw",
"away",
"the",
"default",
"when",
"adding",
"user",
"values",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/spi/ArrayFieldSetter.java#L41-L53 |
117,042 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.printExample | public String printExample(OptionHandlerFilter mode, ResourceBundle rb) {
StringBuilder buf = new StringBuilder();
checkNonNull(mode, "mode");
for (OptionHandler h : options) {
OptionDef option = h.option;
if(option.usage().length()==0) continue; // ignore
... | java | public String printExample(OptionHandlerFilter mode, ResourceBundle rb) {
StringBuilder buf = new StringBuilder();
checkNonNull(mode, "mode");
for (OptionHandler h : options) {
OptionDef option = h.option;
if(option.usage().length()==0) continue; // ignore
... | [
"public",
"String",
"printExample",
"(",
"OptionHandlerFilter",
"mode",
",",
"ResourceBundle",
"rb",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"checkNonNull",
"(",
"mode",
",",
"\"mode\"",
")",
";",
"for",
"(",
"OptionHandle... | Formats a command line example into a string.
<p>
This method produces a string like <code> -d <dir> -v -b</code>.
This is useful for printing a command line example (perhaps
as a part of the usage screen).
@param mode
Determines which options will be a part of the returned string.
Must not be {@code null}.
@p... | [
"Formats",
"a",
"command",
"line",
"example",
"into",
"a",
"string",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L230-L245 |
117,043 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.printOption | protected void printOption(PrintWriter out, OptionHandler handler, int len, ResourceBundle rb, OptionHandlerFilter filter) {
// Hiding options without usage information
if (handler.option.usage() == null ||
handler.option.usage().length() == 0 ||
!filter.select(handler)) {
return... | java | protected void printOption(PrintWriter out, OptionHandler handler, int len, ResourceBundle rb, OptionHandlerFilter filter) {
// Hiding options without usage information
if (handler.option.usage() == null ||
handler.option.usage().length() == 0 ||
!filter.select(handler)) {
return... | [
"protected",
"void",
"printOption",
"(",
"PrintWriter",
"out",
",",
"OptionHandler",
"handler",
",",
"int",
"len",
",",
"ResourceBundle",
"rb",
",",
"OptionHandlerFilter",
"filter",
")",
"{",
"// Hiding options without usage information",
"if",
"(",
"handler",
".",
... | Prints usage information for a given option.
<p>
Subtypes may override this method and determine which options get printed (or other things),
based on {@link OptionHandler} (perhaps by using {@code handler.setter.asAnnotatedElement()}).
@param out Writer to write into
@param handler handler where to receive the... | [
"Prints",
"usage",
"information",
"for",
"a",
"given",
"option",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L322-L354 |
117,044 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.wrapLines | private List<String> wrapLines(String line, final int maxLength) {
List<String> rv = new ArrayList<String>();
for (String restOfLine : line.split("\\n")) {
while (restOfLine.length() > maxLength) {
// try to wrap at space, but don't try too hard as some languages don't even have... | java | private List<String> wrapLines(String line, final int maxLength) {
List<String> rv = new ArrayList<String>();
for (String restOfLine : line.split("\\n")) {
while (restOfLine.length() > maxLength) {
// try to wrap at space, but don't try too hard as some languages don't even have... | [
"private",
"List",
"<",
"String",
">",
"wrapLines",
"(",
"String",
"line",
",",
"final",
"int",
"maxLength",
")",
"{",
"List",
"<",
"String",
">",
"rv",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"restOfLine",
"... | Wraps a line so that the resulting parts are not longer than a given maximum length.
@param line Line to wrap
@param maxLength maximum length for the resulting parts
@return list of all wrapped parts | [
"Wraps",
"a",
"line",
"so",
"that",
"the",
"resulting",
"parts",
"are",
"not",
"longer",
"than",
"a",
"given",
"maximum",
"length",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L377-L393 |
117,045 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.parseArgument | public void parseArgument(final String... args) throws CmdLineException {
checkNonNull(args, "args");
String expandedArgs[] = args;
if (parserProperties.getAtSyntax()) {
expandedArgs = expandAtFiles(args);
}
CmdLineImpl cmdLine = new CmdLineImpl(expa... | java | public void parseArgument(final String... args) throws CmdLineException {
checkNonNull(args, "args");
String expandedArgs[] = args;
if (parserProperties.getAtSyntax()) {
expandedArgs = expandAtFiles(args);
}
CmdLineImpl cmdLine = new CmdLineImpl(expa... | [
"public",
"void",
"parseArgument",
"(",
"final",
"String",
"...",
"args",
")",
"throws",
"CmdLineException",
"{",
"checkNonNull",
"(",
"args",
",",
"\"args\"",
")",
";",
"String",
"expandedArgs",
"[",
"]",
"=",
"args",
";",
"if",
"(",
"parserProperties",
"."... | Parses the command line arguments and set them to the option bean
given in the constructor.
@param args arguments to parse
@throws CmdLineException
if there's any error parsing arguments, or if
{@link Option#required() required} option was not given.
@throws NullPointerException if {@code args} is {@code null}. | [
"Parses",
"the",
"command",
"line",
"arguments",
"and",
"set",
"them",
"to",
"the",
"option",
"bean",
"given",
"in",
"the",
"constructor",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L473-L536 |
117,046 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.expandAtFiles | private String[] expandAtFiles(String args[]) throws CmdLineException {
List<String> result = new ArrayList<String>();
for (String arg : args) {
if (arg.startsWith("@")) {
File file = new File(arg.substring(1));
if (!file.exists())
throw ne... | java | private String[] expandAtFiles(String args[]) throws CmdLineException {
List<String> result = new ArrayList<String>();
for (String arg : args) {
if (arg.startsWith("@")) {
File file = new File(arg.substring(1));
if (!file.exists())
throw ne... | [
"private",
"String",
"[",
"]",
"expandAtFiles",
"(",
"String",
"args",
"[",
"]",
")",
"throws",
"CmdLineException",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"arg",
":",... | Expands every entry prefixed with the AT sign by
reading the file. The AT sign is used to reference
another file that contains command line options separated
by line breaks.
@param args the command line arguments to be preprocessed.
@return args with the @ sequences replaced by the text files referenced
by the @ sequen... | [
"Expands",
"every",
"entry",
"prefixed",
"with",
"the",
"AT",
"sign",
"by",
"reading",
"the",
"file",
".",
"The",
"AT",
"sign",
"is",
"used",
"to",
"reference",
"another",
"file",
"that",
"contains",
"command",
"line",
"options",
"separated",
"by",
"line",
... | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L548-L565 |
117,047 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.readAllLines | private static List<String> readAllLines(File f) throws IOException {
BufferedReader r = new BufferedReader(new FileReader(f));
try {
List<String> result = new ArrayList<String>();
String line;
while ((line = r.readLine()) != null) {
result.add(line);
... | java | private static List<String> readAllLines(File f) throws IOException {
BufferedReader r = new BufferedReader(new FileReader(f));
try {
List<String> result = new ArrayList<String>();
String line;
while ((line = r.readLine()) != null) {
result.add(line);
... | [
"private",
"static",
"List",
"<",
"String",
">",
"readAllLines",
"(",
"File",
"f",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"r",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"f",
")",
")",
";",
"try",
"{",
"List",
"<",
"String... | Reads all lines of a file with the platform encoding. | [
"Reads",
"all",
"lines",
"of",
"a",
"file",
"with",
"the",
"platform",
"encoding",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L570-L582 |
117,048 | kohsuke/args4j | args4j/src/org/kohsuke/args4j/Config.java | Config.parse | public static Config parse(InputSource xml) throws IOException, SAXException {
Config rv = new Config();
XMLReader reader = XMLReaderFactory.createXMLReader();
ConfigHandler handler = rv.new ConfigHandler(rv);
reader.setContentHandler(handler);
reader.parse(xml);
return rv;
} | java | public static Config parse(InputSource xml) throws IOException, SAXException {
Config rv = new Config();
XMLReader reader = XMLReaderFactory.createXMLReader();
ConfigHandler handler = rv.new ConfigHandler(rv);
reader.setContentHandler(handler);
reader.parse(xml);
return rv;
} | [
"public",
"static",
"Config",
"parse",
"(",
"InputSource",
"xml",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"Config",
"rv",
"=",
"new",
"Config",
"(",
")",
";",
"XMLReader",
"reader",
"=",
"XMLReaderFactory",
".",
"createXMLReader",
"(",
")",
"... | Parses a XML file and returns a Config object holding the information.
@param xml source of the xml data
@return
@throws IOException
@throws SAXException | [
"Parses",
"a",
"XML",
"file",
"and",
"returns",
"a",
"Config",
"object",
"holding",
"the",
"information",
"."
] | dc2e7e265caf15a1a146e3389c1f16a8781f06cf | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/Config.java#L74-L81 |
117,049 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/MultimediaObject.java | MultimediaObject.getInfo | public MultimediaInfo getInfo() throws InputFormatException,
EncoderException {
if (inputFile.canRead())
{
FFMPEGExecutor ffmpeg = locator.createExecutor();
ffmpeg.addArgument("-i");
ffmpeg.addArgument(inputFile.getAbsolutePath());
try
... | java | public MultimediaInfo getInfo() throws InputFormatException,
EncoderException {
if (inputFile.canRead())
{
FFMPEGExecutor ffmpeg = locator.createExecutor();
ffmpeg.addArgument("-i");
ffmpeg.addArgument(inputFile.getAbsolutePath());
try
... | [
"public",
"MultimediaInfo",
"getInfo",
"(",
")",
"throws",
"InputFormatException",
",",
"EncoderException",
"{",
"if",
"(",
"inputFile",
".",
"canRead",
"(",
")",
")",
"{",
"FFMPEGExecutor",
"ffmpeg",
"=",
"locator",
".",
"createExecutor",
"(",
")",
";",
"ffmp... | Returns a set informations about a multimedia file, if its format is
supported for decoding.
@return A set of informations about the file and its contents.
@throws InputFormatException If the format of the source file cannot be
recognized and decoded.
@throws EncoderException If a problem occurs calling the underlying... | [
"Returns",
"a",
"set",
"informations",
"about",
"a",
"multimedia",
"file",
"if",
"its",
"format",
"is",
"supported",
"for",
"decoding",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/MultimediaObject.java#L95-L122 |
117,050 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/ScreenExtractor.java | ScreenExtractor.render | public void render(MultimediaObject multimediaObject, int width, int height, int seconds, File outputDir,
String fileNamePrefix, String extension, int quality)
throws InputFormatException, EncoderException {
File inputFile = multimediaObject.getFile();
try
{
i... | java | public void render(MultimediaObject multimediaObject, int width, int height, int seconds, File outputDir,
String fileNamePrefix, String extension, int quality)
throws InputFormatException, EncoderException {
File inputFile = multimediaObject.getFile();
try
{
i... | [
"public",
"void",
"render",
"(",
"MultimediaObject",
"multimediaObject",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"seconds",
",",
"File",
"outputDir",
",",
"String",
"fileNamePrefix",
",",
"String",
"extension",
",",
"int",
"quality",
")",
"throw... | Generates screenshots from source video.
@param multimediaObject Source MultimediaObject @see MultimediaObject
@param width Output width
@param height Output height
@param seconds Interval in seconds between screens
@param outputDir Destination of output images
@param fileNamePrefix Name all thumbnails will start with... | [
"Generates",
"screenshots",
"from",
"source",
"video",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/ScreenExtractor.java#L62-L131 |
117,051 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/ScreenExtractor.java | ScreenExtractor.render | public void render(MultimediaObject multimediaObject, int width, int height, int seconds, File target, int quality)
throws EncoderException {
File inputFile = multimediaObject.getFile();
target = target.getAbsoluteFile();
target.getParentFile().mkdirs();
try
{
... | java | public void render(MultimediaObject multimediaObject, int width, int height, int seconds, File target, int quality)
throws EncoderException {
File inputFile = multimediaObject.getFile();
target = target.getAbsoluteFile();
target.getParentFile().mkdirs();
try
{
... | [
"public",
"void",
"render",
"(",
"MultimediaObject",
"multimediaObject",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"seconds",
",",
"File",
"target",
",",
"int",
"quality",
")",
"throws",
"EncoderException",
"{",
"File",
"inputFile",
"=",
"multimed... | Generate a single screenshot from source video.
@param multimediaObject Source MultimediaObject @see MultimediaObject
@param width Output width
@param height Output height
@param seconds Interval in seconds between screens
@param target Destination of output image
@param quality The range is between 1-31 with 31 being... | [
"Generate",
"a",
"single",
"screenshot",
"from",
"source",
"video",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/ScreenExtractor.java#L147-L211 |
117,052 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/Encoder.java | Encoder.getCoders | protected String[] getCoders(boolean encoder, boolean audio) throws EncoderException {
ArrayList<String> res = new ArrayList<>();
FFMPEGExecutor localFFMPEG = locator.createExecutor();
localFFMPEG.addArgument(encoder ? "-encoders" : "-decoders");
try
{
localFFMPEG.exe... | java | protected String[] getCoders(boolean encoder, boolean audio) throws EncoderException {
ArrayList<String> res = new ArrayList<>();
FFMPEGExecutor localFFMPEG = locator.createExecutor();
localFFMPEG.addArgument(encoder ? "-encoders" : "-decoders");
try
{
localFFMPEG.exe... | [
"protected",
"String",
"[",
"]",
"getCoders",
"(",
"boolean",
"encoder",
",",
"boolean",
"audio",
")",
"throws",
"EncoderException",
"{",
"ArrayList",
"<",
"String",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"FFMPEGExecutor",
"localFFMPEG",
"... | Returns a list with the names of all the coders bundled with the ffmpeg
distribution in use.
@param encoder Do search encoders, else decoders
@param audio Do search for audio encodes, else video
@return A list with the names of all the included encoders
@throws EncoderException If a problem occurs calling the underlyi... | [
"Returns",
"a",
"list",
"with",
"the",
"names",
"of",
"all",
"the",
"coders",
"bundled",
"with",
"the",
"ffmpeg",
"distribution",
"in",
"use",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/Encoder.java#L135-L196 |
117,053 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/FFMPEGExecutor.java | FFMPEGExecutor.execute | public void execute() throws IOException {
int argsSize = args.size();
String[] cmd = new String[argsSize + 2];
cmd[0] = ffmpegExecutablePath;
for (int i = 0; i < argsSize; i++)
{
cmd[i + 1] = args.get(i);
}
cmd[argsSize + 1] = "-hide_banner"; // Don'... | java | public void execute() throws IOException {
int argsSize = args.size();
String[] cmd = new String[argsSize + 2];
cmd[0] = ffmpegExecutablePath;
for (int i = 0; i < argsSize; i++)
{
cmd[i + 1] = args.get(i);
}
cmd[argsSize + 1] = "-hide_banner"; // Don'... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"IOException",
"{",
"int",
"argsSize",
"=",
"args",
".",
"size",
"(",
")",
";",
"String",
"[",
"]",
"cmd",
"=",
"new",
"String",
"[",
"argsSize",
"+",
"2",
"]",
";",
"cmd",
"[",
"0",
"]",
"=",
"ffm... | Executes the ffmpeg process with the previous given arguments.
@return process exit code
@throws IOException If the process call fails. | [
"Executes",
"the",
"ffmpeg",
"process",
"with",
"the",
"previous",
"given",
"arguments",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/FFMPEGExecutor.java#L97-L123 |
117,054 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/FFMPEGExecutor.java | FFMPEGExecutor.destroy | public void destroy() {
if (inputStream != null)
{
try
{
inputStream.close();
} catch (Throwable t)
{
LOG.warn("Error closing input stream", t);
}
inputStream = null;
}
if (outputStrea... | java | public void destroy() {
if (inputStream != null)
{
try
{
inputStream.close();
} catch (Throwable t)
{
LOG.warn("Error closing input stream", t);
}
inputStream = null;
}
if (outputStrea... | [
"public",
"void",
"destroy",
"(",
")",
"{",
"if",
"(",
"inputStream",
"!=",
"null",
")",
"{",
"try",
"{",
"inputStream",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Error closing input stream\... | If there's a ffmpeg execution in progress, it kills it. | [
"If",
"there",
"s",
"a",
"ffmpeg",
"execution",
"in",
"progress",
"it",
"kills",
"it",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/FFMPEGExecutor.java#L155-L200 |
117,055 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/FFMPEGExecutor.java | FFMPEGExecutor.getProcessExitCode | public int getProcessExitCode()
{
// Make sure it's terminated
try
{
ffmpeg.waitFor();
}
catch (InterruptedException ex)
{
LOG.warn("Interrupted during waiting on process, forced shutdown?", ex);
}
return ffmpeg.exitValue();
... | java | public int getProcessExitCode()
{
// Make sure it's terminated
try
{
ffmpeg.waitFor();
}
catch (InterruptedException ex)
{
LOG.warn("Interrupted during waiting on process, forced shutdown?", ex);
}
return ffmpeg.exitValue();
... | [
"public",
"int",
"getProcessExitCode",
"(",
")",
"{",
"// Make sure it's terminated",
"try",
"{",
"ffmpeg",
".",
"waitFor",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"ex",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Interrupted during waiting on process,... | Return the exit code of the ffmpeg process
If the process is not yet terminated, it waits for the termination
of the process
@return | [
"Return",
"the",
"exit",
"code",
"of",
"the",
"ffmpeg",
"process",
"If",
"the",
"process",
"is",
"not",
"yet",
"terminated",
"it",
"waits",
"for",
"the",
"termination",
"of",
"the",
"process"
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/FFMPEGExecutor.java#L209-L221 |
117,056 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java | DefaultFFMPEGLocator.copyFile | private void copyFile(String path, File dest) {
String resourceName= "native/" + path;
try
{
LOG.debug("Copy from resource <"+resourceName+"> to target <"+dest.getAbsolutePath()+">");
if (copy(getClass().getResourceAsStream(resourceName), dest.getAbsolutePath()))
... | java | private void copyFile(String path, File dest) {
String resourceName= "native/" + path;
try
{
LOG.debug("Copy from resource <"+resourceName+"> to target <"+dest.getAbsolutePath()+">");
if (copy(getClass().getResourceAsStream(resourceName), dest.getAbsolutePath()))
... | [
"private",
"void",
"copyFile",
"(",
"String",
"path",
",",
"File",
"dest",
")",
"{",
"String",
"resourceName",
"=",
"\"native/\"",
"+",
"path",
";",
"try",
"{",
"LOG",
".",
"debug",
"(",
"\"Copy from resource <\"",
"+",
"resourceName",
"+",
"\"> to target <\""... | Copies a file bundled in the package to the supplied destination.
@param path The name of the bundled file.
@param dest The destination.
@throws RuntimeException If an unexpected error occurs. | [
"Copies",
"a",
"file",
"bundled",
"in",
"the",
"package",
"to",
"the",
"supplied",
"destination",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java#L127-L153 |
117,057 | a-schild/jave2 | jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java | DefaultFFMPEGLocator.copy | private boolean copy(InputStream source, String destination) {
boolean success = true;
try
{
Files.copy(source, Paths.get(destination), StandardCopyOption.REPLACE_EXISTING);
} catch (IOException ex)
{
LOG.fatal("Cannot write file " + destination, ... | java | private boolean copy(InputStream source, String destination) {
boolean success = true;
try
{
Files.copy(source, Paths.get(destination), StandardCopyOption.REPLACE_EXISTING);
} catch (IOException ex)
{
LOG.fatal("Cannot write file " + destination, ... | [
"private",
"boolean",
"copy",
"(",
"InputStream",
"source",
",",
"String",
"destination",
")",
"{",
"boolean",
"success",
"=",
"true",
";",
"try",
"{",
"Files",
".",
"copy",
"(",
"source",
",",
"Paths",
".",
"get",
"(",
"destination",
")",
",",
"Standard... | Copy a file from source to destination.
@param source The name of the bundled file.
@param destination the destination
@return True if succeeded , False if not | [
"Copy",
"a",
"file",
"from",
"source",
"to",
"destination",
"."
] | 1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26 | https://github.com/a-schild/jave2/blob/1e7d6a1ca7c27cc63570f1aabb5c84ee124f3e26/jave-core/src/main/java/ws/schild/jave/DefaultFFMPEGLocator.java#L162-L175 |
117,058 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.debug | protected void debug(String message) {
final Log log = getLog();
if (log != null)
log.debug(message);
} | java | protected void debug(String message) {
final Log log = getLog();
if (log != null)
log.debug(message);
} | [
"protected",
"void",
"debug",
"(",
"String",
"message",
")",
"{",
"final",
"Log",
"log",
"=",
"getLog",
"(",
")",
";",
"if",
"(",
"log",
"!=",
"null",
")",
"log",
".",
"debug",
"(",
"message",
")",
";",
"}"
] | Log given message at debug level
@param message | [
"Log",
"given",
"message",
"at",
"debug",
"level"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L96-L100 |
117,059 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.debug | protected void debug(String message, Throwable throwable) {
final Log log = getLog();
if (log != null)
log.debug(message, throwable);
} | java | protected void debug(String message, Throwable throwable) {
final Log log = getLog();
if (log != null)
log.debug(message, throwable);
} | [
"protected",
"void",
"debug",
"(",
"String",
"message",
",",
"Throwable",
"throwable",
")",
"{",
"final",
"Log",
"log",
"=",
"getLog",
"(",
")",
";",
"if",
"(",
"log",
"!=",
"null",
")",
"log",
".",
"debug",
"(",
"message",
",",
"throwable",
")",
";"... | Log given message and throwable at debug level
@param message
@param throwable | [
"Log",
"given",
"message",
"and",
"throwable",
"at",
"debug",
"level"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L108-L112 |
117,060 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.info | protected void info(String message) {
final Log log = getLog();
if (log != null)
log.info(message);
} | java | protected void info(String message) {
final Log log = getLog();
if (log != null)
log.info(message);
} | [
"protected",
"void",
"info",
"(",
"String",
"message",
")",
"{",
"final",
"Log",
"log",
"=",
"getLog",
"(",
")",
";",
"if",
"(",
"log",
"!=",
"null",
")",
"log",
".",
"info",
"(",
"message",
")",
";",
"}"
] | Log given message at info level
@param message | [
"Log",
"given",
"message",
"at",
"info",
"level"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L119-L123 |
117,061 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.configureOAuth2Token | protected boolean configureOAuth2Token(final GitHubClient client,
final String oauth2Token) {
if (StringUtils.isEmpty(oauth2Token))
return false;
if (isDebug())
debug("Using OAuth2 access token authentication");
client.setOAuth2Token(oauth2Token);
return true;
} | java | protected boolean configureOAuth2Token(final GitHubClient client,
final String oauth2Token) {
if (StringUtils.isEmpty(oauth2Token))
return false;
if (isDebug())
debug("Using OAuth2 access token authentication");
client.setOAuth2Token(oauth2Token);
return true;
} | [
"protected",
"boolean",
"configureOAuth2Token",
"(",
"final",
"GitHubClient",
"client",
",",
"final",
"String",
"oauth2Token",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"oauth2Token",
")",
")",
"return",
"false",
";",
"if",
"(",
"isDebug",
"(",
... | Configure credentials from configured OAuth2 token
@param client
@param oauth2Token
@return true if configured, false otherwise | [
"Configure",
"credentials",
"from",
"configured",
"OAuth2",
"token"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L266-L275 |
117,062 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.configureServerCredentials | protected boolean configureServerCredentials(final GitHubClient client,
final String serverId, final Settings settings,
final MavenSession session) throws MojoExecutionException {
if (StringUtils.isEmpty(serverId))
return false;
String serverUsername = null;
String serverPassword = null;
// Mav... | java | protected boolean configureServerCredentials(final GitHubClient client,
final String serverId, final Settings settings,
final MavenSession session) throws MojoExecutionException {
if (StringUtils.isEmpty(serverId))
return false;
String serverUsername = null;
String serverPassword = null;
// Mav... | [
"protected",
"boolean",
"configureServerCredentials",
"(",
"final",
"GitHubClient",
"client",
",",
"final",
"String",
"serverId",
",",
"final",
"Settings",
"settings",
",",
"final",
"MavenSession",
"session",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
... | Configure client with credentials from given server id
@param client
@param serverId
@param settings
@param session
@return true if configured, false otherwise
@throws MojoExecutionException | [
"Configure",
"client",
"with",
"credentials",
"from",
"given",
"server",
"id"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L287-L362 |
117,063 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.getServer | protected Server getServer(final Settings settings, final String serverId) {
if (settings == null)
return null;
List<Server> servers = settings.getServers();
if (servers == null || servers.isEmpty())
return null;
for (Server server : servers)
if (serverId.equals(server.getId()))
return server;
r... | java | protected Server getServer(final Settings settings, final String serverId) {
if (settings == null)
return null;
List<Server> servers = settings.getServers();
if (servers == null || servers.isEmpty())
return null;
for (Server server : servers)
if (serverId.equals(server.getId()))
return server;
r... | [
"protected",
"Server",
"getServer",
"(",
"final",
"Settings",
"settings",
",",
"final",
"String",
"serverId",
")",
"{",
"if",
"(",
"settings",
"==",
"null",
")",
"return",
"null",
";",
"List",
"<",
"Server",
">",
"servers",
"=",
"settings",
".",
"getServer... | Get server with given id
@param settings
@param serverId
must be non-null and non-empty
@return server or null if none matching | [
"Get",
"server",
"with",
"given",
"id"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L395-L406 |
117,064 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.matchNonProxy | protected boolean matchNonProxy( final Proxy proxy, final String hostname )
{
String host = hostname;
if ( null == hostname )
host = IGitHubConstants.HOST_DEFAULT; // IGitHubConstants.HOST_API;
// code from org.apache.maven.plugins.site.AbstractDeployMojo#getProxyInfo
final String nonProxyHosts = proxy.ge... | java | protected boolean matchNonProxy( final Proxy proxy, final String hostname )
{
String host = hostname;
if ( null == hostname )
host = IGitHubConstants.HOST_DEFAULT; // IGitHubConstants.HOST_API;
// code from org.apache.maven.plugins.site.AbstractDeployMojo#getProxyInfo
final String nonProxyHosts = proxy.ge... | [
"protected",
"boolean",
"matchNonProxy",
"(",
"final",
"Proxy",
"proxy",
",",
"final",
"String",
"hostname",
")",
"{",
"String",
"host",
"=",
"hostname",
";",
"if",
"(",
"null",
"==",
"hostname",
")",
"host",
"=",
"IGitHubConstants",
".",
"HOST_DEFAULT",
";"... | Check hostname that matched nonProxy setting
@param proxy Maven Proxy. Must not null
@param hostname
@return matching result. true: match nonProxy | [
"Check",
"hostname",
"that",
"matched",
"nonProxy",
"setting"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L415-L466 |
117,065 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java | GitHubProjectMojo.getProxy | protected Proxy getProxy(final Settings settings, final String serverId, final String host) {
if (settings == null)
return null;
List<Proxy> proxies = settings.getProxies();
if (proxies == null || proxies.isEmpty())
return null;
// search id match first
if ( serverId != null && !serverId.isEmpty() ) {
... | java | protected Proxy getProxy(final Settings settings, final String serverId, final String host) {
if (settings == null)
return null;
List<Proxy> proxies = settings.getProxies();
if (proxies == null || proxies.isEmpty())
return null;
// search id match first
if ( serverId != null && !serverId.isEmpty() ) {
... | [
"protected",
"Proxy",
"getProxy",
"(",
"final",
"Settings",
"settings",
",",
"final",
"String",
"serverId",
",",
"final",
"String",
"host",
")",
"{",
"if",
"(",
"settings",
"==",
"null",
")",
"return",
"null",
";",
"List",
"<",
"Proxy",
">",
"proxies",
"... | Get proxy from settings
@param settings
@param serverId
must be non-null and non-empty
@param host
hostname
@return proxy or null if none matching | [
"Get",
"proxy",
"from",
"settings"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/GitHubProjectMojo.java#L478-L517 |
117,066 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/RepositoryUtils.java | RepositoryUtils.extractRepositoryFromScmUrl | public static RepositoryId extractRepositoryFromScmUrl(String url) {
if (StringUtils.isEmpty(url))
return null;
int ghIndex = url.indexOf(HOST_DEFAULT);
if (ghIndex == -1 || ghIndex + 1 >= url.length())
return null;
if (!url.endsWith(SUFFIX_GIT))
return null;
url = url.substring(ghIndex + HOST_DEFAUL... | java | public static RepositoryId extractRepositoryFromScmUrl(String url) {
if (StringUtils.isEmpty(url))
return null;
int ghIndex = url.indexOf(HOST_DEFAULT);
if (ghIndex == -1 || ghIndex + 1 >= url.length())
return null;
if (!url.endsWith(SUFFIX_GIT))
return null;
url = url.substring(ghIndex + HOST_DEFAUL... | [
"public",
"static",
"RepositoryId",
"extractRepositoryFromScmUrl",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"url",
")",
")",
"return",
"null",
";",
"int",
"ghIndex",
"=",
"url",
".",
"indexOf",
"(",
"HOST_DEFAULT",
")",
... | Extra repository id from given SCM URL
@param url
@return repository id or null if extraction fails | [
"Extra",
"repository",
"id",
"from",
"given",
"SCM",
"URL"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/RepositoryUtils.java#L44-L55 |
117,067 | github/maven-plugins | github-core/src/main/java/com/github/maven/plugins/core/StringUtils.java | StringUtils.isEmpty | public static boolean isEmpty(final String... values) {
if (values == null || values.length == 0)
return true;
for (String value : values)
if (value == null || value.length() == 0)
return true;
return false;
} | java | public static boolean isEmpty(final String... values) {
if (values == null || values.length == 0)
return true;
for (String value : values)
if (value == null || value.length() == 0)
return true;
return false;
} | [
"public",
"static",
"boolean",
"isEmpty",
"(",
"final",
"String",
"...",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"length",
"==",
"0",
")",
"return",
"true",
";",
"for",
"(",
"String",
"value",
":",
"values",
")",
"... | Are any given values null or empty?
@param values
@return true if any null or empty, false otherwise | [
"Are",
"any",
"given",
"values",
"null",
"or",
"empty?"
] | 8d6d49393d1453be709ecc4cfe87f41f2081f5c5 | https://github.com/github/maven-plugins/blob/8d6d49393d1453be709ecc4cfe87f41f2081f5c5/github-core/src/main/java/com/github/maven/plugins/core/StringUtils.java#L40-L47 |
117,068 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/color/ExtendedColorPicker.java | ExtendedColorPicker.updateValuesFromHSVFields | @Override
protected void updateValuesFromHSVFields () {
int[] hsv = ColorUtils.RGBtoHSV(color);
int h = hsv[0];
int s = hsv[1];
int v = hsv[2];
if (hBar.isInputValid()) h = hBar.getValue();
if (sBar.isInputValid()) s = sBar.getValue();
if (vBar.isInputValid()) v = vBar.getValue();
color = ColorUtils.... | java | @Override
protected void updateValuesFromHSVFields () {
int[] hsv = ColorUtils.RGBtoHSV(color);
int h = hsv[0];
int s = hsv[1];
int v = hsv[2];
if (hBar.isInputValid()) h = hBar.getValue();
if (sBar.isInputValid()) s = sBar.getValue();
if (vBar.isInputValid()) v = vBar.getValue();
color = ColorUtils.... | [
"@",
"Override",
"protected",
"void",
"updateValuesFromHSVFields",
"(",
")",
"{",
"int",
"[",
"]",
"hsv",
"=",
"ColorUtils",
".",
"RGBtoHSV",
"(",
"color",
")",
";",
"int",
"h",
"=",
"hsv",
"[",
"0",
"]",
";",
"int",
"s",
"=",
"hsv",
"[",
"1",
"]",... | Updates picker from H, S and V bars | [
"Updates",
"picker",
"from",
"H",
"S",
"and",
"V",
"bars"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/color/ExtendedColorPicker.java#L172-L192 |
117,069 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/color/ExtendedColorPicker.java | ExtendedColorPicker.updateValuesFromRGBFields | private void updateValuesFromRGBFields () {
int r = MathUtils.round(color.r * 255.0f);
int g = MathUtils.round(color.g * 255.0f);
int b = MathUtils.round(color.b * 255.0f);
if (rBar.isInputValid()) r = rBar.getValue();
if (gBar.isInputValid()) g = gBar.getValue();
if (bBar.isInputValid()) b = bBar.getValue... | java | private void updateValuesFromRGBFields () {
int r = MathUtils.round(color.r * 255.0f);
int g = MathUtils.round(color.g * 255.0f);
int b = MathUtils.round(color.b * 255.0f);
if (rBar.isInputValid()) r = rBar.getValue();
if (gBar.isInputValid()) g = gBar.getValue();
if (bBar.isInputValid()) b = bBar.getValue... | [
"private",
"void",
"updateValuesFromRGBFields",
"(",
")",
"{",
"int",
"r",
"=",
"MathUtils",
".",
"round",
"(",
"color",
".",
"r",
"*",
"255.0f",
")",
";",
"int",
"g",
"=",
"MathUtils",
".",
"round",
"(",
"color",
".",
"g",
"*",
"255.0f",
")",
";",
... | Updates picker from R, G and B bars | [
"Updates",
"picker",
"from",
"R",
"G",
"and",
"B",
"bars"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/color/ExtendedColorPicker.java#L195-L217 |
117,070 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/HighlightTextArea.java | HighlightTextArea.processHighlighter | public void processHighlighter () {
if (highlights == null) return;
highlights.clear();
if (highlighter != null) highlighter.process(this, highlights);
chunkUpdateScheduled = true;
} | java | public void processHighlighter () {
if (highlights == null) return;
highlights.clear();
if (highlighter != null) highlighter.process(this, highlights);
chunkUpdateScheduled = true;
} | [
"public",
"void",
"processHighlighter",
"(",
")",
"{",
"if",
"(",
"highlights",
"==",
"null",
")",
"return",
";",
"highlights",
".",
"clear",
"(",
")",
";",
"if",
"(",
"highlighter",
"!=",
"null",
")",
"highlighter",
".",
"process",
"(",
"this",
",",
"... | Processes highlighter rules, collects created highlights and schedules text area displayed text update. This should be called
after highlighter rules has changed to update highlights. | [
"Processes",
"highlighter",
"rules",
"collects",
"created",
"highlights",
"and",
"schedules",
"text",
"area",
"displayed",
"text",
"update",
".",
"This",
"should",
"be",
"called",
"after",
"highlighter",
"rules",
"has",
"changed",
"to",
"update",
"highlights",
"."... | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/HighlightTextArea.java#L173-L178 |
117,071 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java | SimpleFormValidator.notEmpty | public FormInputValidator notEmpty (VisValidatableTextField field, String errorMsg) {
EmptyInputValidator validator = new EmptyInputValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | java | public FormInputValidator notEmpty (VisValidatableTextField field, String errorMsg) {
EmptyInputValidator validator = new EmptyInputValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"notEmpty",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"EmptyInputValidator",
"validator",
"=",
"new",
"EmptyInputValidator",
"(",
"errorMsg",
")",
";",
"field",
".",
"addValidator",
"(",
"validator",
... | Validates if file is not empty | [
"Validates",
"if",
"file",
"is",
"not",
"empty"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java#L98-L103 |
117,072 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java | SimpleFormValidator.integerNumber | public FormInputValidator integerNumber (VisValidatableTextField field, String errorMsg) {
ValidatorWrapper wrapper = new ValidatorWrapper(errorMsg, Validators.INTEGERS);
field.addValidator(wrapper);
add(field);
return wrapper;
} | java | public FormInputValidator integerNumber (VisValidatableTextField field, String errorMsg) {
ValidatorWrapper wrapper = new ValidatorWrapper(errorMsg, Validators.INTEGERS);
field.addValidator(wrapper);
add(field);
return wrapper;
} | [
"public",
"FormInputValidator",
"integerNumber",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"ValidatorWrapper",
"wrapper",
"=",
"new",
"ValidatorWrapper",
"(",
"errorMsg",
",",
"Validators",
".",
"INTEGERS",
")",
";",
"field",
".",... | Validates if entered text is integer number | [
"Validates",
"if",
"entered",
"text",
"is",
"integer",
"number"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java#L106-L111 |
117,073 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java | SimpleFormValidator.floatNumber | public FormInputValidator floatNumber (VisValidatableTextField field, String errorMsg) {
ValidatorWrapper wrapper = new ValidatorWrapper(errorMsg, Validators.FLOATS);
field.addValidator(wrapper);
add(field);
return wrapper;
} | java | public FormInputValidator floatNumber (VisValidatableTextField field, String errorMsg) {
ValidatorWrapper wrapper = new ValidatorWrapper(errorMsg, Validators.FLOATS);
field.addValidator(wrapper);
add(field);
return wrapper;
} | [
"public",
"FormInputValidator",
"floatNumber",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"ValidatorWrapper",
"wrapper",
"=",
"new",
"ValidatorWrapper",
"(",
"errorMsg",
",",
"Validators",
".",
"FLOATS",
")",
";",
"field",
".",
"... | Validates if entered text is float number | [
"Validates",
"if",
"entered",
"text",
"is",
"float",
"number"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java#L114-L119 |
117,074 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java | SimpleFormValidator.custom | public FormInputValidator custom (VisValidatableTextField field, FormInputValidator customValidator) {
field.addValidator(customValidator);
add(field);
return customValidator;
} | java | public FormInputValidator custom (VisValidatableTextField field, FormInputValidator customValidator) {
field.addValidator(customValidator);
add(field);
return customValidator;
} | [
"public",
"FormInputValidator",
"custom",
"(",
"VisValidatableTextField",
"field",
",",
"FormInputValidator",
"customValidator",
")",
"{",
"field",
".",
"addValidator",
"(",
"customValidator",
")",
";",
"add",
"(",
"field",
")",
";",
"return",
"customValidator",
";"... | Allows to add custom validator to field | [
"Allows",
"to",
"add",
"custom",
"validator",
"to",
"field"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java#L160-L164 |
117,075 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java | SimpleFormValidator.validate | public void validate () {
formInvalid = false;
errorMsgText = null;
for (CheckedButtonWrapper wrapper : buttons) {
if (wrapper.button.isChecked() != wrapper.mustBeChecked) {
wrapper.setButtonStateInvalid(true);
} else {
wrapper.setButtonStateInvalid(false);
}
}
for (CheckedButtonWrapper wra... | java | public void validate () {
formInvalid = false;
errorMsgText = null;
for (CheckedButtonWrapper wrapper : buttons) {
if (wrapper.button.isChecked() != wrapper.mustBeChecked) {
wrapper.setButtonStateInvalid(true);
} else {
wrapper.setButtonStateInvalid(false);
}
}
for (CheckedButtonWrapper wra... | [
"public",
"void",
"validate",
"(",
")",
"{",
"formInvalid",
"=",
"false",
";",
"errorMsgText",
"=",
"null",
";",
"for",
"(",
"CheckedButtonWrapper",
"wrapper",
":",
"buttons",
")",
"{",
"if",
"(",
"wrapper",
".",
"button",
".",
"isChecked",
"(",
")",
"!=... | Performs full check of this form, typically there is no need to call this method manually since form will be automatically
validated upon field content change. However calling this might be required when change made to field state does not
cause change event to be fired. For example disabling or enabling field. | [
"Performs",
"full",
"check",
"of",
"this",
"form",
"typically",
"there",
"is",
"no",
"need",
"to",
"call",
"this",
"method",
"manually",
"since",
"form",
"will",
"be",
"automatically",
"validated",
"upon",
"field",
"content",
"change",
".",
"However",
"calling... | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java#L231-L289 |
117,076 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/VisTextArea.java | VisTextArea.sizeChanged | @Override
protected void sizeChanged () {
lastText = null; // Cause calculateOffsets to recalculate the line breaks.
// The number of lines showed must be updated whenever the height is updated
BitmapFont font = style.font;
Drawable background = style.background;
float availableHeight = getHeight() - (backg... | java | @Override
protected void sizeChanged () {
lastText = null; // Cause calculateOffsets to recalculate the line breaks.
// The number of lines showed must be updated whenever the height is updated
BitmapFont font = style.font;
Drawable background = style.background;
float availableHeight = getHeight() - (backg... | [
"@",
"Override",
"protected",
"void",
"sizeChanged",
"(",
")",
"{",
"lastText",
"=",
"null",
";",
"// Cause calculateOffsets to recalculate the line breaks.",
"// The number of lines showed must be updated whenever the height is updated",
"BitmapFont",
"font",
"=",
"style",
".",
... | OVERRIDE from TextField | [
"OVERRIDE",
"from",
"TextField"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/VisTextArea.java#L213-L222 |
117,077 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.fileExists | public FormInputValidator fileExists (VisValidatableTextField field, String errorMsg) {
FileExistsValidator validator = new FileExistsValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | java | public FormInputValidator fileExists (VisValidatableTextField field, String errorMsg) {
FileExistsValidator validator = new FileExistsValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"fileExists",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"FileExistsValidator",
"validator",
"=",
"new",
"FileExistsValidator",
"(",
"errorMsg",
")",
";",
"field",
".",
"addValidator",
"(",
"validator"... | Validates if absolute path entered in text field points to an existing file. | [
"Validates",
"if",
"absolute",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"file",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L57-L62 |
117,078 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.fileExists | public FormInputValidator fileExists (VisValidatableTextField field, FileHandle relativeTo, String errorMsg) {
FileExistsValidator validator = new FileExistsValidator(relativeTo.file(), errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | java | public FormInputValidator fileExists (VisValidatableTextField field, FileHandle relativeTo, String errorMsg) {
FileExistsValidator validator = new FileExistsValidator(relativeTo.file(), errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"fileExists",
"(",
"VisValidatableTextField",
"field",
",",
"FileHandle",
"relativeTo",
",",
"String",
"errorMsg",
")",
"{",
"FileExistsValidator",
"validator",
"=",
"new",
"FileExistsValidator",
"(",
"relativeTo",
".",
"file",
"(",
")"... | Validates if relative path entered in text field points to an existing file.
@param relativeTo path of this file is used to create absolute path from entered in field (see {@link FileExistsValidator}). | [
"Validates",
"if",
"relative",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"file",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L103-L109 |
117,079 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.directory | public FormInputValidator directory (VisValidatableTextField field, String errorMsg) {
DirectoryValidator validator = new DirectoryValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | java | public FormInputValidator directory (VisValidatableTextField field, String errorMsg) {
DirectoryValidator validator = new DirectoryValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"directory",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"DirectoryValidator",
"validator",
"=",
"new",
"DirectoryValidator",
"(",
"errorMsg",
")",
";",
"field",
".",
"addValidator",
"(",
"validator",
... | Validates if relative path entered in text field points to an existing directory. | [
"Validates",
"if",
"relative",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"directory",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L156-L161 |
117,080 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.directoryEmpty | public FormInputValidator directoryEmpty (VisValidatableTextField field, String errorMsg) {
DirectoryContentValidator validator = new DirectoryContentValidator(errorMsg, true);
field.addValidator(validator);
add(field);
return validator;
} | java | public FormInputValidator directoryEmpty (VisValidatableTextField field, String errorMsg) {
DirectoryContentValidator validator = new DirectoryContentValidator(errorMsg, true);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"directoryEmpty",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"DirectoryContentValidator",
"validator",
"=",
"new",
"DirectoryContentValidator",
"(",
"errorMsg",
",",
"true",
")",
";",
"field",
".",
"ad... | Validates if relative path entered in text field points to an existing and empty directory. | [
"Validates",
"if",
"relative",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"and",
"empty",
"directory",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L164-L169 |
117,081 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.directoryNotEmpty | public FormInputValidator directoryNotEmpty (VisValidatableTextField field, String errorMsg) {
DirectoryContentValidator validator = new DirectoryContentValidator(errorMsg, false);
field.addValidator(validator);
add(field);
return validator;
} | java | public FormInputValidator directoryNotEmpty (VisValidatableTextField field, String errorMsg) {
DirectoryContentValidator validator = new DirectoryContentValidator(errorMsg, false);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"directoryNotEmpty",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"DirectoryContentValidator",
"validator",
"=",
"new",
"DirectoryContentValidator",
"(",
"errorMsg",
",",
"false",
")",
";",
"field",
".",
... | Validates if relative path entered in text field points to an existing and non empty directory. | [
"Validates",
"if",
"relative",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"and",
"non",
"empty",
"directory",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L172-L177 |
117,082 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/tabbedpane/TabbedPane.java | TabbedPane.remove | public boolean remove (final Tab tab, boolean ignoreTabDirty) {
checkIfTabsBelongsToThisPane(tab);
if (ignoreTabDirty) {
return removeTab(tab);
}
if (tab.isDirty() && mainTable.getStage() != null) {
Dialogs.showOptionDialog(mainTable.getStage(), Text.UNSAVED_DIALOG_TITLE.get(), Text.UNSAVED_DIALOG_TEXT.... | java | public boolean remove (final Tab tab, boolean ignoreTabDirty) {
checkIfTabsBelongsToThisPane(tab);
if (ignoreTabDirty) {
return removeTab(tab);
}
if (tab.isDirty() && mainTable.getStage() != null) {
Dialogs.showOptionDialog(mainTable.getStage(), Text.UNSAVED_DIALOG_TITLE.get(), Text.UNSAVED_DIALOG_TEXT.... | [
"public",
"boolean",
"remove",
"(",
"final",
"Tab",
"tab",
",",
"boolean",
"ignoreTabDirty",
")",
"{",
"checkIfTabsBelongsToThisPane",
"(",
"tab",
")",
";",
"if",
"(",
"ignoreTabDirty",
")",
"{",
"return",
"removeTab",
"(",
"tab",
")",
";",
"}",
"if",
"(",... | Removes tab from pane, if tab is dirty and 'ignoreTabDirty == false' this will cause to display "Unsaved changes" dialog!
@return true if tab was removed, false if that tab wasn't added to this pane or "Unsaved changes" dialog was started | [
"Removes",
"tab",
"from",
"pane",
"if",
"tab",
"is",
"dirty",
"and",
"ignoreTabDirty",
"==",
"false",
"this",
"will",
"cause",
"to",
"display",
"Unsaved",
"changes",
"dialog!"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/tabbedpane/TabbedPane.java#L345-L371 |
117,083 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/tabbedpane/TabbedPane.java | TabbedPane.removeAll | public void removeAll () {
for (Tab tab : tabs) {
tab.setPane(null);
tab.onHide();
tab.dispose();
}
tabs.clear();
tabsButtonMap.clear();
tabsPane.clear();
notifyListenersRemovedAll();
} | java | public void removeAll () {
for (Tab tab : tabs) {
tab.setPane(null);
tab.onHide();
tab.dispose();
}
tabs.clear();
tabsButtonMap.clear();
tabsPane.clear();
notifyListenersRemovedAll();
} | [
"public",
"void",
"removeAll",
"(",
")",
"{",
"for",
"(",
"Tab",
"tab",
":",
"tabs",
")",
"{",
"tab",
".",
"setPane",
"(",
"null",
")",
";",
"tab",
".",
"onHide",
"(",
")",
";",
"tab",
".",
"dispose",
"(",
")",
";",
"}",
"tabs",
".",
"clear",
... | Removes all tabs, ignores if tab is dirty | [
"Removes",
"all",
"tabs",
"ignores",
"if",
"tab",
"is",
"dirty"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/tabbedpane/TabbedPane.java#L407-L419 |
117,084 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/Menu.java | Menu.setMenuBar | void setMenuBar (MenuBar menuBar) {
if (this.menuBar != null && menuBar != null) throw new IllegalStateException("Menu was already added to MenuBar");
this.menuBar = menuBar;
} | java | void setMenuBar (MenuBar menuBar) {
if (this.menuBar != null && menuBar != null) throw new IllegalStateException("Menu was already added to MenuBar");
this.menuBar = menuBar;
} | [
"void",
"setMenuBar",
"(",
"MenuBar",
"menuBar",
")",
"{",
"if",
"(",
"this",
".",
"menuBar",
"!=",
"null",
"&&",
"menuBar",
"!=",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Menu was already added to MenuBar\"",
")",
";",
"this",
".",
"menuB... | Called by MenuBar when this menu is added to it | [
"Called",
"by",
"MenuBar",
"when",
"this",
"menu",
"is",
"added",
"to",
"it"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/Menu.java#L99-L102 |
117,085 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/VisWindow.java | VisWindow.centerWindow | public boolean centerWindow () {
Group parent = getParent();
if (parent == null) {
centerOnAdd = true;
return false;
} else {
moveToCenter();
return true;
}
} | java | public boolean centerWindow () {
Group parent = getParent();
if (parent == null) {
centerOnAdd = true;
return false;
} else {
moveToCenter();
return true;
}
} | [
"public",
"boolean",
"centerWindow",
"(",
")",
"{",
"Group",
"parent",
"=",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"centerOnAdd",
"=",
"true",
";",
"return",
"false",
";",
"}",
"else",
"{",
"moveToCenter",
"(",
")",
... | Centers this window, if it has parent it will be done instantly, if it does not have parent it will be centered when it will
be added to stage
@return true when window was centered, false when window will be centered when added to stage | [
"Centers",
"this",
"window",
"if",
"it",
"has",
"parent",
"it",
"will",
"be",
"done",
"instantly",
"if",
"it",
"does",
"not",
"have",
"parent",
"it",
"will",
"be",
"centered",
"when",
"it",
"will",
"be",
"added",
"to",
"stage"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/VisWindow.java#L76-L85 |
117,086 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/VisWindow.java | VisWindow.fadeOut | public void fadeOut (float time) {
if (fadeOutActionRunning) return;
fadeOutActionRunning = true;
final Touchable previousTouchable = getTouchable();
setTouchable(Touchable.disabled);
Stage stage = getStage();
if (stage != null && stage.getKeyboardFocus() != null && stage.getKeyboardFocus().isDescendantOf(t... | java | public void fadeOut (float time) {
if (fadeOutActionRunning) return;
fadeOutActionRunning = true;
final Touchable previousTouchable = getTouchable();
setTouchable(Touchable.disabled);
Stage stage = getStage();
if (stage != null && stage.getKeyboardFocus() != null && stage.getKeyboardFocus().isDescendantOf(t... | [
"public",
"void",
"fadeOut",
"(",
"float",
"time",
")",
"{",
"if",
"(",
"fadeOutActionRunning",
")",
"return",
";",
"fadeOutActionRunning",
"=",
"true",
";",
"final",
"Touchable",
"previousTouchable",
"=",
"getTouchable",
"(",
")",
";",
"setTouchable",
"(",
"T... | Fade outs this window, when fade out animation is completed, window is removed from Stage. Calling this for the
second time won't have any effect if previous animation is still running. | [
"Fade",
"outs",
"this",
"window",
"when",
"fade",
"out",
"animation",
"is",
"completed",
"window",
"is",
"removed",
"from",
"Stage",
".",
"Calling",
"this",
"for",
"the",
"second",
"time",
"won",
"t",
"have",
"any",
"effect",
"if",
"previous",
"animation",
... | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/VisWindow.java#L118-L137 |
117,087 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showOKDialog | public static VisDialog showOKDialog (Stage stage, String title, String text) {
final VisDialog dialog = new VisDialog(title);
dialog.closeOnEscape();
dialog.text(text);
dialog.button(ButtonType.OK.getText()).padBottom(3);
dialog.pack();
dialog.centerWindow();
dialog.addListener(new InputListener() {
@... | java | public static VisDialog showOKDialog (Stage stage, String title, String text) {
final VisDialog dialog = new VisDialog(title);
dialog.closeOnEscape();
dialog.text(text);
dialog.button(ButtonType.OK.getText()).padBottom(3);
dialog.pack();
dialog.centerWindow();
dialog.addListener(new InputListener() {
@... | [
"public",
"static",
"VisDialog",
"showOKDialog",
"(",
"Stage",
"stage",
",",
"String",
"title",
",",
"String",
"text",
")",
"{",
"final",
"VisDialog",
"dialog",
"=",
"new",
"VisDialog",
"(",
"title",
")",
";",
"dialog",
".",
"closeOnEscape",
"(",
")",
";",... | Dialog with given text and single OK button.
@param title dialog title | [
"Dialog",
"with",
"given",
"text",
"and",
"single",
"OK",
"button",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L53-L72 |
117,088 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showOptionDialog | public static OptionDialog showOptionDialog (Stage stage, String title, String text, OptionDialogType type, OptionDialogListener listener) {
OptionDialog dialog = new OptionDialog(title, text, type, listener);
stage.addActor(dialog.fadeIn());
return dialog;
} | java | public static OptionDialog showOptionDialog (Stage stage, String title, String text, OptionDialogType type, OptionDialogListener listener) {
OptionDialog dialog = new OptionDialog(title, text, type, listener);
stage.addActor(dialog.fadeIn());
return dialog;
} | [
"public",
"static",
"OptionDialog",
"showOptionDialog",
"(",
"Stage",
"stage",
",",
"String",
"title",
",",
"String",
"text",
",",
"OptionDialogType",
"type",
",",
"OptionDialogListener",
"listener",
")",
"{",
"OptionDialog",
"dialog",
"=",
"new",
"OptionDialog",
... | Dialog with text and buttons like Yes, No, Cancel.
@param title dialog title
@param type specifies what types of buttons will this dialog have
@param listener dialog buttons listener.
@return dialog for the purpose of changing buttons text.
@see OptionDialog
@since 0.6.0 | [
"Dialog",
"with",
"text",
"and",
"buttons",
"like",
"Yes",
"No",
"Cancel",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L83-L87 |
117,089 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showInputDialog | public static InputDialog showInputDialog (Stage stage, String title, String fieldTitle, InputDialogListener listener) {
InputDialog dialog = new InputDialog(title, fieldTitle, true, null, listener);
stage.addActor(dialog.fadeIn());
return dialog;
} | java | public static InputDialog showInputDialog (Stage stage, String title, String fieldTitle, InputDialogListener listener) {
InputDialog dialog = new InputDialog(title, fieldTitle, true, null, listener);
stage.addActor(dialog.fadeIn());
return dialog;
} | [
"public",
"static",
"InputDialog",
"showInputDialog",
"(",
"Stage",
"stage",
",",
"String",
"title",
",",
"String",
"fieldTitle",
",",
"InputDialogListener",
"listener",
")",
"{",
"InputDialog",
"dialog",
"=",
"new",
"InputDialog",
"(",
"title",
",",
"fieldTitle",... | Dialog with text and text field for user input. Cannot be canceled.
@param title dialog title.
@param fieldTitle displayed before input field, may be null.
@param listener dialog buttons listener. | [
"Dialog",
"with",
"text",
"and",
"text",
"field",
"for",
"user",
"input",
".",
"Cannot",
"be",
"canceled",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L110-L114 |
117,090 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showErrorDialog | public static DetailsDialog showErrorDialog (Stage stage, String text) {
return showErrorDialog(stage, text, (String) null);
} | java | public static DetailsDialog showErrorDialog (Stage stage, String text) {
return showErrorDialog(stage, text, (String) null);
} | [
"public",
"static",
"DetailsDialog",
"showErrorDialog",
"(",
"Stage",
"stage",
",",
"String",
"text",
")",
"{",
"return",
"showErrorDialog",
"(",
"stage",
",",
"text",
",",
"(",
"String",
")",
"null",
")",
";",
"}"
] | Dialog with title "Error" and provided text. | [
"Dialog",
"with",
"title",
"Error",
"and",
"provided",
"text",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L156-L158 |
117,091 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showErrorDialog | public static DetailsDialog showErrorDialog (Stage stage, String text, Throwable exception) {
if (exception == null)
return showErrorDialog(stage, text, (String) null);
else
return showErrorDialog(stage, text, getStackTrace(exception));
} | java | public static DetailsDialog showErrorDialog (Stage stage, String text, Throwable exception) {
if (exception == null)
return showErrorDialog(stage, text, (String) null);
else
return showErrorDialog(stage, text, getStackTrace(exception));
} | [
"public",
"static",
"DetailsDialog",
"showErrorDialog",
"(",
"Stage",
"stage",
",",
"String",
"text",
",",
"Throwable",
"exception",
")",
"{",
"if",
"(",
"exception",
"==",
"null",
")",
"return",
"showErrorDialog",
"(",
"stage",
",",
"text",
",",
"(",
"Strin... | Dialog with title "Error", provided text and exception stacktrace available after pressing 'Details' button. | [
"Dialog",
"with",
"title",
"Error",
"provided",
"text",
"and",
"exception",
"stacktrace",
"available",
"after",
"pressing",
"Details",
"button",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L161-L166 |
117,092 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showErrorDialog | public static DetailsDialog showErrorDialog (Stage stage, String text, String details) {
DetailsDialog dialog = new DetailsDialog(text, Text.ERROR.get(), details);
stage.addActor(dialog.fadeIn());
return dialog;
} | java | public static DetailsDialog showErrorDialog (Stage stage, String text, String details) {
DetailsDialog dialog = new DetailsDialog(text, Text.ERROR.get(), details);
stage.addActor(dialog.fadeIn());
return dialog;
} | [
"public",
"static",
"DetailsDialog",
"showErrorDialog",
"(",
"Stage",
"stage",
",",
"String",
"text",
",",
"String",
"details",
")",
"{",
"DetailsDialog",
"dialog",
"=",
"new",
"DetailsDialog",
"(",
"text",
",",
"Text",
".",
"ERROR",
".",
"get",
"(",
")",
... | Dialog with title "Error", provided text, and provided details available after pressing 'Details' button. | [
"Dialog",
"with",
"title",
"Error",
"provided",
"text",
"and",
"provided",
"details",
"available",
"after",
"pressing",
"Details",
"button",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L169-L173 |
117,093 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/toast/MessageToast.java | MessageToast.addLinkLabel | public void addLinkLabel (String text, LinkLabel.LinkLabelListener labelListener) {
LinkLabel label = new LinkLabel(text);
label.setListener(labelListener);
linkLabelTable.add(label).spaceRight(12);
} | java | public void addLinkLabel (String text, LinkLabel.LinkLabelListener labelListener) {
LinkLabel label = new LinkLabel(text);
label.setListener(labelListener);
linkLabelTable.add(label).spaceRight(12);
} | [
"public",
"void",
"addLinkLabel",
"(",
"String",
"text",
",",
"LinkLabel",
".",
"LinkLabelListener",
"labelListener",
")",
"{",
"LinkLabel",
"label",
"=",
"new",
"LinkLabel",
"(",
"text",
")",
";",
"label",
".",
"setListener",
"(",
"labelListener",
")",
";",
... | Adds new link label below toast message.
@param text link label text
@param labelListener will be called upon label click. Note that toast won't be closed automatically so {@link Toast#fadeOut()}
must be called | [
"Adds",
"new",
"link",
"label",
"below",
"toast",
"message",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/toast/MessageToast.java#L44-L48 |
117,094 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/spinner/FloatSpinnerModel.java | FloatSpinnerModel.setMin | public void setMin (BigDecimal min) {
if (min.compareTo(max) > 0) throw new IllegalArgumentException("min can't be > max");
this.min = min;
if (min.compareTo(BigDecimal.ZERO) >= 0) {
textFieldFilter.setAcceptNegativeValues(false);
} else {
textFieldFilter.setAcceptNegativeValues(true);
}
if (curren... | java | public void setMin (BigDecimal min) {
if (min.compareTo(max) > 0) throw new IllegalArgumentException("min can't be > max");
this.min = min;
if (min.compareTo(BigDecimal.ZERO) >= 0) {
textFieldFilter.setAcceptNegativeValues(false);
} else {
textFieldFilter.setAcceptNegativeValues(true);
}
if (curren... | [
"public",
"void",
"setMin",
"(",
"BigDecimal",
"min",
")",
"{",
"if",
"(",
"min",
".",
"compareTo",
"(",
"max",
")",
">",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"min can't be > max\"",
")",
";",
"this",
".",
"min",
"=",
"min",
";",
... | Sets min value. If current is lesser than min, the current value is set to min value | [
"Sets",
"min",
"value",
".",
"If",
"current",
"is",
"lesser",
"than",
"min",
"the",
"current",
"value",
"is",
"set",
"to",
"min",
"value"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/spinner/FloatSpinnerModel.java#L202-L217 |
117,095 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java | ColorUtils.HSVtoRGB | public static Color HSVtoRGB (float h, float s, float v, float alpha) {
Color c = HSVtoRGB(h, s, v);
c.a = alpha;
return c;
} | java | public static Color HSVtoRGB (float h, float s, float v, float alpha) {
Color c = HSVtoRGB(h, s, v);
c.a = alpha;
return c;
} | [
"public",
"static",
"Color",
"HSVtoRGB",
"(",
"float",
"h",
",",
"float",
"s",
",",
"float",
"v",
",",
"float",
"alpha",
")",
"{",
"Color",
"c",
"=",
"HSVtoRGB",
"(",
"h",
",",
"s",
",",
"v",
")",
";",
"c",
".",
"a",
"=",
"alpha",
";",
"return"... | Converts HSV to RGB
@param h hue 0-360
@param s saturation 0-100
@param v value 0-100
@param alpha 0-1
@return RGB values in LibGDX {@link Color} class | [
"Converts",
"HSV",
"to",
"RGB"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java#L36-L40 |
117,096 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java | ColorUtils.RGBtoHSV | public static int[] RGBtoHSV (float r, float g, float b) {
float h, s, v;
float min, max, delta;
min = Math.min(Math.min(r, g), b);
max = Math.max(Math.max(r, g), b);
v = max;
delta = max - min;
if (max != 0)
s = delta / max;
else {
s = 0;
h = 0;
return new int[]{MathUtils.round(h), MathU... | java | public static int[] RGBtoHSV (float r, float g, float b) {
float h, s, v;
float min, max, delta;
min = Math.min(Math.min(r, g), b);
max = Math.max(Math.max(r, g), b);
v = max;
delta = max - min;
if (max != 0)
s = delta / max;
else {
s = 0;
h = 0;
return new int[]{MathUtils.round(h), MathU... | [
"public",
"static",
"int",
"[",
"]",
"RGBtoHSV",
"(",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
")",
"{",
"float",
"h",
",",
"s",
",",
"v",
";",
"float",
"min",
",",
"max",
",",
"delta",
";",
"min",
"=",
"Math",
".",
"min",
"(",
"Ma... | Converts RGB to HSV color system
@param r red 0-1
@param g green 0-1
@param b blue 0-1
@return 3 element int array with hue (0-360), saturation (0-100) and value (0-100) | [
"Converts",
"RGB",
"to",
"HSV",
"color",
"system"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java#L130-L168 |
117,097 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/highlight/BaseHighlighter.java | BaseHighlighter.word | public void word (Color color, String... words) {
for (String word : words) {
addRule(new WordHighlightRule(color, word));
}
} | java | public void word (Color color, String... words) {
for (String word : words) {
addRule(new WordHighlightRule(color, word));
}
} | [
"public",
"void",
"word",
"(",
"Color",
"color",
",",
"String",
"...",
"words",
")",
"{",
"for",
"(",
"String",
"word",
":",
"words",
")",
"{",
"addRule",
"(",
"new",
"WordHighlightRule",
"(",
"color",
",",
"word",
")",
")",
";",
"}",
"}"
] | Adds word based highlighter rule. Utility method allowing to add many words at once.
@see #word(Color, String)
@see WordHighlightRule | [
"Adds",
"word",
"based",
"highlighter",
"rule",
".",
"Utility",
"method",
"allowing",
"to",
"add",
"many",
"words",
"at",
"once",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/highlight/BaseHighlighter.java#L52-L56 |
117,098 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/highlight/BaseHighlighter.java | BaseHighlighter.process | public void process (HighlightTextArea textArea, Array<Highlight> highlights) {
for (HighlightRule rule : rules) {
rule.process(textArea, highlights);
}
} | java | public void process (HighlightTextArea textArea, Array<Highlight> highlights) {
for (HighlightRule rule : rules) {
rule.process(textArea, highlights);
}
} | [
"public",
"void",
"process",
"(",
"HighlightTextArea",
"textArea",
",",
"Array",
"<",
"Highlight",
">",
"highlights",
")",
"{",
"for",
"(",
"HighlightRule",
"rule",
":",
"rules",
")",
"{",
"rule",
".",
"process",
"(",
"textArea",
",",
"highlights",
")",
";... | Process all rules in this highlighter.
@param highlights current highlights, new highlights can be added to this list however it should not be modified in any other ways | [
"Process",
"all",
"rules",
"in",
"this",
"highlighter",
"."
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/highlight/BaseHighlighter.java#L62-L66 |
117,099 | kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/color/BasicColorPicker.java | BasicColorPicker.updateValuesFromCurrentColor | protected void updateValuesFromCurrentColor () {
int[] hsv = ColorUtils.RGBtoHSV(color);
int ch = hsv[0];
int cs = hsv[1];
int cv = hsv[2];
verticalBar.setValue(ch);
palette.setValue(cs, cv);
} | java | protected void updateValuesFromCurrentColor () {
int[] hsv = ColorUtils.RGBtoHSV(color);
int ch = hsv[0];
int cs = hsv[1];
int cv = hsv[2];
verticalBar.setValue(ch);
palette.setValue(cs, cv);
} | [
"protected",
"void",
"updateValuesFromCurrentColor",
"(",
")",
"{",
"int",
"[",
"]",
"hsv",
"=",
"ColorUtils",
".",
"RGBtoHSV",
"(",
"color",
")",
";",
"int",
"ch",
"=",
"hsv",
"[",
"0",
"]",
";",
"int",
"cs",
"=",
"hsv",
"[",
"1",
"]",
";",
"int",... | Updates picker ui from current color | [
"Updates",
"picker",
"ui",
"from",
"current",
"color"
] | 3b68f82d94ae32bffa2a3399c63f432e0f4908e0 | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/color/BasicColorPicker.java#L221-L229 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.