repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/geom/Ellipsoid.java | Ellipsoid.of | public static Ellipsoid of(
final String name,
final double a,
final double b,
final double f
) {
return new Ellipsoid(name, a, b, f);
} | java | public static Ellipsoid of(
final String name,
final double a,
final double b,
final double f
) {
return new Ellipsoid(name, a, b, f);
} | [
"public",
"static",
"Ellipsoid",
"of",
"(",
"final",
"String",
"name",
",",
"final",
"double",
"a",
",",
"final",
"double",
"b",
",",
"final",
"double",
"f",
")",
"{",
"return",
"new",
"Ellipsoid",
"(",
"name",
",",
"a",
",",
"b",
",",
"f",
")",
";... | Create a new earth ellipsoid with the given parameters.
@param name the name of the earth ellipsoid model
@param a the equatorial radius, in meter
@param b the polar radius, in meter
@param f the inverse flattening
@return a new earth ellipsoid with the given parameters | [
"Create",
"a",
"new",
"earth",
"ellipsoid",
"with",
"the",
"given",
"parameters",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/geom/Ellipsoid.java#L158-L165 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/GPX.java | GPX.builder | @Deprecated
public static Builder builder(final String version, final String creator) {
return new Builder(Version.of(version), creator);
} | java | @Deprecated
public static Builder builder(final String version, final String creator) {
return new Builder(Version.of(version), creator);
} | [
"@",
"Deprecated",
"public",
"static",
"Builder",
"builder",
"(",
"final",
"String",
"version",
",",
"final",
"String",
"creator",
")",
"{",
"return",
"new",
"Builder",
"(",
"Version",
".",
"of",
"(",
"version",
")",
",",
"creator",
")",
";",
"}"
] | Create a new GPX builder with the given GPX version and creator string.
@param version the GPX version string
@param creator the GPX creator
@return new GPX builder
@throws NullPointerException if one of the arguments is {@code null}
@deprecated Use {@link #builder(Version, String)} instead. | [
"Create",
"a",
"new",
"GPX",
"builder",
"with",
"the",
"given",
"GPX",
"version",
"and",
"creator",
"string",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/GPX.java#L974-L977 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/GPX.java | GPX.reader | public static Reader reader(final Version version, final Mode mode) {
return new Reader(GPX.xmlReader(version), mode);
} | java | public static Reader reader(final Version version, final Mode mode) {
return new Reader(GPX.xmlReader(version), mode);
} | [
"public",
"static",
"Reader",
"reader",
"(",
"final",
"Version",
"version",
",",
"final",
"Mode",
"mode",
")",
"{",
"return",
"new",
"Reader",
"(",
"GPX",
".",
"xmlReader",
"(",
"version",
")",
",",
"mode",
")",
";",
"}"
] | Return a GPX reader, reading GPX files with the given version and in the
given reading mode.
@since 1.3
@see #reader()
@param version the GPX version to read
@param mode the reading mode
@return a new GPX reader object
@throws NullPointerException if one of the arguments is {@code null} | [
"Return",
"a",
"GPX",
"reader",
"reading",
"GPX",
"files",
"with",
"the",
"given",
"version",
"and",
"in",
"the",
"given",
"reading",
"mode",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/GPX.java#L1731-L1733 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/GPX.java | GPX.reader | public static Reader reader(final Version version) {
return new Reader(GPX.xmlReader(version), Mode.STRICT);
} | java | public static Reader reader(final Version version) {
return new Reader(GPX.xmlReader(version), Mode.STRICT);
} | [
"public",
"static",
"Reader",
"reader",
"(",
"final",
"Version",
"version",
")",
"{",
"return",
"new",
"Reader",
"(",
"GPX",
".",
"xmlReader",
"(",
"version",
")",
",",
"Mode",
".",
"STRICT",
")",
";",
"}"
] | Return a GPX reader, reading GPX files with the given version and in
strict reading mode.
@since 1.3
@see #reader()
@param version the GPX version to read
@return a new GPX reader object
@throws NullPointerException if one of the arguments is {@code null} | [
"Return",
"a",
"GPX",
"reader",
"reading",
"GPX",
"files",
"with",
"the",
"given",
"version",
"and",
"in",
"strict",
"reading",
"mode",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/GPX.java#L1747-L1749 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/GPX.java | GPX.reader | public static Reader reader(final Mode mode) {
return new Reader(GPX.xmlReader(Version.V11), mode);
} | java | public static Reader reader(final Mode mode) {
return new Reader(GPX.xmlReader(Version.V11), mode);
} | [
"public",
"static",
"Reader",
"reader",
"(",
"final",
"Mode",
"mode",
")",
"{",
"return",
"new",
"Reader",
"(",
"GPX",
".",
"xmlReader",
"(",
"Version",
".",
"V11",
")",
",",
"mode",
")",
";",
"}"
] | Return a GPX reader, reading GPX files with version 1.1 and in the given
reading mode.
@since 1.3
@see #reader()
@param mode the reading mode
@return a new GPX reader object
@throws NullPointerException if one of the arguments is {@code null} | [
"Return",
"a",
"GPX",
"reader",
"reading",
"GPX",
"files",
"with",
"version",
"1",
".",
"1",
"and",
"in",
"the",
"given",
"reading",
"mode",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/GPX.java#L1763-L1765 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/format/LocationFormatter.java | LocationFormatter.toPattern | public String toPattern() {
return _formats.stream()
.map(Objects::toString)
.collect(Collectors.joining());
} | java | public String toPattern() {
return _formats.stream()
.map(Objects::toString)
.collect(Collectors.joining());
} | [
"public",
"String",
"toPattern",
"(",
")",
"{",
"return",
"_formats",
".",
"stream",
"(",
")",
".",
"map",
"(",
"Objects",
"::",
"toString",
")",
".",
"collect",
"(",
"Collectors",
".",
"joining",
"(",
")",
")",
";",
"}"
] | Return the pattern string represented by this formatter.
@see #ofPattern(String)
@return the pattern string of {@code this} formatter | [
"Return",
"the",
"pattern",
"string",
"represented",
"by",
"this",
"formatter",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/format/LocationFormatter.java#L301-L305 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/IO.java | IO.readString | static String readString(final DataInput in) throws IOException {
final byte[] bytes = new byte[readInt(in)];
in.readFully(bytes);
return new String(bytes, "UTF-8");
} | java | static String readString(final DataInput in) throws IOException {
final byte[] bytes = new byte[readInt(in)];
in.readFully(bytes);
return new String(bytes, "UTF-8");
} | [
"static",
"String",
"readString",
"(",
"final",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"readInt",
"(",
"in",
")",
"]",
";",
"in",
".",
"readFully",
"(",
"bytes",
")",
";",
"r... | Reads a string value from the given data input.
@param in the data input
@return the read string value
@throws NullPointerException if one of the given arguments is {@code null}
@throws IOException if an I/O error occurs | [
"Reads",
"a",
"string",
"value",
"from",
"the",
"given",
"data",
"input",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/IO.java#L129-L133 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/IO.java | IO.writes | static <T> void writes(
final Collection<? extends T> elements,
final Writer<? super T> writer,
final DataOutput out
)
throws IOException
{
writeInt(elements.size(), out);
for (T element : elements) {
writer.write(element, out);
}
} | java | static <T> void writes(
final Collection<? extends T> elements,
final Writer<? super T> writer,
final DataOutput out
)
throws IOException
{
writeInt(elements.size(), out);
for (T element : elements) {
writer.write(element, out);
}
} | [
"static",
"<",
"T",
">",
"void",
"writes",
"(",
"final",
"Collection",
"<",
"?",
"extends",
"T",
">",
"elements",
",",
"final",
"Writer",
"<",
"?",
"super",
"T",
">",
"writer",
",",
"final",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"writ... | Write the given elements to the data output.
@param elements the elements to write
@param writer the element writer
@param out the data output
@param <T> the element type
@throws NullPointerException if one of the given arguments is {@code null}
@throws IOException if an I/O error occurs | [
"Write",
"the",
"given",
"elements",
"to",
"the",
"data",
"output",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/IO.java#L172-L183 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/IO.java | IO.reads | static <T> List<T> reads(
final Reader<? extends T> reader,
final DataInput in
)
throws IOException
{
final int length = readInt(in);
final List<T> elements = new ArrayList<>(length);
for (int i = 0; i < length; ++i) {
elements.add(reader.read(in));
}
return elements;
} | java | static <T> List<T> reads(
final Reader<? extends T> reader,
final DataInput in
)
throws IOException
{
final int length = readInt(in);
final List<T> elements = new ArrayList<>(length);
for (int i = 0; i < length; ++i) {
elements.add(reader.read(in));
}
return elements;
} | [
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"reads",
"(",
"final",
"Reader",
"<",
"?",
"extends",
"T",
">",
"reader",
",",
"final",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"final",
"int",
"length",
"=",
"readInt",
"(",
"in",
")",
... | Reads a list of elements from the given data input.
@param reader the element reader
@param in the data input
@param <T> the element type
@return the read element list
@throws NullPointerException if one of the given arguments is {@code null}
@throws IOException if an I/O error occurs | [
"Reads",
"a",
"list",
"of",
"elements",
"from",
"the",
"given",
"data",
"input",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/IO.java#L195-L207 | train |
jenetics/jpx | jpx/src/main/java/io/jenetics/jpx/Speed.java | Speed.to | public double to(final Unit unit) {
requireNonNull(unit);
return unit.convert(_value, Unit.METERS_PER_SECOND);
} | java | public double to(final Unit unit) {
requireNonNull(unit);
return unit.convert(_value, Unit.METERS_PER_SECOND);
} | [
"public",
"double",
"to",
"(",
"final",
"Unit",
"unit",
")",
"{",
"requireNonNull",
"(",
"unit",
")",
";",
"return",
"unit",
".",
"convert",
"(",
"_value",
",",
"Unit",
".",
"METERS_PER_SECOND",
")",
";",
"}"
] | Return the GPS speed value in the desired unit.
@param unit the speed unit
@return the GPS speed value in the desired unit
@throws NullPointerException if the given speed {@code unit} is
{@code null} | [
"Return",
"the",
"GPS",
"speed",
"value",
"in",
"the",
"desired",
"unit",
"."
] | 58fefc10580602d07f1480d6a5886d13a553ff8f | https://github.com/jenetics/jpx/blob/58fefc10580602d07f1480d6a5886d13a553ff8f/jpx/src/main/java/io/jenetics/jpx/Speed.java#L136-L139 | train |
davidmoten/rxjava2-extras | src/main/java/com/github/davidmoten/rx2/flowable/Serialized.java | Serialized.write | public static <T extends Serializable> Flowable<T> write(final Flowable<T> source, final File file) {
return write(source, file, false, DEFAULT_BUFFER_SIZE);
} | java | public static <T extends Serializable> Flowable<T> write(final Flowable<T> source, final File file) {
return write(source, file, false, DEFAULT_BUFFER_SIZE);
} | [
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"Flowable",
"<",
"T",
">",
"write",
"(",
"final",
"Flowable",
"<",
"T",
">",
"source",
",",
"final",
"File",
"file",
")",
"{",
"return",
"write",
"(",
"source",
",",
"file",
",",
"false",
... | Writes the source stream to the given file in given append mode and using
the a buffer size of 8192 bytes.
@param source
flowable stream to write
@param file
file to write to
@param <T>
the generic type of the input stream
@return re-emits the input stream | [
"Writes",
"the",
"source",
"stream",
"to",
"the",
"given",
"file",
"in",
"given",
"append",
"mode",
"and",
"using",
"the",
"a",
"buffer",
"size",
"of",
"8192",
"bytes",
"."
] | bf5ece3f97191f29a81957a6529bc3cfa4d7b328 | https://github.com/davidmoten/rxjava2-extras/blob/bf5ece3f97191f29a81957a6529bc3cfa4d7b328/src/main/java/com/github/davidmoten/rx2/flowable/Serialized.java#L216-L218 | train |
davidmoten/rxjava2-extras | src/main/java/com/github/davidmoten/rx2/internal/flowable/buffertofile/MemoryMappedFile.java | MemoryMappedFile.getMethod | @VisibleForTesting
static Method getMethod(Class<?> cls, String name, Class<?>... params) {
Method m;
try {
m = cls.getDeclaredMethod(name, params);
} catch (Exception e) {
throw new RuntimeException(e);
}
m.setAccessible(true);
return m;
} | java | @VisibleForTesting
static Method getMethod(Class<?> cls, String name, Class<?>... params) {
Method m;
try {
m = cls.getDeclaredMethod(name, params);
} catch (Exception e) {
throw new RuntimeException(e);
}
m.setAccessible(true);
return m;
} | [
"@",
"VisibleForTesting",
"static",
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"...",
"params",
")",
"{",
"Method",
"m",
";",
"try",
"{",
"m",
"=",
"cls",
".",
"getDeclaredMethod",
"... | Bundle reflection calls to get access to the given method | [
"Bundle",
"reflection",
"calls",
"to",
"get",
"access",
"to",
"the",
"given",
"method"
] | bf5ece3f97191f29a81957a6529bc3cfa4d7b328 | https://github.com/davidmoten/rxjava2-extras/blob/bf5ece3f97191f29a81957a6529bc3cfa4d7b328/src/main/java/com/github/davidmoten/rx2/internal/flowable/buffertofile/MemoryMappedFile.java#L40-L50 | train |
davidmoten/rxjava2-extras | src/main/java/com/github/davidmoten/rx2/internal/flowable/buffertofile/MemoryMappedFile.java | MemoryMappedFile.mapAndSetOffset | private void mapAndSetOffset() {
try {
final RandomAccessFile backingFile = new RandomAccessFile(this.file, "rw");
backingFile.setLength(this.size);
final FileChannel ch = backingFile.getChannel();
this.addr = (Long) mmap.invoke(ch, 1, 0L, this.size);
... | java | private void mapAndSetOffset() {
try {
final RandomAccessFile backingFile = new RandomAccessFile(this.file, "rw");
backingFile.setLength(this.size);
final FileChannel ch = backingFile.getChannel();
this.addr = (Long) mmap.invoke(ch, 1, 0L, this.size);
... | [
"private",
"void",
"mapAndSetOffset",
"(",
")",
"{",
"try",
"{",
"final",
"RandomAccessFile",
"backingFile",
"=",
"new",
"RandomAccessFile",
"(",
"this",
".",
"file",
",",
"\"rw\"",
")",
";",
"backingFile",
".",
"setLength",
"(",
"this",
".",
"size",
")",
... | for the given length and set this.addr to the returned offset | [
"for",
"the",
"given",
"length",
"and",
"set",
"this",
".",
"addr",
"to",
"the",
"returned",
"offset"
] | bf5ece3f97191f29a81957a6529bc3cfa4d7b328 | https://github.com/davidmoten/rxjava2-extras/blob/bf5ece3f97191f29a81957a6529bc3cfa4d7b328/src/main/java/com/github/davidmoten/rx2/internal/flowable/buffertofile/MemoryMappedFile.java#L59-L71 | train |
davidmoten/rxjava2-extras | src/main/java/com/github/davidmoten/rx2/internal/flowable/buffertofile/MemoryMappedFile.java | MemoryMappedFile.getBytes | public void getBytes(long pos, byte[] data, long offset, long length) {
unsafe.copyMemory(null, pos + addr, data, BYTE_ARRAY_OFFSET + offset, length);
} | java | public void getBytes(long pos, byte[] data, long offset, long length) {
unsafe.copyMemory(null, pos + addr, data, BYTE_ARRAY_OFFSET + offset, length);
} | [
"public",
"void",
"getBytes",
"(",
"long",
"pos",
",",
"byte",
"[",
"]",
"data",
",",
"long",
"offset",
",",
"long",
"length",
")",
"{",
"unsafe",
".",
"copyMemory",
"(",
"null",
",",
"pos",
"+",
"addr",
",",
"data",
",",
"BYTE_ARRAY_OFFSET",
"+",
"o... | May want to have offset & length within data as well, for both of these | [
"May",
"want",
"to",
"have",
"offset",
"&",
"length",
"within",
"data",
"as",
"well",
"for",
"both",
"of",
"these"
] | bf5ece3f97191f29a81957a6529bc3cfa4d7b328 | https://github.com/davidmoten/rxjava2-extras/blob/bf5ece3f97191f29a81957a6529bc3cfa4d7b328/src/main/java/com/github/davidmoten/rx2/internal/flowable/buffertofile/MemoryMappedFile.java#L117-L119 | train |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.put | public Phrase put(String key, CharSequence value) {
if (!keys.contains(key)) {
throw new IllegalArgumentException("Invalid key: " + key);
}
if (value == null) {
throw new IllegalArgumentException("Null value for '" + key + "'");
}
keysToValues.put(key, value);
// Invalidate the cach... | java | public Phrase put(String key, CharSequence value) {
if (!keys.contains(key)) {
throw new IllegalArgumentException("Invalid key: " + key);
}
if (value == null) {
throw new IllegalArgumentException("Null value for '" + key + "'");
}
keysToValues.put(key, value);
// Invalidate the cach... | [
"public",
"Phrase",
"put",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"if",
"(",
"!",
"keys",
".",
"contains",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid key: \"",
"+",
"key",
")",
";",
"}",
... | Replaces the given key with a non-null value. You may reuse Phrase instances and replace
keys with new values.
@throws IllegalArgumentException if the key is not in the pattern. | [
"Replaces",
"the",
"given",
"key",
"with",
"a",
"non",
"-",
"null",
"value",
".",
"You",
"may",
"reuse",
"Phrase",
"instances",
"and",
"replace",
"keys",
"with",
"new",
"values",
"."
] | d91f18e80790832db11b811c462f8e5cd492d97e | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L151-L163 | train |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.putOptional | public Phrase putOptional(String key, CharSequence value) {
return keys.contains(key) ? put(key, value) : this;
} | java | public Phrase putOptional(String key, CharSequence value) {
return keys.contains(key) ? put(key, value) : this;
} | [
"public",
"Phrase",
"putOptional",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"return",
"keys",
".",
"contains",
"(",
"key",
")",
"?",
"put",
"(",
"key",
",",
"value",
")",
":",
"this",
";",
"}"
] | Silently ignored if the key is not in the pattern.
@see #put(String, CharSequence) | [
"Silently",
"ignored",
"if",
"the",
"key",
"is",
"not",
"in",
"the",
"pattern",
"."
] | d91f18e80790832db11b811c462f8e5cd492d97e | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L179-L181 | train |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.format | public CharSequence format() {
if (formatted == null) {
if (!keysToValues.keySet().containsAll(keys)) {
Set<String> missingKeys = new HashSet<String>(keys);
missingKeys.removeAll(keysToValues.keySet());
throw new IllegalArgumentException("Missing keys: " + missingKeys);
}
... | java | public CharSequence format() {
if (formatted == null) {
if (!keysToValues.keySet().containsAll(keys)) {
Set<String> missingKeys = new HashSet<String>(keys);
missingKeys.removeAll(keysToValues.keySet());
throw new IllegalArgumentException("Missing keys: " + missingKeys);
}
... | [
"public",
"CharSequence",
"format",
"(",
")",
"{",
"if",
"(",
"formatted",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"keysToValues",
".",
"keySet",
"(",
")",
".",
"containsAll",
"(",
"keys",
")",
")",
"{",
"Set",
"<",
"String",
">",
"missingKeys",
"=",... | Returns the text after replacing all keys with values.
@throws IllegalArgumentException if any keys are not replaced. | [
"Returns",
"the",
"text",
"after",
"replacing",
"all",
"keys",
"with",
"values",
"."
] | d91f18e80790832db11b811c462f8e5cd492d97e | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L198-L215 | train |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.token | private Token token(Token prev) {
if (curChar == EOF) {
return null;
}
if (curChar == '{') {
char nextChar = lookahead();
if (nextChar == '{') {
return leftCurlyBracket(prev);
} else if (nextChar >= 'a' && nextChar <= 'z') {
return key(prev);
} else {
th... | java | private Token token(Token prev) {
if (curChar == EOF) {
return null;
}
if (curChar == '{') {
char nextChar = lookahead();
if (nextChar == '{') {
return leftCurlyBracket(prev);
} else if (nextChar >= 'a' && nextChar <= 'z') {
return key(prev);
} else {
th... | [
"private",
"Token",
"token",
"(",
"Token",
"prev",
")",
"{",
"if",
"(",
"curChar",
"==",
"EOF",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"curChar",
"==",
"'",
"'",
")",
"{",
"char",
"nextChar",
"=",
"lookahead",
"(",
")",
";",
"if",
"(",
... | Returns the next token from the input pattern, or null when finished parsing. | [
"Returns",
"the",
"next",
"token",
"from",
"the",
"input",
"pattern",
"or",
"null",
"when",
"finished",
"parsing",
"."
] | d91f18e80790832db11b811c462f8e5cd492d97e | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L250-L266 | train |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.text | private TextToken text(Token prev) {
int startIndex = curCharIndex;
while (curChar != '{' && curChar != EOF) {
consume();
}
return new TextToken(prev, curCharIndex - startIndex);
} | java | private TextToken text(Token prev) {
int startIndex = curCharIndex;
while (curChar != '{' && curChar != EOF) {
consume();
}
return new TextToken(prev, curCharIndex - startIndex);
} | [
"private",
"TextToken",
"text",
"(",
"Token",
"prev",
")",
"{",
"int",
"startIndex",
"=",
"curCharIndex",
";",
"while",
"(",
"curChar",
"!=",
"'",
"'",
"&&",
"curChar",
"!=",
"EOF",
")",
"{",
"consume",
"(",
")",
";",
"}",
"return",
"new",
"TextToken",... | Consumes and returns a token for a sequence of text. | [
"Consumes",
"and",
"returns",
"a",
"token",
"for",
"a",
"sequence",
"of",
"text",
"."
] | d91f18e80790832db11b811c462f8e5cd492d97e | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L299-L306 | train |
square/phrase | src/main/java/com/squareup/phrase/Phrase.java | Phrase.consume | private void consume() {
curCharIndex++;
curChar = (curCharIndex == pattern.length()) ? EOF : pattern.charAt(curCharIndex);
} | java | private void consume() {
curCharIndex++;
curChar = (curCharIndex == pattern.length()) ? EOF : pattern.charAt(curCharIndex);
} | [
"private",
"void",
"consume",
"(",
")",
"{",
"curCharIndex",
"++",
";",
"curChar",
"=",
"(",
"curCharIndex",
"==",
"pattern",
".",
"length",
"(",
")",
")",
"?",
"EOF",
":",
"pattern",
".",
"charAt",
"(",
"curCharIndex",
")",
";",
"}"
] | Advances the current character position without any error checking. Consuming beyond the
end of the string can only happen if this parser contains a bug. | [
"Advances",
"the",
"current",
"character",
"position",
"without",
"any",
"error",
"checking",
".",
"Consuming",
"beyond",
"the",
"end",
"of",
"the",
"string",
"can",
"only",
"happen",
"if",
"this",
"parser",
"contains",
"a",
"bug",
"."
] | d91f18e80790832db11b811c462f8e5cd492d97e | https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/Phrase.java#L324-L327 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java | DataTableRenderer.determineLanguage | private String determineLanguage(FacesContext fc, DataTable dataTable) {
final List<String> availableLanguages = Arrays.asList("de", "en", "es", "fr", "hu", "it", "nl", "pl", "pt",
"ru");
if (BsfUtils.isStringValued(dataTable.getCustomLangUrl())) {
return dataTable.getCustomLangUrl();
} else if (BsfUtils.i... | java | private String determineLanguage(FacesContext fc, DataTable dataTable) {
final List<String> availableLanguages = Arrays.asList("de", "en", "es", "fr", "hu", "it", "nl", "pl", "pt",
"ru");
if (BsfUtils.isStringValued(dataTable.getCustomLangUrl())) {
return dataTable.getCustomLangUrl();
} else if (BsfUtils.i... | [
"private",
"String",
"determineLanguage",
"(",
"FacesContext",
"fc",
",",
"DataTable",
"dataTable",
")",
"{",
"final",
"List",
"<",
"String",
">",
"availableLanguages",
"=",
"Arrays",
".",
"asList",
"(",
"\"de\"",
",",
"\"en\"",
",",
"\"es\"",
",",
"\"fr\"",
... | Determine if the user specify a lang Otherwise return null to avoid language
settings.
@param fc
@param dataTable
@return | [
"Determine",
"if",
"the",
"user",
"specify",
"a",
"lang",
"Otherwise",
"return",
"null",
"to",
"avoid",
"language",
"settings",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java#L851-L868 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/slider/Slider.java | Slider.getType | public String getType() {
String mode = A.asString(getAttributes().get("mode"), "badge");
return mode.equals("edit") ? "text" : "hidden";
} | java | public String getType() {
String mode = A.asString(getAttributes().get("mode"), "badge");
return mode.equals("edit") ? "text" : "hidden";
} | [
"public",
"String",
"getType",
"(",
")",
"{",
"String",
"mode",
"=",
"A",
".",
"asString",
"(",
"getAttributes",
"(",
")",
".",
"get",
"(",
"\"mode\"",
")",
",",
"\"badge\"",
")",
";",
"return",
"mode",
".",
"equals",
"(",
"\"edit\"",
")",
"?",
"\"te... | Method added to prevent AngularFaces from setting the type | [
"Method",
"added",
"to",
"prevent",
"AngularFaces",
"from",
"setting",
"the",
"type"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/slider/Slider.java#L73-L76 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.renderPassThruAttributes | protected void renderPassThruAttributes(FacesContext context, UIComponent component, String[] attrs,
boolean shouldRenderDataAttributes) throws IOException {
ResponseWriter writer = context.getResponseWriter();
if ((attrs == null || attrs.length <= 0) && shouldRenderDataAttributes == false)
return;
... | java | protected void renderPassThruAttributes(FacesContext context, UIComponent component, String[] attrs,
boolean shouldRenderDataAttributes) throws IOException {
ResponseWriter writer = context.getResponseWriter();
if ((attrs == null || attrs.length <= 0) && shouldRenderDataAttributes == false)
return;
... | [
"protected",
"void",
"renderPassThruAttributes",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
",",
"String",
"[",
"]",
"attrs",
",",
"boolean",
"shouldRenderDataAttributes",
")",
"throws",
"IOException",
"{",
"ResponseWriter",
"writer",
"=",
"conte... | Method that provide ability to render pass through attributes.
@param context
@param component
@param attrs
@throws IOException | [
"Method",
"that",
"provide",
"ability",
"to",
"render",
"pass",
"through",
"attributes",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L55-L83 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.generateErrorAndRequiredClass | protected void generateErrorAndRequiredClass(UIInput input, ResponseWriter rw, String clientId,
String additionalClass1, String additionalClass2, String additionalClass3) throws IOException {
String styleClass = getErrorAndRequiredClass(input, clientId);
if (null != additionalClass1) {
additionalClass1 = ... | java | protected void generateErrorAndRequiredClass(UIInput input, ResponseWriter rw, String clientId,
String additionalClass1, String additionalClass2, String additionalClass3) throws IOException {
String styleClass = getErrorAndRequiredClass(input, clientId);
if (null != additionalClass1) {
additionalClass1 = ... | [
"protected",
"void",
"generateErrorAndRequiredClass",
"(",
"UIInput",
"input",
",",
"ResponseWriter",
"rw",
",",
"String",
"clientId",
",",
"String",
"additionalClass1",
",",
"String",
"additionalClass2",
",",
"String",
"additionalClass3",
")",
"throws",
"IOException",
... | Renders the CSS pseudo classes for required fields and for the error levels.
@param input
@param rw
@param clientId
@throws IOException | [
"Renders",
"the",
"CSS",
"pseudo",
"classes",
"for",
"required",
"fields",
"and",
"for",
"the",
"error",
"levels",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L147-L169 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.getConverter | public static Converter getConverter(FacesContext fc, ValueHolder vh) {
// explicit converter
Converter converter = vh.getConverter();
// try to find implicit converter
if (converter == null) {
ValueExpression expr = ((UIComponent) vh).getValueExpression("value");
if (expr != null) {
Class<?>... | java | public static Converter getConverter(FacesContext fc, ValueHolder vh) {
// explicit converter
Converter converter = vh.getConverter();
// try to find implicit converter
if (converter == null) {
ValueExpression expr = ((UIComponent) vh).getValueExpression("value");
if (expr != null) {
Class<?>... | [
"public",
"static",
"Converter",
"getConverter",
"(",
"FacesContext",
"fc",
",",
"ValueHolder",
"vh",
")",
"{",
"// explicit converter\r",
"Converter",
"converter",
"=",
"vh",
".",
"getConverter",
"(",
")",
";",
"// try to find implicit converter\r",
"if",
"(",
"con... | Finds the appropriate converter for a given value holder
@param fc
FacesContext instance
@param vh
ValueHolder instance to look converter for
@return Converter | [
"Finds",
"the",
"appropriate",
"converter",
"for",
"a",
"given",
"value",
"holder"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L504-L520 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.getRequestParameter | public static String getRequestParameter(FacesContext context, String name) {
return context.getExternalContext().getRequestParameterMap().get(name);
} | java | public static String getRequestParameter(FacesContext context, String name) {
return context.getExternalContext().getRequestParameterMap().get(name);
} | [
"public",
"static",
"String",
"getRequestParameter",
"(",
"FacesContext",
"context",
",",
"String",
"name",
")",
"{",
"return",
"context",
".",
"getExternalContext",
"(",
")",
".",
"getRequestParameterMap",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Returns request parameter value for the provided parameter name.
@param context Faces context.
@param name Parameter name to get value for.
@return Request parameter value for the provided parameter name. | [
"Returns",
"request",
"parameter",
"value",
"for",
"the",
"provided",
"parameter",
"name",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L576-L578 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.beginDisabledFieldset | public static boolean beginDisabledFieldset(IContentDisabled component, ResponseWriter rw) throws IOException {
if (component.isContentDisabled()) {
rw.startElement("fieldset", (UIComponent) component);
rw.writeAttribute("disabled", "disabled", "null");
return true;
}
return false;
} | java | public static boolean beginDisabledFieldset(IContentDisabled component, ResponseWriter rw) throws IOException {
if (component.isContentDisabled()) {
rw.startElement("fieldset", (UIComponent) component);
rw.writeAttribute("disabled", "disabled", "null");
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"beginDisabledFieldset",
"(",
"IContentDisabled",
"component",
",",
"ResponseWriter",
"rw",
")",
"throws",
"IOException",
"{",
"if",
"(",
"component",
".",
"isContentDisabled",
"(",
")",
")",
"{",
"rw",
".",
"startElement",
"(",
"\... | Renders the code disabling every input field and every button within a
container.
@param component
@param rw
@return true if an element has been rendered
@throws IOException | [
"Renders",
"the",
"code",
"disabling",
"every",
"input",
"field",
"and",
"every",
"button",
"within",
"a",
"container",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L621-L628 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreRenderer.java | CoreRenderer.getFormGroupWithFeedback | @Deprecated
protected String getFormGroupWithFeedback(String additionalClass, String clientId) {
if (BsfUtils.isLegacyFeedbackClassesEnabled()) {
return additionalClass;
}
return additionalClass + " " + FacesMessages.getErrorSeverityClass(clientId);
} | java | @Deprecated
protected String getFormGroupWithFeedback(String additionalClass, String clientId) {
if (BsfUtils.isLegacyFeedbackClassesEnabled()) {
return additionalClass;
}
return additionalClass + " " + FacesMessages.getErrorSeverityClass(clientId);
} | [
"@",
"Deprecated",
"protected",
"String",
"getFormGroupWithFeedback",
"(",
"String",
"additionalClass",
",",
"String",
"clientId",
")",
"{",
"if",
"(",
"BsfUtils",
".",
"isLegacyFeedbackClassesEnabled",
"(",
")",
")",
"{",
"return",
"additionalClass",
";",
"}",
"r... | Get the main field container
@deprecated Use
{@link CoreInputRenderer#getWithFeedback(net.bootsfaces.render.CoreInputRenderer.InputMode, javax.faces.component.UIComponent)}
instead
@param additionalClass
@param clientId
@return | [
"Get",
"the",
"main",
"field",
"container"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreRenderer.java#L641-L647 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java | DateTimePickerRenderer.getValueAsString | public static String getValueAsString(Object value, FacesContext ctx, DateTimePicker dtp) {
// Else we use our own converter
if(value == null) {
return null;
}
Locale sloc = BsfUtils.selectLocale(ctx.getViewRoot().getLocale(), dtp.getLocale(), dtp);
String javaFormatString = BsfUtils.selectJavaDateTimeForm... | java | public static String getValueAsString(Object value, FacesContext ctx, DateTimePicker dtp) {
// Else we use our own converter
if(value == null) {
return null;
}
Locale sloc = BsfUtils.selectLocale(ctx.getViewRoot().getLocale(), dtp.getLocale(), dtp);
String javaFormatString = BsfUtils.selectJavaDateTimeForm... | [
"public",
"static",
"String",
"getValueAsString",
"(",
"Object",
"value",
",",
"FacesContext",
"ctx",
",",
"DateTimePicker",
"dtp",
")",
"{",
"// Else we use our own converter",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Locale",
... | Yields the value which is displayed in the input field of the date picker.
@param ctx
@param dtp
@return | [
"Yields",
"the",
"value",
"which",
"is",
"displayed",
"in",
"the",
"input",
"field",
"of",
"the",
"date",
"picker",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java#L86-L95 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java | DateTimePickerRenderer.getDateAsString | public static String getDateAsString(FacesContext fc, DateTimePicker dtp, Object value, String javaFormatString, Locale locale) {
if (value == null) {
return null;
}
Converter converter = dtp.getConverter();
return converter == null ?
getInternalDateAsString(value, javaFormatString, locale)
:
c... | java | public static String getDateAsString(FacesContext fc, DateTimePicker dtp, Object value, String javaFormatString, Locale locale) {
if (value == null) {
return null;
}
Converter converter = dtp.getConverter();
return converter == null ?
getInternalDateAsString(value, javaFormatString, locale)
:
c... | [
"public",
"static",
"String",
"getDateAsString",
"(",
"FacesContext",
"fc",
",",
"DateTimePicker",
"dtp",
",",
"Object",
"value",
",",
"String",
"javaFormatString",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"nul... | Get date in string format
@param fc The FacesContext
@param dtp the DateTimePicker component
@param value The date to display
@param javaFormatString The format string as defined by the SimpleDateFormat syntax
@param locale The locale
@return null if the value is null. | [
"Get",
"date",
"in",
"string",
"format"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dateTimePicker/DateTimePickerRenderer.java#L106-L117 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/growl/GrowlRenderer.java | GrowlRenderer.encodeSeverityMessage | private void encodeSeverityMessage(FacesContext facesContext, Growl uiGrowl, FacesMessage msg)
throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
String summary = msg.getSummary() != null ? msg.getSummary() : "";
String detail = msg.getDetail() != null ? msg.get... | java | private void encodeSeverityMessage(FacesContext facesContext, Growl uiGrowl, FacesMessage msg)
throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
String summary = msg.getSummary() != null ? msg.getSummary() : "";
String detail = msg.getDetail() != null ? msg.get... | [
"private",
"void",
"encodeSeverityMessage",
"(",
"FacesContext",
"facesContext",
",",
"Growl",
"uiGrowl",
",",
"FacesMessage",
"msg",
")",
"throws",
"IOException",
"{",
"ResponseWriter",
"writer",
"=",
"facesContext",
".",
"getResponseWriter",
"(",
")",
";",
"String... | Encode single faces message as growl
@param facesContext
@param uiGrowl
@param msg
@throws IOException | [
"Encode",
"single",
"faces",
"message",
"as",
"growl"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/growl/GrowlRenderer.java#L104-L163 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/growl/GrowlRenderer.java | GrowlRenderer.getSeverityIcon | private String getSeverityIcon(FacesMessage message) {
if (message.getSeverity().equals(FacesMessage.SEVERITY_WARN))
return "fa fa-exclamation-triangle";
else if (message.getSeverity().equals(FacesMessage.SEVERITY_ERROR))
return "fa fa-times-circle";
else if (message.getSeverity().equals(FacesMessage.SEVERI... | java | private String getSeverityIcon(FacesMessage message) {
if (message.getSeverity().equals(FacesMessage.SEVERITY_WARN))
return "fa fa-exclamation-triangle";
else if (message.getSeverity().equals(FacesMessage.SEVERITY_ERROR))
return "fa fa-times-circle";
else if (message.getSeverity().equals(FacesMessage.SEVERI... | [
"private",
"String",
"getSeverityIcon",
"(",
"FacesMessage",
"message",
")",
"{",
"if",
"(",
"message",
".",
"getSeverity",
"(",
")",
".",
"equals",
"(",
"FacesMessage",
".",
"SEVERITY_WARN",
")",
")",
"return",
"\"fa fa-exclamation-triangle\"",
";",
"else",
"if... | Get severity related icons.
We use FA icons because future version of Bootstrap
does not support glyphicons anymore
@param message
@return | [
"Get",
"severity",
"related",
"icons",
".",
"We",
"use",
"FA",
"icons",
"because",
"future",
"version",
"of",
"Bootstrap",
"does",
"not",
"support",
"glyphicons",
"anymore"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/growl/GrowlRenderer.java#L172-L180 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/growl/GrowlRenderer.java | GrowlRenderer.getMessageType | private String getMessageType(FacesMessage message) {
if (message.getSeverity().equals(FacesMessage.SEVERITY_WARN))
return "warning";
else if (message.getSeverity().equals(FacesMessage.SEVERITY_ERROR))
return "danger";
else if (message.getSeverity().equals(FacesMessage.SEVERITY_FATAL))
return "danger";
... | java | private String getMessageType(FacesMessage message) {
if (message.getSeverity().equals(FacesMessage.SEVERITY_WARN))
return "warning";
else if (message.getSeverity().equals(FacesMessage.SEVERITY_ERROR))
return "danger";
else if (message.getSeverity().equals(FacesMessage.SEVERITY_FATAL))
return "danger";
... | [
"private",
"String",
"getMessageType",
"(",
"FacesMessage",
"message",
")",
"{",
"if",
"(",
"message",
".",
"getSeverity",
"(",
")",
".",
"equals",
"(",
"FacesMessage",
".",
"SEVERITY_WARN",
")",
")",
"return",
"\"warning\"",
";",
"else",
"if",
"(",
"message... | Translate severity type to growl style class
@param message
@return | [
"Translate",
"severity",
"type",
"to",
"growl",
"style",
"class"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/growl/GrowlRenderer.java#L187-L197 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java | TreeModelUtils.printNodeData | public static void printNodeData(Node rootNode, String tab) {
tab = tab == null ? "" : tab + " ";
for (Node n : rootNode.getChilds()) {
printNodeData(n, tab);
}
} | java | public static void printNodeData(Node rootNode, String tab) {
tab = tab == null ? "" : tab + " ";
for (Node n : rootNode.getChilds()) {
printNodeData(n, tab);
}
} | [
"public",
"static",
"void",
"printNodeData",
"(",
"Node",
"rootNode",
",",
"String",
"tab",
")",
"{",
"tab",
"=",
"tab",
"==",
"null",
"?",
"\"\"",
":",
"tab",
"+",
"\" \"",
";",
"for",
"(",
"Node",
"n",
":",
"rootNode",
".",
"getChilds",
"(",
")",
... | Debug method to print tree node structure
@param rootNode
@param tab | [
"Debug",
"method",
"to",
"print",
"tree",
"node",
"structure"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java#L40-L47 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java | TreeModelUtils.searchNodeById | public static Node searchNodeById(Node rootNode, int nodeId) {
if (rootNode.getNodeId() == nodeId) {
return rootNode;
}
Node foundNode = null;
for (Node n : rootNode.getChilds()) {
foundNode = searchNodeById(n, nodeId);
if (foundNode != null) {
... | java | public static Node searchNodeById(Node rootNode, int nodeId) {
if (rootNode.getNodeId() == nodeId) {
return rootNode;
}
Node foundNode = null;
for (Node n : rootNode.getChilds()) {
foundNode = searchNodeById(n, nodeId);
if (foundNode != null) {
... | [
"public",
"static",
"Node",
"searchNodeById",
"(",
"Node",
"rootNode",
",",
"int",
"nodeId",
")",
"{",
"if",
"(",
"rootNode",
".",
"getNodeId",
"(",
")",
"==",
"nodeId",
")",
"{",
"return",
"rootNode",
";",
"}",
"Node",
"foundNode",
"=",
"null",
";",
"... | Basic implementation of recursive node search by id It works only on a
DefaultNodeImpl
@param rootNode
@param nodeId
@return Node instance or null if there is no node with specific id | [
"Basic",
"implementation",
"of",
"recursive",
"node",
"search",
"by",
"id",
"It",
"works",
"only",
"on",
"a",
"DefaultNodeImpl"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java#L57-L69 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java | TreeModelUtils.renderModelAsJson | public static String renderModelAsJson(Node rootNode, boolean renderRoot) {
if (renderRoot) {
return renderSubnodes(rootNode == null ? new ArrayList<Node>() : new ArrayList<Node>(Arrays.asList(rootNode)));
} else if (rootNode != null && rootNode.hasChild()) {
return renderSubnode... | java | public static String renderModelAsJson(Node rootNode, boolean renderRoot) {
if (renderRoot) {
return renderSubnodes(rootNode == null ? new ArrayList<Node>() : new ArrayList<Node>(Arrays.asList(rootNode)));
} else if (rootNode != null && rootNode.hasChild()) {
return renderSubnode... | [
"public",
"static",
"String",
"renderModelAsJson",
"(",
"Node",
"rootNode",
",",
"boolean",
"renderRoot",
")",
"{",
"if",
"(",
"renderRoot",
")",
"{",
"return",
"renderSubnodes",
"(",
"rootNode",
"==",
"null",
"?",
"new",
"ArrayList",
"<",
"Node",
">",
"(",
... | Render the node model as JSON
@param rootNode
@param renderRoot
@return | [
"Render",
"the",
"node",
"model",
"as",
"JSON"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java#L78-L86 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dropMenu/DropMenuRenderer.java | DropMenuRenderer.encodeDropMenuStart | public static void encodeDropMenuStart(DropMenu c, ResponseWriter rw, String l) throws IOException {
rw.startElement("ul", c);
if (c.getContentClass() != null)
rw.writeAttribute("class", "dropdown-menu " + c.getContentClass(), "class");
else
rw.writeAttribute("class", "dropdown-menu", "class");
if (null !... | java | public static void encodeDropMenuStart(DropMenu c, ResponseWriter rw, String l) throws IOException {
rw.startElement("ul", c);
if (c.getContentClass() != null)
rw.writeAttribute("class", "dropdown-menu " + c.getContentClass(), "class");
else
rw.writeAttribute("class", "dropdown-menu", "class");
if (null !... | [
"public",
"static",
"void",
"encodeDropMenuStart",
"(",
"DropMenu",
"c",
",",
"ResponseWriter",
"rw",
",",
"String",
"l",
")",
"throws",
"IOException",
"{",
"rw",
".",
"startElement",
"(",
"\"ul\"",
",",
"c",
")",
";",
"if",
"(",
"c",
".",
"getContentClass... | Renders the Drop Menu.
@param c
@param rw
@param l
@throws IOException | [
"Renders",
"the",
"Drop",
"Menu",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dropMenu/DropMenuRenderer.java#L210-L220 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java | TabViewRenderer.drawClearDiv | private static void drawClearDiv(ResponseWriter writer, UIComponent tabView) throws IOException {
writer.startElement("div", tabView);
writer.writeAttribute("style", "clear:both;", "style");
writer.endElement("div");
} | java | private static void drawClearDiv(ResponseWriter writer, UIComponent tabView) throws IOException {
writer.startElement("div", tabView);
writer.writeAttribute("style", "clear:both;", "style");
writer.endElement("div");
} | [
"private",
"static",
"void",
"drawClearDiv",
"(",
"ResponseWriter",
"writer",
",",
"UIComponent",
"tabView",
")",
"throws",
"IOException",
"{",
"writer",
".",
"startElement",
"(",
"\"div\"",
",",
"tabView",
")",
";",
"writer",
".",
"writeAttribute",
"(",
"\"styl... | Draw a clear div
@param writer
@param tabView
@throws IOException | [
"Draw",
"a",
"clear",
"div"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java#L276-L280 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java | TabViewRenderer.encodeTabLinks | private static void encodeTabLinks(FacesContext context, ResponseWriter writer, TabView tabView,
int currentlyActiveIndex, List<UIComponent> tabs, String clientId, String hiddenInputFieldID)
throws IOException {
writer.startElement("ul", tabView);
writer.writeAttribute("id", clientId, "id");
Tooltip.generat... | java | private static void encodeTabLinks(FacesContext context, ResponseWriter writer, TabView tabView,
int currentlyActiveIndex, List<UIComponent> tabs, String clientId, String hiddenInputFieldID)
throws IOException {
writer.startElement("ul", tabView);
writer.writeAttribute("id", clientId, "id");
Tooltip.generat... | [
"private",
"static",
"void",
"encodeTabLinks",
"(",
"FacesContext",
"context",
",",
"ResponseWriter",
"writer",
",",
"TabView",
"tabView",
",",
"int",
"currentlyActiveIndex",
",",
"List",
"<",
"UIComponent",
">",
"tabs",
",",
"String",
"clientId",
",",
"String",
... | Encode the list of links that render the tabs
@param context
@param writer
@param tabView
@param currentlyActiveIndex
@param tabs
@param clientId
@param hiddenInputFieldID
@throws IOException | [
"Encode",
"the",
"list",
"of",
"links",
"that",
"render",
"the",
"tabs"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java#L294-L325 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java | TabViewRenderer.encodeTabContentPanes | private static void encodeTabContentPanes(final FacesContext context, final ResponseWriter writer,
final TabView tabView, final int currentlyActiveIndex, final List<UIComponent> tabs) throws IOException {
writer.startElement("div", tabView);
String classes = "tab-content";
if (tabView.getContentClass() != null... | java | private static void encodeTabContentPanes(final FacesContext context, final ResponseWriter writer,
final TabView tabView, final int currentlyActiveIndex, final List<UIComponent> tabs) throws IOException {
writer.startElement("div", tabView);
String classes = "tab-content";
if (tabView.getContentClass() != null... | [
"private",
"static",
"void",
"encodeTabContentPanes",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"ResponseWriter",
"writer",
",",
"final",
"TabView",
"tabView",
",",
"final",
"int",
"currentlyActiveIndex",
",",
"final",
"List",
"<",
"UIComponent",
">",
... | Generates the HTML of the tab panes.
@param context
the current FacesContext
@param writer
the response writer
@param tabs
@param children
the tabs
@throws IOException
only thrown if something's wrong with the response writer | [
"Generates",
"the",
"HTML",
"of",
"the",
"tab",
"panes",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java#L357-L408 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java | TabViewRenderer.encodeTabs | private static void encodeTabs(final FacesContext context, final ResponseWriter writer, final List<UIComponent> children,
final int currentlyActiveIndex, final String hiddenInputFieldID, final boolean disabled) throws IOException {
if (null != children) {
int tabIndex = 0;
for (int index = 0; index < childr... | java | private static void encodeTabs(final FacesContext context, final ResponseWriter writer, final List<UIComponent> children,
final int currentlyActiveIndex, final String hiddenInputFieldID, final boolean disabled) throws IOException {
if (null != children) {
int tabIndex = 0;
for (int index = 0; index < childr... | [
"private",
"static",
"void",
"encodeTabs",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"ResponseWriter",
"writer",
",",
"final",
"List",
"<",
"UIComponent",
">",
"children",
",",
"final",
"int",
"currentlyActiveIndex",
",",
"final",
"String",
"hiddenInp... | Generates the HTML of the tabs.
@param context
the current FacesContext
@param writer
the response writer
@param children
the tabs
@throws IOException
only thrown if something's wrong with the response writer | [
"Generates",
"the",
"HTML",
"of",
"the",
"tabs",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java#L465-L497 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java | TabViewRenderer.encodeTabAnchorTag | private static void encodeTabAnchorTag(FacesContext context, ResponseWriter writer, Tab tab,
String hiddenInputFieldID, int tabindex, boolean disabled) throws IOException {
writer.startElement("a", tab);
writer.writeAttribute("id", tab.getClientId().replace(":", "_") + "_tab", "id");
writer.writeAttribute("rol... | java | private static void encodeTabAnchorTag(FacesContext context, ResponseWriter writer, Tab tab,
String hiddenInputFieldID, int tabindex, boolean disabled) throws IOException {
writer.startElement("a", tab);
writer.writeAttribute("id", tab.getClientId().replace(":", "_") + "_tab", "id");
writer.writeAttribute("rol... | [
"private",
"static",
"void",
"encodeTabAnchorTag",
"(",
"FacesContext",
"context",
",",
"ResponseWriter",
"writer",
",",
"Tab",
"tab",
",",
"String",
"hiddenInputFieldID",
",",
"int",
"tabindex",
",",
"boolean",
"disabled",
")",
"throws",
"IOException",
"{",
"writ... | Generate the clickable entity of the tab.
@param writer
the response writer
@param tab
the tab to be rendered.
@throws IOException
only thrown if something's wrong with the response writer | [
"Generate",
"the",
"clickable",
"entity",
"of",
"the",
"tab",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tabView/TabViewRenderer.java#L562-L588 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/A.java | A.toInt | public static int toInt(Object val) {
if (val == null) { return 0; }
if (val instanceof Number) {
return ((Number) val).intValue();
}
if (val instanceof String) {
return Integer.parseInt((String) val);
}
throw new IllegalArgumentException(... | java | public static int toInt(Object val) {
if (val == null) { return 0; }
if (val instanceof Number) {
return ((Number) val).intValue();
}
if (val instanceof String) {
return Integer.parseInt((String) val);
}
throw new IllegalArgumentException(... | [
"public",
"static",
"int",
"toInt",
"(",
"Object",
"val",
")",
"{",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"val",
"instanceof",
"Number",
")",
"{",
"return",
"(",
"(",
"Number",
")",
"val",
")",
".",
"intVal... | Converts the parameter to an integer value, if possible.
Throws an IllegalArgumentException if the parameter cannot be converted to an integer.
@param val the parameter to be converted. May be a String, a number or null. Everything else causes an {@link IllegalArgumentException} to be thrown.
@return the integer value... | [
"Converts",
"the",
"parameter",
"to",
"an",
"integer",
"value",
"if",
"possible",
".",
"Throws",
"an",
"IllegalArgumentException",
"if",
"the",
"parameter",
"cannot",
"be",
"converted",
"to",
"an",
"integer",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/A.java#L34-L44 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/button/ButtonRenderer.java | ButtonRenderer.encodeClick | private String encodeClick(FacesContext context, Button button) {
String js;
String userClick = button.getOnclick();
if (userClick != null) {
js = userClick;
} // +COLON; }
else {
js = "";
}
String fragment = button.getFragment();
String outcome = button.getOutcome();
if (null != outcome && out... | java | private String encodeClick(FacesContext context, Button button) {
String js;
String userClick = button.getOnclick();
if (userClick != null) {
js = userClick;
} // +COLON; }
else {
js = "";
}
String fragment = button.getFragment();
String outcome = button.getOutcome();
if (null != outcome && out... | [
"private",
"String",
"encodeClick",
"(",
"FacesContext",
"context",
",",
"Button",
"button",
")",
"{",
"String",
"js",
";",
"String",
"userClick",
"=",
"button",
".",
"getOnclick",
"(",
")",
";",
"if",
"(",
"userClick",
"!=",
"null",
")",
"{",
"js",
"=",... | Renders the Javascript code dealing with the click event. If the
developer provides their own onclick handler, is precedes the generated
Javascript code.
@param context
The current FacesContext.
@param attrs
the attribute list
@return some Javascript code, such as
"window.location.href='/targetView.jsf';" | [
"Renders",
"the",
"Javascript",
"code",
"dealing",
"with",
"the",
"click",
"event",
".",
"If",
"the",
"developer",
"provides",
"their",
"own",
"onclick",
"handler",
"is",
"precedes",
"the",
"generated",
"Javascript",
"code",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/button/ButtonRenderer.java#L197-L261 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/button/ButtonRenderer.java | ButtonRenderer.canOutcomeBeRendered | private boolean canOutcomeBeRendered(Button button, String fragment, String outcome) {
boolean renderOutcome = true;
if (null == outcome && button.getAttributes() != null && button.getAttributes().containsKey("ng-click")) {
String ngClick = (String)button.getAttributes().get("ng-click");
if (null != ngClick &... | java | private boolean canOutcomeBeRendered(Button button, String fragment, String outcome) {
boolean renderOutcome = true;
if (null == outcome && button.getAttributes() != null && button.getAttributes().containsKey("ng-click")) {
String ngClick = (String)button.getAttributes().get("ng-click");
if (null != ngClick &... | [
"private",
"boolean",
"canOutcomeBeRendered",
"(",
"Button",
"button",
",",
"String",
"fragment",
",",
"String",
"outcome",
")",
"{",
"boolean",
"renderOutcome",
"=",
"true",
";",
"if",
"(",
"null",
"==",
"outcome",
"&&",
"button",
".",
"getAttributes",
"(",
... | Do we have to suppress the target URL?
@param attrs
the component's attribute list
@param fragment
the fragment of the URL behind the hash (outcome#fragment)
@param outcome
the value of the outcome attribute
@return true if the outcome can be rendered. | [
"Do",
"we",
"have",
"to",
"suppress",
"the",
"target",
"URL?"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/button/ButtonRenderer.java#L274-L285 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/button/ButtonRenderer.java | ButtonRenderer.determineTargetURL | private String determineTargetURL(FacesContext context, Button button, String outcome) {
ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) context.getApplication()
.getNavigationHandler();
NavigationCase navCase = cnh.getNavigationCase(context, null, outcome);
/*
* Param Name: javax.faces... | java | private String determineTargetURL(FacesContext context, Button button, String outcome) {
ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) context.getApplication()
.getNavigationHandler();
NavigationCase navCase = cnh.getNavigationCase(context, null, outcome);
/*
* Param Name: javax.faces... | [
"private",
"String",
"determineTargetURL",
"(",
"FacesContext",
"context",
",",
"Button",
"button",
",",
"String",
"outcome",
")",
"{",
"ConfigurableNavigationHandler",
"cnh",
"=",
"(",
"ConfigurableNavigationHandler",
")",
"context",
".",
"getApplication",
"(",
")",
... | Translate the outcome attribute value to the target URL.
@param context
the current FacesContext
@param outcome
the value of the outcome attribute
@return the target URL of the navigation rule (or the outcome if there's
not navigation rule) | [
"Translate",
"the",
"outcome",
"attribute",
"value",
"to",
"the",
"target",
"URL",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/button/ButtonRenderer.java#L297-L325 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/button/ButtonRenderer.java | ButtonRenderer.getStyleClasses | private static String getStyleClasses(Button button, boolean isResponsive) {
StringBuilder sb;
sb = new StringBuilder(40); // optimize int
sb.append("btn");
String size = button.getSize();
if (size != null) {
sb.append(" btn-").append(size);
}
String look = button.getLook();
if (look != null) {
s... | java | private static String getStyleClasses(Button button, boolean isResponsive) {
StringBuilder sb;
sb = new StringBuilder(40); // optimize int
sb.append("btn");
String size = button.getSize();
if (size != null) {
sb.append(" btn-").append(size);
}
String look = button.getLook();
if (look != null) {
s... | [
"private",
"static",
"String",
"getStyleClasses",
"(",
"Button",
"button",
",",
"boolean",
"isResponsive",
")",
"{",
"StringBuilder",
"sb",
";",
"sb",
"=",
"new",
"StringBuilder",
"(",
"40",
")",
";",
"// optimize int",
"sb",
".",
"append",
"(",
"\"btn\"",
"... | Collects the CSS classes of the button.
@return the CSS classes (separated by a space). | [
"Collects",
"the",
"CSS",
"classes",
"of",
"the",
"button",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/button/ButtonRenderer.java#L372-L401 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/expressions/BeforeExpressionResolver.java | BeforeExpressionResolver.resolve | public List<UIComponent> resolve(UIComponent component, List<UIComponent> parentComponents, String currentId,
String originalExpression, String[] parameters) {
List<UIComponent> result = new ArrayList<UIComponent>();
for (UIComponent parent : parentComponents) {
UIComponent grandparent = component.getParent()... | java | public List<UIComponent> resolve(UIComponent component, List<UIComponent> parentComponents, String currentId,
String originalExpression, String[] parameters) {
List<UIComponent> result = new ArrayList<UIComponent>();
for (UIComponent parent : parentComponents) {
UIComponent grandparent = component.getParent()... | [
"public",
"List",
"<",
"UIComponent",
">",
"resolve",
"(",
"UIComponent",
"component",
",",
"List",
"<",
"UIComponent",
">",
"parentComponents",
",",
"String",
"currentId",
",",
"String",
"originalExpression",
",",
"String",
"[",
"]",
"parameters",
")",
"{",
"... | Collects everything preceding the current JSF node within the same branch of the tree.
It's like "@previous previous:@previous previous:@previous:@previous ...". | [
"Collects",
"everything",
"preceding",
"the",
"current",
"JSF",
"node",
"within",
"the",
"same",
"branch",
"of",
"the",
"tree",
".",
"It",
"s",
"like"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/expressions/BeforeExpressionResolver.java#L20-L39 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java | PanelGridRenderer.encodeEnd | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
PanelGrid panelGrid = (PanelGrid) component;
ResponseWriter writer = context.getResponseWriter();
boolean idHasBeenRendered=false;
String... | java | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
PanelGrid panelGrid = (PanelGrid) component;
ResponseWriter writer = context.getResponseWriter();
boolean idHasBeenRendered=false;
String... | [
"@",
"Override",
"public",
"void",
"encodeEnd",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"PanelGrid",
"panelGri... | Renders the grid component and its children. | [
"Renders",
"the",
"grid",
"component",
"and",
"its",
"children",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L53-L107 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java | PanelGridRenderer.getRowClasses | protected String[] getRowClasses(PanelGrid grid) {
String rowClasses = grid.getRowClasses();
if (null == rowClasses || rowClasses.trim().length()==0)
return null;
String[] rows = rowClasses.split(",");
return rows;
} | java | protected String[] getRowClasses(PanelGrid grid) {
String rowClasses = grid.getRowClasses();
if (null == rowClasses || rowClasses.trim().length()==0)
return null;
String[] rows = rowClasses.split(",");
return rows;
} | [
"protected",
"String",
"[",
"]",
"getRowClasses",
"(",
"PanelGrid",
"grid",
")",
"{",
"String",
"rowClasses",
"=",
"grid",
".",
"getRowClasses",
"(",
")",
";",
"if",
"(",
"null",
"==",
"rowClasses",
"||",
"rowClasses",
".",
"trim",
"(",
")",
".",
"length... | Extract the option row classes from the JSF file.
@return null or a String array. | [
"Extract",
"the",
"option",
"row",
"classes",
"from",
"the",
"JSF",
"file",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L114-L120 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java | PanelGridRenderer.getColSpanArray | protected int[] getColSpanArray(PanelGrid panelGrid) {
String columnsCSV = panelGrid.getColSpans();
if (null == columnsCSV || columnsCSV.trim().length()==0)
{
columnsCSV = panelGrid.getColumns();
if ("1".equals(columnsCSV)) {
columnsCSV = "12";
} else if ("2".equals(columnsCSV)) {
... | java | protected int[] getColSpanArray(PanelGrid panelGrid) {
String columnsCSV = panelGrid.getColSpans();
if (null == columnsCSV || columnsCSV.trim().length()==0)
{
columnsCSV = panelGrid.getColumns();
if ("1".equals(columnsCSV)) {
columnsCSV = "12";
} else if ("2".equals(columnsCSV)) {
... | [
"protected",
"int",
"[",
"]",
"getColSpanArray",
"(",
"PanelGrid",
"panelGrid",
")",
"{",
"String",
"columnsCSV",
"=",
"panelGrid",
".",
"getColSpans",
"(",
")",
";",
"if",
"(",
"null",
"==",
"columnsCSV",
"||",
"columnsCSV",
".",
"trim",
"(",
")",
".",
... | Read the colSpans attribute.
@return a integer array
@throws FacesException
if the attribute is missing or invalid. | [
"Read",
"the",
"colSpans",
"attribute",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L129-L169 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java | PanelGridRenderer.getColumnClasses | protected String[] getColumnClasses(PanelGrid panelGrid, int[] colSpans) {
String columnsCSV = panelGrid.getColumnClasses();
String[] columnClasses;
if (null == columnsCSV || columnsCSV.trim().length()==0)
columnClasses = null;
else {
columnClasses = columnsCSV.split(",");
if (columnClasses.length > c... | java | protected String[] getColumnClasses(PanelGrid panelGrid, int[] colSpans) {
String columnsCSV = panelGrid.getColumnClasses();
String[] columnClasses;
if (null == columnsCSV || columnsCSV.trim().length()==0)
columnClasses = null;
else {
columnClasses = columnsCSV.split(",");
if (columnClasses.length > c... | [
"protected",
"String",
"[",
"]",
"getColumnClasses",
"(",
"PanelGrid",
"panelGrid",
",",
"int",
"[",
"]",
"colSpans",
")",
"{",
"String",
"columnsCSV",
"=",
"panelGrid",
".",
"getColumnClasses",
"(",
")",
";",
"String",
"[",
"]",
"columnClasses",
";",
"if",
... | Merge the column span information and the optional columnClasses attribute.
@param colSpans
the integer array returned by getColSpans().
@return null or an array of String consisting of the CSS classes. | [
"Merge",
"the",
"column",
"span",
"information",
"and",
"the",
"optional",
"columnClasses",
"attribute",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L178-L215 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java | PanelGridRenderer.generateColumnStart | protected void generateColumnStart(UIComponent child, String colStyleClass, ResponseWriter writer) throws IOException {
writer.startElement("div", child);
writer.writeAttribute("class", colStyleClass, "class");
} | java | protected void generateColumnStart(UIComponent child, String colStyleClass, ResponseWriter writer) throws IOException {
writer.startElement("div", child);
writer.writeAttribute("class", colStyleClass, "class");
} | [
"protected",
"void",
"generateColumnStart",
"(",
"UIComponent",
"child",
",",
"String",
"colStyleClass",
",",
"ResponseWriter",
"writer",
")",
"throws",
"IOException",
"{",
"writer",
".",
"startElement",
"(",
"\"div\"",
",",
"child",
")",
";",
"writer",
".",
"wr... | Generates the start of each Bootstrap column.
@param child
the child component to be drawn within the column.
@param colStyleClass
the current CSS style class
@param writer
the current response writer.
@throws IOException
if something's wrong with the response writer. | [
"Generates",
"the",
"start",
"of",
"each",
"Bootstrap",
"column",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L271-L274 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java | PanelGridRenderer.generateRowStart | protected void generateRowStart(ResponseWriter writer, int row, String[] rowClasses, PanelGrid panelGrid) throws IOException {
writer.startElement("div", panelGrid);
if (null == rowClasses)
writer.writeAttribute("class", "row", "class");
else
writer.writeAttribute("class", "row " + rowClasses[row % rowClass... | java | protected void generateRowStart(ResponseWriter writer, int row, String[] rowClasses, PanelGrid panelGrid) throws IOException {
writer.startElement("div", panelGrid);
if (null == rowClasses)
writer.writeAttribute("class", "row", "class");
else
writer.writeAttribute("class", "row " + rowClasses[row % rowClass... | [
"protected",
"void",
"generateRowStart",
"(",
"ResponseWriter",
"writer",
",",
"int",
"row",
",",
"String",
"[",
"]",
"rowClasses",
",",
"PanelGrid",
"panelGrid",
")",
"throws",
"IOException",
"{",
"writer",
".",
"startElement",
"(",
"\"div\"",
",",
"panelGrid",... | Generates the start of each Bootstrap row.
@param writer
the current response writer.
@param row
the current row index
@param rowClasses
the array of row classes
@throws IOException
if something's wrong with the response writer. | [
"Generates",
"the",
"start",
"of",
"each",
"Bootstrap",
"row",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L288-L294 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java | PanelGridRenderer.generateContainerStart | protected void generateContainerStart(ResponseWriter writer, PanelGrid panelGrid, boolean idHasBeenRendered) throws IOException {
writer.startElement("div", panelGrid);
if (!idHasBeenRendered) {
String clientId = panelGrid.getClientId();
writer.writeAttribute("id", clientId, "id");
}
writeAttribute(writer... | java | protected void generateContainerStart(ResponseWriter writer, PanelGrid panelGrid, boolean idHasBeenRendered) throws IOException {
writer.startElement("div", panelGrid);
if (!idHasBeenRendered) {
String clientId = panelGrid.getClientId();
writer.writeAttribute("id", clientId, "id");
}
writeAttribute(writer... | [
"protected",
"void",
"generateContainerStart",
"(",
"ResponseWriter",
"writer",
",",
"PanelGrid",
"panelGrid",
",",
"boolean",
"idHasBeenRendered",
")",
"throws",
"IOException",
"{",
"writer",
".",
"startElement",
"(",
"\"div\"",
",",
"panelGrid",
")",
";",
"if",
... | Generates the start of the entire Bootstrap container.
@param writer
the current response writer.
@throws IOException
if something's wrong with the response writer. | [
"Generates",
"the",
"start",
"of",
"the",
"entire",
"Bootstrap",
"container",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L304-L324 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java | SelectBooleanCheckboxRenderer.renderInputTag | protected void renderInputTag(FacesContext context, ResponseWriter rw, String clientId,
SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
int numberOfDivs = 0;
String responsiveStyleClass = Responsive.getResponsiveStyleClass(selectBooleanCheckbox, false).trim();
if (responsiveStyleClass.length(... | java | protected void renderInputTag(FacesContext context, ResponseWriter rw, String clientId,
SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
int numberOfDivs = 0;
String responsiveStyleClass = Responsive.getResponsiveStyleClass(selectBooleanCheckbox, false).trim();
if (responsiveStyleClass.length(... | [
"protected",
"void",
"renderInputTag",
"(",
"FacesContext",
"context",
",",
"ResponseWriter",
"rw",
",",
"String",
"clientId",
",",
"SelectBooleanCheckbox",
"selectBooleanCheckbox",
")",
"throws",
"IOException",
"{",
"int",
"numberOfDivs",
"=",
"0",
";",
"String",
"... | Renders the input tag.
@param context
the FacesContext
@param rw
@param clientId
@param selectBooleanCheckbox
the component to render
@throws java.io.IOException | [
"Renders",
"the",
"input",
"tag",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java#L195-L218 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java | SelectBooleanCheckboxRenderer.renderInputTagEnd | protected void renderInputTagEnd(ResponseWriter rw, SelectBooleanCheckbox selectBooleanCheckbox)
throws IOException {
rw.endElement("input");
String caption = selectBooleanCheckbox.getCaption();
if (null != caption) {
if (selectBooleanCheckbox.isEscape()) {
rw.writeText(" " + caption, null);
} else {... | java | protected void renderInputTagEnd(ResponseWriter rw, SelectBooleanCheckbox selectBooleanCheckbox)
throws IOException {
rw.endElement("input");
String caption = selectBooleanCheckbox.getCaption();
if (null != caption) {
if (selectBooleanCheckbox.isEscape()) {
rw.writeText(" " + caption, null);
} else {... | [
"protected",
"void",
"renderInputTagEnd",
"(",
"ResponseWriter",
"rw",
",",
"SelectBooleanCheckbox",
"selectBooleanCheckbox",
")",
"throws",
"IOException",
"{",
"rw",
".",
"endElement",
"(",
"\"input\"",
")",
";",
"String",
"caption",
"=",
"selectBooleanCheckbox",
"."... | Closes the input tag. This method is protected in order to allow
third-party frameworks to derive from it.
@param rw
the response writer
@param selectBooleanCheckbox
the component to render
@throws IOException
may be thrown by the response writer | [
"Closes",
"the",
"input",
"tag",
".",
"This",
"method",
"is",
"protected",
"in",
"order",
"to",
"allow",
"third",
"-",
"party",
"frameworks",
"to",
"derive",
"from",
"it",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java#L340-L353 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java | SelectBooleanCheckboxRenderer.renderInputTagValue | protected void renderInputTagValue(FacesContext context, ResponseWriter rw,
SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
String v = getValue2Render(context, selectBooleanCheckbox);
if (v != null && "true".equals(v)) {
rw.writeAttribute("checked", v, null);
}
} | java | protected void renderInputTagValue(FacesContext context, ResponseWriter rw,
SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
String v = getValue2Render(context, selectBooleanCheckbox);
if (v != null && "true".equals(v)) {
rw.writeAttribute("checked", v, null);
}
} | [
"protected",
"void",
"renderInputTagValue",
"(",
"FacesContext",
"context",
",",
"ResponseWriter",
"rw",
",",
"SelectBooleanCheckbox",
"selectBooleanCheckbox",
")",
"throws",
"IOException",
"{",
"String",
"v",
"=",
"getValue2Render",
"(",
"context",
",",
"selectBooleanC... | Renders the value of the input tag. This method is protected in order to
allow third-party frameworks to derive from it.
@param context
the FacesContext
@param rw
the response writer
@param selectBooleanCheckbox
the component to render
@throws IOException
may be thrown by the response writer | [
"Renders",
"the",
"value",
"of",
"the",
"input",
"tag",
".",
"This",
"method",
"is",
"protected",
"in",
"order",
"to",
"allow",
"third",
"-",
"party",
"frameworks",
"to",
"derive",
"from",
"it",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java#L368-L374 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/inputText/InputText.java | InputText.setMask | public void setMask(String mask) {
if (mask != null && !mask.isEmpty()) {
AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/jquery.inputmask.bundle.min.js");
}
getStateHelper().put(PropertyKeys.mask, mask);
} | java | public void setMask(String mask) {
if (mask != null && !mask.isEmpty()) {
AddResourcesListener.addResourceToHeadButAfterJQuery(C.BSF_LIBRARY, "js/jquery.inputmask.bundle.min.js");
}
getStateHelper().put(PropertyKeys.mask, mask);
} | [
"public",
"void",
"setMask",
"(",
"String",
"mask",
")",
"{",
"if",
"(",
"mask",
"!=",
"null",
"&&",
"!",
"mask",
".",
"isEmpty",
"(",
")",
")",
"{",
"AddResourcesListener",
".",
"addResourceToHeadButAfterJQuery",
"(",
"C",
".",
"BSF_LIBRARY",
",",
"\"js/j... | Sets input mask and triggers JavaScript to be loaded.
@param mask Input mask to set. | [
"Sets",
"input",
"mask",
"and",
"triggers",
"JavaScript",
"to",
"be",
"loaded",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/inputText/InputText.java#L193-L198 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/navLink/NavLinkRenderer.java | NavLinkRenderer.getStyleClasses | private static String getStyleClasses(AbstractNavLink link, boolean isResponsive) {
StringBuilder sb;
sb = new StringBuilder(20); // optimize int
String look = null;
if (link instanceof Link) {
look = ((Link) link).getLook();
} else if (link instanceof CommandLink) {
look = ((CommandLink) link).getLook... | java | private static String getStyleClasses(AbstractNavLink link, boolean isResponsive) {
StringBuilder sb;
sb = new StringBuilder(20); // optimize int
String look = null;
if (link instanceof Link) {
look = ((Link) link).getLook();
} else if (link instanceof CommandLink) {
look = ((CommandLink) link).getLook... | [
"private",
"static",
"String",
"getStyleClasses",
"(",
"AbstractNavLink",
"link",
",",
"boolean",
"isResponsive",
")",
"{",
"StringBuilder",
"sb",
";",
"sb",
"=",
"new",
"StringBuilder",
"(",
"20",
")",
";",
"// optimize int",
"String",
"look",
"=",
"null",
";... | Collects the CSS classes of the link.
@return the CSS classes (separated by a space). | [
"Collects",
"the",
"CSS",
"classes",
"of",
"the",
"link",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/navLink/NavLinkRenderer.java#L442-L461 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.isValued | public static boolean isValued(Object obj) {
if (obj == null) return false;
if (obj instanceof String) return isStringValued((String) obj);
return true;
} | java | public static boolean isValued(Object obj) {
if (obj == null) return false;
if (obj instanceof String) return isStringValued((String) obj);
return true;
} | [
"public",
"static",
"boolean",
"isValued",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"obj",
"instanceof",
"String",
")",
"return",
"isStringValued",
"(",
"(",
"String",
")",
"obj",
")",
";",... | Check if a generic object is valued
@param obj
@return | [
"Check",
"if",
"a",
"generic",
"object",
"is",
"valued"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L78-L82 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.stringOrDefault | public static String stringOrDefault(String str, String defaultValue) {
if(isStringValued(str)) return str;
return defaultValue;
} | java | public static String stringOrDefault(String str, String defaultValue) {
if(isStringValued(str)) return str;
return defaultValue;
} | [
"public",
"static",
"String",
"stringOrDefault",
"(",
"String",
"str",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"isStringValued",
"(",
"str",
")",
")",
"return",
"str",
";",
"return",
"defaultValue",
";",
"}"
] | Get the string if is not null or empty,
otherwise return the default value
@param str
@param defaultValue
@return | [
"Get",
"the",
"string",
"if",
"is",
"not",
"null",
"or",
"empty",
"otherwise",
"return",
"the",
"default",
"value"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L100-L103 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.snakeCaseToCamelCase | public static String snakeCaseToCamelCase(String snakeCase) {
if(snakeCase.contains("-")) {
StringBuilder camelCaseStr = new StringBuilder(snakeCase.length());
boolean toUpperCase = false;
for (char c : snakeCase.toCharArray()) {
if (c == '-')
toUpperCase = true;
else {
if (toUpperCase) {
... | java | public static String snakeCaseToCamelCase(String snakeCase) {
if(snakeCase.contains("-")) {
StringBuilder camelCaseStr = new StringBuilder(snakeCase.length());
boolean toUpperCase = false;
for (char c : snakeCase.toCharArray()) {
if (c == '-')
toUpperCase = true;
else {
if (toUpperCase) {
... | [
"public",
"static",
"String",
"snakeCaseToCamelCase",
"(",
"String",
"snakeCase",
")",
"{",
"if",
"(",
"snakeCase",
".",
"contains",
"(",
"\"-\"",
")",
")",
"{",
"StringBuilder",
"camelCaseStr",
"=",
"new",
"StringBuilder",
"(",
"snakeCase",
".",
"length",
"("... | Transform a snake-case string to a camel-case one.
@param snakeCase
@return | [
"Transform",
"a",
"snake",
"-",
"case",
"string",
"to",
"a",
"camel",
"-",
"case",
"one",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L110-L128 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.camelCaseToSnakeCase | public static String camelCaseToSnakeCase(String camelCase) {
if (null == camelCase || camelCase.length()==0)
return camelCase;
StringBuilder snakeCase = new StringBuilder(camelCase.length()+3);
snakeCase.append(camelCase.charAt(0));
boolean hasCamelCase=false;
for (int i = 1; i < camelCase.length(); i++) ... | java | public static String camelCaseToSnakeCase(String camelCase) {
if (null == camelCase || camelCase.length()==0)
return camelCase;
StringBuilder snakeCase = new StringBuilder(camelCase.length()+3);
snakeCase.append(camelCase.charAt(0));
boolean hasCamelCase=false;
for (int i = 1; i < camelCase.length(); i++) ... | [
"public",
"static",
"String",
"camelCaseToSnakeCase",
"(",
"String",
"camelCase",
")",
"{",
"if",
"(",
"null",
"==",
"camelCase",
"||",
"camelCase",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"camelCase",
";",
"StringBuilder",
"snakeCase",
"=",
"new"... | Transform a snake-case string to a camelCase one.
@param camelCase
@return the original string if there is no camelCase character. Otherwise, a snake-case representation of the camelCase version. | [
"Transform",
"a",
"snake",
"-",
"case",
"string",
"to",
"a",
"camelCase",
"one",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L135-L154 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.escapeHtml | public static String escapeHtml(String htmlString) {
StringBuffer sb = new StringBuffer(htmlString.length());
// true if last char was blank
boolean lastWasBlankChar = false;
int len = htmlString.length();
char c;
for (int i = 0; i < len; i++)
{
c = htmlString.charAt(i);
if (c == ' ') {
// blan... | java | public static String escapeHtml(String htmlString) {
StringBuffer sb = new StringBuffer(htmlString.length());
// true if last char was blank
boolean lastWasBlankChar = false;
int len = htmlString.length();
char c;
for (int i = 0; i < len; i++)
{
c = htmlString.charAt(i);
if (c == ' ') {
// blan... | [
"public",
"static",
"String",
"escapeHtml",
"(",
"String",
"htmlString",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
"htmlString",
".",
"length",
"(",
")",
")",
";",
"// true if last char was blank",
"boolean",
"lastWasBlankChar",
"=",
"false"... | Escape html special chars from string
@param htmlString
@return | [
"Escape",
"html",
"special",
"chars",
"from",
"string"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L179-L237 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.escapeJQuerySpecialCharsInSelector | public static String escapeJQuerySpecialCharsInSelector(String selector) {
String jQuerySpecialChars = "!\"#$%&'()*+,./:;<=>?@[]^`{|}~;";
String[] jsc = jQuerySpecialChars.split("(?!^)");
for(String c: jsc) {
selector = selector.replace(c, "\\\\" + c);
}
return selector;
} | java | public static String escapeJQuerySpecialCharsInSelector(String selector) {
String jQuerySpecialChars = "!\"#$%&'()*+,./:;<=>?@[]^`{|}~;";
String[] jsc = jQuerySpecialChars.split("(?!^)");
for(String c: jsc) {
selector = selector.replace(c, "\\\\" + c);
}
return selector;
} | [
"public",
"static",
"String",
"escapeJQuerySpecialCharsInSelector",
"(",
"String",
"selector",
")",
"{",
"String",
"jQuerySpecialChars",
"=",
"\"!\\\"#$%&'()*+,./:;<=>?@[]^`{|}~;\"",
";",
"String",
"[",
"]",
"jsc",
"=",
"jQuerySpecialChars",
".",
"split",
"(",
"\"(?!^)\... | Escape special jQuery chars in selector query
@param selector
@return | [
"Escape",
"special",
"jQuery",
"chars",
"in",
"selector",
"query"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L244-L251 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.getClosestForm | public static UIForm getClosestForm(UIComponent component) {
while (component != null) {
if (component instanceof UIForm) {
return (UIForm) component;
}
component = component.getParent();
}
return null;
} | java | public static UIForm getClosestForm(UIComponent component) {
while (component != null) {
if (component instanceof UIForm) {
return (UIForm) component;
}
component = component.getParent();
}
return null;
} | [
"public",
"static",
"UIForm",
"getClosestForm",
"(",
"UIComponent",
"component",
")",
"{",
"while",
"(",
"component",
"!=",
"null",
")",
"{",
"if",
"(",
"component",
"instanceof",
"UIForm",
")",
"{",
"return",
"(",
"UIForm",
")",
"component",
";",
"}",
"co... | Get the related form
@param component
@return | [
"Get",
"the",
"related",
"form"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L275-L283 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.getComponentClientId | public static String getComponentClientId(final String componentId) {
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
UIComponent c = findComponent(root, componentId);
if (c==null) {
return null;
}
return c.getClientId(context);
} | java | public static String getComponentClientId(final String componentId) {
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
UIComponent c = findComponent(root, componentId);
if (c==null) {
return null;
}
return c.getClientId(context);
} | [
"public",
"static",
"String",
"getComponentClientId",
"(",
"final",
"String",
"componentId",
")",
"{",
"FacesContext",
"context",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"UIViewRoot",
"root",
"=",
"context",
".",
"getViewRoot",
"(",
")",
"... | Returns the clientId for a component with id="foo".
@return null if there's no such component. | [
"Returns",
"the",
"clientId",
"for",
"a",
"component",
"with",
"id",
"=",
"foo",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L289-L298 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.findComponent | public static UIComponent findComponent(UIComponent c, String id) {
if (id.equals(c.getId())) {
return c;
}
Iterator<UIComponent> kids = c.getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent found = findComponent(kids.next(), id);
if (found != null) {
return found;
}
}
return null;
... | java | public static UIComponent findComponent(UIComponent c, String id) {
if (id.equals(c.getId())) {
return c;
}
Iterator<UIComponent> kids = c.getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent found = findComponent(kids.next(), id);
if (found != null) {
return found;
}
}
return null;
... | [
"public",
"static",
"UIComponent",
"findComponent",
"(",
"UIComponent",
"c",
",",
"String",
"id",
")",
"{",
"if",
"(",
"id",
".",
"equals",
"(",
"c",
".",
"getId",
"(",
")",
")",
")",
"{",
"return",
"c",
";",
"}",
"Iterator",
"<",
"UIComponent",
">",... | Finds component with the given id | [
"Finds",
"component",
"with",
"the",
"given",
"id"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L303-L315 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.getInitParam | public static String getInitParam(String param, FacesContext context) {
return context.getExternalContext().getInitParameter(param);
} | java | public static String getInitParam(String param, FacesContext context) {
return context.getExternalContext().getInitParameter(param);
} | [
"public",
"static",
"String",
"getInitParam",
"(",
"String",
"param",
",",
"FacesContext",
"context",
")",
"{",
"return",
"context",
".",
"getExternalContext",
"(",
")",
".",
"getInitParameter",
"(",
"param",
")",
";",
"}"
] | Shortcut for getting context parameters using an already obtained FacesContext.
@param param context parameter name
@return value of context parameter, may be null or empty | [
"Shortcut",
"for",
"getting",
"context",
"parameters",
"using",
"an",
"already",
"obtained",
"FacesContext",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L331-L333 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.resolveSearchExpressions | public static String resolveSearchExpressions(String refItem) {
if (refItem != null) {
if (refItem.contains("@") || refItem.contains("*")) {
refItem = ExpressionResolver.getComponentIDs(FacesContext.getCurrentInstance(),
FacesContext.getCurrentInstance().getViewRoot(), refItem);
}
}
return refItem... | java | public static String resolveSearchExpressions(String refItem) {
if (refItem != null) {
if (refItem.contains("@") || refItem.contains("*")) {
refItem = ExpressionResolver.getComponentIDs(FacesContext.getCurrentInstance(),
FacesContext.getCurrentInstance().getViewRoot(), refItem);
}
}
return refItem... | [
"public",
"static",
"String",
"resolveSearchExpressions",
"(",
"String",
"refItem",
")",
"{",
"if",
"(",
"refItem",
"!=",
"null",
")",
"{",
"if",
"(",
"refItem",
".",
"contains",
"(",
"\"@\"",
")",
"||",
"refItem",
".",
"contains",
"(",
"\"*\"",
")",
")"... | Resolve the search expression
@param refItem
@return | [
"Resolve",
"the",
"search",
"expression"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L671-L679 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.isLegacyFeedbackClassesEnabled | public static boolean isLegacyFeedbackClassesEnabled() {
String legacyErrorClasses = getInitParam("net.bootsfaces.legacy_error_classes");
legacyErrorClasses=evalELIfPossible(legacyErrorClasses);
return legacyErrorClasses.equalsIgnoreCase("true") || legacyErrorClasses.equalsIgnoreCase("yes");
} | java | public static boolean isLegacyFeedbackClassesEnabled() {
String legacyErrorClasses = getInitParam("net.bootsfaces.legacy_error_classes");
legacyErrorClasses=evalELIfPossible(legacyErrorClasses);
return legacyErrorClasses.equalsIgnoreCase("true") || legacyErrorClasses.equalsIgnoreCase("yes");
} | [
"public",
"static",
"boolean",
"isLegacyFeedbackClassesEnabled",
"(",
")",
"{",
"String",
"legacyErrorClasses",
"=",
"getInitParam",
"(",
"\"net.bootsfaces.legacy_error_classes\"",
")",
";",
"legacyErrorClasses",
"=",
"evalELIfPossible",
"(",
"legacyErrorClasses",
")",
";",... | It checks where the framework should place BS feedback classes.
@return | [
"It",
"checks",
"where",
"the",
"framework",
"should",
"place",
"BS",
"feedback",
"classes",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L733-L737 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/datepicker/Datepicker.java | Datepicker.encodeDefaultLanguageJS | private void encodeDefaultLanguageJS(FacesContext fc) throws IOException {
ResponseWriter rw = fc.getResponseWriter();
rw.startElement("script", null);
rw.write("$.datepicker.setDefaults($.datepicker.regional['" + fc.getViewRoot().getLocale().getLanguage()
+ "']);");
rw.endElement("script");
} | java | private void encodeDefaultLanguageJS(FacesContext fc) throws IOException {
ResponseWriter rw = fc.getResponseWriter();
rw.startElement("script", null);
rw.write("$.datepicker.setDefaults($.datepicker.regional['" + fc.getViewRoot().getLocale().getLanguage()
+ "']);");
rw.endElement("script");
} | [
"private",
"void",
"encodeDefaultLanguageJS",
"(",
"FacesContext",
"fc",
")",
"throws",
"IOException",
"{",
"ResponseWriter",
"rw",
"=",
"fc",
".",
"getResponseWriter",
"(",
")",
";",
"rw",
".",
"startElement",
"(",
"\"script\"",
",",
"null",
")",
";",
"rw",
... | Generates the default language for the date picker. Originally implemented in
the HeadRenderer, this code has been moved here to provide better
compatibility to PrimeFaces. If multiple date pickers are on the page, the
script is generated redundantly, but this shouldn't do no harm.
@param fc
The current FacesContext
@... | [
"Generates",
"the",
"default",
"language",
"for",
"the",
"date",
"picker",
".",
"Originally",
"implemented",
"in",
"the",
"HeadRenderer",
"this",
"code",
"has",
"been",
"moved",
"here",
"to",
"provide",
"better",
"compatibility",
"to",
"PrimeFaces",
".",
"If",
... | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/datepicker/Datepicker.java#L208-L214 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/datepicker/Datepicker.java | Datepicker.convertFormat | public static String convertFormat(String format) {
if (format == null)
return null;
else {
// day of week
format = format.replaceAll("EEE", "D");
// year
format = format.replaceAll("yy", "y");
// month
if (format.indexOf("MMM") != -1) {
format = format.replaceAll("MMM", "M");
} else {
... | java | public static String convertFormat(String format) {
if (format == null)
return null;
else {
// day of week
format = format.replaceAll("EEE", "D");
// year
format = format.replaceAll("yy", "y");
// month
if (format.indexOf("MMM") != -1) {
format = format.replaceAll("MMM", "M");
} else {
... | [
"public",
"static",
"String",
"convertFormat",
"(",
"String",
"format",
")",
"{",
"if",
"(",
"format",
"==",
"null",
")",
"return",
"null",
";",
"else",
"{",
"// day of week",
"format",
"=",
"format",
".",
"replaceAll",
"(",
"\"EEE\"",
",",
"\"D\"",
")",
... | Converts a java Date format to a jQuery date format
@param format
Format to be converted
@return converted format | [
"Converts",
"a",
"java",
"Date",
"format",
"to",
"a",
"jQuery",
"date",
"format"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/datepicker/Datepicker.java#L602-L619 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/Responsive.java | Responsive.encodeVisibility | private static String encodeVisibility(IResponsive r, String value, String prefix) {
if(value == null) return "";
if ("true".equals(value) || "false".equals(value)) {
throw new FacesException("The attributes 'visible' and 'hidden' don't accept boolean values. If you want to show or hide the element conditionall... | java | private static String encodeVisibility(IResponsive r, String value, String prefix) {
if(value == null) return "";
if ("true".equals(value) || "false".equals(value)) {
throw new FacesException("The attributes 'visible' and 'hidden' don't accept boolean values. If you want to show or hide the element conditionall... | [
"private",
"static",
"String",
"encodeVisibility",
"(",
"IResponsive",
"r",
",",
"String",
"value",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"\"\"",
";",
"if",
"(",
"\"true\"",
".",
"equals",
"(",
"value",
")",
... | Encode the visible field
@param r
@return | [
"Encode",
"the",
"visible",
"field"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/Responsive.java#L115-L123 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/Responsive.java | Responsive.getSize | private static String getSize(IResponsiveLabel r, Sizes size) {
String colSize = "-1";
switch(size) {
case xs:
colSize = r.getLabelColXs();
if(colSize.equals("-1")) colSize = r.getLabelTinyScreen();
break;
case sm:
colSize = r.getLabelColSm();
if(colSize.equals("-1")) colSize = r.getLabelSmallScr... | java | private static String getSize(IResponsiveLabel r, Sizes size) {
String colSize = "-1";
switch(size) {
case xs:
colSize = r.getLabelColXs();
if(colSize.equals("-1")) colSize = r.getLabelTinyScreen();
break;
case sm:
colSize = r.getLabelColSm();
if(colSize.equals("-1")) colSize = r.getLabelSmallScr... | [
"private",
"static",
"String",
"getSize",
"(",
"IResponsiveLabel",
"r",
",",
"Sizes",
"size",
")",
"{",
"String",
"colSize",
"=",
"\"-1\"",
";",
"switch",
"(",
"size",
")",
"{",
"case",
"xs",
":",
"colSize",
"=",
"r",
".",
"getLabelColXs",
"(",
")",
";... | Decode col sizes between two way of definition
@param col
@param size
@return | [
"Decode",
"col",
"sizes",
"between",
"two",
"way",
"of",
"definition"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/Responsive.java#L131-L152 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/Responsive.java | Responsive.sizeToInt | private static int sizeToInt(String size) {
if (size==null) return -1;
if ("full".equals(size)) return 12;
if ("full-size".equals(size)) return 12;
if ("fullSize".equals(size)) return 12;
if ("full-width".equals(size)) return 12;
if ("fullWidth".equals(size)) return 12;
if ("half".equals(size)) return 6;
... | java | private static int sizeToInt(String size) {
if (size==null) return -1;
if ("full".equals(size)) return 12;
if ("full-size".equals(size)) return 12;
if ("fullSize".equals(size)) return 12;
if ("full-width".equals(size)) return 12;
if ("fullWidth".equals(size)) return 12;
if ("half".equals(size)) return 6;
... | [
"private",
"static",
"int",
"sizeToInt",
"(",
"String",
"size",
")",
"{",
"if",
"(",
"size",
"==",
"null",
")",
"return",
"-",
"1",
";",
"if",
"(",
"\"full\"",
".",
"equals",
"(",
"size",
")",
")",
"return",
"12",
";",
"if",
"(",
"\"full-size\"",
"... | Convert the specified size to int value
@param size
@return | [
"Convert",
"the",
"specified",
"size",
"to",
"int",
"value"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/Responsive.java#L182-L204 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/Responsive.java | Responsive.getSizeRange | private static List<String> getSizeRange(String operation, String size)
{
return getSizeRange(operation, size, null);
} | java | private static List<String> getSizeRange(String operation, String size)
{
return getSizeRange(operation, size, null);
} | [
"private",
"static",
"List",
"<",
"String",
">",
"getSizeRange",
"(",
"String",
"operation",
",",
"String",
"size",
")",
"{",
"return",
"getSizeRange",
"(",
"operation",
",",
"size",
",",
"null",
")",
";",
"}"
] | Get the size ranges
@param operation
@param size
@return | [
"Get",
"the",
"size",
"ranges"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/Responsive.java#L324-L327 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/Responsive.java | Responsive.wonderfulTokenizer | public static List<String> wonderfulTokenizer(String tokenString, String[] delimiters) {
List<String> tokens = new ArrayList<String>();
String currentToken = "";
for(int i = 0; i < tokenString.length(); i++) {
String _currItem = String.valueOf(tokenString.charAt(i));
if(_currItem.trim().isEmpty()) continue;... | java | public static List<String> wonderfulTokenizer(String tokenString, String[] delimiters) {
List<String> tokens = new ArrayList<String>();
String currentToken = "";
for(int i = 0; i < tokenString.length(); i++) {
String _currItem = String.valueOf(tokenString.charAt(i));
if(_currItem.trim().isEmpty()) continue;... | [
"public",
"static",
"List",
"<",
"String",
">",
"wonderfulTokenizer",
"(",
"String",
"tokenString",
",",
"String",
"[",
"]",
"delimiters",
")",
"{",
"List",
"<",
"String",
">",
"tokens",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"String... | Tokenize string based on rules
@param tokenString
@param delimiters
@return | [
"Tokenize",
"string",
"based",
"on",
"rules"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/Responsive.java#L375-L406 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/Responsive.java | Responsive.getResponsiveLabelClass | public static String getResponsiveLabelClass(IResponsiveLabel r) {
if(!shouldRenderResponsiveClasses(r)) {
return "";
}
int colxs = sizeToInt(getSize(r, Sizes.xs));
int colsm = sizeToInt(getSize(r, Sizes.sm));
int colmd = sizeToInt(getSi... | java | public static String getResponsiveLabelClass(IResponsiveLabel r) {
if(!shouldRenderResponsiveClasses(r)) {
return "";
}
int colxs = sizeToInt(getSize(r, Sizes.xs));
int colsm = sizeToInt(getSize(r, Sizes.sm));
int colmd = sizeToInt(getSi... | [
"public",
"static",
"String",
"getResponsiveLabelClass",
"(",
"IResponsiveLabel",
"r",
")",
"{",
"if",
"(",
"!",
"shouldRenderResponsiveClasses",
"(",
"r",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"int",
"colxs",
"=",
"sizeToInt",
"(",
"getSize",
"(",
"r",... | Create the responsive class combination
@param r the component bearing the responsiveness attributes
@return null, if there's no label-col-xx attribute | [
"Create",
"the",
"responsive",
"class",
"combination"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/Responsive.java#L413-L451 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/Responsive.java | Responsive.shouldRenderResponsiveClasses | private static boolean shouldRenderResponsiveClasses(Object r) {
// This method only checks inputs.
if(r instanceof UIComponent && r instanceof IResponsiveLabel) {
UIForm form = AJAXRenderer.getSurroundingForm((UIComponent) r, true);
if(form instanceof Form) {
... | java | private static boolean shouldRenderResponsiveClasses(Object r) {
// This method only checks inputs.
if(r instanceof UIComponent && r instanceof IResponsiveLabel) {
UIForm form = AJAXRenderer.getSurroundingForm((UIComponent) r, true);
if(form instanceof Form) {
... | [
"private",
"static",
"boolean",
"shouldRenderResponsiveClasses",
"(",
"Object",
"r",
")",
"{",
"// This method only checks inputs.",
"if",
"(",
"r",
"instanceof",
"UIComponent",
"&&",
"r",
"instanceof",
"IResponsiveLabel",
")",
"{",
"UIForm",
"form",
"=",
"AJAXRendere... | Temporal and ugly hack to prevent responsive classes to be applied to inputs inside inline forms.
This should be removed and the logic placed somewhere else.
@return whether the component should render responsive classes | [
"Temporal",
"and",
"ugly",
"hack",
"to",
"prevent",
"responsive",
"classes",
"to",
"be",
"applied",
"to",
"inputs",
"inside",
"inline",
"forms",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/Responsive.java#L460-L473 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/CoreMessageRenderer.java | CoreMessageRenderer.getSeverityName | public String getSeverityName(Severity severity) {
if (severity.equals(FacesMessage.SEVERITY_INFO)) {
return "info";
} else if (severity.equals(FacesMessage.SEVERITY_WARN)) {
return "warn";
} else if (severity.equals(FacesMessage.SEVERITY_ERROR)) {
return "error";
} else if (severity.equals(FacesMessag... | java | public String getSeverityName(Severity severity) {
if (severity.equals(FacesMessage.SEVERITY_INFO)) {
return "info";
} else if (severity.equals(FacesMessage.SEVERITY_WARN)) {
return "warn";
} else if (severity.equals(FacesMessage.SEVERITY_ERROR)) {
return "error";
} else if (severity.equals(FacesMessag... | [
"public",
"String",
"getSeverityName",
"(",
"Severity",
"severity",
")",
"{",
"if",
"(",
"severity",
".",
"equals",
"(",
"FacesMessage",
".",
"SEVERITY_INFO",
")",
")",
"{",
"return",
"\"info\"",
";",
"}",
"else",
"if",
"(",
"severity",
".",
"equals",
"(",... | Returns name of the given severity in lower case.
@param severity Severity to get name of.
@return Name of the given severity in lower case. | [
"Returns",
"name",
"of",
"the",
"given",
"severity",
"in",
"lower",
"case",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/CoreMessageRenderer.java#L50-L61 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/beans/ELTools.java | ELTools.createValueExpression | public static ValueExpression createValueExpression(String p_expression) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELContext();
ValueExpression vex = expressionFactory.create... | java | public static ValueExpression createValueExpression(String p_expression) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELContext();
ValueExpression vex = expressionFactory.create... | [
"public",
"static",
"ValueExpression",
"createValueExpression",
"(",
"String",
"p_expression",
")",
"{",
"FacesContext",
"context",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"ExpressionFactory",
"expressionFactory",
"=",
"context",
".",
"getApplicat... | Utility method to create a JSF Value expression from the p_expression string
@param p_expression
@return | [
"Utility",
"method",
"to",
"create",
"a",
"JSF",
"Value",
"expression",
"from",
"the",
"p_expression",
"string"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/beans/ELTools.java#L52-L58 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/beans/ELTools.java | ELTools.createValueExpression | public static ValueExpression createValueExpression(String p_expression, Class<?> expectedType) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELContext();
if (null == expectedTyp... | java | public static ValueExpression createValueExpression(String p_expression, Class<?> expectedType) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELContext();
if (null == expectedTyp... | [
"public",
"static",
"ValueExpression",
"createValueExpression",
"(",
"String",
"p_expression",
",",
"Class",
"<",
"?",
">",
"expectedType",
")",
"{",
"FacesContext",
"context",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"ExpressionFactory",
"expr... | Utility method to create a JSF Value expression from p_expression with
exprectedType class as return
@param p_expression
@param expectedType
@return | [
"Utility",
"method",
"to",
"create",
"a",
"JSF",
"Value",
"expression",
"from",
"p_expression",
"with",
"exprectedType",
"class",
"as",
"return"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/beans/ELTools.java#L68-L78 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/beans/ELTools.java | ELTools.createMethodExpression | public static MethodExpression createMethodExpression(String p_expression, Class<?> returnType,
Class<?>... parameterTypes) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELConte... | java | public static MethodExpression createMethodExpression(String p_expression, Class<?> returnType,
Class<?>... parameterTypes) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELConte... | [
"public",
"static",
"MethodExpression",
"createMethodExpression",
"(",
"String",
"p_expression",
",",
"Class",
"<",
"?",
">",
"returnType",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"FacesContext",
"context",
"=",
"FacesContext",
".",
"getC... | Utility method to create a JSF Method expression
@param p_expression
@param returnType
@param parameterTypes
@return | [
"Utility",
"method",
"to",
"create",
"a",
"JSF",
"Method",
"expression"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/beans/ELTools.java#L88-L97 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/beans/ELTools.java | ELTools.getBeanAttributeInfos | public static NGBeanAttributeInfo getBeanAttributeInfos(UIComponent c) {
String core = getCoreValueExpression(c);
synchronized (beanAttributeInfos) {
if (beanAttributeInfos.containsKey(c)) {
return beanAttributeInfos.get(c);
}
}
NGBeanAttributeInfo info = new NGBeanAttributeInfo(c);
synchronized (be... | java | public static NGBeanAttributeInfo getBeanAttributeInfos(UIComponent c) {
String core = getCoreValueExpression(c);
synchronized (beanAttributeInfos) {
if (beanAttributeInfos.containsKey(c)) {
return beanAttributeInfos.get(c);
}
}
NGBeanAttributeInfo info = new NGBeanAttributeInfo(c);
synchronized (be... | [
"public",
"static",
"NGBeanAttributeInfo",
"getBeanAttributeInfos",
"(",
"UIComponent",
"c",
")",
"{",
"String",
"core",
"=",
"getCoreValueExpression",
"(",
"c",
")",
";",
"synchronized",
"(",
"beanAttributeInfos",
")",
"{",
"if",
"(",
"beanAttributeInfos",
".",
"... | Get the bean attributes info
@param c
@return | [
"Get",
"the",
"bean",
"attributes",
"info"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/beans/ELTools.java#L140-L152 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/beans/ELTools.java | ELTools.getCoreValueExpression | public static String getCoreValueExpression(UIComponent component) {
ValueExpression valueExpression = component.getValueExpression("value");
if (null != valueExpression) {
String v = valueExpression.getExpressionString();
if (null != v) {
Matcher matcher = EL_EXPRESSION.matcher(v);
if (matcher.find()... | java | public static String getCoreValueExpression(UIComponent component) {
ValueExpression valueExpression = component.getValueExpression("value");
if (null != valueExpression) {
String v = valueExpression.getExpressionString();
if (null != v) {
Matcher matcher = EL_EXPRESSION.matcher(v);
if (matcher.find()... | [
"public",
"static",
"String",
"getCoreValueExpression",
"(",
"UIComponent",
"component",
")",
"{",
"ValueExpression",
"valueExpression",
"=",
"component",
".",
"getValueExpression",
"(",
"\"value\"",
")",
";",
"if",
"(",
"null",
"!=",
"valueExpression",
")",
"{",
... | Return the core value expression of a specified component
@param component
@return | [
"Return",
"the",
"core",
"value",
"expression",
"of",
"a",
"specified",
"component"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/beans/ELTools.java#L160-L174 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/beans/ELTools.java | ELTools.readAnnotations | public static Annotation[] readAnnotations(UIComponent p_component) {
ValueExpression valueExpression = p_component.getValueExpression("value");
if (valueExpression != null && valueExpression.getExpressionString() != null && valueExpression.getExpressionString().length()>0) {
return readAnnotations(valueExpressi... | java | public static Annotation[] readAnnotations(UIComponent p_component) {
ValueExpression valueExpression = p_component.getValueExpression("value");
if (valueExpression != null && valueExpression.getExpressionString() != null && valueExpression.getExpressionString().length()>0) {
return readAnnotations(valueExpressi... | [
"public",
"static",
"Annotation",
"[",
"]",
"readAnnotations",
"(",
"UIComponent",
"p_component",
")",
"{",
"ValueExpression",
"valueExpression",
"=",
"p_component",
".",
"getValueExpression",
"(",
"\"value\"",
")",
";",
"if",
"(",
"valueExpression",
"!=",
"null",
... | Which annotations are given to an object displayed by a JSF component?
@param p_component
the component
@return null if there are no annotations, or if they cannot be accessed | [
"Which",
"annotations",
"are",
"given",
"to",
"an",
"object",
"displayed",
"by",
"a",
"JSF",
"component?"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/beans/ELTools.java#L412-L418 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.processEvent | public void processEvent(SystemEvent event) throws AbortProcessingException {
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
// render the resources only if there is at least one bsf component
if (ensureExistBootsfacesComponent(root, context)) {
addCSS(roo... | java | public void processEvent(SystemEvent event) throws AbortProcessingException {
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
// render the resources only if there is at least one bsf component
if (ensureExistBootsfacesComponent(root, context)) {
addCSS(roo... | [
"public",
"void",
"processEvent",
"(",
"SystemEvent",
"event",
")",
"throws",
"AbortProcessingException",
"{",
"FacesContext",
"context",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"UIViewRoot",
"root",
"=",
"context",
".",
"getViewRoot",
"(",
... | Trigger adding the resources if and only if the event has been fired by
UIViewRoot. | [
"Trigger",
"adding",
"the",
"resources",
"if",
"and",
"only",
"if",
"the",
"event",
"has",
"been",
"fired",
"by",
"UIViewRoot",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L131-L141 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.ensureExistBootsfacesComponent | private boolean ensureExistBootsfacesComponent(UIViewRoot root, FacesContext context) {
Map<String, Object> viewMap = root.getViewMap();
// check explicit js request
if (viewMap.get(RESOURCE_KEY) != null)
return true;
// check explicit css request
if (viewMap.get(THEME_RESOURCE_KEY) != null)
return tru... | java | private boolean ensureExistBootsfacesComponent(UIViewRoot root, FacesContext context) {
Map<String, Object> viewMap = root.getViewMap();
// check explicit js request
if (viewMap.get(RESOURCE_KEY) != null)
return true;
// check explicit css request
if (viewMap.get(THEME_RESOURCE_KEY) != null)
return tru... | [
"private",
"boolean",
"ensureExistBootsfacesComponent",
"(",
"UIViewRoot",
"root",
",",
"FacesContext",
"context",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"viewMap",
"=",
"root",
".",
"getViewMap",
"(",
")",
";",
"// check explicit js request",
"if",
... | Check if there is almost one bootsfaces component in page. If yes, load the
correct items.
To ensure that, it checks first the viewMap to find specific bootsfaces key.
If it found nothing, it check for components that has as a resource lib, the
"bsf" lib.
@param root the UIViewRoot
@param context the faces conte... | [
"Check",
"if",
"there",
"is",
"almost",
"one",
"bootsfaces",
"component",
"in",
"page",
".",
"If",
"yes",
"load",
"the",
"correct",
"items",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L155-L172 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.findBsfComponent | public static UIComponent findBsfComponent(UIComponent parent, String targetLib) {
if (targetLib.equalsIgnoreCase((String) parent.getAttributes().get("library"))) {
return parent;
}
Iterator<UIComponent> kids = parent.getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent found = findBsfComponent(ki... | java | public static UIComponent findBsfComponent(UIComponent parent, String targetLib) {
if (targetLib.equalsIgnoreCase((String) parent.getAttributes().get("library"))) {
return parent;
}
Iterator<UIComponent> kids = parent.getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent found = findBsfComponent(ki... | [
"public",
"static",
"UIComponent",
"findBsfComponent",
"(",
"UIComponent",
"parent",
",",
"String",
"targetLib",
")",
"{",
"if",
"(",
"targetLib",
".",
"equalsIgnoreCase",
"(",
"(",
"String",
")",
"parent",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"\... | Check all components in page to find one that has as resource library the
target library. I use this method to check existence of a BsF component
because, at this level, the getComponentResource returns always null
@param parent the parent component
@param targetLib the lib to search
@return | [
"Check",
"all",
"components",
"in",
"page",
"to",
"find",
"one",
"that",
"has",
"as",
"resource",
"library",
"the",
"target",
"library",
".",
"I",
"use",
"this",
"method",
"to",
"check",
"existence",
"of",
"a",
"BsF",
"component",
"because",
"at",
"this",
... | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L183-L195 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.addMetaTags | private void addMetaTags(UIViewRoot root, FacesContext context) {
// Check context-param
String viewportParam = BsfUtils.getInitParam(C.P_VIEWPORT, context);
viewportParam = evalELIfPossible(viewportParam);
String content = "width=device-width, initial-scale=1";
if (!viewportParam.isEmpty() && isFalseOrNo(vi... | java | private void addMetaTags(UIViewRoot root, FacesContext context) {
// Check context-param
String viewportParam = BsfUtils.getInitParam(C.P_VIEWPORT, context);
viewportParam = evalELIfPossible(viewportParam);
String content = "width=device-width, initial-scale=1";
if (!viewportParam.isEmpty() && isFalseOrNo(vi... | [
"private",
"void",
"addMetaTags",
"(",
"UIViewRoot",
"root",
",",
"FacesContext",
"context",
")",
"{",
"// Check context-param",
"String",
"viewportParam",
"=",
"BsfUtils",
".",
"getInitParam",
"(",
"C",
".",
"P_VIEWPORT",
",",
"context",
")",
";",
"viewportParam"... | Add the viewport meta tag if not disabled from context-param
@param root
@param context
@param isProduction | [
"Add",
"the",
"viewport",
"meta",
"tag",
"if",
"not",
"disabled",
"from",
"context",
"-",
"param"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L204-L226 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.addCSS | private void addCSS(UIViewRoot root, FacesContext context) {
// The following code is needed to diagnose the warning "Unable to save dynamic
// action with clientId 'j_id...'"
// List<UIComponent> r = root.getComponentResources(context, "head");
// System.out.println("**************");
// for (UIComponent ava... | java | private void addCSS(UIViewRoot root, FacesContext context) {
// The following code is needed to diagnose the warning "Unable to save dynamic
// action with clientId 'j_id...'"
// List<UIComponent> r = root.getComponentResources(context, "head");
// System.out.println("**************");
// for (UIComponent ava... | [
"private",
"void",
"addCSS",
"(",
"UIViewRoot",
"root",
",",
"FacesContext",
"context",
")",
"{",
"// The following code is needed to diagnose the warning \"Unable to save dynamic",
"// action with clientId 'j_id...'\"",
"// List<UIComponent> r = root.getComponentResources(context, \"head\... | Add the required CSS files and the FontAwesome CDN link.
@param root The UIViewRoot of the JSF tree.
@param context The current FacesContext | [
"Add",
"the",
"required",
"CSS",
"files",
"and",
"the",
"FontAwesome",
"CDN",
"link",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L234-L327 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.addJavascript | private void addJavascript(UIViewRoot root, FacesContext context) {
// The following code is needed to diagnose the warning "Unable to save dynamic
// action with clientId 'j_id...'"
// List<UIComponent> r = root.getComponentResources(context, "head");
// System.out.println("**************");
// for (UICompon... | java | private void addJavascript(UIViewRoot root, FacesContext context) {
// The following code is needed to diagnose the warning "Unable to save dynamic
// action with clientId 'j_id...'"
// List<UIComponent> r = root.getComponentResources(context, "head");
// System.out.println("**************");
// for (UICompon... | [
"private",
"void",
"addJavascript",
"(",
"UIViewRoot",
"root",
",",
"FacesContext",
"context",
")",
"{",
"// The following code is needed to diagnose the warning \"Unable to save dynamic",
"// action with clientId 'j_id...'\"",
"// List<UIComponent> r = root.getComponentResources(context, ... | Add the required Javascript files and the FontAwesome CDN link.
@param root The UIViewRoot of the JSF tree.
@param context The current FacesContext | [
"Add",
"the",
"required",
"Javascript",
"files",
"and",
"the",
"FontAwesome",
"CDN",
"link",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L386-L428 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.removeDuplicateResources | private void removeDuplicateResources(UIViewRoot root, FacesContext context) {
List<UIComponent> resourcesToRemove = new ArrayList<UIComponent>();
Map<String, UIComponent> alreadyThere = new HashMap<String, UIComponent>();
List<UIComponent> components = new ArrayList<UIComponent>(root.getComponentResources(contex... | java | private void removeDuplicateResources(UIViewRoot root, FacesContext context) {
List<UIComponent> resourcesToRemove = new ArrayList<UIComponent>();
Map<String, UIComponent> alreadyThere = new HashMap<String, UIComponent>();
List<UIComponent> components = new ArrayList<UIComponent>(root.getComponentResources(contex... | [
"private",
"void",
"removeDuplicateResources",
"(",
"UIViewRoot",
"root",
",",
"FacesContext",
"context",
")",
"{",
"List",
"<",
"UIComponent",
">",
"resourcesToRemove",
"=",
"new",
"ArrayList",
"<",
"UIComponent",
">",
"(",
")",
";",
"Map",
"<",
"String",
","... | Remove duplicate resource files. For some reason, many resource files are
added more than once, especially when AJAX is used. The method removes the
duplicate files.
TODO: Verify if the duplicate resource files are a bug of BootsFaces or of
the Mojarra library itself.
@param root The current UIViewRoot
@param cont... | [
"Remove",
"duplicate",
"resource",
"files",
".",
"For",
"some",
"reason",
"many",
"resource",
"files",
"are",
"added",
"more",
"than",
"once",
"especially",
"when",
"AJAX",
"is",
"used",
".",
"The",
"method",
"removes",
"the",
"duplicate",
"files",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L619-L654 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.enforceCorrectLoadOrder | private void enforceCorrectLoadOrder(UIViewRoot root, FacesContext context) {
// // first, handle the CSS files.
// // Put BootsFaces.css or BootsFaces.min.css first,
// // theme.css second
// // and everything else behind them.
List<UIComponent> resources = new ArrayList<UIComponent>();
List<UIComponent> f... | java | private void enforceCorrectLoadOrder(UIViewRoot root, FacesContext context) {
// // first, handle the CSS files.
// // Put BootsFaces.css or BootsFaces.min.css first,
// // theme.css second
// // and everything else behind them.
List<UIComponent> resources = new ArrayList<UIComponent>();
List<UIComponent> f... | [
"private",
"void",
"enforceCorrectLoadOrder",
"(",
"UIViewRoot",
"root",
",",
"FacesContext",
"context",
")",
"{",
"// // first, handle the CSS files.",
"// // Put BootsFaces.css or BootsFaces.min.css first,",
"// // theme.css second",
"// // and everything else behind them.",
"List",
... | Make sure jQuery is loaded before jQueryUI, and that every other Javascript
is loaded later. Also make sure that the BootsFaces resource files are loaded
prior to other resource files, giving the developer the opportunity to
overwrite a CSS or JS file.
@param root The current UIViewRoot
@param context The current F... | [
"Make",
"sure",
"jQuery",
"is",
"loaded",
"before",
"jQueryUI",
"and",
"that",
"every",
"other",
"Javascript",
"is",
"loaded",
"later",
".",
"Also",
"make",
"sure",
"that",
"the",
"BootsFaces",
"resource",
"files",
"are",
"loaded",
"prior",
"to",
"other",
"r... | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L702-L778 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.findHeader | private UIComponent findHeader(UIViewRoot root) {
for (UIComponent c : root.getChildren()) {
if (c instanceof HtmlHead)
return c;
}
for (UIComponent c : root.getChildren()) {
if (c instanceof HtmlBody)
return null;
if (c instanceof UIOutput)
if (c.getFacets() != null)
return c;
}
ret... | java | private UIComponent findHeader(UIViewRoot root) {
for (UIComponent c : root.getChildren()) {
if (c instanceof HtmlHead)
return c;
}
for (UIComponent c : root.getChildren()) {
if (c instanceof HtmlBody)
return null;
if (c instanceof UIOutput)
if (c.getFacets() != null)
return c;
}
ret... | [
"private",
"UIComponent",
"findHeader",
"(",
"UIViewRoot",
"root",
")",
"{",
"for",
"(",
"UIComponent",
"c",
":",
"root",
".",
"getChildren",
"(",
")",
")",
"{",
"if",
"(",
"c",
"instanceof",
"HtmlHead",
")",
"return",
"c",
";",
"}",
"for",
"(",
"UICom... | Looks for the header in the JSF tree.
@param root The root of the JSF tree.
@return null, if the head couldn't be found. | [
"Looks",
"for",
"the",
"header",
"in",
"the",
"JSF",
"tree",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L816-L829 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.addResourceToHeadButAfterJQuery | public static void addResourceToHeadButAfterJQuery(String library, String resource) {
addResource(resource, library, library + "#" + resource, RESOURCE_KEY);
} | java | public static void addResourceToHeadButAfterJQuery(String library, String resource) {
addResource(resource, library, library + "#" + resource, RESOURCE_KEY);
} | [
"public",
"static",
"void",
"addResourceToHeadButAfterJQuery",
"(",
"String",
"library",
",",
"String",
"resource",
")",
"{",
"addResource",
"(",
"resource",
",",
"library",
",",
"library",
"+",
"\"#\"",
"+",
"resource",
",",
"RESOURCE_KEY",
")",
";",
"}"
] | Registers a JS file that needs to be included in the header of the HTML file,
but after jQuery and AngularJS.
@param library The name of the sub-folder of the resources folder.
@param resource The name of the resource file within the library folder. | [
"Registers",
"a",
"JS",
"file",
"that",
"needs",
"to",
"be",
"included",
"in",
"the",
"header",
"of",
"the",
"HTML",
"file",
"but",
"after",
"jQuery",
"and",
"AngularJS",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L838-L840 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.addBasicJSResource | public static void addBasicJSResource(String library, String resource) {
addResource(resource, library, resource, BASIC_JS_RESOURCE_KEY);
} | java | public static void addBasicJSResource(String library, String resource) {
addResource(resource, library, resource, BASIC_JS_RESOURCE_KEY);
} | [
"public",
"static",
"void",
"addBasicJSResource",
"(",
"String",
"library",
",",
"String",
"resource",
")",
"{",
"addResource",
"(",
"resource",
",",
"library",
",",
"resource",
",",
"BASIC_JS_RESOURCE_KEY",
")",
";",
"}"
] | Registers a core JS file that needs to be included in the header of the HTML
file, but after jQuery and AngularJS.
@param library The name of the sub-folder of the resources folder.
@param resource The name of the resource file within the library folder. | [
"Registers",
"a",
"core",
"JS",
"file",
"that",
"needs",
"to",
"be",
"included",
"in",
"the",
"header",
"of",
"the",
"HTML",
"file",
"but",
"after",
"jQuery",
"and",
"AngularJS",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L849-L851 | train |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/listeners/AddResourcesListener.java | AddResourcesListener.addThemedCSSResource | public static void addThemedCSSResource(String resource) {
Map<String, Object> viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap();
@SuppressWarnings("unchecked")
List<String> resourceList = (List<String>) viewMap.get(THEME_RESOURCE_KEY);
if (null == resourceList) {
resourceList = new Arra... | java | public static void addThemedCSSResource(String resource) {
Map<String, Object> viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap();
@SuppressWarnings("unchecked")
List<String> resourceList = (List<String>) viewMap.get(THEME_RESOURCE_KEY);
if (null == resourceList) {
resourceList = new Arra... | [
"public",
"static",
"void",
"addThemedCSSResource",
"(",
"String",
"resource",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"viewMap",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
".",
"getViewRoot",
"(",
")",
".",
"getViewMap",
"(",
")",... | Registers a themed CSS file that needs to be included in the header of the
HTML file.
@param resource The name of the resource file within the library folder. | [
"Registers",
"a",
"themed",
"CSS",
"file",
"that",
"needs",
"to",
"be",
"included",
"in",
"the",
"header",
"of",
"the",
"HTML",
"file",
"."
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java#L859-L871 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.