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
larsga/Duke
duke-lucene/src/main/java/no/priv/garshol/duke/databases/LuceneDatabase.java
LuceneDatabase.commit
public void commit() { if (directory == null) return; try { if (reader != null) reader.close(); // it turns out that IndexWriter.optimize actually slows // searches down, because it invalidates the cache. therefore // not calling it any more. // http://www.searchwor...
java
public void commit() { if (directory == null) return; try { if (reader != null) reader.close(); // it turns out that IndexWriter.optimize actually slows // searches down, because it invalidates the cache. therefore // not calling it any more. // http://www.searchwor...
[ "public", "void", "commit", "(", ")", "{", "if", "(", "directory", "==", "null", ")", "return", ";", "try", "{", "if", "(", "reader", "!=", "null", ")", "reader", ".", "close", "(", ")", ";", "// it turns out that IndexWriter.optimize actually slows", "// se...
Flushes all changes to disk.
[ "Flushes", "all", "changes", "to", "disk", "." ]
6263f9c6e984c26362a76241c7c7ea3bb4469bac
https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-lucene/src/main/java/no/priv/garshol/duke/databases/LuceneDatabase.java#L218-L237
train
larsga/Duke
duke-lucene/src/main/java/no/priv/garshol/duke/databases/LuceneDatabase.java
LuceneDatabase.findRecordById
public Record findRecordById(String id) { if (directory == null) init(); Property idprop = config.getIdentityProperties().iterator().next(); for (Record r : lookup(idprop, id)) if (r.getValue(idprop.getName()).equals(id)) return r; return null; // not found }
java
public Record findRecordById(String id) { if (directory == null) init(); Property idprop = config.getIdentityProperties().iterator().next(); for (Record r : lookup(idprop, id)) if (r.getValue(idprop.getName()).equals(id)) return r; return null; // not found }
[ "public", "Record", "findRecordById", "(", "String", "id", ")", "{", "if", "(", "directory", "==", "null", ")", "init", "(", ")", ";", "Property", "idprop", "=", "config", ".", "getIdentityProperties", "(", ")", ".", "iterator", "(", ")", ".", "next", ...
Look up record by identity.
[ "Look", "up", "record", "by", "identity", "." ]
6263f9c6e984c26362a76241c7c7ea3bb4469bac
https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-lucene/src/main/java/no/priv/garshol/duke/databases/LuceneDatabase.java#L242-L252
train
larsga/Duke
duke-core/src/main/java/no/priv/garshol/duke/cleaners/PhoneNumberCleaner.java
PhoneNumberCleaner.clean
public String clean(String value) { String orig = value; // check if there's a + before the first digit boolean initialplus = findPlus(value); // remove everything but digits value = sub.clean(value); if (value == null) return null; // check for initial '00' boolean zero...
java
public String clean(String value) { String orig = value; // check if there's a + before the first digit boolean initialplus = findPlus(value); // remove everything but digits value = sub.clean(value); if (value == null) return null; // check for initial '00' boolean zero...
[ "public", "String", "clean", "(", "String", "value", ")", "{", "String", "orig", "=", "value", ";", "// check if there's a + before the first digit", "boolean", "initialplus", "=", "findPlus", "(", "value", ")", ";", "// remove everything but digits", "value", "=", ...
look for zero after country code, and remove if present
[ "look", "for", "zero", "after", "country", "code", "and", "remove", "if", "present" ]
6263f9c6e984c26362a76241c7c7ea3bb4469bac
https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/cleaners/PhoneNumberCleaner.java#L32-L66
train
larsga/Duke
duke-core/src/main/java/no/priv/garshol/duke/Link.java
Link.overrides
public boolean overrides(Link other) { if (other.getStatus() == LinkStatus.ASSERTED && status != LinkStatus.ASSERTED) return false; else if (status == LinkStatus.ASSERTED && other.getStatus() != LinkStatus.ASSERTED) return true; // the two links are from equivalent sources ...
java
public boolean overrides(Link other) { if (other.getStatus() == LinkStatus.ASSERTED && status != LinkStatus.ASSERTED) return false; else if (status == LinkStatus.ASSERTED && other.getStatus() != LinkStatus.ASSERTED) return true; // the two links are from equivalent sources ...
[ "public", "boolean", "overrides", "(", "Link", "other", ")", "{", "if", "(", "other", ".", "getStatus", "(", ")", "==", "LinkStatus", ".", "ASSERTED", "&&", "status", "!=", "LinkStatus", ".", "ASSERTED", ")", "return", "false", ";", "else", "if", "(", ...
Returns true if the information in this link should take precedence over the information in the other link.
[ "Returns", "true", "if", "the", "information", "in", "this", "link", "should", "take", "precedence", "over", "the", "information", "in", "the", "other", "link", "." ]
6263f9c6e984c26362a76241c7c7ea3bb4469bac
https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/Link.java#L92-L104
train
larsga/Duke
duke-server/src/main/java/no/priv/garshol/duke/server/DukeController.java
DukeController.process
public void process() { // are we ready to process yet, or have we had an error, and are // waiting a bit longer in the hope that it will resolve itself? if (error_skips > 0) { error_skips--; return; } try { if (logger != null) logger.debug("Starting processing"); ...
java
public void process() { // are we ready to process yet, or have we had an error, and are // waiting a bit longer in the hope that it will resolve itself? if (error_skips > 0) { error_skips--; return; } try { if (logger != null) logger.debug("Starting processing"); ...
[ "public", "void", "process", "(", ")", "{", "// are we ready to process yet, or have we had an error, and are", "// waiting a bit longer in the hope that it will resolve itself?", "if", "(", "error_skips", ">", "0", ")", "{", "error_skips", "--", ";", "return", ";", "}", "t...
Runs the record linkage process.
[ "Runs", "the", "record", "linkage", "process", "." ]
6263f9c6e984c26362a76241c7c7ea3bb4469bac
https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-server/src/main/java/no/priv/garshol/duke/server/DukeController.java#L98-L124
train
larsga/Duke
duke-server/src/main/java/no/priv/garshol/duke/server/DukeController.java
DukeController.reportError
void reportError(Throwable throwable) { if (logger != null) logger.error("Timer reported error", throwable); status = "Thread blocked on error: " + throwable; error_skips = error_factor; }
java
void reportError(Throwable throwable) { if (logger != null) logger.error("Timer reported error", throwable); status = "Thread blocked on error: " + throwable; error_skips = error_factor; }
[ "void", "reportError", "(", "Throwable", "throwable", ")", "{", "if", "(", "logger", "!=", "null", ")", "logger", ".", "error", "(", "\"Timer reported error\"", ",", "throwable", ")", ";", "status", "=", "\"Thread blocked on error: \"", "+", "throwable", ";", ...
called by timer thread
[ "called", "by", "timer", "thread" ]
6263f9c6e984c26362a76241c7c7ea3bb4469bac
https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-server/src/main/java/no/priv/garshol/duke/server/DukeController.java#L155-L160
train
larsga/Duke
duke-core/src/main/java/no/priv/garshol/duke/utils/ObjectUtils.java
ObjectUtils.makePropertyName
public static String makePropertyName(String name) { char[] buf = new char[name.length() + 3]; int pos = 0; buf[pos++] = 's'; buf[pos++] = 'e'; buf[pos++] = 't'; for (int ix = 0; ix < name.length(); ix++) { char ch = name.charAt(ix); if (ix == 0) ch = Character.toUpperCase(c...
java
public static String makePropertyName(String name) { char[] buf = new char[name.length() + 3]; int pos = 0; buf[pos++] = 's'; buf[pos++] = 'e'; buf[pos++] = 't'; for (int ix = 0; ix < name.length(); ix++) { char ch = name.charAt(ix); if (ix == 0) ch = Character.toUpperCase(c...
[ "public", "static", "String", "makePropertyName", "(", "String", "name", ")", "{", "char", "[", "]", "buf", "=", "new", "char", "[", "name", ".", "length", "(", ")", "+", "3", "]", ";", "int", "pos", "=", "0", ";", "buf", "[", "pos", "++", "]", ...
public because it's used by other packages that use Duke
[ "public", "because", "it", "s", "used", "by", "other", "packages", "that", "use", "Duke" ]
6263f9c6e984c26362a76241c7c7ea3bb4469bac
https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/utils/ObjectUtils.java#L77-L99
train
andremion/Louvre
louvre/src/main/java/com/andremion/louvre/util/transition/MediaSharedElementCallback.java
MediaSharedElementCallback.mapObsoleteElements
@NonNull private List<String> mapObsoleteElements(List<String> names) { List<String> elementsToRemove = new ArrayList<>(names.size()); for (String name : names) { if (name.startsWith("android")) continue; elementsToRemove.add(name); } return elementsToRemove; ...
java
@NonNull private List<String> mapObsoleteElements(List<String> names) { List<String> elementsToRemove = new ArrayList<>(names.size()); for (String name : names) { if (name.startsWith("android")) continue; elementsToRemove.add(name); } return elementsToRemove; ...
[ "@", "NonNull", "private", "List", "<", "String", ">", "mapObsoleteElements", "(", "List", "<", "String", ">", "names", ")", "{", "List", "<", "String", ">", "elementsToRemove", "=", "new", "ArrayList", "<>", "(", "names", ".", "size", "(", ")", ")", "...
Maps all views that don't start with "android" namespace. @param names All shared element names. @return The obsolete shared element names.
[ "Maps", "all", "views", "that", "don", "t", "start", "with", "android", "namespace", "." ]
9aeddc88f2e51b8f0f757c290ff26904ae8d6af2
https://github.com/andremion/Louvre/blob/9aeddc88f2e51b8f0f757c290ff26904ae8d6af2/louvre/src/main/java/com/andremion/louvre/util/transition/MediaSharedElementCallback.java#L72-L80
train
andremion/Louvre
louvre/src/main/java/com/andremion/louvre/util/transition/MediaSharedElementCallback.java
MediaSharedElementCallback.removeObsoleteElements
private void removeObsoleteElements(List<String> names, Map<String, View> sharedElements, List<String> elementsToRemove) { if (elementsToRemove.size() > 0) { names.removeAll(elementsToRemove); for (String ele...
java
private void removeObsoleteElements(List<String> names, Map<String, View> sharedElements, List<String> elementsToRemove) { if (elementsToRemove.size() > 0) { names.removeAll(elementsToRemove); for (String ele...
[ "private", "void", "removeObsoleteElements", "(", "List", "<", "String", ">", "names", ",", "Map", "<", "String", ",", "View", ">", "sharedElements", ",", "List", "<", "String", ">", "elementsToRemove", ")", "{", "if", "(", "elementsToRemove", ".", "size", ...
Removes obsolete elements from names and shared elements. @param names Shared element names. @param sharedElements Shared elements. @param elementsToRemove The elements that should be removed.
[ "Removes", "obsolete", "elements", "from", "names", "and", "shared", "elements", "." ]
9aeddc88f2e51b8f0f757c290ff26904ae8d6af2
https://github.com/andremion/Louvre/blob/9aeddc88f2e51b8f0f757c290ff26904ae8d6af2/louvre/src/main/java/com/andremion/louvre/util/transition/MediaSharedElementCallback.java#L89-L98
train
andremion/Louvre
louvre/src/main/java/com/andremion/louvre/home/GalleryAdapter.java
GalleryAdapter.onBindViewHolder
@Override public void onBindViewHolder(GalleryAdapter.ViewHolder holder, int position, List<Object> payloads) { if (payloads.isEmpty()) { // If doesn't have any payload then bind the fully item super.onBindViewHolder(holder, position, payloads); } else { for (Object payload :...
java
@Override public void onBindViewHolder(GalleryAdapter.ViewHolder holder, int position, List<Object> payloads) { if (payloads.isEmpty()) { // If doesn't have any payload then bind the fully item super.onBindViewHolder(holder, position, payloads); } else { for (Object payload :...
[ "@", "Override", "public", "void", "onBindViewHolder", "(", "GalleryAdapter", ".", "ViewHolder", "holder", ",", "int", "position", ",", "List", "<", "Object", ">", "payloads", ")", "{", "if", "(", "payloads", ".", "isEmpty", "(", ")", ")", "{", "// If does...
Binding view holder with payloads is used to handle partial changes in item.
[ "Binding", "view", "holder", "with", "payloads", "is", "used", "to", "handle", "partial", "changes", "in", "item", "." ]
9aeddc88f2e51b8f0f757c290ff26904ae8d6af2
https://github.com/andremion/Louvre/blob/9aeddc88f2e51b8f0f757c290ff26904ae8d6af2/louvre/src/main/java/com/andremion/louvre/home/GalleryAdapter.java#L190-L210
train
airlift/slice
src/main/java/io/airlift/slice/UnsafeSliceFactory.java
UnsafeSliceFactory.newSlice
public Slice newSlice(long address, int size) { if (address <= 0) { throw new IllegalArgumentException("Invalid address: " + address); } if (size == 0) { return Slices.EMPTY_SLICE; } return new Slice(null, address, size, 0, null); }
java
public Slice newSlice(long address, int size) { if (address <= 0) { throw new IllegalArgumentException("Invalid address: " + address); } if (size == 0) { return Slices.EMPTY_SLICE; } return new Slice(null, address, size, 0, null); }
[ "public", "Slice", "newSlice", "(", "long", "address", ",", "int", "size", ")", "{", "if", "(", "address", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid address: \"", "+", "address", ")", ";", "}", "if", "(", "size", "=...
Creates a slice for directly a raw memory address. This is inherently unsafe as it may be used to access arbitrary memory. @param address the raw memory address base @param size the size of the slice @return the unsafe slice
[ "Creates", "a", "slice", "for", "directly", "a", "raw", "memory", "address", ".", "This", "is", "inherently", "unsafe", "as", "it", "may", "be", "used", "to", "access", "arbitrary", "memory", "." ]
7166cb0319e3655f8ba15f5a7ccf3d2f721c1242
https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/UnsafeSliceFactory.java#L64-L73
train
airlift/slice
src/main/java/io/airlift/slice/UnsafeSliceFactory.java
UnsafeSliceFactory.newSlice
public Slice newSlice(long address, int size, Object reference) { if (address <= 0) { throw new IllegalArgumentException("Invalid address: " + address); } if (reference == null) { throw new NullPointerException("Object reference is null"); } if (size =...
java
public Slice newSlice(long address, int size, Object reference) { if (address <= 0) { throw new IllegalArgumentException("Invalid address: " + address); } if (reference == null) { throw new NullPointerException("Object reference is null"); } if (size =...
[ "public", "Slice", "newSlice", "(", "long", "address", ",", "int", "size", ",", "Object", "reference", ")", "{", "if", "(", "address", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid address: \"", "+", "address", ")", ";", ...
Creates a slice for directly a raw memory address. This is inherently unsafe as it may be used to access arbitrary memory. The slice will hold the specified object reference to prevent the garbage collector from freeing it while it is in use by the slice. @param address the raw memory address base @param size the size...
[ "Creates", "a", "slice", "for", "directly", "a", "raw", "memory", "address", ".", "This", "is", "inherently", "unsafe", "as", "it", "may", "be", "used", "to", "access", "arbitrary", "memory", ".", "The", "slice", "will", "hold", "the", "specified", "object...
7166cb0319e3655f8ba15f5a7ccf3d2f721c1242
https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/UnsafeSliceFactory.java#L86-L98
train
airlift/slice
src/main/java/io/airlift/slice/Murmur3Hash32.java
Murmur3Hash32.hash
public static int hash(int input) { int k1 = mixK1(input); int h1 = mixH1(DEFAULT_SEED, k1); return fmix(h1, SizeOf.SIZE_OF_INT); }
java
public static int hash(int input) { int k1 = mixK1(input); int h1 = mixH1(DEFAULT_SEED, k1); return fmix(h1, SizeOf.SIZE_OF_INT); }
[ "public", "static", "int", "hash", "(", "int", "input", ")", "{", "int", "k1", "=", "mixK1", "(", "input", ")", ";", "int", "h1", "=", "mixH1", "(", "DEFAULT_SEED", ",", "k1", ")", ";", "return", "fmix", "(", "h1", ",", "SizeOf", ".", "SIZE_OF_INT"...
Special-purpose version for hashing a single int value. Value is treated as little-endian
[ "Special", "-", "purpose", "version", "for", "hashing", "a", "single", "int", "value", ".", "Value", "is", "treated", "as", "little", "-", "endian" ]
7166cb0319e3655f8ba15f5a7ccf3d2f721c1242
https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Murmur3Hash32.java#L70-L76
train
airlift/slice
src/main/java/io/airlift/slice/SliceUtf8.java
SliceUtf8.isAscii
public static boolean isAscii(Slice utf8) { int length = utf8.length(); int offset = 0; // Length rounded to 8 bytes int length8 = length & 0x7FFF_FFF8; for (; offset < length8; offset += 8) { if ((utf8.getLongUnchecked(offset) & TOP_MASK64) != 0) { ...
java
public static boolean isAscii(Slice utf8) { int length = utf8.length(); int offset = 0; // Length rounded to 8 bytes int length8 = length & 0x7FFF_FFF8; for (; offset < length8; offset += 8) { if ((utf8.getLongUnchecked(offset) & TOP_MASK64) != 0) { ...
[ "public", "static", "boolean", "isAscii", "(", "Slice", "utf8", ")", "{", "int", "length", "=", "utf8", ".", "length", "(", ")", ";", "int", "offset", "=", "0", ";", "// Length rounded to 8 bytes", "int", "length8", "=", "length", "&", "0x7FFF_FFF8", ";", ...
Does the slice contain only 7-bit ASCII characters.
[ "Does", "the", "slice", "contain", "only", "7", "-", "bit", "ASCII", "characters", "." ]
7166cb0319e3655f8ba15f5a7ccf3d2f721c1242
https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/SliceUtf8.java#L67-L95
train
airlift/slice
src/main/java/io/airlift/slice/SliceUtf8.java
SliceUtf8.lengthOfCodePoint
public static int lengthOfCodePoint(int codePoint) { if (codePoint < 0) { throw new InvalidCodePointException(codePoint); } if (codePoint < 0x80) { // normal ASCII // 0xxx_xxxx return 1; } if (codePoint < 0x800) { re...
java
public static int lengthOfCodePoint(int codePoint) { if (codePoint < 0) { throw new InvalidCodePointException(codePoint); } if (codePoint < 0x80) { // normal ASCII // 0xxx_xxxx return 1; } if (codePoint < 0x800) { re...
[ "public", "static", "int", "lengthOfCodePoint", "(", "int", "codePoint", ")", "{", "if", "(", "codePoint", "<", "0", ")", "{", "throw", "new", "InvalidCodePointException", "(", "codePoint", ")", ";", "}", "if", "(", "codePoint", "<", "0x80", ")", "{", "/...
Gets the UTF-8 sequence length of the code point. @throws InvalidCodePointException if code point is not within a valid range
[ "Gets", "the", "UTF", "-", "8", "sequence", "length", "of", "the", "code", "point", "." ]
7166cb0319e3655f8ba15f5a7ccf3d2f721c1242
https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/SliceUtf8.java#L906-L927
train
jblas-project/jblas
src/main/java/org/jblas/ComplexDouble.java
ComplexDouble.divi
public ComplexDouble divi(ComplexDouble c, ComplexDouble result) { double d = c.r * c.r + c.i * c.i; double newR = (r * c.r + i * c.i) / d; double newI = (i * c.r - r * c.i) / d; result.r = newR; result.i = newI; return result; }
java
public ComplexDouble divi(ComplexDouble c, ComplexDouble result) { double d = c.r * c.r + c.i * c.i; double newR = (r * c.r + i * c.i) / d; double newI = (i * c.r - r * c.i) / d; result.r = newR; result.i = newI; return result; }
[ "public", "ComplexDouble", "divi", "(", "ComplexDouble", "c", ",", "ComplexDouble", "result", ")", "{", "double", "d", "=", "c", ".", "r", "*", "c", ".", "r", "+", "c", ".", "i", "*", "c", ".", "i", ";", "double", "newR", "=", "(", "r", "*", "c...
Divide two complex numbers, in-place @param c complex number to divide this by @param result complex number to hold result @return same as result
[ "Divide", "two", "complex", "numbers", "in", "-", "place" ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/ComplexDouble.java#L284-L291
train
jblas-project/jblas
src/main/java/org/jblas/util/Permutations.java
Permutations.randomPermutation
public static int[] randomPermutation(int size) { Random r = new Random(); int[] result = new int[size]; for (int j = 0; j < size; j++) { result[j] = j; } for (int j = size - 1; j > 0; j--) { int k = r.nextInt(j); int temp = result[j]...
java
public static int[] randomPermutation(int size) { Random r = new Random(); int[] result = new int[size]; for (int j = 0; j < size; j++) { result[j] = j; } for (int j = size - 1; j > 0; j--) { int k = r.nextInt(j); int temp = result[j]...
[ "public", "static", "int", "[", "]", "randomPermutation", "(", "int", "size", ")", "{", "Random", "r", "=", "new", "Random", "(", ")", ";", "int", "[", "]", "result", "=", "new", "int", "[", "size", "]", ";", "for", "(", "int", "j", "=", "0", "...
Create a random permutation of the numbers 0, ..., size - 1. see Algorithm P, D.E. Knuth: The Art of Computer Programming, Vol. 2, p. 145
[ "Create", "a", "random", "permutation", "of", "the", "numbers", "0", "...", "size", "-", "1", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/Permutations.java#L54-L70
train
jblas-project/jblas
src/main/java/org/jblas/util/Permutations.java
Permutations.randomSubset
public static int[] randomSubset(int k, int n) { assert(0 < k && k <= n); Random r = new Random(); int t = 0, m = 0; int[] result = new int[k]; while (m < k) { double u = r.nextDouble(); if ( (n - t) * u < k - m ) { result[m] = t; ...
java
public static int[] randomSubset(int k, int n) { assert(0 < k && k <= n); Random r = new Random(); int t = 0, m = 0; int[] result = new int[k]; while (m < k) { double u = r.nextDouble(); if ( (n - t) * u < k - m ) { result[m] = t; ...
[ "public", "static", "int", "[", "]", "randomSubset", "(", "int", "k", ",", "int", "n", ")", "{", "assert", "(", "0", "<", "k", "&&", "k", "<=", "n", ")", ";", "Random", "r", "=", "new", "Random", "(", ")", ";", "int", "t", "=", "0", ",", "m...
Get a random sample of k out of n elements. See Algorithm S, D. E. Knuth, The Art of Computer Programming, Vol. 2, p.142.
[ "Get", "a", "random", "sample", "of", "k", "out", "of", "n", "elements", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/Permutations.java#L77-L92
train
jblas-project/jblas
src/main/java/org/jblas/Singular.java
Singular.fullSVD
public static DoubleMatrix[] fullSVD(DoubleMatrix A) { int m = A.rows; int n = A.columns; DoubleMatrix U = new DoubleMatrix(m, m); DoubleMatrix S = new DoubleMatrix(min(m, n)); DoubleMatrix V = new DoubleMatrix(n, n); int info = NativeBlas.dgesvd('A', 'A', m, n, A.dup()...
java
public static DoubleMatrix[] fullSVD(DoubleMatrix A) { int m = A.rows; int n = A.columns; DoubleMatrix U = new DoubleMatrix(m, m); DoubleMatrix S = new DoubleMatrix(min(m, n)); DoubleMatrix V = new DoubleMatrix(n, n); int info = NativeBlas.dgesvd('A', 'A', m, n, A.dup()...
[ "public", "static", "DoubleMatrix", "[", "]", "fullSVD", "(", "DoubleMatrix", "A", ")", "{", "int", "m", "=", "A", ".", "rows", ";", "int", "n", "=", "A", ".", "columns", ";", "DoubleMatrix", "U", "=", "new", "DoubleMatrix", "(", "m", ",", "m", ")"...
Compute a singular-value decomposition of A. @return A DoubleMatrix[3] array of U, S, V such that A = U * diag(S) * V'
[ "Compute", "a", "singular", "-", "value", "decomposition", "of", "A", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Singular.java#L21-L36
train
jblas-project/jblas
src/main/java/org/jblas/util/LibraryLoader.java
LibraryLoader.tryPath
private InputStream tryPath(String path) { Logger.getLogger().debug("Trying path \"" + path + "\"."); return getClass().getResourceAsStream(path); }
java
private InputStream tryPath(String path) { Logger.getLogger().debug("Trying path \"" + path + "\"."); return getClass().getResourceAsStream(path); }
[ "private", "InputStream", "tryPath", "(", "String", "path", ")", "{", "Logger", ".", "getLogger", "(", ")", ".", "debug", "(", "\"Trying path \\\"\"", "+", "path", "+", "\"\\\".\"", ")", ";", "return", "getClass", "(", ")", ".", "getResourceAsStream", "(", ...
Try to open a file at the given position.
[ "Try", "to", "open", "a", "file", "at", "the", "given", "position", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/LibraryLoader.java#L233-L236
train
jblas-project/jblas
src/main/java/org/jblas/util/LibraryLoader.java
LibraryLoader.loadLibraryFromStream
private void loadLibraryFromStream(String libname, InputStream is) { try { File tempfile = createTempFile(libname); OutputStream os = new FileOutputStream(tempfile); logger.debug("tempfile.getPath() = " + tempfile.getPath()); long savedTime = System.currentTimeMillis(); // ...
java
private void loadLibraryFromStream(String libname, InputStream is) { try { File tempfile = createTempFile(libname); OutputStream os = new FileOutputStream(tempfile); logger.debug("tempfile.getPath() = " + tempfile.getPath()); long savedTime = System.currentTimeMillis(); // ...
[ "private", "void", "loadLibraryFromStream", "(", "String", "libname", ",", "InputStream", "is", ")", "{", "try", "{", "File", "tempfile", "=", "createTempFile", "(", "libname", ")", ";", "OutputStream", "os", "=", "new", "FileOutputStream", "(", "tempfile", ")...
Load a system library from a stream. Copies the library to a temp file and loads from there. @param libname name of the library (just used in constructing the library name) @param is InputStream pointing to the library
[ "Load", "a", "system", "library", "from", "a", "stream", ".", "Copies", "the", "library", "to", "a", "temp", "file", "and", "loads", "from", "there", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/LibraryLoader.java#L249-L282
train
jblas-project/jblas
src/main/java/org/jblas/util/SanityChecks.java
SanityChecks.checkVectorAddition
public static void checkVectorAddition() { DoubleMatrix x = new DoubleMatrix(3, 1, 1.0, 2.0, 3.0); DoubleMatrix y = new DoubleMatrix(3, 1, 4.0, 5.0, 6.0); DoubleMatrix z = new DoubleMatrix(3, 1, 5.0, 7.0, 9.0); check("checking vector addition", x.add(y).equals(z)); }
java
public static void checkVectorAddition() { DoubleMatrix x = new DoubleMatrix(3, 1, 1.0, 2.0, 3.0); DoubleMatrix y = new DoubleMatrix(3, 1, 4.0, 5.0, 6.0); DoubleMatrix z = new DoubleMatrix(3, 1, 5.0, 7.0, 9.0); check("checking vector addition", x.add(y).equals(z)); }
[ "public", "static", "void", "checkVectorAddition", "(", ")", "{", "DoubleMatrix", "x", "=", "new", "DoubleMatrix", "(", "3", ",", "1", ",", "1.0", ",", "2.0", ",", "3.0", ")", ";", "DoubleMatrix", "y", "=", "new", "DoubleMatrix", "(", "3", ",", "1", ...
Check whether vector addition works. This is pure Java code and should work.
[ "Check", "whether", "vector", "addition", "works", ".", "This", "is", "pure", "Java", "code", "and", "should", "work", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/SanityChecks.java#L64-L70
train
jblas-project/jblas
src/main/java/org/jblas/util/SanityChecks.java
SanityChecks.checkXerbla
public static void checkXerbla() { double[] x = new double[9]; System.out.println("Check whether we're catching XERBLA errors. If you see something like \"** On entry to DGEMM parameter number 4 had an illegal value\", it didn't work!"); try { NativeBlas.dgemm('N', 'N', 3, -1, 3, 1...
java
public static void checkXerbla() { double[] x = new double[9]; System.out.println("Check whether we're catching XERBLA errors. If you see something like \"** On entry to DGEMM parameter number 4 had an illegal value\", it didn't work!"); try { NativeBlas.dgemm('N', 'N', 3, -1, 3, 1...
[ "public", "static", "void", "checkXerbla", "(", ")", "{", "double", "[", "]", "x", "=", "new", "double", "[", "9", "]", ";", "System", ".", "out", ".", "println", "(", "\"Check whether we're catching XERBLA errors. If you see something like \\\"** On entry to DGEMM p...
Check whether error handling works. If it works, you should see an ok, otherwise, you might see the actual error message and then the program exits.
[ "Check", "whether", "error", "handling", "works", ".", "If", "it", "works", "you", "should", "see", "an", "ok", "otherwise", "you", "might", "see", "the", "actual", "error", "message", "and", "then", "the", "program", "exits", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/SanityChecks.java#L99-L109
train
jblas-project/jblas
src/main/java/org/jblas/util/SanityChecks.java
SanityChecks.checkEigenvalues
public static void checkEigenvalues() { DoubleMatrix A = new DoubleMatrix(new double[][]{ {3.0, 2.0, 0.0}, {2.0, 3.0, 2.0}, {0.0, 2.0, 3.0} }); DoubleMatrix E = new DoubleMatrix(3, 1); NativeBlas.dsyev('N', 'U', 3, A.d...
java
public static void checkEigenvalues() { DoubleMatrix A = new DoubleMatrix(new double[][]{ {3.0, 2.0, 0.0}, {2.0, 3.0, 2.0}, {0.0, 2.0, 3.0} }); DoubleMatrix E = new DoubleMatrix(3, 1); NativeBlas.dsyev('N', 'U', 3, A.d...
[ "public", "static", "void", "checkEigenvalues", "(", ")", "{", "DoubleMatrix", "A", "=", "new", "DoubleMatrix", "(", "new", "double", "[", "]", "[", "]", "{", "{", "3.0", ",", "2.0", ",", "0.0", "}", ",", "{", "2.0", ",", "3.0", ",", "2.0", "}", ...
Compute eigenvalues. This is a routine not in ATLAS, but in the original LAPACK.
[ "Compute", "eigenvalues", ".", "This", "is", "a", "routine", "not", "in", "ATLAS", "but", "in", "the", "original", "LAPACK", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/SanityChecks.java#L115-L126
train
jblas-project/jblas
src/main/java/org/jblas/Decompose.java
Decompose.cholesky
public static DoubleMatrix cholesky(DoubleMatrix A) { DoubleMatrix result = A.dup(); int info = NativeBlas.dpotrf('U', A.rows, result.data, 0, A.rows); if (info < 0) { throw new LapackArgumentException("DPOTRF", -info); } else if (info > 0) { throw new LapackPositivityExcepti...
java
public static DoubleMatrix cholesky(DoubleMatrix A) { DoubleMatrix result = A.dup(); int info = NativeBlas.dpotrf('U', A.rows, result.data, 0, A.rows); if (info < 0) { throw new LapackArgumentException("DPOTRF", -info); } else if (info > 0) { throw new LapackPositivityExcepti...
[ "public", "static", "DoubleMatrix", "cholesky", "(", "DoubleMatrix", "A", ")", "{", "DoubleMatrix", "result", "=", "A", ".", "dup", "(", ")", ";", "int", "info", "=", "NativeBlas", ".", "dpotrf", "(", "'", "'", ",", "A", ".", "rows", ",", "result", "...
Compute Cholesky decomposition of A @param A symmetric, positive definite matrix (only upper half is used) @return upper triangular matrix U such that A = U' * U
[ "Compute", "Cholesky", "decomposition", "of", "A" ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Decompose.java#L149-L159
train
jblas-project/jblas
src/main/java/org/jblas/Decompose.java
Decompose.qr
public static QRDecomposition<DoubleMatrix> qr(DoubleMatrix A) { int minmn = min(A.rows, A.columns); DoubleMatrix result = A.dup(); DoubleMatrix tau = new DoubleMatrix(minmn); SimpleBlas.geqrf(result, tau); DoubleMatrix R = new DoubleMatrix(A.rows, A.columns); for (int i = 0; i < A.rows; i++) { ...
java
public static QRDecomposition<DoubleMatrix> qr(DoubleMatrix A) { int minmn = min(A.rows, A.columns); DoubleMatrix result = A.dup(); DoubleMatrix tau = new DoubleMatrix(minmn); SimpleBlas.geqrf(result, tau); DoubleMatrix R = new DoubleMatrix(A.rows, A.columns); for (int i = 0; i < A.rows; i++) { ...
[ "public", "static", "QRDecomposition", "<", "DoubleMatrix", ">", "qr", "(", "DoubleMatrix", "A", ")", "{", "int", "minmn", "=", "min", "(", "A", ".", "rows", ",", "A", ".", "columns", ")", ";", "DoubleMatrix", "result", "=", "A", ".", "dup", "(", ")"...
QR decomposition. Decomposes (m,n) matrix A into a (m,m) matrix Q and an (m,n) matrix R such that Q is orthogonal, R is upper triangular and Q * R = A Note that if A has more rows than columns, then the lower rows of R will contain only zeros, such that the corresponding later columns of Q do not enter the computatio...
[ "QR", "decomposition", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Decompose.java#L200-L214
train
jblas-project/jblas
src/main/java/org/jblas/MatrixFunctions.java
MatrixFunctions.absi
public static DoubleMatrix absi(DoubleMatrix x) { /*# mapfct('Math.abs') #*/ //RJPP-BEGIN------------------------------------------------------------ for (int i = 0; i < x.length; i++) x.put(i, (double) Math.abs(x.get(i))); return x; //RJPP-END----------------------------------------------------------...
java
public static DoubleMatrix absi(DoubleMatrix x) { /*# mapfct('Math.abs') #*/ //RJPP-BEGIN------------------------------------------------------------ for (int i = 0; i < x.length; i++) x.put(i, (double) Math.abs(x.get(i))); return x; //RJPP-END----------------------------------------------------------...
[ "public", "static", "DoubleMatrix", "absi", "(", "DoubleMatrix", "x", ")", "{", "/*# mapfct('Math.abs') #*/", "//RJPP-BEGIN------------------------------------------------------------", "for", "(", "int", "i", "=", "0", ";", "i", "<", "x", ".", "length", ";", "i", "...
Sets all elements in this matrix to their absolute values. Note that this operation is in-place. @see MatrixFunctions#abs(DoubleMatrix) @return this matrix
[ "Sets", "all", "elements", "in", "this", "matrix", "to", "their", "absolute", "values", ".", "Note", "that", "this", "operation", "is", "in", "-", "place", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/MatrixFunctions.java#L69-L76
train
jblas-project/jblas
src/main/java/org/jblas/MatrixFunctions.java
MatrixFunctions.expm
public static DoubleMatrix expm(DoubleMatrix A) { // constants for pade approximation final double c0 = 1.0; final double c1 = 0.5; final double c2 = 0.12; final double c3 = 0.01833333333333333; final double c4 = 0.0019927536231884053; final double c5 = 1.63043478...
java
public static DoubleMatrix expm(DoubleMatrix A) { // constants for pade approximation final double c0 = 1.0; final double c1 = 0.5; final double c2 = 0.12; final double c3 = 0.01833333333333333; final double c4 = 0.0019927536231884053; final double c5 = 1.63043478...
[ "public", "static", "DoubleMatrix", "expm", "(", "DoubleMatrix", "A", ")", "{", "// constants for pade approximation", "final", "double", "c0", "=", "1.0", ";", "final", "double", "c1", "=", "0.5", ";", "final", "double", "c2", "=", "0.12", ";", "final", "do...
Calculate matrix exponential of a square matrix. A scaled Pade approximation algorithm is used. The algorithm has been directly translated from Golub & Van Loan "Matrix Computations", algorithm 11.3.1. Special Horner techniques from 11.2 are also used to minimize the number of matrix multiplications. @param A square ...
[ "Calculate", "matrix", "exponential", "of", "a", "square", "matrix", "." ]
2818f231228e655cda80dfd8e0b87709fdfd8a70
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/MatrixFunctions.java#L406-L451
train
wdtinc/mapbox-vector-tile-java
src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java
JtsAdapter.toGeomType
public static VectorTile.Tile.GeomType toGeomType(Geometry geometry) { VectorTile.Tile.GeomType result = VectorTile.Tile.GeomType.UNKNOWN; if(geometry instanceof Point || geometry instanceof MultiPoint) { result = VectorTile.Tile.GeomType.POINT; } else if(geometry i...
java
public static VectorTile.Tile.GeomType toGeomType(Geometry geometry) { VectorTile.Tile.GeomType result = VectorTile.Tile.GeomType.UNKNOWN; if(geometry instanceof Point || geometry instanceof MultiPoint) { result = VectorTile.Tile.GeomType.POINT; } else if(geometry i...
[ "public", "static", "VectorTile", ".", "Tile", ".", "GeomType", "toGeomType", "(", "Geometry", "geometry", ")", "{", "VectorTile", ".", "Tile", ".", "GeomType", "result", "=", "VectorTile", ".", "Tile", ".", "GeomType", ".", "UNKNOWN", ";", "if", "(", "geo...
Get the MVT type mapping for the provided JTS Geometry. @param geometry JTS Geometry to get MVT type for @return MVT type for the given JTS Geometry, may return {@link com.wdtinc.mapbox_vector_tile.VectorTile.Tile.GeomType#UNKNOWN}
[ "Get", "the", "MVT", "type", "mapping", "for", "the", "provided", "JTS", "Geometry", "." ]
e5e3df3fc2260709e289f972a1348c0a1ea30339
https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java#L184-L201
train
wdtinc/mapbox-vector-tile-java
src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java
JtsAdapter.equalAsInts
private static boolean equalAsInts(Vec2d a, Vec2d b) { return ((int) a.x) == ((int) b.x) && ((int) a.y) == ((int) b.y); }
java
private static boolean equalAsInts(Vec2d a, Vec2d b) { return ((int) a.x) == ((int) b.x) && ((int) a.y) == ((int) b.y); }
[ "private", "static", "boolean", "equalAsInts", "(", "Vec2d", "a", ",", "Vec2d", "b", ")", "{", "return", "(", "(", "int", ")", "a", ".", "x", ")", "==", "(", "(", "int", ")", "b", ".", "x", ")", "&&", "(", "(", "int", ")", "a", ".", "y", ")...
Return true if the values of the two vectors are equal when cast as ints. @param a first vector to compare @param b second vector to compare @return true if the values of the two vectors are equal when cast as ints
[ "Return", "true", "if", "the", "values", "of", "the", "two", "vectors", "are", "equal", "when", "cast", "as", "ints", "." ]
e5e3df3fc2260709e289f972a1348c0a1ea30339
https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java#L630-L632
train
wdtinc/mapbox-vector-tile-java
src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/model/JtsLayer.java
JtsLayer.validate
private static void validate(String name, Collection<Geometry> geometries, int extent) { if (name == null) { throw new IllegalArgumentException("layer name is null"); } if (geometries == null) { throw new IllegalArgumentException("geometry collection is null"); } ...
java
private static void validate(String name, Collection<Geometry> geometries, int extent) { if (name == null) { throw new IllegalArgumentException("layer name is null"); } if (geometries == null) { throw new IllegalArgumentException("geometry collection is null"); } ...
[ "private", "static", "void", "validate", "(", "String", "name", ",", "Collection", "<", "Geometry", ">", "geometries", ",", "int", "extent", ")", "{", "if", "(", "name", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"layer name i...
Validate the JtsLayer. @param name mvt layer name @param geometries geometries in the tile @throws IllegalArgumentException when {@code name} or {@code geometries} are null
[ "Validate", "the", "JtsLayer", "." ]
e5e3df3fc2260709e289f972a1348c0a1ea30339
https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/model/JtsLayer.java#L121-L131
train
wdtinc/mapbox-vector-tile-java
src/main/java/com/wdtinc/mapbox_vector_tile/build/MvtLayerProps.java
MvtLayerProps.addKey
public int addKey(String key) { JdkUtils.requireNonNull(key); int nextIndex = keys.size(); final Integer mapIndex = JdkUtils.putIfAbsent(keys, key, nextIndex); return mapIndex == null ? nextIndex : mapIndex; }
java
public int addKey(String key) { JdkUtils.requireNonNull(key); int nextIndex = keys.size(); final Integer mapIndex = JdkUtils.putIfAbsent(keys, key, nextIndex); return mapIndex == null ? nextIndex : mapIndex; }
[ "public", "int", "addKey", "(", "String", "key", ")", "{", "JdkUtils", ".", "requireNonNull", "(", "key", ")", ";", "int", "nextIndex", "=", "keys", ".", "size", "(", ")", ";", "final", "Integer", "mapIndex", "=", "JdkUtils", ".", "putIfAbsent", "(", "...
Add the key and return it's index code. If the key already is present, the previous index code is returned and no insertion is done. @param key key to add @return index of the key
[ "Add", "the", "key", "and", "return", "it", "s", "index", "code", ".", "If", "the", "key", "already", "is", "present", "the", "previous", "index", "code", "is", "returned", "and", "no", "insertion", "is", "done", "." ]
e5e3df3fc2260709e289f972a1348c0a1ea30339
https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/build/MvtLayerProps.java#L35-L40
train
liuguangqiang/SwipeBack
library/src/main/java/com/liuguangqiang/swipeback/SwipeBackLayout.java
SwipeBackLayout.findScrollView
private void findScrollView(ViewGroup viewGroup) { scrollChild = viewGroup; if (viewGroup.getChildCount() > 0) { int count = viewGroup.getChildCount(); View child; for (int i = 0; i < count; i++) { child = viewGroup.getChildAt(i); if (c...
java
private void findScrollView(ViewGroup viewGroup) { scrollChild = viewGroup; if (viewGroup.getChildCount() > 0) { int count = viewGroup.getChildCount(); View child; for (int i = 0; i < count; i++) { child = viewGroup.getChildAt(i); if (c...
[ "private", "void", "findScrollView", "(", "ViewGroup", "viewGroup", ")", "{", "scrollChild", "=", "viewGroup", ";", "if", "(", "viewGroup", ".", "getChildCount", "(", ")", ">", "0", ")", "{", "int", "count", "=", "viewGroup", ".", "getChildCount", "(", ")"...
Find out the scrollable child view from a ViewGroup. @param viewGroup
[ "Find", "out", "the", "scrollable", "child", "view", "from", "a", "ViewGroup", "." ]
0dd68189c58a5b2ead6bd5fe97c2a29cb43639f6
https://github.com/liuguangqiang/SwipeBack/blob/0dd68189c58a5b2ead6bd5fe97c2a29cb43639f6/library/src/main/java/com/liuguangqiang/swipeback/SwipeBackLayout.java#L227-L240
train
alkacon/opencms-core
src/org/opencms/ui/apps/sessions/CmsSendBroadcastDialog.java
CmsSendBroadcastDialog.removeAllBroadcasts
private void removeAllBroadcasts(Set<String> sessionIds) { if (sessionIds == null) { for (CmsSessionInfo info : OpenCms.getSessionManager().getSessionInfos()) { OpenCms.getSessionManager().getBroadcastQueue(info.getSessionId().getStringValue()).clear(); } ret...
java
private void removeAllBroadcasts(Set<String> sessionIds) { if (sessionIds == null) { for (CmsSessionInfo info : OpenCms.getSessionManager().getSessionInfos()) { OpenCms.getSessionManager().getBroadcastQueue(info.getSessionId().getStringValue()).clear(); } ret...
[ "private", "void", "removeAllBroadcasts", "(", "Set", "<", "String", ">", "sessionIds", ")", "{", "if", "(", "sessionIds", "==", "null", ")", "{", "for", "(", "CmsSessionInfo", "info", ":", "OpenCms", ".", "getSessionManager", "(", ")", ".", "getSessionInfos...
Removes all pending broadcasts @param sessionIds to remove broadcast for (or null for all sessions)
[ "Removes", "all", "pending", "broadcasts" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sessions/CmsSendBroadcastDialog.java#L169-L180
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java
CmsPatternPanelMonthlyView.onWeekDayChange
@UiHandler("m_atDay") void onWeekDayChange(ValueChangeEvent<String> event) { if (handleChange()) { m_controller.setWeekDay(event.getValue()); } }
java
@UiHandler("m_atDay") void onWeekDayChange(ValueChangeEvent<String> event) { if (handleChange()) { m_controller.setWeekDay(event.getValue()); } }
[ "@", "UiHandler", "(", "\"m_atDay\"", ")", "void", "onWeekDayChange", "(", "ValueChangeEvent", "<", "String", ">", "event", ")", "{", "if", "(", "handleChange", "(", ")", ")", "{", "m_controller", ".", "setWeekDay", "(", "event", ".", "getValue", "(", ")",...
Handles week day changes. @param event the change event.
[ "Handles", "week", "day", "changes", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java#L282-L288
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java
CmsPatternPanelMonthlyView.addCheckBox
private void addCheckBox(final String internalValue, String labelMessageKey) { CmsCheckBox box = new CmsCheckBox(Messages.get().key(labelMessageKey)); box.setInternalValue(internalValue); box.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(...
java
private void addCheckBox(final String internalValue, String labelMessageKey) { CmsCheckBox box = new CmsCheckBox(Messages.get().key(labelMessageKey)); box.setInternalValue(internalValue); box.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(...
[ "private", "void", "addCheckBox", "(", "final", "String", "internalValue", ",", "String", "labelMessageKey", ")", "{", "CmsCheckBox", "box", "=", "new", "CmsCheckBox", "(", "Messages", ".", "get", "(", ")", ".", "key", "(", "labelMessageKey", ")", ")", ";", ...
Creates a check box and adds it to the week panel and the checkboxes. @param internalValue the internal value of the checkbox @param labelMessageKey key for the label of the checkbox
[ "Creates", "a", "check", "box", "and", "adds", "it", "to", "the", "week", "panel", "and", "the", "checkboxes", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java#L295-L311
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java
CmsPatternPanelMonthlyView.checkExactlyTheWeeksCheckBoxes
private void checkExactlyTheWeeksCheckBoxes(Collection<WeekOfMonth> weeksToCheck) { for (CmsCheckBox cb : m_checkboxes) { cb.setChecked(weeksToCheck.contains(WeekOfMonth.valueOf(cb.getInternalValue()))); } }
java
private void checkExactlyTheWeeksCheckBoxes(Collection<WeekOfMonth> weeksToCheck) { for (CmsCheckBox cb : m_checkboxes) { cb.setChecked(weeksToCheck.contains(WeekOfMonth.valueOf(cb.getInternalValue()))); } }
[ "private", "void", "checkExactlyTheWeeksCheckBoxes", "(", "Collection", "<", "WeekOfMonth", ">", "weeksToCheck", ")", "{", "for", "(", "CmsCheckBox", "cb", ":", "m_checkboxes", ")", "{", "cb", ".", "setChecked", "(", "weeksToCheck", ".", "contains", "(", "WeekOf...
Check exactly the week check-boxes representing the given weeks. @param weeksToCheck the weeks selected.
[ "Check", "exactly", "the", "week", "check", "-", "boxes", "representing", "the", "given", "weeks", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java#L317-L322
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java
CmsPatternPanelMonthlyView.fillWeekPanel
private void fillWeekPanel() { addCheckBox(WeekOfMonth.FIRST.toString(), Messages.GUI_SERIALDATE_WEEKDAYNUMBER_1_0); addCheckBox(WeekOfMonth.SECOND.toString(), Messages.GUI_SERIALDATE_WEEKDAYNUMBER_2_0); addCheckBox(WeekOfMonth.THIRD.toString(), Messages.GUI_SERIALDATE_WEEKDAYNUMBER_3_0); ...
java
private void fillWeekPanel() { addCheckBox(WeekOfMonth.FIRST.toString(), Messages.GUI_SERIALDATE_WEEKDAYNUMBER_1_0); addCheckBox(WeekOfMonth.SECOND.toString(), Messages.GUI_SERIALDATE_WEEKDAYNUMBER_2_0); addCheckBox(WeekOfMonth.THIRD.toString(), Messages.GUI_SERIALDATE_WEEKDAYNUMBER_3_0); ...
[ "private", "void", "fillWeekPanel", "(", ")", "{", "addCheckBox", "(", "WeekOfMonth", ".", "FIRST", ".", "toString", "(", ")", ",", "Messages", ".", "GUI_SERIALDATE_WEEKDAYNUMBER_1_0", ")", ";", "addCheckBox", "(", "WeekOfMonth", ".", "SECOND", ".", "toString", ...
Fills the week panel with checkboxes.
[ "Fills", "the", "week", "panel", "with", "checkboxes", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyView.java#L327-L334
train
alkacon/opencms-core
src-setup/org/opencms/setup/ui/A_CmsSetupStep.java
A_CmsSetupStep.htmlLabel
public Label htmlLabel(String html) { Label label = new Label(); label.setContentMode(ContentMode.HTML); label.setValue(html); return label; }
java
public Label htmlLabel(String html) { Label label = new Label(); label.setContentMode(ContentMode.HTML); label.setValue(html); return label; }
[ "public", "Label", "htmlLabel", "(", "String", "html", ")", "{", "Label", "label", "=", "new", "Label", "(", ")", ";", "label", ".", "setContentMode", "(", "ContentMode", ".", "HTML", ")", ";", "label", ".", "setValue", "(", "html", ")", ";", "return",...
Creates a new HTML-formatted label with the given content. @param html the label content
[ "Creates", "a", "new", "HTML", "-", "formatted", "label", "with", "the", "given", "content", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/ui/A_CmsSetupStep.java#L80-L87
train
alkacon/opencms-core
src-setup/org/opencms/setup/ui/A_CmsSetupStep.java
A_CmsSetupStep.readSnippet
public String readSnippet(String name) { String path = CmsStringUtil.joinPaths( m_context.getSetupBean().getWebAppRfsPath(), CmsSetupBean.FOLDER_SETUP, "html", name); try (InputStream stream = new FileInputStream(path)) { byte[] data = CmsFile...
java
public String readSnippet(String name) { String path = CmsStringUtil.joinPaths( m_context.getSetupBean().getWebAppRfsPath(), CmsSetupBean.FOLDER_SETUP, "html", name); try (InputStream stream = new FileInputStream(path)) { byte[] data = CmsFile...
[ "public", "String", "readSnippet", "(", "String", "name", ")", "{", "String", "path", "=", "CmsStringUtil", ".", "joinPaths", "(", "m_context", ".", "getSetupBean", "(", ")", ".", "getWebAppRfsPath", "(", ")", ",", "CmsSetupBean", ".", "FOLDER_SETUP", ",", "...
Reads an HTML snippet with the given name. @return the HTML data
[ "Reads", "an", "HTML", "snippet", "with", "the", "given", "name", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/ui/A_CmsSetupStep.java#L94-L108
train
alkacon/opencms-core
src/org/opencms/widgets/CmsAddFormatterWidget.java
CmsAddFormatterWidget.getSelectOptionValues
public static List<String> getSelectOptionValues(CmsObject cms, String rootPath, boolean allRemoved) { try { cms = OpenCms.initCmsObject(cms); cms.getRequestContext().setSiteRoot(""); CmsADEConfigData adeConfig = OpenCms.getADEManager().lookupConfiguration(cms, rootPath); ...
java
public static List<String> getSelectOptionValues(CmsObject cms, String rootPath, boolean allRemoved) { try { cms = OpenCms.initCmsObject(cms); cms.getRequestContext().setSiteRoot(""); CmsADEConfigData adeConfig = OpenCms.getADEManager().lookupConfiguration(cms, rootPath); ...
[ "public", "static", "List", "<", "String", ">", "getSelectOptionValues", "(", "CmsObject", "cms", ",", "String", "rootPath", ",", "boolean", "allRemoved", ")", "{", "try", "{", "cms", "=", "OpenCms", ".", "initCmsObject", "(", "cms", ")", ";", "cms", ".", ...
Returns all values that can be selected in the widget. @param cms the current CMS object @param rootPath the root path to the currently edited xml file (sitemap config) @param allRemoved flag, indicating if all inheritedly available formatters should be disabled @return all values that can be selected in the widget.
[ "Returns", "all", "values", "that", "can", "be", "selected", "in", "the", "widget", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsAddFormatterWidget.java#L85-L109
train
alkacon/opencms-core
src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java
CmsEditableGroup.addRow
public void addRow(Component component) { Component actualComponent = component == null ? m_newComponentFactory.get() : component; I_CmsEditableGroupRow row = m_rowBuilder.buildRow(this, actualComponent); m_container.addComponent(row); updatePlaceholder(); updateButtonBars(); ...
java
public void addRow(Component component) { Component actualComponent = component == null ? m_newComponentFactory.get() : component; I_CmsEditableGroupRow row = m_rowBuilder.buildRow(this, actualComponent); m_container.addComponent(row); updatePlaceholder(); updateButtonBars(); ...
[ "public", "void", "addRow", "(", "Component", "component", ")", "{", "Component", "actualComponent", "=", "component", "==", "null", "?", "m_newComponentFactory", ".", "get", "(", ")", ":", "component", ";", "I_CmsEditableGroupRow", "row", "=", "m_rowBuilder", "...
Adds a row for the given component at the end of the group. @param component the component to wrap in the row to be added
[ "Adds", "a", "row", "for", "the", "given", "component", "at", "the", "end", "of", "the", "group", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java#L251-L259
train
alkacon/opencms-core
src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java
CmsEditableGroup.addRowAfter
public void addRowAfter(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if (index >= 0) { Component component = m_newComponentFactory.get(); I_CmsEditableGroupRow newRow = m_rowBuilder.buildRow(this, component); m_container.addComponent(n...
java
public void addRowAfter(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if (index >= 0) { Component component = m_newComponentFactory.get(); I_CmsEditableGroupRow newRow = m_rowBuilder.buildRow(this, component); m_container.addComponent(n...
[ "public", "void", "addRowAfter", "(", "I_CmsEditableGroupRow", "row", ")", "{", "int", "index", "=", "m_container", ".", "getComponentIndex", "(", "row", ")", ";", "if", "(", "index", ">=", "0", ")", "{", "Component", "component", "=", "m_newComponentFactory",...
Adds a new row after the given one. @param row the row after which a new one should be added
[ "Adds", "a", "new", "row", "after", "the", "given", "one", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java#L266-L277
train
alkacon/opencms-core
src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java
CmsEditableGroup.getRows
public List<I_CmsEditableGroupRow> getRows() { List<I_CmsEditableGroupRow> result = Lists.newArrayList(); for (Component component : m_container) { if (component instanceof I_CmsEditableGroupRow) { result.add((I_CmsEditableGroupRow)component); } } ...
java
public List<I_CmsEditableGroupRow> getRows() { List<I_CmsEditableGroupRow> result = Lists.newArrayList(); for (Component component : m_container) { if (component instanceof I_CmsEditableGroupRow) { result.add((I_CmsEditableGroupRow)component); } } ...
[ "public", "List", "<", "I_CmsEditableGroupRow", ">", "getRows", "(", ")", "{", "List", "<", "I_CmsEditableGroupRow", ">", "result", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "(", "Component", "component", ":", "m_container", ")", "{", "if", ...
Gets all rows. @return the list of all rows
[ "Gets", "all", "rows", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java#L324-L333
train
alkacon/opencms-core
src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java
CmsEditableGroup.moveDown
public void moveDown(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if ((index >= 0) && (index < (m_container.getComponentCount() - 1))) { m_container.removeComponent(row); m_container.addComponent(row, index + 1); } updateButtonBars...
java
public void moveDown(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if ((index >= 0) && (index < (m_container.getComponentCount() - 1))) { m_container.removeComponent(row); m_container.addComponent(row, index + 1); } updateButtonBars...
[ "public", "void", "moveDown", "(", "I_CmsEditableGroupRow", "row", ")", "{", "int", "index", "=", "m_container", ".", "getComponentIndex", "(", "row", ")", ";", "if", "(", "(", "index", ">=", "0", ")", "&&", "(", "index", "<", "(", "m_container", ".", ...
Moves the given row down. @param row the row to move
[ "Moves", "the", "given", "row", "down", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java#L350-L358
train
alkacon/opencms-core
src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java
CmsEditableGroup.moveUp
public void moveUp(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if (index > 0) { m_container.removeComponent(row); m_container.addComponent(row, index - 1); } updateButtonBars(); }
java
public void moveUp(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if (index > 0) { m_container.removeComponent(row); m_container.addComponent(row, index - 1); } updateButtonBars(); }
[ "public", "void", "moveUp", "(", "I_CmsEditableGroupRow", "row", ")", "{", "int", "index", "=", "m_container", ".", "getComponentIndex", "(", "row", ")", ";", "if", "(", "index", ">", "0", ")", "{", "m_container", ".", "removeComponent", "(", "row", ")", ...
Moves the given row up. @param row the row to move
[ "Moves", "the", "given", "row", "up", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java#L365-L373
train
alkacon/opencms-core
src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java
CmsEditableGroup.remove
public void remove(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if (index >= 0) { m_container.removeComponent(row); } updatePlaceholder(); updateButtonBars(); updateGroupValidation(); }
java
public void remove(I_CmsEditableGroupRow row) { int index = m_container.getComponentIndex(row); if (index >= 0) { m_container.removeComponent(row); } updatePlaceholder(); updateButtonBars(); updateGroupValidation(); }
[ "public", "void", "remove", "(", "I_CmsEditableGroupRow", "row", ")", "{", "int", "index", "=", "m_container", ".", "getComponentIndex", "(", "row", ")", ";", "if", "(", "index", ">=", "0", ")", "{", "m_container", ".", "removeComponent", "(", "row", ")", ...
Removes the given row. @param row the row to remove
[ "Removes", "the", "given", "row", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/editablegroup/CmsEditableGroup.java#L380-L389
train
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.adjustLinks
public void adjustLinks(String sourceFolder, String targetFolder) throws CmsException { String rootSourceFolder = addSiteRoot(sourceFolder); String rootTargetFolder = addSiteRoot(targetFolder); String siteRoot = getRequestContext().getSiteRoot(); getRequestContext().setSiteRoot(""); ...
java
public void adjustLinks(String sourceFolder, String targetFolder) throws CmsException { String rootSourceFolder = addSiteRoot(sourceFolder); String rootTargetFolder = addSiteRoot(targetFolder); String siteRoot = getRequestContext().getSiteRoot(); getRequestContext().setSiteRoot(""); ...
[ "public", "void", "adjustLinks", "(", "String", "sourceFolder", ",", "String", "targetFolder", ")", "throws", "CmsException", "{", "String", "rootSourceFolder", "=", "addSiteRoot", "(", "sourceFolder", ")", ";", "String", "rootTargetFolder", "=", "addSiteRoot", "(",...
Adjusts all links in the target folder that point to the source folder so that they are kept "relative" in the target folder where possible. If a link is found from the target folder to the source folder, then the target folder is checked if a target of the same name is found also "relative" inside the target Folder, ...
[ "Adjusts", "all", "links", "in", "the", "target", "folder", "that", "point", "to", "the", "source", "folder", "so", "that", "they", "are", "kept", "relative", "in", "the", "target", "folder", "where", "possible", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L253-L265
train
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColorSelector.java
CmsColorSelector.setRGB
public void setRGB(int red, int green, int blue) throws Exception { CmsColor color = new CmsColor(); color.setRGB(red, green, blue); m_red = red; m_green = green; m_blue = blue; m_hue = color.getHue(); m_saturation = color.getSaturation(); m_br...
java
public void setRGB(int red, int green, int blue) throws Exception { CmsColor color = new CmsColor(); color.setRGB(red, green, blue); m_red = red; m_green = green; m_blue = blue; m_hue = color.getHue(); m_saturation = color.getSaturation(); m_br...
[ "public", "void", "setRGB", "(", "int", "red", ",", "int", "green", ",", "int", "blue", ")", "throws", "Exception", "{", "CmsColor", "color", "=", "new", "CmsColor", "(", ")", ";", "color", ".", "setRGB", "(", "red", ",", "green", ",", "blue", ")", ...
Sets the Red, Green, and Blue color variables. This will automatically populate the Hue, Saturation and Brightness and Hexadecimal fields, too. The RGB color model is an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors. The name of the mod...
[ "Sets", "the", "Red", "Green", "and", "Blue", "color", "variables", ".", "This", "will", "automatically", "populate", "the", "Hue", "Saturation", "and", "Brightness", "and", "Hexadecimal", "fields", "too", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColorSelector.java#L787-L809
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.doSave
protected void doSave() { List<CmsFavoriteEntry> entries = getEntries(); try { m_favDao.saveFavorites(entries); } catch (Exception e) { CmsErrorDialog.showErrorDialog(e); } }
java
protected void doSave() { List<CmsFavoriteEntry> entries = getEntries(); try { m_favDao.saveFavorites(entries); } catch (Exception e) { CmsErrorDialog.showErrorDialog(e); } }
[ "protected", "void", "doSave", "(", ")", "{", "List", "<", "CmsFavoriteEntry", ">", "entries", "=", "getEntries", "(", ")", ";", "try", "{", "m_favDao", ".", "saveFavorites", "(", "entries", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "Cms...
Saves the list of currently displayed favorites.
[ "Saves", "the", "list", "of", "currently", "displayed", "favorites", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L273-L281
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.getEntries
List<CmsFavoriteEntry> getEntries() { List<CmsFavoriteEntry> result = new ArrayList<>(); for (I_CmsEditableGroupRow row : m_group.getRows()) { CmsFavoriteEntry entry = ((CmsFavInfo)row).getEntry(); result.add(entry); } return result; }
java
List<CmsFavoriteEntry> getEntries() { List<CmsFavoriteEntry> result = new ArrayList<>(); for (I_CmsEditableGroupRow row : m_group.getRows()) { CmsFavoriteEntry entry = ((CmsFavInfo)row).getEntry(); result.add(entry); } return result; }
[ "List", "<", "CmsFavoriteEntry", ">", "getEntries", "(", ")", "{", "List", "<", "CmsFavoriteEntry", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "I_CmsEditableGroupRow", "row", ":", "m_group", ".", "getRows", "(", ")", ")", "{...
Gets the favorite entries corresponding to the currently displayed favorite widgets. @return the list of favorite entries
[ "Gets", "the", "favorite", "entries", "corresponding", "to", "the", "currently", "displayed", "favorite", "widgets", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L296-L304
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.createFavInfo
private CmsFavInfo createFavInfo(CmsFavoriteEntry entry) throws CmsException { String title = ""; String subtitle = ""; CmsFavInfo result = new CmsFavInfo(entry); CmsObject cms = A_CmsUI.getCmsObject(); String project = getProject(cms, entry); String site = getSite(cms, ...
java
private CmsFavInfo createFavInfo(CmsFavoriteEntry entry) throws CmsException { String title = ""; String subtitle = ""; CmsFavInfo result = new CmsFavInfo(entry); CmsObject cms = A_CmsUI.getCmsObject(); String project = getProject(cms, entry); String site = getSite(cms, ...
[ "private", "CmsFavInfo", "createFavInfo", "(", "CmsFavoriteEntry", "entry", ")", "throws", "CmsException", "{", "String", "title", "=", "\"\"", ";", "String", "subtitle", "=", "\"\"", ";", "CmsFavInfo", "result", "=", "new", "CmsFavInfo", "(", "entry", ")", ";...
Creates a favorite widget for a favorite entry. @param entry the favorite entry @return the favorite widget @throws CmsException if something goes wrong
[ "Creates", "a", "favorite", "widget", "for", "a", "favorite", "entry", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L314-L349
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.getEntry
private CmsFavoriteEntry getEntry(Component row) { if (row instanceof CmsFavInfo) { return ((CmsFavInfo)row).getEntry(); } return null; }
java
private CmsFavoriteEntry getEntry(Component row) { if (row instanceof CmsFavInfo) { return ((CmsFavInfo)row).getEntry(); } return null; }
[ "private", "CmsFavoriteEntry", "getEntry", "(", "Component", "row", ")", "{", "if", "(", "row", "instanceof", "CmsFavInfo", ")", "{", "return", "(", "(", "CmsFavInfo", ")", "row", ")", ".", "getEntry", "(", ")", ";", "}", "return", "null", ";", "}" ]
Gets the favorite entry for a given row. @param row the widget used to display the favorite @return the favorite entry for the widget
[ "Gets", "the", "favorite", "entry", "for", "a", "given", "row", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L357-L366
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.getProject
private String getProject(CmsObject cms, CmsFavoriteEntry entry) throws CmsException { String result = m_projectLabels.get(entry.getProjectId()); if (result == null) { result = cms.readProject(entry.getProjectId()).getName(); m_projectLabels.put(entry.getProjectId(), result); ...
java
private String getProject(CmsObject cms, CmsFavoriteEntry entry) throws CmsException { String result = m_projectLabels.get(entry.getProjectId()); if (result == null) { result = cms.readProject(entry.getProjectId()).getName(); m_projectLabels.put(entry.getProjectId(), result); ...
[ "private", "String", "getProject", "(", "CmsObject", "cms", ",", "CmsFavoriteEntry", "entry", ")", "throws", "CmsException", "{", "String", "result", "=", "m_projectLabels", ".", "get", "(", "entry", ".", "getProjectId", "(", ")", ")", ";", "if", "(", "resul...
Gets the project name for a favorite entry. @param cms the CMS context @param entry the favorite entry @return the project name for the favorite entry @throws CmsException if something goes wrong
[ "Gets", "the", "project", "name", "for", "a", "favorite", "entry", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L376-L384
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.getSite
private String getSite(CmsObject cms, CmsFavoriteEntry entry) { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot()); Item item = m_sitesContainer.getItem(entry.getSiteRoot()); if (item != null) { return (String)(item.getItemProperty("caption").getValue())...
java
private String getSite(CmsObject cms, CmsFavoriteEntry entry) { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot()); Item item = m_sitesContainer.getItem(entry.getSiteRoot()); if (item != null) { return (String)(item.getItemProperty("caption").getValue())...
[ "private", "String", "getSite", "(", "CmsObject", "cms", ",", "CmsFavoriteEntry", "entry", ")", "{", "CmsSite", "site", "=", "OpenCms", ".", "getSiteManager", "(", ")", ".", "getSiteForRootPath", "(", "entry", ".", "getSiteRoot", "(", ")", ")", ";", "Item", ...
Gets the site label for the entry. @param cms the current CMS context @param entry the entry @return the site label for the entry
[ "Gets", "the", "site", "label", "for", "the", "entry", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L393-L407
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDialog.java
CmsFavoriteDialog.onClickAdd
private void onClickAdd() { if (m_currentLocation.isPresent()) { CmsFavoriteEntry entry = m_currentLocation.get(); List<CmsFavoriteEntry> entries = getEntries(); entries.add(entry); try { m_favDao.saveFavorites(entries); } catch (Excep...
java
private void onClickAdd() { if (m_currentLocation.isPresent()) { CmsFavoriteEntry entry = m_currentLocation.get(); List<CmsFavoriteEntry> entries = getEntries(); entries.add(entry); try { m_favDao.saveFavorites(entries); } catch (Excep...
[ "private", "void", "onClickAdd", "(", ")", "{", "if", "(", "m_currentLocation", ".", "isPresent", "(", ")", ")", "{", "CmsFavoriteEntry", "entry", "=", "m_currentLocation", ".", "get", "(", ")", ";", "List", "<", "CmsFavoriteEntry", ">", "entries", "=", "g...
The click handler for the add button.
[ "The", "click", "handler", "for", "the", "add", "button", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L412-L425
train
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagNavigation.java
CmsJspTagNavigation.setLocale
public void setLocale(String locale) { try { m_locale = LocaleUtils.toLocale(locale); } catch (IllegalArgumentException e) { LOG.error(Messages.get().getBundle().key(Messages.ERR_TAG_INVALID_LOCALE_1, "cms:navigation"), e); m_locale = null; } }
java
public void setLocale(String locale) { try { m_locale = LocaleUtils.toLocale(locale); } catch (IllegalArgumentException e) { LOG.error(Messages.get().getBundle().key(Messages.ERR_TAG_INVALID_LOCALE_1, "cms:navigation"), e); m_locale = null; } }
[ "public", "void", "setLocale", "(", "String", "locale", ")", "{", "try", "{", "m_locale", "=", "LocaleUtils", ".", "toLocale", "(", "locale", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "LOG", ".", "error", "(", "Messages", "....
Sets the locale for which the property should be read. @param locale the locale for which the property should be read.
[ "Sets", "the", "locale", "for", "which", "the", "property", "should", "be", "read", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagNavigation.java#L220-L228
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDAO.java
CmsFavoriteDAO.loadFavorites
public List<CmsFavoriteEntry> loadFavorites() throws CmsException { List<CmsFavoriteEntry> result = new ArrayList<>(); try { CmsUser user = readUser(); String data = (String)user.getAdditionalInfo(ADDINFO_KEY); if (CmsStringUtil.isEmptyOrWhitespaceOnly(data)) { ...
java
public List<CmsFavoriteEntry> loadFavorites() throws CmsException { List<CmsFavoriteEntry> result = new ArrayList<>(); try { CmsUser user = readUser(); String data = (String)user.getAdditionalInfo(ADDINFO_KEY); if (CmsStringUtil.isEmptyOrWhitespaceOnly(data)) { ...
[ "public", "List", "<", "CmsFavoriteEntry", ">", "loadFavorites", "(", ")", "throws", "CmsException", "{", "List", "<", "CmsFavoriteEntry", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "CmsUser", "user", "=", "readUser", "(", ")"...
Loads the favorite list. @return the list of favorites @throws CmsException if something goes wrong
[ "Loads", "the", "favorite", "list", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDAO.java#L120-L147
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDAO.java
CmsFavoriteDAO.saveFavorites
public void saveFavorites(List<CmsFavoriteEntry> favorites) throws CmsException { try { JSONObject json = new JSONObject(); JSONArray array = new JSONArray(); for (CmsFavoriteEntry entry : favorites) { array.put(entry.toJson()); } json...
java
public void saveFavorites(List<CmsFavoriteEntry> favorites) throws CmsException { try { JSONObject json = new JSONObject(); JSONArray array = new JSONArray(); for (CmsFavoriteEntry entry : favorites) { array.put(entry.toJson()); } json...
[ "public", "void", "saveFavorites", "(", "List", "<", "CmsFavoriteEntry", ">", "favorites", ")", "throws", "CmsException", "{", "try", "{", "JSONObject", "json", "=", "new", "JSONObject", "(", ")", ";", "JSONArray", "array", "=", "new", "JSONArray", "(", ")",...
Saves the favorites. @param favorites the list of favorites to save @throws CmsException if something goes wrong
[ "Saves", "the", "favorites", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDAO.java#L155-L172
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsFavoriteDAO.java
CmsFavoriteDAO.validate
private boolean validate(CmsFavoriteEntry entry) { try { String siteRoot = entry.getSiteRoot(); if (!m_okSiteRoots.contains(siteRoot)) { m_rootCms.readResource(siteRoot); m_okSiteRoots.add(siteRoot); } CmsUUID project = entry.getPr...
java
private boolean validate(CmsFavoriteEntry entry) { try { String siteRoot = entry.getSiteRoot(); if (!m_okSiteRoots.contains(siteRoot)) { m_rootCms.readResource(siteRoot); m_okSiteRoots.add(siteRoot); } CmsUUID project = entry.getPr...
[ "private", "boolean", "validate", "(", "CmsFavoriteEntry", "entry", ")", "{", "try", "{", "String", "siteRoot", "=", "entry", ".", "getSiteRoot", "(", ")", ";", "if", "(", "!", "m_okSiteRoots", ".", "contains", "(", "siteRoot", ")", ")", "{", "m_rootCms", ...
Validates a favorite entry. <p>If the favorite entry references a resource or project that can't be read, this will return false. @param entry the favorite entry @return the
[ "Validates", "a", "favorite", "entry", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDAO.java#L188-L214
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.showCurrentDates
public void showCurrentDates(Collection<CmsPair<Date, Boolean>> dates) { m_overviewList.setDatesWithCheckState(dates); m_overviewPopup.center(); }
java
public void showCurrentDates(Collection<CmsPair<Date, Boolean>> dates) { m_overviewList.setDatesWithCheckState(dates); m_overviewPopup.center(); }
[ "public", "void", "showCurrentDates", "(", "Collection", "<", "CmsPair", "<", "Date", ",", "Boolean", ">", ">", "dates", ")", "{", "m_overviewList", ".", "setDatesWithCheckState", "(", "dates", ")", ";", "m_overviewPopup", ".", "center", "(", ")", ";", "}" ]
Shows the provided list of dates as current dates. @param dates the current dates to show, accompanied with the information if they are exceptions or not.
[ "Shows", "the", "provided", "list", "of", "dates", "as", "current", "dates", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L339-L344
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.updateExceptions
public void updateExceptions() { m_exceptionsList.setDates(m_model.getExceptions()); if (m_model.getExceptions().size() > 0) { m_exceptionsPanel.setVisible(true); } else { m_exceptionsPanel.setVisible(false); } }
java
public void updateExceptions() { m_exceptionsList.setDates(m_model.getExceptions()); if (m_model.getExceptions().size() > 0) { m_exceptionsPanel.setVisible(true); } else { m_exceptionsPanel.setVisible(false); } }
[ "public", "void", "updateExceptions", "(", ")", "{", "m_exceptionsList", ".", "setDates", "(", "m_model", ".", "getExceptions", "(", ")", ")", ";", "if", "(", "m_model", ".", "getExceptions", "(", ")", ".", "size", "(", ")", ">", "0", ")", "{", "m_exce...
Updates the exceptions panel.
[ "Updates", "the", "exceptions", "panel", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L349-L357
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.onCurrentTillEndChange
@UiHandler("m_currentTillEndCheckBox") void onCurrentTillEndChange(ValueChangeEvent<Boolean> event) { if (handleChange()) { m_controller.setCurrentTillEnd(event.getValue()); } }
java
@UiHandler("m_currentTillEndCheckBox") void onCurrentTillEndChange(ValueChangeEvent<Boolean> event) { if (handleChange()) { m_controller.setCurrentTillEnd(event.getValue()); } }
[ "@", "UiHandler", "(", "\"m_currentTillEndCheckBox\"", ")", "void", "onCurrentTillEndChange", "(", "ValueChangeEvent", "<", "Boolean", ">", "event", ")", "{", "if", "(", "handleChange", "(", ")", ")", "{", "m_controller", ".", "setCurrentTillEnd", "(", "event", ...
Handle a "current till end" change event. @param event the change event.
[ "Handle", "a", "current", "till", "end", "change", "event", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L372-L378
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.onEndTimeChange
@UiHandler("m_endTime") void onEndTimeChange(CmsDateBoxEvent event) { if (handleChange() && !event.isUserTyping()) { m_controller.setEndTime(event.getDate()); } }
java
@UiHandler("m_endTime") void onEndTimeChange(CmsDateBoxEvent event) { if (handleChange() && !event.isUserTyping()) { m_controller.setEndTime(event.getDate()); } }
[ "@", "UiHandler", "(", "\"m_endTime\"", ")", "void", "onEndTimeChange", "(", "CmsDateBoxEvent", "event", ")", "{", "if", "(", "handleChange", "(", ")", "&&", "!", "event", ".", "isUserTyping", "(", ")", ")", "{", "m_controller", ".", "setEndTime", "(", "ev...
Handle an end time change. @param event the change event.
[ "Handle", "an", "end", "time", "change", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L384-L390
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.onEndTypeChange
void onEndTypeChange() { EndType endType = m_model.getEndType(); m_groupDuration.selectButton(getDurationButtonForType(endType)); switch (endType) { case DATE: case TIMES: m_durationPanel.setVisible(true); m_seriesEndDate.setValue(m_model....
java
void onEndTypeChange() { EndType endType = m_model.getEndType(); m_groupDuration.selectButton(getDurationButtonForType(endType)); switch (endType) { case DATE: case TIMES: m_durationPanel.setVisible(true); m_seriesEndDate.setValue(m_model....
[ "void", "onEndTypeChange", "(", ")", "{", "EndType", "endType", "=", "m_model", ".", "getEndType", "(", ")", ";", "m_groupDuration", ".", "selectButton", "(", "getDurationButtonForType", "(", "endType", ")", ")", ";", "switch", "(", "endType", ")", "{", "cas...
Called when the end type is changed.
[ "Called", "when", "the", "end", "type", "is", "changed", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L395-L414
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.onPatternChange
void onPatternChange() { PatternType patternType = m_model.getPatternType(); boolean isSeries = !patternType.equals(PatternType.NONE); setSerialOptionsVisible(isSeries); m_seriesCheckBox.setChecked(isSeries); if (isSeries) { m_groupPattern.selectButton(m_patternButto...
java
void onPatternChange() { PatternType patternType = m_model.getPatternType(); boolean isSeries = !patternType.equals(PatternType.NONE); setSerialOptionsVisible(isSeries); m_seriesCheckBox.setChecked(isSeries); if (isSeries) { m_groupPattern.selectButton(m_patternButto...
[ "void", "onPatternChange", "(", ")", "{", "PatternType", "patternType", "=", "m_model", ".", "getPatternType", "(", ")", ";", "boolean", "isSeries", "=", "!", "patternType", ".", "equals", "(", "PatternType", ".", "NONE", ")", ";", "setSerialOptionsVisible", "...
Called when the pattern has changed.
[ "Called", "when", "the", "pattern", "has", "changed", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L457-L470
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.onSeriesChange
@UiHandler("m_seriesCheckBox") void onSeriesChange(ValueChangeEvent<Boolean> event) { if (handleChange()) { m_controller.setIsSeries(event.getValue()); } }
java
@UiHandler("m_seriesCheckBox") void onSeriesChange(ValueChangeEvent<Boolean> event) { if (handleChange()) { m_controller.setIsSeries(event.getValue()); } }
[ "@", "UiHandler", "(", "\"m_seriesCheckBox\"", ")", "void", "onSeriesChange", "(", "ValueChangeEvent", "<", "Boolean", ">", "event", ")", "{", "if", "(", "handleChange", "(", ")", ")", "{", "m_controller", ".", "setIsSeries", "(", "event", ".", "getValue", "...
Handle changes of the series check box. @param event the change event.
[ "Handle", "changes", "of", "the", "series", "check", "box", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L476-L482
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.onStartTimeChange
@UiHandler("m_startTime") void onStartTimeChange(CmsDateBoxEvent event) { if (handleChange() && !event.isUserTyping()) { m_controller.setStartTime(event.getDate()); } }
java
@UiHandler("m_startTime") void onStartTimeChange(CmsDateBoxEvent event) { if (handleChange() && !event.isUserTyping()) { m_controller.setStartTime(event.getDate()); } }
[ "@", "UiHandler", "(", "\"m_startTime\"", ")", "void", "onStartTimeChange", "(", "CmsDateBoxEvent", "event", ")", "{", "if", "(", "handleChange", "(", ")", "&&", "!", "event", ".", "isUserTyping", "(", ")", ")", "{", "m_controller", ".", "setStartTime", "(",...
Handle a start time change. @param event the change event
[ "Handle", "a", "start", "time", "change", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L512-L518
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.onWholeDayChange
@UiHandler("m_wholeDayCheckBox") void onWholeDayChange(ValueChangeEvent<Boolean> event) { //TODO: Improve - adjust time selections? if (handleChange()) { m_controller.setWholeDay(event.getValue()); } }
java
@UiHandler("m_wholeDayCheckBox") void onWholeDayChange(ValueChangeEvent<Boolean> event) { //TODO: Improve - adjust time selections? if (handleChange()) { m_controller.setWholeDay(event.getValue()); } }
[ "@", "UiHandler", "(", "\"m_wholeDayCheckBox\"", ")", "void", "onWholeDayChange", "(", "ValueChangeEvent", "<", "Boolean", ">", "event", ")", "{", "//TODO: Improve - adjust time selections?", "if", "(", "handleChange", "(", ")", ")", "{", "m_controller", ".", "setWh...
Handle a whole day change event. @param event the change event.
[ "Handle", "a", "whole", "day", "change", "event", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L524-L531
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.createAndAddButton
private void createAndAddButton(PatternType pattern, String messageKey) { CmsRadioButton btn = new CmsRadioButton(pattern.toString(), Messages.get().key(messageKey)); btn.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().radioButtonlabel()); btn.setGroup(m_groupPattern); m_patt...
java
private void createAndAddButton(PatternType pattern, String messageKey) { CmsRadioButton btn = new CmsRadioButton(pattern.toString(), Messages.get().key(messageKey)); btn.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().radioButtonlabel()); btn.setGroup(m_groupPattern); m_patt...
[ "private", "void", "createAndAddButton", "(", "PatternType", "pattern", ",", "String", "messageKey", ")", "{", "CmsRadioButton", "btn", "=", "new", "CmsRadioButton", "(", "pattern", ".", "toString", "(", ")", ",", "Messages", ".", "get", "(", ")", ".", "key"...
Creates a pattern choice radio button and adds it where necessary. @param pattern the pattern that should be chosen by the button. @param messageKey the message key for the button's label.
[ "Creates", "a", "pattern", "choice", "radio", "button", "and", "adds", "it", "where", "necessary", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L552-L560
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.initDatesPanel
private void initDatesPanel() { m_startLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_TIME_STARTTIME_0)); m_startTime.setAllowInvalidValue(true); m_startTime.setValue(m_model.getStart()); m_endLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_TIME_ENDTIME_0)); m...
java
private void initDatesPanel() { m_startLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_TIME_STARTTIME_0)); m_startTime.setAllowInvalidValue(true); m_startTime.setValue(m_model.getStart()); m_endLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_TIME_ENDTIME_0)); m...
[ "private", "void", "initDatesPanel", "(", ")", "{", "m_startLabel", ".", "setText", "(", "Messages", ".", "get", "(", ")", ".", "key", "(", "Messages", ".", "GUI_SERIALDATE_TIME_STARTTIME_0", ")", ")", ";", "m_startTime", ".", "setAllowInvalidValue", "(", "tru...
Initialize dates panel elements.
[ "Initialize", "dates", "panel", "elements", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L580-L593
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.initDeactivationPanel
private void initDeactivationPanel() { m_deactivationPanel.setVisible(false); m_deactivationText.setText(Messages.get().key(Messages.GUI_SERIALDATE_DEACTIVE_TEXT_0)); }
java
private void initDeactivationPanel() { m_deactivationPanel.setVisible(false); m_deactivationText.setText(Messages.get().key(Messages.GUI_SERIALDATE_DEACTIVE_TEXT_0)); }
[ "private", "void", "initDeactivationPanel", "(", ")", "{", "m_deactivationPanel", ".", "setVisible", "(", "false", ")", ";", "m_deactivationText", ".", "setText", "(", "Messages", ".", "get", "(", ")", ".", "key", "(", "Messages", ".", "GUI_SERIALDATE_DEACTIVE_T...
Initialize elements of the panel displayed for the deactivated widget.
[ "Initialize", "elements", "of", "the", "panel", "displayed", "for", "the", "deactivated", "widget", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L598-L603
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.initDurationButtonGroup
private void initDurationButtonGroup() { m_groupDuration = new CmsRadioButtonGroup(); m_endsAfterRadioButton = new CmsRadioButton( EndType.TIMES.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_OCC_0)); m_endsAfterRadioButton.setGroup(m_groupDurat...
java
private void initDurationButtonGroup() { m_groupDuration = new CmsRadioButtonGroup(); m_endsAfterRadioButton = new CmsRadioButton( EndType.TIMES.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_OCC_0)); m_endsAfterRadioButton.setGroup(m_groupDurat...
[ "private", "void", "initDurationButtonGroup", "(", ")", "{", "m_groupDuration", "=", "new", "CmsRadioButtonGroup", "(", ")", ";", "m_endsAfterRadioButton", "=", "new", "CmsRadioButton", "(", "EndType", ".", "TIMES", ".", "toString", "(", ")", ",", "Messages", "....
Configure all UI elements in the "ending"-options panel.
[ "Configure", "all", "UI", "elements", "in", "the", "ending", "-", "options", "panel", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L608-L633
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.initDurationPanel
private void initDurationPanel() { m_durationPrefixLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_DURATION_PREFIX_0)); m_durationAfterPostfixLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_OCC_POSTFIX_0)); m_seriesEndDate.setDateOnly(true); m_seriesEn...
java
private void initDurationPanel() { m_durationPrefixLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_DURATION_PREFIX_0)); m_durationAfterPostfixLabel.setText(Messages.get().key(Messages.GUI_SERIALDATE_DURATION_ENDTYPE_OCC_POSTFIX_0)); m_seriesEndDate.setDateOnly(true); m_seriesEn...
[ "private", "void", "initDurationPanel", "(", ")", "{", "m_durationPrefixLabel", ".", "setText", "(", "Messages", ".", "get", "(", ")", ".", "key", "(", "Messages", ".", "GUI_SERIALDATE_DURATION_PREFIX_0", ")", ")", ";", "m_durationAfterPostfixLabel", ".", "setText...
Initialize elements from the duration panel.
[ "Initialize", "elements", "from", "the", "duration", "panel", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L636-L653
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.initExceptionsPanel
private void initExceptionsPanel() { m_exceptionsPanel.setLegend(Messages.get().key(Messages.GUI_SERIALDATE_PANEL_EXCEPTIONS_0)); m_exceptionsPanel.addCloseHandler(this); m_exceptionsPanel.setVisible(false); }
java
private void initExceptionsPanel() { m_exceptionsPanel.setLegend(Messages.get().key(Messages.GUI_SERIALDATE_PANEL_EXCEPTIONS_0)); m_exceptionsPanel.addCloseHandler(this); m_exceptionsPanel.setVisible(false); }
[ "private", "void", "initExceptionsPanel", "(", ")", "{", "m_exceptionsPanel", ".", "setLegend", "(", "Messages", ".", "get", "(", ")", ".", "key", "(", "Messages", ".", "GUI_SERIALDATE_PANEL_EXCEPTIONS_0", ")", ")", ";", "m_exceptionsPanel", ".", "addCloseHandler"...
Configure all UI elements in the exceptions panel.
[ "Configure", "all", "UI", "elements", "in", "the", "exceptions", "panel", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L658-L663
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.initManagementPart
private void initManagementPart() { m_manageExceptionsButton.setText(Messages.get().key(Messages.GUI_SERIALDATE_BUTTON_MANAGE_EXCEPTIONS_0)); m_manageExceptionsButton.getElement().getStyle().setFloat(Style.Float.RIGHT); }
java
private void initManagementPart() { m_manageExceptionsButton.setText(Messages.get().key(Messages.GUI_SERIALDATE_BUTTON_MANAGE_EXCEPTIONS_0)); m_manageExceptionsButton.getElement().getStyle().setFloat(Style.Float.RIGHT); }
[ "private", "void", "initManagementPart", "(", ")", "{", "m_manageExceptionsButton", ".", "setText", "(", "Messages", ".", "get", "(", ")", ".", "key", "(", "Messages", ".", "GUI_SERIALDATE_BUTTON_MANAGE_EXCEPTIONS_0", ")", ")", ";", "m_manageExceptionsButton", ".", ...
Initialize the ui elements for the management part.
[ "Initialize", "the", "ui", "elements", "for", "the", "management", "part", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L668-L672
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java
CmsSerialDateView.initPatternButtonGroup
private void initPatternButtonGroup() { m_groupPattern = new CmsRadioButtonGroup(); m_patternButtons = new HashMap<>(); createAndAddButton(PatternType.DAILY, Messages.GUI_SERIALDATE_TYPE_DAILY_0); m_patternButtons.put(PatternType.NONE, m_patternButtons.get(PatternType.DAILY)); ...
java
private void initPatternButtonGroup() { m_groupPattern = new CmsRadioButtonGroup(); m_patternButtons = new HashMap<>(); createAndAddButton(PatternType.DAILY, Messages.GUI_SERIALDATE_TYPE_DAILY_0); m_patternButtons.put(PatternType.NONE, m_patternButtons.get(PatternType.DAILY)); ...
[ "private", "void", "initPatternButtonGroup", "(", ")", "{", "m_groupPattern", "=", "new", "CmsRadioButtonGroup", "(", ")", ";", "m_patternButtons", "=", "new", "HashMap", "<>", "(", ")", ";", "createAndAddButton", "(", "PatternType", ".", "DAILY", ",", "Messages...
Initialize the pattern choice button group.
[ "Initialize", "the", "pattern", "choice", "button", "group", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateView.java#L711-L736
train
alkacon/opencms-core
src/org/opencms/ui/apps/CmsAppView.java
CmsAppView.injectAdditionalStyles
private void injectAdditionalStyles() { try { Collection<String> stylesheets = OpenCms.getWorkplaceAppManager().getAdditionalStyleSheets(); for (String stylesheet : stylesheets) { A_CmsUI.get().getPage().addDependency(new Dependency(Type.STYLESHEET, stylesheet)); ...
java
private void injectAdditionalStyles() { try { Collection<String> stylesheets = OpenCms.getWorkplaceAppManager().getAdditionalStyleSheets(); for (String stylesheet : stylesheets) { A_CmsUI.get().getPage().addDependency(new Dependency(Type.STYLESHEET, stylesheet)); ...
[ "private", "void", "injectAdditionalStyles", "(", ")", "{", "try", "{", "Collection", "<", "String", ">", "stylesheets", "=", "OpenCms", ".", "getWorkplaceAppManager", "(", ")", ".", "getAdditionalStyleSheets", "(", ")", ";", "for", "(", "String", "stylesheet", ...
Inject external stylesheets.
[ "Inject", "external", "stylesheets", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsAppView.java#L396-L406
train
alkacon/opencms-core
src/org/opencms/ugc/CmsUgcActionElement.java
CmsUgcActionElement.createSessionForResource
public String createSessionForResource(String configPath, String fileName) throws CmsUgcException { CmsUgcSession formSession = CmsUgcSessionFactory.getInstance().createSessionForFile( getCmsObject(), getRequest(), configPath, fileName); return "" + formS...
java
public String createSessionForResource(String configPath, String fileName) throws CmsUgcException { CmsUgcSession formSession = CmsUgcSessionFactory.getInstance().createSessionForFile( getCmsObject(), getRequest(), configPath, fileName); return "" + formS...
[ "public", "String", "createSessionForResource", "(", "String", "configPath", ",", "String", "fileName", ")", "throws", "CmsUgcException", "{", "CmsUgcSession", "formSession", "=", "CmsUgcSessionFactory", ".", "getInstance", "(", ")", ".", "createSessionForFile", "(", ...
Creates a new form session to edit the file with the given name using the given form configuration. @param configPath the site path of the form configuration @param fileName the name (not path) of the XML content to edit @return the id of the newly created form session @throws CmsUgcException if something goes wrong
[ "Creates", "a", "new", "form", "session", "to", "edit", "the", "file", "with", "the", "given", "name", "using", "the", "given", "form", "configuration", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcActionElement.java#L63-L71
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.setValue
public final void setValue(String value) { if ((null == value) || value.isEmpty()) { setDefaultValue(); } else { try { tryToSetParsedValue(value); } catch (@SuppressWarnings("unused") Exception e) { CmsDebugLog.consoleLog("Could not se...
java
public final void setValue(String value) { if ((null == value) || value.isEmpty()) { setDefaultValue(); } else { try { tryToSetParsedValue(value); } catch (@SuppressWarnings("unused") Exception e) { CmsDebugLog.consoleLog("Could not se...
[ "public", "final", "void", "setValue", "(", "String", "value", ")", "{", "if", "(", "(", "null", "==", "value", ")", "||", "value", ".", "isEmpty", "(", ")", ")", "{", "setDefaultValue", "(", ")", ";", "}", "else", "{", "try", "{", "tryToSetParsedVal...
Set the value as provided. @param value the serial date value as JSON string.
[ "Set", "the", "value", "as", "provided", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L75-L88
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.datesToJsonArray
private JSONValue datesToJsonArray(Collection<Date> dates) { if (null != dates) { JSONArray result = new JSONArray(); for (Date d : dates) { result.set(result.size(), dateToJson(d)); } return result; } return null; }
java
private JSONValue datesToJsonArray(Collection<Date> dates) { if (null != dates) { JSONArray result = new JSONArray(); for (Date d : dates) { result.set(result.size(), dateToJson(d)); } return result; } return null; }
[ "private", "JSONValue", "datesToJsonArray", "(", "Collection", "<", "Date", ">", "dates", ")", "{", "if", "(", "null", "!=", "dates", ")", "{", "JSONArray", "result", "=", "new", "JSONArray", "(", ")", ";", "for", "(", "Date", "d", ":", "dates", ")", ...
Converts a collection of dates to a JSON array with the long representation of the dates as strings. @param dates the list to convert. @return JSON array with long values of dates as string
[ "Converts", "a", "collection", "of", "dates", "to", "a", "JSON", "array", "with", "the", "long", "representation", "of", "the", "dates", "as", "strings", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L156-L166
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.dateToJson
private JSONValue dateToJson(Date d) { return null != d ? new JSONString(Long.toString(d.getTime())) : null; }
java
private JSONValue dateToJson(Date d) { return null != d ? new JSONString(Long.toString(d.getTime())) : null; }
[ "private", "JSONValue", "dateToJson", "(", "Date", "d", ")", "{", "return", "null", "!=", "d", "?", "new", "JSONString", "(", "Long", ".", "toString", "(", "d", ".", "getTime", "(", ")", ")", ")", ":", "null", ";", "}" ]
Convert a date to the String representation we use in the JSON. @param d the date to convert @return the String representation we use in the JSON.
[ "Convert", "a", "date", "to", "the", "String", "representation", "we", "use", "in", "the", "JSON", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L173-L176
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readOptionalBoolean
private Boolean readOptionalBoolean(JSONValue val) { JSONBoolean b = null == val ? null : val.isBoolean(); if (b != null) { return Boolean.valueOf(b.booleanValue()); } return null; }
java
private Boolean readOptionalBoolean(JSONValue val) { JSONBoolean b = null == val ? null : val.isBoolean(); if (b != null) { return Boolean.valueOf(b.booleanValue()); } return null; }
[ "private", "Boolean", "readOptionalBoolean", "(", "JSONValue", "val", ")", "{", "JSONBoolean", "b", "=", "null", "==", "val", "?", "null", ":", "val", ".", "isBoolean", "(", ")", ";", "if", "(", "b", "!=", "null", ")", "{", "return", "Boolean", ".", ...
Read an optional boolean value form a JSON value. @param val the JSON value that should represent the boolean. @return the boolean from the JSON or null if reading the boolean fails.
[ "Read", "an", "optional", "boolean", "value", "form", "a", "JSON", "value", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L265-L272
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readOptionalDate
private Date readOptionalDate(JSONValue val) { JSONString str = null == val ? null : val.isString(); if (str != null) { try { return new Date(Long.parseLong(str.stringValue())); } catch (@SuppressWarnings("unused") NumberFormatException e) { // do...
java
private Date readOptionalDate(JSONValue val) { JSONString str = null == val ? null : val.isString(); if (str != null) { try { return new Date(Long.parseLong(str.stringValue())); } catch (@SuppressWarnings("unused") NumberFormatException e) { // do...
[ "private", "Date", "readOptionalDate", "(", "JSONValue", "val", ")", "{", "JSONString", "str", "=", "null", "==", "val", "?", "null", ":", "val", ".", "isString", "(", ")", ";", "if", "(", "str", "!=", "null", ")", "{", "try", "{", "return", "new", ...
Read an optional Date value form a JSON value. @param val the JSON value that should represent the Date as long value in a string. @return the Date from the JSON or null if reading the date fails.
[ "Read", "an", "optional", "Date", "value", "form", "a", "JSON", "value", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L279-L290
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readOptionalInt
private int readOptionalInt(JSONValue val) { JSONString str = null == val ? null : val.isString(); if (str != null) { try { return Integer.valueOf(str.stringValue()).intValue(); } catch (@SuppressWarnings("unused") NumberFormatException e) { // Do...
java
private int readOptionalInt(JSONValue val) { JSONString str = null == val ? null : val.isString(); if (str != null) { try { return Integer.valueOf(str.stringValue()).intValue(); } catch (@SuppressWarnings("unused") NumberFormatException e) { // Do...
[ "private", "int", "readOptionalInt", "(", "JSONValue", "val", ")", "{", "JSONString", "str", "=", "null", "==", "val", "?", "null", ":", "val", ".", "isString", "(", ")", ";", "if", "(", "str", "!=", "null", ")", "{", "try", "{", "return", "Integer",...
Read an optional int value form a JSON value. @param val the JSON value that should represent the int. @return the int from the JSON or 0 reading the int fails.
[ "Read", "an", "optional", "int", "value", "form", "a", "JSON", "value", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L297-L308
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readOptionalMonth
private Month readOptionalMonth(JSONValue val) { String str = readOptionalString(val); if (null != str) { try { return Month.valueOf(str); } catch (@SuppressWarnings("unused") IllegalArgumentException e) { // Do nothing -return the default value ...
java
private Month readOptionalMonth(JSONValue val) { String str = readOptionalString(val); if (null != str) { try { return Month.valueOf(str); } catch (@SuppressWarnings("unused") IllegalArgumentException e) { // Do nothing -return the default value ...
[ "private", "Month", "readOptionalMonth", "(", "JSONValue", "val", ")", "{", "String", "str", "=", "readOptionalString", "(", "val", ")", ";", "if", "(", "null", "!=", "str", ")", "{", "try", "{", "return", "Month", ".", "valueOf", "(", "str", ")", ";",...
Read an optional month value form a JSON value. @param val the JSON value that should represent the month. @return the month from the JSON or null if reading the month fails.
[ "Read", "an", "optional", "month", "value", "form", "a", "JSON", "value", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L315-L326
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readOptionalString
private String readOptionalString(JSONValue val) { JSONString str = null == val ? null : val.isString(); if (str != null) { return str.stringValue(); } return null; }
java
private String readOptionalString(JSONValue val) { JSONString str = null == val ? null : val.isString(); if (str != null) { return str.stringValue(); } return null; }
[ "private", "String", "readOptionalString", "(", "JSONValue", "val", ")", "{", "JSONString", "str", "=", "null", "==", "val", "?", "null", ":", "val", ".", "isString", "(", ")", ";", "if", "(", "str", "!=", "null", ")", "{", "return", "str", ".", "str...
Read an optional string value form a JSON value. @param val the JSON value that should represent the string. @return the string from the JSON or null if reading the string fails.
[ "Read", "an", "optional", "string", "value", "form", "a", "JSON", "value", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L333-L340
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.readWeekDay
private WeekDay readWeekDay(JSONValue val) throws IllegalArgumentException { String str = readOptionalString(val); if (null != str) { return WeekDay.valueOf(str); } throw new IllegalArgumentException(); }
java
private WeekDay readWeekDay(JSONValue val) throws IllegalArgumentException { String str = readOptionalString(val); if (null != str) { return WeekDay.valueOf(str); } throw new IllegalArgumentException(); }
[ "private", "WeekDay", "readWeekDay", "(", "JSONValue", "val", ")", "throws", "IllegalArgumentException", "{", "String", "str", "=", "readOptionalString", "(", "val", ")", ";", "if", "(", "null", "!=", "str", ")", "{", "return", "WeekDay", ".", "valueOf", "("...
Read a single weekday from the provided JSON value. @param val the value to read the week day from. @return the week day read @throws IllegalArgumentException thrown if the provided JSON value is not the representation of a week day.
[ "Read", "a", "single", "weekday", "from", "the", "provided", "JSON", "value", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L401-L408
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.toJsonStringList
private JSONValue toJsonStringList(Collection<? extends Object> list) { if (null != list) { JSONArray array = new JSONArray(); for (Object o : list) { array.set(array.size(), new JSONString(o.toString())); } return array; } else { ...
java
private JSONValue toJsonStringList(Collection<? extends Object> list) { if (null != list) { JSONArray array = new JSONArray(); for (Object o : list) { array.set(array.size(), new JSONString(o.toString())); } return array; } else { ...
[ "private", "JSONValue", "toJsonStringList", "(", "Collection", "<", "?", "extends", "Object", ">", "list", ")", "{", "if", "(", "null", "!=", "list", ")", "{", "JSONArray", "array", "=", "new", "JSONArray", "(", ")", ";", "for", "(", "Object", "o", ":"...
Convert a list of objects to a JSON array with the string representations of that objects. @param list the list of objects. @return the JSON array with the string representations.
[ "Convert", "a", "list", "of", "objects", "to", "a", "JSON", "array", "with", "the", "string", "representations", "of", "that", "objects", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L461-L472
train
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java
CmsSerialDateValue.tryToSetParsedValue
private void tryToSetParsedValue(String value) throws Exception { JSONObject json = JSONParser.parseStrict(value).isObject(); JSONValue val = json.get(JsonKey.START); setStart(readOptionalDate(val)); val = json.get(JsonKey.END); setEnd(readOptionalDate(val)); setWholeDay...
java
private void tryToSetParsedValue(String value) throws Exception { JSONObject json = JSONParser.parseStrict(value).isObject(); JSONValue val = json.get(JsonKey.START); setStart(readOptionalDate(val)); val = json.get(JsonKey.END); setEnd(readOptionalDate(val)); setWholeDay...
[ "private", "void", "tryToSetParsedValue", "(", "String", "value", ")", "throws", "Exception", "{", "JSONObject", "json", "=", "JSONParser", ".", "parseStrict", "(", "value", ")", ".", "isObject", "(", ")", ";", "JSONValue", "val", "=", "json", ".", "get", ...
Try to set the value from the provided Json string. @param value the value to set. @throws Exception thrown if parsing fails.
[ "Try", "to", "set", "the", "value", "from", "the", "provided", "Json", "string", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsSerialDateValue.java#L479-L496
train
alkacon/opencms-core
src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java
CmsJspCategoryAccessBean.getCategories
private static List<CmsCategory> getCategories(CmsObject cms, CmsResource resource) { if ((null != resource) && (null != cms)) { try { return CmsCategoryService.getInstance().readResourceCategories(cms, resource); } catch (CmsException e) { LOG.error(e.ge...
java
private static List<CmsCategory> getCategories(CmsObject cms, CmsResource resource) { if ((null != resource) && (null != cms)) { try { return CmsCategoryService.getInstance().readResourceCategories(cms, resource); } catch (CmsException e) { LOG.error(e.ge...
[ "private", "static", "List", "<", "CmsCategory", ">", "getCategories", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ")", "{", "if", "(", "(", "null", "!=", "resource", ")", "&&", "(", "null", "!=", "cms", ")", ")", "{", "try", "{", "return"...
Reads the categories for the given resource. @param cms the {@link CmsObject} used for reading the categories. @param resource the resource for which the categories should be read. @return the categories assigned to the given resource.
[ "Reads", "the", "categories", "for", "the", "given", "resource", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java#L113-L123
train
alkacon/opencms-core
src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java
CmsJspCategoryAccessBean.getLeafItems
public List<CmsCategory> getLeafItems() { List<CmsCategory> result = new ArrayList<CmsCategory>(); if (m_categories.isEmpty()) { return result; } Iterator<CmsCategory> it = m_categories.iterator(); CmsCategory current = it.next(); while (it.hasNext()) { ...
java
public List<CmsCategory> getLeafItems() { List<CmsCategory> result = new ArrayList<CmsCategory>(); if (m_categories.isEmpty()) { return result; } Iterator<CmsCategory> it = m_categories.iterator(); CmsCategory current = it.next(); while (it.hasNext()) { ...
[ "public", "List", "<", "CmsCategory", ">", "getLeafItems", "(", ")", "{", "List", "<", "CmsCategory", ">", "result", "=", "new", "ArrayList", "<", "CmsCategory", ">", "(", ")", ";", "if", "(", "m_categories", ".", "isEmpty", "(", ")", ")", "{", "return...
Returns only the leaf categories of the wrapped categories. The method assumes that categories are ordered in the list, i.e., parents are directly followed by their children. NOTE: In the complete category tree a leaf of the wrapped tree part may not be a leaf. @return only the leaf categories of the wrapped categor...
[ "Returns", "only", "the", "leaf", "categories", "of", "the", "wrapped", "categories", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java#L154-L171
train
alkacon/opencms-core
src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java
CmsJspCategoryAccessBean.getSubCategories
public Map<String, CmsJspCategoryAccessBean> getSubCategories() { if (m_subCategories == null) { m_subCategories = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() { @SuppressWarnings("synthetic-access") public Object transform(Object pathPrefix) { ...
java
public Map<String, CmsJspCategoryAccessBean> getSubCategories() { if (m_subCategories == null) { m_subCategories = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() { @SuppressWarnings("synthetic-access") public Object transform(Object pathPrefix) { ...
[ "public", "Map", "<", "String", ",", "CmsJspCategoryAccessBean", ">", "getSubCategories", "(", ")", "{", "if", "(", "m_subCategories", "==", "null", ")", "{", "m_subCategories", "=", "CmsCollectionsGenericWrapper", ".", "createLazyMap", "(", "new", "Transformer", ...
Returns a map from a category path to the wrapper of all the sub-categories of the category with the path given as key. @return a map from a category path to all sub-categories of the path's category.
[ "Returns", "a", "map", "from", "a", "category", "path", "to", "the", "wrapper", "of", "all", "the", "sub", "-", "categories", "of", "the", "category", "with", "the", "path", "given", "as", "key", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java#L178-L192
train
alkacon/opencms-core
src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java
CmsJspCategoryAccessBean.getTopItems
public List<CmsCategory> getTopItems() { List<CmsCategory> categories = new ArrayList<CmsCategory>(); String matcher = Pattern.quote(m_mainCategoryPath) + "[^/]*/"; for (CmsCategory category : m_categories) { if (category.getPath().matches(matcher)) { categories.add(...
java
public List<CmsCategory> getTopItems() { List<CmsCategory> categories = new ArrayList<CmsCategory>(); String matcher = Pattern.quote(m_mainCategoryPath) + "[^/]*/"; for (CmsCategory category : m_categories) { if (category.getPath().matches(matcher)) { categories.add(...
[ "public", "List", "<", "CmsCategory", ">", "getTopItems", "(", ")", "{", "List", "<", "CmsCategory", ">", "categories", "=", "new", "ArrayList", "<", "CmsCategory", ">", "(", ")", ";", "String", "matcher", "=", "Pattern", ".", "quote", "(", "m_mainCategory...
Returns all categories that are direct children of the current main category. @return all categories that are direct children of the current main category.
[ "Returns", "all", "categories", "that", "are", "direct", "children", "of", "the", "current", "main", "category", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspCategoryAccessBean.java#L199-L209
train
alkacon/opencms-core
src/org/opencms/jsp/util/CmsJspImageBean.java
CmsJspImageBean.addHiDpiImage
public void addHiDpiImage(String factor, CmsJspImageBean image) { if (m_hiDpiImages == null) { m_hiDpiImages = CmsCollectionsGenericWrapper.createLazyMap(new CmsScaleHiDpiTransformer()); } m_hiDpiImages.put(factor, image); }
java
public void addHiDpiImage(String factor, CmsJspImageBean image) { if (m_hiDpiImages == null) { m_hiDpiImages = CmsCollectionsGenericWrapper.createLazyMap(new CmsScaleHiDpiTransformer()); } m_hiDpiImages.put(factor, image); }
[ "public", "void", "addHiDpiImage", "(", "String", "factor", ",", "CmsJspImageBean", "image", ")", "{", "if", "(", "m_hiDpiImages", "==", "null", ")", "{", "m_hiDpiImages", "=", "CmsCollectionsGenericWrapper", ".", "createLazyMap", "(", "new", "CmsScaleHiDpiTransform...
adds a CmsJspImageBean as hi-DPI variant to this image @param factor the variant multiplier, e.g. "2x" (the common retina multiplier) @param image the image to be used for this variant
[ "adds", "a", "CmsJspImageBean", "as", "hi", "-", "DPI", "variant", "to", "this", "image" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspImageBean.java#L362-L368
train
alkacon/opencms-core
src/org/opencms/search/galleries/CmsGallerySearchResult.java
CmsGallerySearchResult.getRequiredSolrFields
public static final String[] getRequiredSolrFields() { if (null == m_requiredSolrFields) { List<Locale> locales = OpenCms.getLocaleManager().getAvailableLocales(); m_requiredSolrFields = new String[14 + (locales.size() * 6)]; int count = 0; m_requiredSolrFields[c...
java
public static final String[] getRequiredSolrFields() { if (null == m_requiredSolrFields) { List<Locale> locales = OpenCms.getLocaleManager().getAvailableLocales(); m_requiredSolrFields = new String[14 + (locales.size() * 6)]; int count = 0; m_requiredSolrFields[c...
[ "public", "static", "final", "String", "[", "]", "getRequiredSolrFields", "(", ")", "{", "if", "(", "null", "==", "m_requiredSolrFields", ")", "{", "List", "<", "Locale", ">", "locales", "=", "OpenCms", ".", "getLocaleManager", "(", ")", ".", "getAvailableLo...
Returns the list of Solr fields a search result must have to initialize the gallery search result correctly. @return the list of Solr fields.
[ "Returns", "the", "list", "of", "Solr", "fields", "a", "search", "result", "must", "have", "to", "initialize", "the", "gallery", "search", "result", "correctly", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/galleries/CmsGallerySearchResult.java#L297-L339
train
alkacon/opencms-core
src/org/opencms/ui/favorites/CmsPageEditorFavoriteContext.java
CmsPageEditorFavoriteContext.toUuid
private static CmsUUID toUuid(String uuid) { if ("null".equals(uuid) || CmsStringUtil.isEmpty(uuid)) { return null; } return new CmsUUID(uuid); }
java
private static CmsUUID toUuid(String uuid) { if ("null".equals(uuid) || CmsStringUtil.isEmpty(uuid)) { return null; } return new CmsUUID(uuid); }
[ "private", "static", "CmsUUID", "toUuid", "(", "String", "uuid", ")", "{", "if", "(", "\"null\"", ".", "equals", "(", "uuid", ")", "||", "CmsStringUtil", ".", "isEmpty", "(", "uuid", ")", ")", "{", "return", "null", ";", "}", "return", "new", "CmsUUID"...
Converts string to UUID and returns it, or null if the conversion is not possible. @param uuid the potential UUID string @return the UUID, or null if conversion is not possible
[ "Converts", "string", "to", "UUID", "and", "returns", "it", "or", "null", "if", "the", "conversion", "is", "not", "possible", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsPageEditorFavoriteContext.java#L85-L92
train
alkacon/opencms-core
src/org/opencms/search/CmsSearchManager.java
CmsSearchManager.ensureIndexIsUnlocked
private void ensureIndexIsUnlocked(String dataDir) { Collection<File> lockFiles = new ArrayList<File>(2); lockFiles.add( new File( CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "index") + "write.lock")); lockFiles.add( new F...
java
private void ensureIndexIsUnlocked(String dataDir) { Collection<File> lockFiles = new ArrayList<File>(2); lockFiles.add( new File( CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "index") + "write.lock")); lockFiles.add( new F...
[ "private", "void", "ensureIndexIsUnlocked", "(", "String", "dataDir", ")", "{", "Collection", "<", "File", ">", "lockFiles", "=", "new", "ArrayList", "<", "File", ">", "(", "2", ")", ";", "lockFiles", ".", "add", "(", "new", "File", "(", "CmsFileUtil", "...
Remove write.lock file in the data directory to ensure the index is unlocked. @param dataDir the data directory of the Solr index that should be unlocked.
[ "Remove", "write", ".", "lock", "file", "in", "the", "data", "directory", "to", "ensure", "the", "index", "is", "unlocked", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchManager.java#L3157-L3178
train
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/CmsScrollPanelImpl.java
CmsScrollPanelImpl.maybeUpdateScrollbarPositions
private void maybeUpdateScrollbarPositions() { if (!isAttached()) { return; } if (m_scrollbar != null) { int vPos = getVerticalScrollPosition(); if (m_scrollbar.getVerticalScrollPosition() != vPos) { m_scrollbar.setVerticalScrollPosi...
java
private void maybeUpdateScrollbarPositions() { if (!isAttached()) { return; } if (m_scrollbar != null) { int vPos = getVerticalScrollPosition(); if (m_scrollbar.getVerticalScrollPosition() != vPos) { m_scrollbar.setVerticalScrollPosi...
[ "private", "void", "maybeUpdateScrollbarPositions", "(", ")", "{", "if", "(", "!", "isAttached", "(", ")", ")", "{", "return", ";", "}", "if", "(", "m_scrollbar", "!=", "null", ")", "{", "int", "vPos", "=", "getVerticalScrollPosition", "(", ")", ";", "if...
Synchronize the scroll positions of the scrollbars with the actual scroll position of the content.
[ "Synchronize", "the", "scroll", "positions", "of", "the", "scrollbars", "with", "the", "actual", "scroll", "position", "of", "the", "content", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsScrollPanelImpl.java#L351-L363
train
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/CmsScrollPanelImpl.java
CmsScrollPanelImpl.setVerticalScrollbar
private void setVerticalScrollbar(final CmsScrollBar scrollbar, int width) { // Validate. if ((scrollbar == m_scrollbar) || (scrollbar == null)) { return; } // Detach new child. scrollbar.asWidget().removeFromParent(); // Remove old child. ...
java
private void setVerticalScrollbar(final CmsScrollBar scrollbar, int width) { // Validate. if ((scrollbar == m_scrollbar) || (scrollbar == null)) { return; } // Detach new child. scrollbar.asWidget().removeFromParent(); // Remove old child. ...
[ "private", "void", "setVerticalScrollbar", "(", "final", "CmsScrollBar", "scrollbar", ",", "int", "width", ")", "{", "// Validate.\r", "if", "(", "(", "scrollbar", "==", "m_scrollbar", ")", "||", "(", "scrollbar", "==", "null", ")", ")", "{", "return", ";", ...
Set the scrollbar used for vertical scrolling. @param scrollbar the scrollbar, or null to clear it @param width the width of the scrollbar in pixels
[ "Set", "the", "scrollbar", "used", "for", "vertical", "scrolling", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsScrollPanelImpl.java#L416-L454
train