id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
sequence
docstring
stringlengths
3
16k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
105
339
300
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/StringContext.java
StringContext.insert
public void insert(StringBuilder buffer, Object value, int index) { if (buffer == null) { throw new NullPointerException("buffer"); } buffer.insert(index, value); }
java
public void insert(StringBuilder buffer, Object value, int index) { if (buffer == null) { throw new NullPointerException("buffer"); } buffer.insert(index, value); }
[ "public", "void", "insert", "(", "StringBuilder", "buffer", ",", "Object", "value", ",", "int", "index", ")", "{", "if", "(", "buffer", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"buffer\"", ")", ";", "}", "buffer", ".", "insert", "(", "index", ",", "value", ")", ";", "}" ]
A function to insert a value into an existing buffer. @param buffer the buffer to insert into @param value the value to insert @param index the index of the position to insert at
[ "A", "function", "to", "insert", "a", "value", "into", "an", "existing", "buffer", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/StringContext.java#L832-L838
301
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/util/ThreadPool.java
ThreadPool.setPriority
public void setPriority(int priority) throws IllegalArgumentException { if (priority < Thread.MIN_PRIORITY || priority > Thread.MAX_PRIORITY) { throw new IllegalArgumentException ("Priority out of range: " + priority); } synchronized (mPool) { mPriority = priority; } }
java
public void setPriority(int priority) throws IllegalArgumentException { if (priority < Thread.MIN_PRIORITY || priority > Thread.MAX_PRIORITY) { throw new IllegalArgumentException ("Priority out of range: " + priority); } synchronized (mPool) { mPriority = priority; } }
[ "public", "void", "setPriority", "(", "int", "priority", ")", "throws", "IllegalArgumentException", "{", "if", "(", "priority", "<", "Thread", ".", "MIN_PRIORITY", "||", "priority", ">", "Thread", ".", "MAX_PRIORITY", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Priority out of range: \"", "+", "priority", ")", ";", "}", "synchronized", "(", "mPool", ")", "{", "mPriority", "=", "priority", ";", "}", "}" ]
Sets the priority given to each thread in the pool. @throws IllegalArgumentException if priority is out of range
[ "Sets", "the", "priority", "given", "to", "each", "thread", "in", "the", "pool", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/ThreadPool.java#L198-L207
302
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/util/ThreadPool.java
ThreadPool.close
public void close(long timeout) throws InterruptedException { synchronized (mPool) { mClosed = true; mPool.notifyAll(); if (timeout != 0) { if (timeout < 0) { while (mActive > 0) { // Infinite wait for notification. mPool.wait(0); } } else { long expireTime = System.currentTimeMillis() + timeout; while (mActive > 0) { mPool.wait(timeout); if (System.currentTimeMillis() > expireTime) { break; } } } } } interrupt(); }
java
public void close(long timeout) throws InterruptedException { synchronized (mPool) { mClosed = true; mPool.notifyAll(); if (timeout != 0) { if (timeout < 0) { while (mActive > 0) { // Infinite wait for notification. mPool.wait(0); } } else { long expireTime = System.currentTimeMillis() + timeout; while (mActive > 0) { mPool.wait(timeout); if (System.currentTimeMillis() > expireTime) { break; } } } } } interrupt(); }
[ "public", "void", "close", "(", "long", "timeout", ")", "throws", "InterruptedException", "{", "synchronized", "(", "mPool", ")", "{", "mClosed", "=", "true", ";", "mPool", ".", "notifyAll", "(", ")", ";", "if", "(", "timeout", "!=", "0", ")", "{", "if", "(", "timeout", "<", "0", ")", "{", "while", "(", "mActive", ">", "0", ")", "{", "// Infinite wait for notification.", "mPool", ".", "wait", "(", "0", ")", ";", "}", "}", "else", "{", "long", "expireTime", "=", "System", ".", "currentTimeMillis", "(", ")", "+", "timeout", ";", "while", "(", "mActive", ">", "0", ")", "{", "mPool", ".", "wait", "(", "timeout", ")", ";", "if", "(", "System", ".", "currentTimeMillis", "(", ")", ">", "expireTime", ")", "{", "break", ";", "}", "}", "}", "}", "}", "interrupt", "(", ")", ";", "}" ]
Will close down all the threads in the pool as they become available. If all the threads cannot become available within the specified timeout, any active threads not yet returned to the thread pool are interrupted. @param timeout Milliseconds to wait before unavailable threads are interrupted. If zero, don't wait at all. If negative, wait forever.
[ "Will", "close", "down", "all", "the", "threads", "in", "the", "pool", "as", "they", "become", "available", ".", "If", "all", "the", "threads", "cannot", "become", "available", "within", "the", "specified", "timeout", "any", "active", "threads", "not", "yet", "returned", "to", "the", "thread", "pool", "are", "interrupted", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/ThreadPool.java#L475-L500
303
teatrove/teatrove
tea/src/main/java/org/teatrove/tea/parsetree/TreeMutator.java
TreeMutator.visitExpression
protected Expression visitExpression(Expression expr) { if (expr == null) { return null; } Expression newExpr = (Expression)expr.accept(this); if (expr != newExpr) { Type newType = newExpr.getType(); if (newType == null || !newType.equals(expr.getType())) { Iterator<Expression.Conversion> it = expr.getConversionChain().iterator(); while (it.hasNext()) { Expression.Conversion conv = it.next(); newExpr.convertTo (conv.getToType(), conv.isCastPreferred()); } } } return newExpr; }
java
protected Expression visitExpression(Expression expr) { if (expr == null) { return null; } Expression newExpr = (Expression)expr.accept(this); if (expr != newExpr) { Type newType = newExpr.getType(); if (newType == null || !newType.equals(expr.getType())) { Iterator<Expression.Conversion> it = expr.getConversionChain().iterator(); while (it.hasNext()) { Expression.Conversion conv = it.next(); newExpr.convertTo (conv.getToType(), conv.isCastPreferred()); } } } return newExpr; }
[ "protected", "Expression", "visitExpression", "(", "Expression", "expr", ")", "{", "if", "(", "expr", "==", "null", ")", "{", "return", "null", ";", "}", "Expression", "newExpr", "=", "(", "Expression", ")", "expr", ".", "accept", "(", "this", ")", ";", "if", "(", "expr", "!=", "newExpr", ")", "{", "Type", "newType", "=", "newExpr", ".", "getType", "(", ")", ";", "if", "(", "newType", "==", "null", "||", "!", "newType", ".", "equals", "(", "expr", ".", "getType", "(", ")", ")", ")", "{", "Iterator", "<", "Expression", ".", "Conversion", ">", "it", "=", "expr", ".", "getConversionChain", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Expression", ".", "Conversion", "conv", "=", "it", ".", "next", "(", ")", ";", "newExpr", ".", "convertTo", "(", "conv", ".", "getToType", "(", ")", ",", "conv", ".", "isCastPreferred", "(", ")", ")", ";", "}", "}", "}", "return", "newExpr", ";", "}" ]
All expressions pass through this method to ensure the expression's type is preserved.
[ "All", "expressions", "pass", "through", "this", "method", "to", "ensure", "the", "expression", "s", "type", "is", "preserved", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/parsetree/TreeMutator.java#L352-L372
304
teatrove/teatrove
tea/src/main/java/org/teatrove/tea/parsetree/TreeMutator.java
TreeMutator.visitBlock
protected Block visitBlock(Block block) { if (block == null) { return null; } Statement stmt = (Statement)block.accept(this); if (stmt instanceof Block) { return (Block)stmt; } else if (stmt != null) { return new Block(stmt); } else { return new Block(block.getSourceInfo()); } }
java
protected Block visitBlock(Block block) { if (block == null) { return null; } Statement stmt = (Statement)block.accept(this); if (stmt instanceof Block) { return (Block)stmt; } else if (stmt != null) { return new Block(stmt); } else { return new Block(block.getSourceInfo()); } }
[ "protected", "Block", "visitBlock", "(", "Block", "block", ")", "{", "if", "(", "block", "==", "null", ")", "{", "return", "null", ";", "}", "Statement", "stmt", "=", "(", "Statement", ")", "block", ".", "accept", "(", "this", ")", ";", "if", "(", "stmt", "instanceof", "Block", ")", "{", "return", "(", "Block", ")", "stmt", ";", "}", "else", "if", "(", "stmt", "!=", "null", ")", "{", "return", "new", "Block", "(", "stmt", ")", ";", "}", "else", "{", "return", "new", "Block", "(", "block", ".", "getSourceInfo", "(", ")", ")", ";", "}", "}" ]
Visit a Block to ensure that new Statement is a Block.
[ "Visit", "a", "Block", "to", "ensure", "that", "new", "Statement", "is", "a", "Block", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/parsetree/TreeMutator.java#L377-L393
305
teatrove/teatrove
examples/directory-browser/src/main/java/org/teatrove/examples/directorybrowser/DirectoryBrowserApplication.java
DirectoryBrowserApplication.init
@Override public void init(ApplicationConfig config) throws ServletException { // The ApplicationConfig is used by the Application to configure itself. mConfig = config; // A log for keeping track of events specific to this application mLog = config.getLog(); }
java
@Override public void init(ApplicationConfig config) throws ServletException { // The ApplicationConfig is used by the Application to configure itself. mConfig = config; // A log for keeping track of events specific to this application mLog = config.getLog(); }
[ "@", "Override", "public", "void", "init", "(", "ApplicationConfig", "config", ")", "throws", "ServletException", "{", "// The ApplicationConfig is used by the Application to configure itself.", "mConfig", "=", "config", ";", "// A log for keeping track of events specific to this application", "mLog", "=", "config", ".", "getLog", "(", ")", ";", "}" ]
Initialize this application with the provided application configuration.
[ "Initialize", "this", "application", "with", "the", "provided", "application", "configuration", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/examples/directory-browser/src/main/java/org/teatrove/examples/directorybrowser/DirectoryBrowserApplication.java#L32-L42
306
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/classfile/ConstantDoubleInfo.java
ConstantDoubleInfo.make
static ConstantDoubleInfo make(ConstantPool cp, double value) { ConstantInfo ci = new ConstantDoubleInfo(value); return (ConstantDoubleInfo)cp.addConstant(ci); }
java
static ConstantDoubleInfo make(ConstantPool cp, double value) { ConstantInfo ci = new ConstantDoubleInfo(value); return (ConstantDoubleInfo)cp.addConstant(ci); }
[ "static", "ConstantDoubleInfo", "make", "(", "ConstantPool", "cp", ",", "double", "value", ")", "{", "ConstantInfo", "ci", "=", "new", "ConstantDoubleInfo", "(", "value", ")", ";", "return", "(", "ConstantDoubleInfo", ")", "cp", ".", "addConstant", "(", "ci", ")", ";", "}" ]
Will return either a new ConstantDoubleInfo object or one already in the constant pool. If it is a new ConstantDoubleInfo, it will be inserted into the pool.
[ "Will", "return", "either", "a", "new", "ConstantDoubleInfo", "object", "or", "one", "already", "in", "the", "constant", "pool", ".", "If", "it", "is", "a", "new", "ConstantDoubleInfo", "it", "will", "be", "inserted", "into", "the", "pool", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/ConstantDoubleInfo.java#L35-L38
307
teatrove/teatrove
build-tools/teatools/src/main/java/org/teatrove/teatools/TeaToolsUtils.java
TeaToolsUtils.isDeprecated
public boolean isDeprecated(Class<?> clazz) { // check if class is marked as deprecated if (clazz.getAnnotation(Deprecated.class) != null) { return true; } // check if super class is deprecated Class<?> superClass = clazz.getSuperclass(); if (superClass != null) { return isDeprecated(superClass); } // check if interfaces are deprecated for (Class<?> iface : clazz.getInterfaces()) { return isDeprecated(iface); } // not deprecated return false; }
java
public boolean isDeprecated(Class<?> clazz) { // check if class is marked as deprecated if (clazz.getAnnotation(Deprecated.class) != null) { return true; } // check if super class is deprecated Class<?> superClass = clazz.getSuperclass(); if (superClass != null) { return isDeprecated(superClass); } // check if interfaces are deprecated for (Class<?> iface : clazz.getInterfaces()) { return isDeprecated(iface); } // not deprecated return false; }
[ "public", "boolean", "isDeprecated", "(", "Class", "<", "?", ">", "clazz", ")", "{", "// check if class is marked as deprecated", "if", "(", "clazz", ".", "getAnnotation", "(", "Deprecated", ".", "class", ")", "!=", "null", ")", "{", "return", "true", ";", "}", "// check if super class is deprecated", "Class", "<", "?", ">", "superClass", "=", "clazz", ".", "getSuperclass", "(", ")", ";", "if", "(", "superClass", "!=", "null", ")", "{", "return", "isDeprecated", "(", "superClass", ")", ";", "}", "// check if interfaces are deprecated", "for", "(", "Class", "<", "?", ">", "iface", ":", "clazz", ".", "getInterfaces", "(", ")", ")", "{", "return", "isDeprecated", "(", "iface", ")", ";", "}", "// not deprecated", "return", "false", ";", "}" ]
Returns whether the given class or any super class or interface is deprecated. @see Deprecated
[ "Returns", "whether", "the", "given", "class", "or", "any", "super", "class", "or", "interface", "is", "deprecated", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/teatools/src/main/java/org/teatrove/teatools/TeaToolsUtils.java#L292-L312
308
teatrove/teatrove
build-tools/teatools/src/main/java/org/teatrove/teatools/TeaToolsUtils.java
TeaToolsUtils.isDeprecated
protected boolean isDeprecated(Class<?> clazz, String methodName, Class<?>... paramTypes) { // check if type is annotated if (isDeprecated(clazz)) { return true; } // check if method is annotated try { Method method = clazz.getDeclaredMethod(methodName, paramTypes); if (method.getAnnotation(Deprecated.class) != null) { return true; } } catch (NoSuchMethodException nsme) { // ignore and continue } // check superclass Class<?> superClass = clazz.getSuperclass(); if (superClass != null) { return isDeprecated(superClass, methodName, paramTypes); } // check interfaces for (Class<?> iface : clazz.getInterfaces()) { return isDeprecated(iface, methodName, paramTypes); } // none found return false; }
java
protected boolean isDeprecated(Class<?> clazz, String methodName, Class<?>... paramTypes) { // check if type is annotated if (isDeprecated(clazz)) { return true; } // check if method is annotated try { Method method = clazz.getDeclaredMethod(methodName, paramTypes); if (method.getAnnotation(Deprecated.class) != null) { return true; } } catch (NoSuchMethodException nsme) { // ignore and continue } // check superclass Class<?> superClass = clazz.getSuperclass(); if (superClass != null) { return isDeprecated(superClass, methodName, paramTypes); } // check interfaces for (Class<?> iface : clazz.getInterfaces()) { return isDeprecated(iface, methodName, paramTypes); } // none found return false; }
[ "protected", "boolean", "isDeprecated", "(", "Class", "<", "?", ">", "clazz", ",", "String", "methodName", ",", "Class", "<", "?", ">", "...", "paramTypes", ")", "{", "// check if type is annotated", "if", "(", "isDeprecated", "(", "clazz", ")", ")", "{", "return", "true", ";", "}", "// check if method is annotated", "try", "{", "Method", "method", "=", "clazz", ".", "getDeclaredMethod", "(", "methodName", ",", "paramTypes", ")", ";", "if", "(", "method", ".", "getAnnotation", "(", "Deprecated", ".", "class", ")", "!=", "null", ")", "{", "return", "true", ";", "}", "}", "catch", "(", "NoSuchMethodException", "nsme", ")", "{", "// ignore and continue", "}", "// check superclass", "Class", "<", "?", ">", "superClass", "=", "clazz", ".", "getSuperclass", "(", ")", ";", "if", "(", "superClass", "!=", "null", ")", "{", "return", "isDeprecated", "(", "superClass", ",", "methodName", ",", "paramTypes", ")", ";", "}", "// check interfaces", "for", "(", "Class", "<", "?", ">", "iface", ":", "clazz", ".", "getInterfaces", "(", ")", ")", "{", "return", "isDeprecated", "(", "iface", ",", "methodName", ",", "paramTypes", ")", ";", "}", "// none found", "return", "false", ";", "}" ]
Returns whether the given method or any super method or interface declaration is deprecated. @see Deprecated
[ "Returns", "whether", "the", "given", "method", "or", "any", "super", "method", "or", "interface", "declaration", "is", "deprecated", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/teatools/src/main/java/org/teatrove/teatools/TeaToolsUtils.java#L331-L363
309
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java
DateContext.createDate
public Date createDate(int month, int day, int year, int hour, int minute, int second, int millisecond) { GregorianCalendar gc = new GregorianCalendar(); gc.clear(); gc.set(Calendar.MONTH, month-1); gc.set(Calendar.DAY_OF_MONTH, day); gc.set(Calendar.YEAR, year); gc.set(Calendar.HOUR_OF_DAY, hour); gc.set(Calendar.MINUTE, minute); gc.set(Calendar.SECOND, second); gc.set(Calendar.MILLISECOND, millisecond); return gc.getTime(); }
java
public Date createDate(int month, int day, int year, int hour, int minute, int second, int millisecond) { GregorianCalendar gc = new GregorianCalendar(); gc.clear(); gc.set(Calendar.MONTH, month-1); gc.set(Calendar.DAY_OF_MONTH, day); gc.set(Calendar.YEAR, year); gc.set(Calendar.HOUR_OF_DAY, hour); gc.set(Calendar.MINUTE, minute); gc.set(Calendar.SECOND, second); gc.set(Calendar.MILLISECOND, millisecond); return gc.getTime(); }
[ "public", "Date", "createDate", "(", "int", "month", ",", "int", "day", ",", "int", "year", ",", "int", "hour", ",", "int", "minute", ",", "int", "second", ",", "int", "millisecond", ")", "{", "GregorianCalendar", "gc", "=", "new", "GregorianCalendar", "(", ")", ";", "gc", ".", "clear", "(", ")", ";", "gc", ".", "set", "(", "Calendar", ".", "MONTH", ",", "month", "-", "1", ")", ";", "gc", ".", "set", "(", "Calendar", ".", "DAY_OF_MONTH", ",", "day", ")", ";", "gc", ".", "set", "(", "Calendar", ".", "YEAR", ",", "year", ")", ";", "gc", ".", "set", "(", "Calendar", ".", "HOUR_OF_DAY", ",", "hour", ")", ";", "gc", ".", "set", "(", "Calendar", ".", "MINUTE", ",", "minute", ")", ";", "gc", ".", "set", "(", "Calendar", ".", "SECOND", ",", "second", ")", ";", "gc", ".", "set", "(", "Calendar", ".", "MILLISECOND", ",", "millisecond", ")", ";", "return", "gc", ".", "getTime", "(", ")", ";", "}" ]
Create a date from the given data. @param month The month (1-12) @param day The day (1-31) @param year The year (4-digit) @param hour The hour (0-23) @param minute The minutes (0-59) @param second The seconds (0-59) @param millisecond The milliseconds (0-999) @return The {@link Date} instance for the given date @throws NumberFormatException if the values are invalid numbers
[ "Create", "a", "date", "from", "the", "given", "data", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java#L265-L279
310
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java
DateContext.changeDate
public Date changeDate(Date date, int delta) { return adjustDate(date, Calendar.DATE, delta); }
java
public Date changeDate(Date date, int delta) { return adjustDate(date, Calendar.DATE, delta); }
[ "public", "Date", "changeDate", "(", "Date", "date", ",", "int", "delta", ")", "{", "return", "adjustDate", "(", "date", ",", "Calendar", ".", "DATE", ",", "delta", ")", ";", "}" ]
Roll a date forward or back a given number of days. Only the days are modified in the associated date. If the delta is positive, then the date is rolled forward the given number of days. If the delta is negative, then the date is rolled backward the given number of days. @param date The initial date from which to start. @param delta The positive or negative integer value of days to move @return The new {@link Date} instance reflecting the specified change
[ "Roll", "a", "date", "forward", "or", "back", "a", "given", "number", "of", "days", ".", "Only", "the", "days", "are", "modified", "in", "the", "associated", "date", ".", "If", "the", "delta", "is", "positive", "then", "the", "date", "is", "rolled", "forward", "the", "given", "number", "of", "days", ".", "If", "the", "delta", "is", "negative", "then", "the", "date", "is", "rolled", "backward", "the", "given", "number", "of", "days", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java#L411-L413
311
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java
DateContext.calculateAge
public int calculateAge(Date birthday) { int result = -1; if (birthday != null) { GregorianCalendar todayCal = new GregorianCalendar(); todayCal.setTime(new Date()); int dayOfYear = todayCal.get(Calendar.DAY_OF_YEAR); int year = todayCal.get(Calendar.YEAR); GregorianCalendar birthdayCal = new GregorianCalendar(); birthdayCal.setTime(birthday); int birthDayOfYear = birthdayCal.get(Calendar.DAY_OF_YEAR); int birthYear = birthdayCal.get(Calendar.YEAR); birthDayOfYear = processLeapYear(todayCal, birthdayCal, birthDayOfYear); result = year - birthYear; if (dayOfYear < birthDayOfYear) { result--; } } return result; }
java
public int calculateAge(Date birthday) { int result = -1; if (birthday != null) { GregorianCalendar todayCal = new GregorianCalendar(); todayCal.setTime(new Date()); int dayOfYear = todayCal.get(Calendar.DAY_OF_YEAR); int year = todayCal.get(Calendar.YEAR); GregorianCalendar birthdayCal = new GregorianCalendar(); birthdayCal.setTime(birthday); int birthDayOfYear = birthdayCal.get(Calendar.DAY_OF_YEAR); int birthYear = birthdayCal.get(Calendar.YEAR); birthDayOfYear = processLeapYear(todayCal, birthdayCal, birthDayOfYear); result = year - birthYear; if (dayOfYear < birthDayOfYear) { result--; } } return result; }
[ "public", "int", "calculateAge", "(", "Date", "birthday", ")", "{", "int", "result", "=", "-", "1", ";", "if", "(", "birthday", "!=", "null", ")", "{", "GregorianCalendar", "todayCal", "=", "new", "GregorianCalendar", "(", ")", ";", "todayCal", ".", "setTime", "(", "new", "Date", "(", ")", ")", ";", "int", "dayOfYear", "=", "todayCal", ".", "get", "(", "Calendar", ".", "DAY_OF_YEAR", ")", ";", "int", "year", "=", "todayCal", ".", "get", "(", "Calendar", ".", "YEAR", ")", ";", "GregorianCalendar", "birthdayCal", "=", "new", "GregorianCalendar", "(", ")", ";", "birthdayCal", ".", "setTime", "(", "birthday", ")", ";", "int", "birthDayOfYear", "=", "birthdayCal", ".", "get", "(", "Calendar", ".", "DAY_OF_YEAR", ")", ";", "int", "birthYear", "=", "birthdayCal", ".", "get", "(", "Calendar", ".", "YEAR", ")", ";", "birthDayOfYear", "=", "processLeapYear", "(", "todayCal", ",", "birthdayCal", ",", "birthDayOfYear", ")", ";", "result", "=", "year", "-", "birthYear", ";", "if", "(", "dayOfYear", "<", "birthDayOfYear", ")", "{", "result", "--", ";", "}", "}", "return", "result", ";", "}" ]
Calcualte the age in years from today given a birthday. @param birthday the birthdate to calculate from @return The number of years that have passed since the birthdate or <code>-1</code> if birthday is <code>null</code>
[ "Calcualte", "the", "age", "in", "years", "from", "today", "given", "a", "birthday", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/DateContext.java#L515-L535
312
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/util/PropertyParser.java
PropertyParser.parse
public void parse(Reader reader) throws IOException { mScanner = new Scanner(reader); mScanner.addErrorListener(new ErrorListener() { public void parseError(ErrorEvent e) { dispatchParseError(e); } }); try { parseProperties(); } finally { mScanner.close(); } }
java
public void parse(Reader reader) throws IOException { mScanner = new Scanner(reader); mScanner.addErrorListener(new ErrorListener() { public void parseError(ErrorEvent e) { dispatchParseError(e); } }); try { parseProperties(); } finally { mScanner.close(); } }
[ "public", "void", "parse", "(", "Reader", "reader", ")", "throws", "IOException", "{", "mScanner", "=", "new", "Scanner", "(", "reader", ")", ";", "mScanner", ".", "addErrorListener", "(", "new", "ErrorListener", "(", ")", "{", "public", "void", "parseError", "(", "ErrorEvent", "e", ")", "{", "dispatchParseError", "(", "e", ")", ";", "}", "}", ")", ";", "try", "{", "parseProperties", "(", ")", ";", "}", "finally", "{", "mScanner", ".", "close", "(", ")", ";", "}", "}" ]
Parses properties from the given reader and stores them in the Map. To capture any parsing errors, call addErrorListener prior to parsing.
[ "Parses", "properties", "from", "the", "given", "reader", "and", "stores", "them", "in", "the", "Map", ".", "To", "capture", "any", "parsing", "errors", "call", "addErrorListener", "prior", "to", "parsing", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/PropertyParser.java#L165-L180
313
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/util/PropertyParser.java
PropertyParser.parseBlock
private void parseBlock(String keyPrefix) throws IOException { parsePropertyList(keyPrefix); Token token; if ((token = peek()).getId() == Token.RBRACE) { read(); } else { error("Right brace expected", token); } }
java
private void parseBlock(String keyPrefix) throws IOException { parsePropertyList(keyPrefix); Token token; if ((token = peek()).getId() == Token.RBRACE) { read(); } else { error("Right brace expected", token); } }
[ "private", "void", "parseBlock", "(", "String", "keyPrefix", ")", "throws", "IOException", "{", "parsePropertyList", "(", "keyPrefix", ")", ";", "Token", "token", ";", "if", "(", "(", "token", "=", "peek", "(", ")", ")", ".", "getId", "(", ")", "==", "Token", ".", "RBRACE", ")", "{", "read", "(", ")", ";", "}", "else", "{", "error", "(", "\"Right brace expected\"", ",", "token", ")", ";", "}", "}" ]
When this is called, the LBRACE token has already been read.
[ "When", "this", "is", "called", "the", "LBRACE", "token", "has", "already", "been", "read", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/PropertyParser.java#L264-L274
314
teatrove/teatrove
tea/src/main/java/org/teatrove/tea/util/ConsoleReporter.java
ConsoleReporter.close
public void close() throws IOException { if (mPositionReader != null) { mPositionReader.close(); } mPositionReader = null; mPositionReaderUnit = null; }
java
public void close() throws IOException { if (mPositionReader != null) { mPositionReader.close(); } mPositionReader = null; mPositionReaderUnit = null; }
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "if", "(", "mPositionReader", "!=", "null", ")", "{", "mPositionReader", ".", "close", "(", ")", ";", "}", "mPositionReader", "=", "null", ";", "mPositionReaderUnit", "=", "null", ";", "}" ]
Closes all open resources.
[ "Closes", "all", "open", "resources", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/util/ConsoleReporter.java#L48-L55
315
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/log/LogScribe.java
LogScribe.createPrepend
protected String createPrepend(LogEvent e) { StringBuffer pre = new StringBuffer(80); String code = "??"; switch (e.getType()) { case LogEvent.DEBUG_TYPE: code = " D"; break; case LogEvent.INFO_TYPE: code = " I"; break; case LogEvent.WARN_TYPE: code = "*W"; break; case LogEvent.ERROR_TYPE: code = "*E"; break; } pre.append(code); pre.append(','); if (mFastFormat != null) { pre.append(mFastFormat.format(e.getTimestamp())); } else { synchronized (mSlowFormat) { pre.append(mSlowFormat.format(e.getTimestamp())); } } if (isShowThreadEnabled()) { pre.append(','); pre.append(e.getThreadName()); } if (isShowSourceEnabled()) { Log source = e.getLogSource(); if (source != null) { String sourceName = source.getName(); if (sourceName != null) { pre.append(','); pre.append(sourceName); } } } pre.append('>'); pre.append(' '); return pre.toString(); }
java
protected String createPrepend(LogEvent e) { StringBuffer pre = new StringBuffer(80); String code = "??"; switch (e.getType()) { case LogEvent.DEBUG_TYPE: code = " D"; break; case LogEvent.INFO_TYPE: code = " I"; break; case LogEvent.WARN_TYPE: code = "*W"; break; case LogEvent.ERROR_TYPE: code = "*E"; break; } pre.append(code); pre.append(','); if (mFastFormat != null) { pre.append(mFastFormat.format(e.getTimestamp())); } else { synchronized (mSlowFormat) { pre.append(mSlowFormat.format(e.getTimestamp())); } } if (isShowThreadEnabled()) { pre.append(','); pre.append(e.getThreadName()); } if (isShowSourceEnabled()) { Log source = e.getLogSource(); if (source != null) { String sourceName = source.getName(); if (sourceName != null) { pre.append(','); pre.append(sourceName); } } } pre.append('>'); pre.append(' '); return pre.toString(); }
[ "protected", "String", "createPrepend", "(", "LogEvent", "e", ")", "{", "StringBuffer", "pre", "=", "new", "StringBuffer", "(", "80", ")", ";", "String", "code", "=", "\"??\"", ";", "switch", "(", "e", ".", "getType", "(", ")", ")", "{", "case", "LogEvent", ".", "DEBUG_TYPE", ":", "code", "=", "\" D\"", ";", "break", ";", "case", "LogEvent", ".", "INFO_TYPE", ":", "code", "=", "\" I\"", ";", "break", ";", "case", "LogEvent", ".", "WARN_TYPE", ":", "code", "=", "\"*W\"", ";", "break", ";", "case", "LogEvent", ".", "ERROR_TYPE", ":", "code", "=", "\"*E\"", ";", "break", ";", "}", "pre", ".", "append", "(", "code", ")", ";", "pre", ".", "append", "(", "'", "'", ")", ";", "if", "(", "mFastFormat", "!=", "null", ")", "{", "pre", ".", "append", "(", "mFastFormat", ".", "format", "(", "e", ".", "getTimestamp", "(", ")", ")", ")", ";", "}", "else", "{", "synchronized", "(", "mSlowFormat", ")", "{", "pre", ".", "append", "(", "mSlowFormat", ".", "format", "(", "e", ".", "getTimestamp", "(", ")", ")", ")", ";", "}", "}", "if", "(", "isShowThreadEnabled", "(", ")", ")", "{", "pre", ".", "append", "(", "'", "'", ")", ";", "pre", ".", "append", "(", "e", ".", "getThreadName", "(", ")", ")", ";", "}", "if", "(", "isShowSourceEnabled", "(", ")", ")", "{", "Log", "source", "=", "e", ".", "getLogSource", "(", ")", ";", "if", "(", "source", "!=", "null", ")", "{", "String", "sourceName", "=", "source", ".", "getName", "(", ")", ";", "if", "(", "sourceName", "!=", "null", ")", "{", "pre", ".", "append", "(", "'", "'", ")", ";", "pre", ".", "append", "(", "sourceName", ")", ";", "}", "}", "}", "pre", ".", "append", "(", "'", "'", ")", ";", "pre", ".", "append", "(", "'", "'", ")", ";", "return", "pre", ".", "toString", "(", ")", ";", "}" ]
Creates the default line prepend for a message.
[ "Creates", "the", "default", "line", "prepend", "for", "a", "message", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/LogScribe.java#L134-L184
316
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java
MathContext.max
public double max(double... values) { double max = Double.MIN_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] > max) { max = values[i]; } } return max; }
java
public double max(double... values) { double max = Double.MIN_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] > max) { max = values[i]; } } return max; }
[ "public", "double", "max", "(", "double", "...", "values", ")", "{", "double", "max", "=", "Double", ".", "MIN_VALUE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "==", "0", "||", "values", "[", "i", "]", ">", "max", ")", "{", "max", "=", "values", "[", "i", "]", ";", "}", "}", "return", "max", ";", "}" ]
Get the greatest of the set of double values. @param values the set of values @return The greatest of the values
[ "Get", "the", "greatest", "of", "the", "set", "of", "double", "values", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java#L256-L265
317
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java
MathContext.max
public float max(float... values) { float max = Float.MIN_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] > max) { max = values[i]; } } return max; }
java
public float max(float... values) { float max = Float.MIN_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] > max) { max = values[i]; } } return max; }
[ "public", "float", "max", "(", "float", "...", "values", ")", "{", "float", "max", "=", "Float", ".", "MIN_VALUE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "==", "0", "||", "values", "[", "i", "]", ">", "max", ")", "{", "max", "=", "values", "[", "i", "]", ";", "}", "}", "return", "max", ";", "}" ]
Get the greatest of the set of float values. @param values the set of values @return The greatest of the values
[ "Get", "the", "greatest", "of", "the", "set", "of", "float", "values", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java#L288-L297
318
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java
MathContext.min
public double min(double... values) { double min = Double.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] < min) { min = values[i]; } } return min; }
java
public double min(double... values) { double min = Double.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] < min) { min = values[i]; } } return min; }
[ "public", "double", "min", "(", "double", "...", "values", ")", "{", "double", "min", "=", "Double", ".", "MAX_VALUE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "==", "0", "||", "values", "[", "i", "]", "<", "min", ")", "{", "min", "=", "values", "[", "i", "]", ";", "}", "}", "return", "min", ";", "}" ]
Get the smallest of the set of double values. @param values the set of values @return The greatest of the values
[ "Get", "the", "smallest", "of", "the", "set", "of", "double", "values", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java#L384-L393
319
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java
MathContext.min
public float min(float... values) { float min = Float.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] < min) { min = values[i]; } } return min; }
java
public float min(float... values) { float min = Float.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] < min) { min = values[i]; } } return min; }
[ "public", "float", "min", "(", "float", "...", "values", ")", "{", "float", "min", "=", "Float", ".", "MAX_VALUE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "==", "0", "||", "values", "[", "i", "]", "<", "min", ")", "{", "min", "=", "values", "[", "i", "]", ";", "}", "}", "return", "min", ";", "}" ]
Get the smallest of the set of float values. @param values the set of values @return The greatest of the values
[ "Get", "the", "smallest", "of", "the", "set", "of", "float", "values", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java#L416-L425
320
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java
MathContext.min
public long min(long... values) { long min = Long.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] < min) { min = values[i]; } } return min; }
java
public long min(long... values) { long min = Long.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (i == 0 || values[i] < min) { min = values[i]; } } return min; }
[ "public", "long", "min", "(", "long", "...", "values", ")", "{", "long", "min", "=", "Long", ".", "MAX_VALUE", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "==", "0", "||", "values", "[", "i", "]", "<", "min", ")", "{", "min", "=", "values", "[", "i", "]", ";", "}", "}", "return", "min", ";", "}" ]
Get the smallest of the set of long values. @param values the set of values @return The greatest of the values
[ "Get", "the", "smallest", "of", "the", "set", "of", "long", "values", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/MathContext.java#L480-L489
321
teatrove/teatrove
teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java
TeaServletRequestStats.applyProperties
public void applyProperties(PropertyMap properties) { if (properties != null) { mRawWindowSize = properties.getInt ("rawWindowSize", DEFAULT_RAW_WINDOW_SIZE); mAggregateWindowSize = properties.getInt ("aggregateWindowSize", DEFAULT_AGGREGATE_WINDOW_SIZE); reset(); } }
java
public void applyProperties(PropertyMap properties) { if (properties != null) { mRawWindowSize = properties.getInt ("rawWindowSize", DEFAULT_RAW_WINDOW_SIZE); mAggregateWindowSize = properties.getInt ("aggregateWindowSize", DEFAULT_AGGREGATE_WINDOW_SIZE); reset(); } }
[ "public", "void", "applyProperties", "(", "PropertyMap", "properties", ")", "{", "if", "(", "properties", "!=", "null", ")", "{", "mRawWindowSize", "=", "properties", ".", "getInt", "(", "\"rawWindowSize\"", ",", "DEFAULT_RAW_WINDOW_SIZE", ")", ";", "mAggregateWindowSize", "=", "properties", ".", "getInt", "(", "\"aggregateWindowSize\"", ",", "DEFAULT_AGGREGATE_WINDOW_SIZE", ")", ";", "reset", "(", ")", ";", "}", "}" ]
This method applies properties from a stats block in the tea servlet config. @param properties
[ "This", "method", "applies", "properties", "from", "a", "stats", "block", "in", "the", "tea", "servlet", "config", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java#L62-L70
322
teatrove/teatrove
teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java
TeaServletRequestStats.getStats
public TemplateStats getStats(String fullTemplateName) { TemplateStats stats = (TemplateStats) mStatsMap.get(fullTemplateName); if (stats == null) { stats = new TemplateStats(fullTemplateName, mRawWindowSize, mAggregateWindowSize); mStatsMap.put(fullTemplateName, stats); } return stats; }
java
public TemplateStats getStats(String fullTemplateName) { TemplateStats stats = (TemplateStats) mStatsMap.get(fullTemplateName); if (stats == null) { stats = new TemplateStats(fullTemplateName, mRawWindowSize, mAggregateWindowSize); mStatsMap.put(fullTemplateName, stats); } return stats; }
[ "public", "TemplateStats", "getStats", "(", "String", "fullTemplateName", ")", "{", "TemplateStats", "stats", "=", "(", "TemplateStats", ")", "mStatsMap", ".", "get", "(", "fullTemplateName", ")", ";", "if", "(", "stats", "==", "null", ")", "{", "stats", "=", "new", "TemplateStats", "(", "fullTemplateName", ",", "mRawWindowSize", ",", "mAggregateWindowSize", ")", ";", "mStatsMap", ".", "put", "(", "fullTemplateName", ",", "stats", ")", ";", "}", "return", "stats", ";", "}" ]
Returns the template stats for a given template name. @param fullTemplateName the full name of the template with '.'s as delimeters. @return the template stats
[ "Returns", "the", "template", "stats", "for", "a", "given", "template", "name", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java#L79-L86
323
teatrove/teatrove
teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java
TeaServletRequestStats.getTemplateStats
public TemplateStats[] getTemplateStats() { Collection<TemplateStats> collection = mStatsMap.values(); TemplateStats[] result = null; if (collection.size() > 0) { result = collection.toArray(new TemplateStats[collection.size()]); } return result; }
java
public TemplateStats[] getTemplateStats() { Collection<TemplateStats> collection = mStatsMap.values(); TemplateStats[] result = null; if (collection.size() > 0) { result = collection.toArray(new TemplateStats[collection.size()]); } return result; }
[ "public", "TemplateStats", "[", "]", "getTemplateStats", "(", ")", "{", "Collection", "<", "TemplateStats", ">", "collection", "=", "mStatsMap", ".", "values", "(", ")", ";", "TemplateStats", "[", "]", "result", "=", "null", ";", "if", "(", "collection", ".", "size", "(", ")", ">", "0", ")", "{", "result", "=", "collection", ".", "toArray", "(", "new", "TemplateStats", "[", "collection", ".", "size", "(", ")", "]", ")", ";", "}", "return", "result", ";", "}" ]
Returns an array of template stats. Returns the template raw and aggregate statistics so as to better understand the performance of templates through time. @return the template stats for this given template.
[ "Returns", "an", "array", "of", "template", "stats", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java#L96-L103
324
teatrove/teatrove
teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java
TeaServletRequestStats.log
public void log(String fullTemplateName, long startTime, long stopTime, long contentLength, Object[] params) { //System.out.println(fullTemplateName + ", " + (stopTime-startTime) + ", " + contentLength); TemplateStats stats = (TemplateStats) mStatsMap.get(fullTemplateName); if (stats == null) { stats = new TemplateStats(fullTemplateName, mRawWindowSize, mAggregateWindowSize); mStatsMap.put(fullTemplateName, stats); } stats.log(startTime, stopTime, contentLength, params); }
java
public void log(String fullTemplateName, long startTime, long stopTime, long contentLength, Object[] params) { //System.out.println(fullTemplateName + ", " + (stopTime-startTime) + ", " + contentLength); TemplateStats stats = (TemplateStats) mStatsMap.get(fullTemplateName); if (stats == null) { stats = new TemplateStats(fullTemplateName, mRawWindowSize, mAggregateWindowSize); mStatsMap.put(fullTemplateName, stats); } stats.log(startTime, stopTime, contentLength, params); }
[ "public", "void", "log", "(", "String", "fullTemplateName", ",", "long", "startTime", ",", "long", "stopTime", ",", "long", "contentLength", ",", "Object", "[", "]", "params", ")", "{", "//System.out.println(fullTemplateName + \", \" + (stopTime-startTime) + \", \" + contentLength);", "TemplateStats", "stats", "=", "(", "TemplateStats", ")", "mStatsMap", ".", "get", "(", "fullTemplateName", ")", ";", "if", "(", "stats", "==", "null", ")", "{", "stats", "=", "new", "TemplateStats", "(", "fullTemplateName", ",", "mRawWindowSize", ",", "mAggregateWindowSize", ")", ";", "mStatsMap", ".", "put", "(", "fullTemplateName", ",", "stats", ")", ";", "}", "stats", ".", "log", "(", "startTime", ",", "stopTime", ",", "contentLength", ",", "params", ")", ";", "}" ]
Logs an invokation of an http template invocation. @param fullTemplateName the name of the template @param startTime the time the template was invoked. @param stopTime the time the template completed. @param contentLength the content length of the result of the template. @param params the parameter values the template was invoked with.
[ "Logs", "an", "invokation", "of", "an", "http", "template", "invocation", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/stats/TeaServletRequestStats.java#L114-L122
325
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/log/DailyLogStream.java
DailyLogStream.moveToIntervalStart
protected void moveToIntervalStart(Calendar cal) { int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); cal.clear(); cal.set(year, month, day); }
java
protected void moveToIntervalStart(Calendar cal) { int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day = cal.get(Calendar.DAY_OF_MONTH); cal.clear(); cal.set(year, month, day); }
[ "protected", "void", "moveToIntervalStart", "(", "Calendar", "cal", ")", "{", "int", "year", "=", "cal", ".", "get", "(", "Calendar", ".", "YEAR", ")", ";", "int", "month", "=", "cal", ".", "get", "(", "Calendar", ".", "MONTH", ")", ";", "int", "day", "=", "cal", ".", "get", "(", "Calendar", ".", "DAY_OF_MONTH", ")", ";", "cal", ".", "clear", "(", ")", ";", "cal", ".", "set", "(", "year", ",", "month", ",", "day", ")", ";", "}" ]
Moves calendar to beginning of day.
[ "Moves", "calendar", "to", "beginning", "of", "day", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/log/DailyLogStream.java#L34-L40
326
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java
HttpHeaderMap.readFrom
public void readFrom(InputStream in, byte[] buffer) throws IOException { String header; while ((header = HttpUtils.readLine(in, buffer, MAX_HEADER_LENGTH)) != null) { if (header.length() == 0) { break; } processHeaderLine(header); } }
java
public void readFrom(InputStream in, byte[] buffer) throws IOException { String header; while ((header = HttpUtils.readLine(in, buffer, MAX_HEADER_LENGTH)) != null) { if (header.length() == 0) { break; } processHeaderLine(header); } }
[ "public", "void", "readFrom", "(", "InputStream", "in", ",", "byte", "[", "]", "buffer", ")", "throws", "IOException", "{", "String", "header", ";", "while", "(", "(", "header", "=", "HttpUtils", ".", "readLine", "(", "in", ",", "buffer", ",", "MAX_HEADER_LENGTH", ")", ")", "!=", "null", ")", "{", "if", "(", "header", ".", "length", "(", ")", "==", "0", ")", "{", "break", ";", "}", "processHeaderLine", "(", "header", ")", ";", "}", "}" ]
Read and parse headers from the given InputStream until a blank line is reached. Except for Cookies, all other headers that contain multiple fields delimited by commas are parsed into multiple headers. @param in stream to read from @param buffer temporary buffer to use
[ "Read", "and", "parse", "headers", "from", "the", "given", "InputStream", "until", "a", "blank", "line", "is", "reached", ".", "Except", "for", "Cookies", "all", "other", "headers", "that", "contain", "multiple", "fields", "delimited", "by", "commas", "are", "parsed", "into", "multiple", "headers", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java#L123-L131
327
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java
HttpHeaderMap.get
public Object get(Object key) { Object value = mMap.get(key); if (value instanceof List) { return ((List)value).get(0); } else { return value; } }
java
public Object get(Object key) { Object value = mMap.get(key); if (value instanceof List) { return ((List)value).get(0); } else { return value; } }
[ "public", "Object", "get", "(", "Object", "key", ")", "{", "Object", "value", "=", "mMap", ".", "get", "(", "key", ")", ";", "if", "(", "value", "instanceof", "List", ")", "{", "return", "(", "(", "List", ")", "value", ")", ".", "get", "(", "0", ")", ";", "}", "else", "{", "return", "value", ";", "}", "}" ]
Returns the first value associated with the given key.
[ "Returns", "the", "first", "value", "associated", "with", "the", "given", "key", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java#L329-L337
328
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java
HttpHeaderMap.getAll
public List getAll(Object key) { Object value = mMap.get(key); if (value instanceof List) { return ((List)value); } else { List list = new ArrayList(); if (value != null || mMap.containsKey(key)) { list.add(value); } mMap.put(key, list); return list; } }
java
public List getAll(Object key) { Object value = mMap.get(key); if (value instanceof List) { return ((List)value); } else { List list = new ArrayList(); if (value != null || mMap.containsKey(key)) { list.add(value); } mMap.put(key, list); return list; } }
[ "public", "List", "getAll", "(", "Object", "key", ")", "{", "Object", "value", "=", "mMap", ".", "get", "(", "key", ")", ";", "if", "(", "value", "instanceof", "List", ")", "{", "return", "(", "(", "List", ")", "value", ")", ";", "}", "else", "{", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "if", "(", "value", "!=", "null", "||", "mMap", ".", "containsKey", "(", "key", ")", ")", "{", "list", ".", "add", "(", "value", ")", ";", "}", "mMap", ".", "put", "(", "key", ",", "list", ")", ";", "return", "list", ";", "}", "}" ]
Returns all the values associated with the given key. Changes to the returned list will be reflected in this map.
[ "Returns", "all", "the", "values", "associated", "with", "the", "given", "key", ".", "Changes", "to", "the", "returned", "list", "will", "be", "reflected", "in", "this", "map", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java#L409-L422
329
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java
HttpHeaderMap.put
public Object put(Object key, Object value) { if (value instanceof List) { return mMap.put(key, new ArrayList((List)value)); } else { return mMap.put(key, value); } }
java
public Object put(Object key, Object value) { if (value instanceof List) { return mMap.put(key, new ArrayList((List)value)); } else { return mMap.put(key, value); } }
[ "public", "Object", "put", "(", "Object", "key", ",", "Object", "value", ")", "{", "if", "(", "value", "instanceof", "List", ")", "{", "return", "mMap", ".", "put", "(", "key", ",", "new", "ArrayList", "(", "(", "List", ")", "value", ")", ")", ";", "}", "else", "{", "return", "mMap", ".", "put", "(", "key", ",", "value", ")", ";", "}", "}" ]
May return a list if the key previously mapped to multiple values.
[ "May", "return", "a", "list", "if", "the", "key", "previously", "mapped", "to", "multiple", "values", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java#L427-L434
330
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java
HttpHeaderMap.add
public void add(Object key, Object value) { Object existing = mMap.get(key); if (existing instanceof List) { if (value instanceof List) { ((List)existing).addAll((List)value); } else { ((List)existing).add(value); } } else if (existing == null && !mMap.containsKey(key)) { if (value instanceof List) { mMap.put(key, new ArrayList((List)value)); } else { mMap.put(key, value); } } else { List list = new ArrayList(); list.add(existing); if (value instanceof List) { list.addAll((List)value); } else { list.add(value); } mMap.put(key, list); } }
java
public void add(Object key, Object value) { Object existing = mMap.get(key); if (existing instanceof List) { if (value instanceof List) { ((List)existing).addAll((List)value); } else { ((List)existing).add(value); } } else if (existing == null && !mMap.containsKey(key)) { if (value instanceof List) { mMap.put(key, new ArrayList((List)value)); } else { mMap.put(key, value); } } else { List list = new ArrayList(); list.add(existing); if (value instanceof List) { list.addAll((List)value); } else { list.add(value); } mMap.put(key, list); } }
[ "public", "void", "add", "(", "Object", "key", ",", "Object", "value", ")", "{", "Object", "existing", "=", "mMap", ".", "get", "(", "key", ")", ";", "if", "(", "existing", "instanceof", "List", ")", "{", "if", "(", "value", "instanceof", "List", ")", "{", "(", "(", "List", ")", "existing", ")", ".", "addAll", "(", "(", "List", ")", "value", ")", ";", "}", "else", "{", "(", "(", "List", ")", "existing", ")", ".", "add", "(", "value", ")", ";", "}", "}", "else", "if", "(", "existing", "==", "null", "&&", "!", "mMap", ".", "containsKey", "(", "key", ")", ")", "{", "if", "(", "value", "instanceof", "List", ")", "{", "mMap", ".", "put", "(", "key", ",", "new", "ArrayList", "(", "(", "List", ")", "value", ")", ")", ";", "}", "else", "{", "mMap", ".", "put", "(", "key", ",", "value", ")", ";", "}", "}", "else", "{", "List", "list", "=", "new", "ArrayList", "(", ")", ";", "list", ".", "add", "(", "existing", ")", ";", "if", "(", "value", "instanceof", "List", ")", "{", "list", ".", "addAll", "(", "(", "List", ")", "value", ")", ";", "}", "else", "{", "list", ".", "add", "(", "value", ")", ";", "}", "mMap", ".", "put", "(", "key", ",", "list", ")", ";", "}", "}" ]
Add more than one value associated with the given key.
[ "Add", "more", "than", "one", "value", "associated", "with", "the", "given", "key", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java#L439-L468
331
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/BeanContext.java
BeanContext.set
public void set(Object object, String attributeName, Object attributeValue) throws IllegalAccessException, InvocationTargetException, BeanContextException { Class<?> objectClass = object.getClass(); String methodName = "set" + attributeName.substring(0,1).toUpperCase() + attributeName.substring(1); String methodKey = objectClass.getName() + "." + methodName; MethodTypePair pair = mMethodTypePairMap.get(methodKey); if (pair == null) { pair = getMethodTypePair(objectClass, methodName, attributeValue); mMethodTypePairMap.put(methodKey, pair); } if (pair != null) { Object[] params = {convertObjectType(attributeValue, pair.type)}; pair.method.invoke(object, params); } else { throw new BeanContextException ( methodName + "(" + (attributeValue == null ? "null" : attributeValue.getClass()) + ") could not be found." ); } }
java
public void set(Object object, String attributeName, Object attributeValue) throws IllegalAccessException, InvocationTargetException, BeanContextException { Class<?> objectClass = object.getClass(); String methodName = "set" + attributeName.substring(0,1).toUpperCase() + attributeName.substring(1); String methodKey = objectClass.getName() + "." + methodName; MethodTypePair pair = mMethodTypePairMap.get(methodKey); if (pair == null) { pair = getMethodTypePair(objectClass, methodName, attributeValue); mMethodTypePairMap.put(methodKey, pair); } if (pair != null) { Object[] params = {convertObjectType(attributeValue, pair.type)}; pair.method.invoke(object, params); } else { throw new BeanContextException ( methodName + "(" + (attributeValue == null ? "null" : attributeValue.getClass()) + ") could not be found." ); } }
[ "public", "void", "set", "(", "Object", "object", ",", "String", "attributeName", ",", "Object", "attributeValue", ")", "throws", "IllegalAccessException", ",", "InvocationTargetException", ",", "BeanContextException", "{", "Class", "<", "?", ">", "objectClass", "=", "object", ".", "getClass", "(", ")", ";", "String", "methodName", "=", "\"set\"", "+", "attributeName", ".", "substring", "(", "0", ",", "1", ")", ".", "toUpperCase", "(", ")", "+", "attributeName", ".", "substring", "(", "1", ")", ";", "String", "methodKey", "=", "objectClass", ".", "getName", "(", ")", "+", "\".\"", "+", "methodName", ";", "MethodTypePair", "pair", "=", "mMethodTypePairMap", ".", "get", "(", "methodKey", ")", ";", "if", "(", "pair", "==", "null", ")", "{", "pair", "=", "getMethodTypePair", "(", "objectClass", ",", "methodName", ",", "attributeValue", ")", ";", "mMethodTypePairMap", ".", "put", "(", "methodKey", ",", "pair", ")", ";", "}", "if", "(", "pair", "!=", "null", ")", "{", "Object", "[", "]", "params", "=", "{", "convertObjectType", "(", "attributeValue", ",", "pair", ".", "type", ")", "}", ";", "pair", ".", "method", ".", "invoke", "(", "object", ",", "params", ")", ";", "}", "else", "{", "throw", "new", "BeanContextException", "(", "methodName", "+", "\"(\"", "+", "(", "attributeValue", "==", "null", "?", "\"null\"", ":", "attributeValue", ".", "getClass", "(", ")", ")", "+", "\") could not be found.\"", ")", ";", "}", "}" ]
Method to set attributes of an object. This method may be called to set the values of an object by passing in the object, the attribute name to set, and the attribute value. To get a listing of attribute values that can be set for a given object, see the createObject method for the object. @param object The object to set an attribute value for. @param attributeName The name of the attribute to set. @param attributeValue The value of the attribute to set.
[ "Method", "to", "set", "attributes", "of", "an", "object", ".", "This", "method", "may", "be", "called", "to", "set", "the", "values", "of", "an", "object", "by", "passing", "in", "the", "object", "the", "attribute", "name", "to", "set", "and", "the", "attribute", "value", ".", "To", "get", "a", "listing", "of", "attribute", "values", "that", "can", "be", "set", "for", "a", "given", "object", "see", "the", "createObject", "method", "for", "the", "object", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/BeanContext.java#L107-L134
332
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/file/TaggedTxFileBuffer.java
TaggedTxFileBuffer.truncate
public void truncate(long size) throws IOException { super.truncate(size); if (size == 0) { synchronized (this) { mTranCount = 0; // Clear the bit to indicate clean. mBitlist.clear(mBitlistPos); } } }
java
public void truncate(long size) throws IOException { super.truncate(size); if (size == 0) { synchronized (this) { mTranCount = 0; // Clear the bit to indicate clean. mBitlist.clear(mBitlistPos); } } }
[ "public", "void", "truncate", "(", "long", "size", ")", "throws", "IOException", "{", "super", ".", "truncate", "(", "size", ")", ";", "if", "(", "size", "==", "0", ")", "{", "synchronized", "(", "this", ")", "{", "mTranCount", "=", "0", ";", "// Clear the bit to indicate clean.", "mBitlist", ".", "clear", "(", "mBitlistPos", ")", ";", "}", "}", "}" ]
Truncating the file to zero restores it to a clean state.
[ "Truncating", "the", "file", "to", "zero", "restores", "it", "to", "a", "clean", "state", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/file/TaggedTxFileBuffer.java#L46-L55
333
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/provisioning/model/ServerProvisioningFeaturePack.java
ServerProvisioningFeaturePack.createStandaloneConfigFiles
private static List<ConfigFile> createStandaloneConfigFiles(FeaturePack featurePack, ConfigOverride configOverride) { final List<org.wildfly.build.common.model.ConfigFile> configFiles = featurePack.getDescription().getConfig().getStandaloneConfigFiles(); final Map<String, ConfigFileOverride> configFileOverrides = configOverride != null ? configOverride.getStandaloneConfigFiles() : null; return createConfigFiles(featurePack.getFeaturePackFile(), configFiles, configOverride, configFileOverrides); }
java
private static List<ConfigFile> createStandaloneConfigFiles(FeaturePack featurePack, ConfigOverride configOverride) { final List<org.wildfly.build.common.model.ConfigFile> configFiles = featurePack.getDescription().getConfig().getStandaloneConfigFiles(); final Map<String, ConfigFileOverride> configFileOverrides = configOverride != null ? configOverride.getStandaloneConfigFiles() : null; return createConfigFiles(featurePack.getFeaturePackFile(), configFiles, configOverride, configFileOverrides); }
[ "private", "static", "List", "<", "ConfigFile", ">", "createStandaloneConfigFiles", "(", "FeaturePack", "featurePack", ",", "ConfigOverride", "configOverride", ")", "{", "final", "List", "<", "org", ".", "wildfly", ".", "build", ".", "common", ".", "model", ".", "ConfigFile", ">", "configFiles", "=", "featurePack", ".", "getDescription", "(", ")", ".", "getConfig", "(", ")", ".", "getStandaloneConfigFiles", "(", ")", ";", "final", "Map", "<", "String", ",", "ConfigFileOverride", ">", "configFileOverrides", "=", "configOverride", "!=", "null", "?", "configOverride", ".", "getStandaloneConfigFiles", "(", ")", ":", "null", ";", "return", "createConfigFiles", "(", "featurePack", ".", "getFeaturePackFile", "(", ")", ",", "configFiles", ",", "configOverride", ",", "configFileOverrides", ")", ";", "}" ]
Creates the provisioning standalone config files. @param featurePack @param configOverride @return
[ "Creates", "the", "provisioning", "standalone", "config", "files", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/provisioning/model/ServerProvisioningFeaturePack.java#L283-L287
334
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/common/model/ConfigFile.java
ConfigFile.getSubsystemConfigs
public Map<String, Map<String, SubsystemConfig>> getSubsystemConfigs(File featurePackFile) throws IOException, XMLStreamException { Map<String, Map<String, SubsystemConfig>> subsystems = new HashMap<>(); try (ZipFile zip = new ZipFile(featurePackFile)) { ZipEntry zipEntry = zip.getEntry(getSubsystems()); if (zipEntry == null) { throw new RuntimeException("Feature pack " + featurePackFile + " subsystems file " + getSubsystems() + " not found"); } InputStreamSource inputStreamSource = new ZipEntryInputStreamSource(featurePackFile, zipEntry); SubsystemsParser.parse(inputStreamSource, getProperties(), subsystems); } return subsystems; }
java
public Map<String, Map<String, SubsystemConfig>> getSubsystemConfigs(File featurePackFile) throws IOException, XMLStreamException { Map<String, Map<String, SubsystemConfig>> subsystems = new HashMap<>(); try (ZipFile zip = new ZipFile(featurePackFile)) { ZipEntry zipEntry = zip.getEntry(getSubsystems()); if (zipEntry == null) { throw new RuntimeException("Feature pack " + featurePackFile + " subsystems file " + getSubsystems() + " not found"); } InputStreamSource inputStreamSource = new ZipEntryInputStreamSource(featurePackFile, zipEntry); SubsystemsParser.parse(inputStreamSource, getProperties(), subsystems); } return subsystems; }
[ "public", "Map", "<", "String", ",", "Map", "<", "String", ",", "SubsystemConfig", ">", ">", "getSubsystemConfigs", "(", "File", "featurePackFile", ")", "throws", "IOException", ",", "XMLStreamException", "{", "Map", "<", "String", ",", "Map", "<", "String", ",", "SubsystemConfig", ">", ">", "subsystems", "=", "new", "HashMap", "<>", "(", ")", ";", "try", "(", "ZipFile", "zip", "=", "new", "ZipFile", "(", "featurePackFile", ")", ")", "{", "ZipEntry", "zipEntry", "=", "zip", ".", "getEntry", "(", "getSubsystems", "(", ")", ")", ";", "if", "(", "zipEntry", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"Feature pack \"", "+", "featurePackFile", "+", "\" subsystems file \"", "+", "getSubsystems", "(", ")", "+", "\" not found\"", ")", ";", "}", "InputStreamSource", "inputStreamSource", "=", "new", "ZipEntryInputStreamSource", "(", "featurePackFile", ",", "zipEntry", ")", ";", "SubsystemsParser", ".", "parse", "(", "inputStreamSource", ",", "getProperties", "(", ")", ",", "subsystems", ")", ";", "}", "return", "subsystems", ";", "}" ]
Retrieves the subsystems configs. @param featurePackFile the feature pack's file containing the subsystem configs @return @throws IOException @throws XMLStreamException
[ "Retrieves", "the", "subsystems", "configs", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/common/model/ConfigFile.java#L74-L85
335
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java
ZipFileSubsystemInputStreamSources.addSubsystemFileSource
public void addSubsystemFileSource(String subsystemFileName, File zipFile, ZipEntry zipEntry) { inputStreamSourceMap.put(subsystemFileName, new ZipEntryInputStreamSource(zipFile, zipEntry)); }
java
public void addSubsystemFileSource(String subsystemFileName, File zipFile, ZipEntry zipEntry) { inputStreamSourceMap.put(subsystemFileName, new ZipEntryInputStreamSource(zipFile, zipEntry)); }
[ "public", "void", "addSubsystemFileSource", "(", "String", "subsystemFileName", ",", "File", "zipFile", ",", "ZipEntry", "zipEntry", ")", "{", "inputStreamSourceMap", ".", "put", "(", "subsystemFileName", ",", "new", "ZipEntryInputStreamSource", "(", "zipFile", ",", "zipEntry", ")", ")", ";", "}" ]
Creates a zip entry inputstream source and maps it to the specified filename. @param subsystemFileName @param zipFile @param zipEntry
[ "Creates", "a", "zip", "entry", "inputstream", "source", "and", "maps", "it", "to", "the", "specified", "filename", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L45-L47
336
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java
ZipFileSubsystemInputStreamSources.addAllSubsystemFileSources
public void addAllSubsystemFileSources(ZipFileSubsystemInputStreamSources other) { for (Map.Entry<String, ZipEntryInputStreamSource> entry : other.inputStreamSourceMap.entrySet()) { if (!this.inputStreamSourceMap.containsKey(entry.getKey())) { this.inputStreamSourceMap.put(entry.getKey(), entry.getValue()); } } }
java
public void addAllSubsystemFileSources(ZipFileSubsystemInputStreamSources other) { for (Map.Entry<String, ZipEntryInputStreamSource> entry : other.inputStreamSourceMap.entrySet()) { if (!this.inputStreamSourceMap.containsKey(entry.getKey())) { this.inputStreamSourceMap.put(entry.getKey(), entry.getValue()); } } }
[ "public", "void", "addAllSubsystemFileSources", "(", "ZipFileSubsystemInputStreamSources", "other", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "ZipEntryInputStreamSource", ">", "entry", ":", "other", ".", "inputStreamSourceMap", ".", "entrySet", "(", ")", ")", "{", "if", "(", "!", "this", ".", "inputStreamSourceMap", ".", "containsKey", "(", "entry", ".", "getKey", "(", ")", ")", ")", "{", "this", ".", "inputStreamSourceMap", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "}" ]
Adds all subsystem input stream sources from the specified factory. Note that only absent sources will be added. @param other
[ "Adds", "all", "subsystem", "input", "stream", "sources", "from", "the", "specified", "factory", ".", "Note", "that", "only", "absent", "sources", "will", "be", "added", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L53-L59
337
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java
ZipFileSubsystemInputStreamSources.addAllSubsystemFileSourcesFromZipFile
public void addAllSubsystemFileSourcesFromZipFile(File file) throws IOException { try (ZipFile zip = new ZipFile(file)) { // extract subsystem template and schema, if present if (zip.getEntry("subsystem-templates") != null) { Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (!entry.isDirectory()) { String entryName = entry.getName(); if (entryName.startsWith("subsystem-templates/")) { addSubsystemFileSource(entryName.substring("subsystem-templates/".length()), file, entry); } } } } } }
java
public void addAllSubsystemFileSourcesFromZipFile(File file) throws IOException { try (ZipFile zip = new ZipFile(file)) { // extract subsystem template and schema, if present if (zip.getEntry("subsystem-templates") != null) { Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (!entry.isDirectory()) { String entryName = entry.getName(); if (entryName.startsWith("subsystem-templates/")) { addSubsystemFileSource(entryName.substring("subsystem-templates/".length()), file, entry); } } } } } }
[ "public", "void", "addAllSubsystemFileSourcesFromZipFile", "(", "File", "file", ")", "throws", "IOException", "{", "try", "(", "ZipFile", "zip", "=", "new", "ZipFile", "(", "file", ")", ")", "{", "// extract subsystem template and schema, if present", "if", "(", "zip", ".", "getEntry", "(", "\"subsystem-templates\"", ")", "!=", "null", ")", "{", "Enumeration", "<", "?", "extends", "ZipEntry", ">", "entries", "=", "zip", ".", "entries", "(", ")", ";", "while", "(", "entries", ".", "hasMoreElements", "(", ")", ")", "{", "ZipEntry", "entry", "=", "entries", ".", "nextElement", "(", ")", ";", "if", "(", "!", "entry", ".", "isDirectory", "(", ")", ")", "{", "String", "entryName", "=", "entry", ".", "getName", "(", ")", ";", "if", "(", "entryName", ".", "startsWith", "(", "\"subsystem-templates/\"", ")", ")", "{", "addSubsystemFileSource", "(", "entryName", ".", "substring", "(", "\"subsystem-templates/\"", ".", "length", "(", ")", ")", ",", "file", ",", "entry", ")", ";", "}", "}", "}", "}", "}", "}" ]
Adds all file sources in the specified zip file. @param file @throws IOException
[ "Adds", "all", "file", "sources", "in", "the", "specified", "zip", "file", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L66-L82
338
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java
ZipFileSubsystemInputStreamSources.addSubsystemFileSourceFromZipFile
public boolean addSubsystemFileSourceFromZipFile(String subsystem, File file) throws IOException { try (ZipFile zip = new ZipFile(file)) { String entryName = "subsystem-templates/"+subsystem; ZipEntry entry = zip.getEntry(entryName); if (entry != null) { addSubsystemFileSource(subsystem, file, entry); return true; } } return false; }
java
public boolean addSubsystemFileSourceFromZipFile(String subsystem, File file) throws IOException { try (ZipFile zip = new ZipFile(file)) { String entryName = "subsystem-templates/"+subsystem; ZipEntry entry = zip.getEntry(entryName); if (entry != null) { addSubsystemFileSource(subsystem, file, entry); return true; } } return false; }
[ "public", "boolean", "addSubsystemFileSourceFromZipFile", "(", "String", "subsystem", ",", "File", "file", ")", "throws", "IOException", "{", "try", "(", "ZipFile", "zip", "=", "new", "ZipFile", "(", "file", ")", ")", "{", "String", "entryName", "=", "\"subsystem-templates/\"", "+", "subsystem", ";", "ZipEntry", "entry", "=", "zip", ".", "getEntry", "(", "entryName", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "addSubsystemFileSource", "(", "subsystem", ",", "file", ",", "entry", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Adds the file source for the specified subsystem, from the specified zip file. @param subsystem @param file @return true if such subsystem file source was found and added; false otherwise @throws IOException
[ "Adds", "the", "file", "source", "for", "the", "specified", "subsystem", "from", "the", "specified", "zip", "file", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L91-L101
339
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java
ZipFileSubsystemInputStreamSources.addAllSubsystemFileSourcesFromModule
public void addAllSubsystemFileSourcesFromModule(FeaturePack.Module module, ArtifactFileResolver artifactFileResolver, boolean transitive) throws IOException { // the subsystem templates are included in module artifacts files for (ModuleParseResult.ArtifactName artifactName : module.getModuleParseResult().getArtifacts()) { // resolve the artifact Artifact artifact = module.getFeaturePack().getArtifactResolver().getArtifact(artifactName.getArtifact()); if (artifact == null) { throw new RuntimeException("Could not resolve module resource artifact " + artifactName.getArtifactCoords() + " for feature pack " + module.getFeaturePack().getFeaturePackFile()); } // resolve the artifact file File artifactFile = artifactFileResolver.getArtifactFile(artifact); // get the subsystem templates addAllSubsystemFileSourcesFromZipFile(artifactFile); } if (transitive) { for (FeaturePack.Module dependency : module.getDependencies().values()) { addAllSubsystemFileSourcesFromModule(dependency, artifactFileResolver, false); } } }
java
public void addAllSubsystemFileSourcesFromModule(FeaturePack.Module module, ArtifactFileResolver artifactFileResolver, boolean transitive) throws IOException { // the subsystem templates are included in module artifacts files for (ModuleParseResult.ArtifactName artifactName : module.getModuleParseResult().getArtifacts()) { // resolve the artifact Artifact artifact = module.getFeaturePack().getArtifactResolver().getArtifact(artifactName.getArtifact()); if (artifact == null) { throw new RuntimeException("Could not resolve module resource artifact " + artifactName.getArtifactCoords() + " for feature pack " + module.getFeaturePack().getFeaturePackFile()); } // resolve the artifact file File artifactFile = artifactFileResolver.getArtifactFile(artifact); // get the subsystem templates addAllSubsystemFileSourcesFromZipFile(artifactFile); } if (transitive) { for (FeaturePack.Module dependency : module.getDependencies().values()) { addAllSubsystemFileSourcesFromModule(dependency, artifactFileResolver, false); } } }
[ "public", "void", "addAllSubsystemFileSourcesFromModule", "(", "FeaturePack", ".", "Module", "module", ",", "ArtifactFileResolver", "artifactFileResolver", ",", "boolean", "transitive", ")", "throws", "IOException", "{", "// the subsystem templates are included in module artifacts files", "for", "(", "ModuleParseResult", ".", "ArtifactName", "artifactName", ":", "module", ".", "getModuleParseResult", "(", ")", ".", "getArtifacts", "(", ")", ")", "{", "// resolve the artifact", "Artifact", "artifact", "=", "module", ".", "getFeaturePack", "(", ")", ".", "getArtifactResolver", "(", ")", ".", "getArtifact", "(", "artifactName", ".", "getArtifact", "(", ")", ")", ";", "if", "(", "artifact", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"Could not resolve module resource artifact \"", "+", "artifactName", ".", "getArtifactCoords", "(", ")", "+", "\" for feature pack \"", "+", "module", ".", "getFeaturePack", "(", ")", ".", "getFeaturePackFile", "(", ")", ")", ";", "}", "// resolve the artifact file", "File", "artifactFile", "=", "artifactFileResolver", ".", "getArtifactFile", "(", "artifact", ")", ";", "// get the subsystem templates", "addAllSubsystemFileSourcesFromZipFile", "(", "artifactFile", ")", ";", "}", "if", "(", "transitive", ")", "{", "for", "(", "FeaturePack", ".", "Module", "dependency", ":", "module", ".", "getDependencies", "(", ")", ".", "values", "(", ")", ")", "{", "addAllSubsystemFileSourcesFromModule", "(", "dependency", ",", "artifactFileResolver", ",", "false", ")", ";", "}", "}", "}" ]
Adds all file sources in the specified module's artifacts. @param module @param artifactFileResolver @param transitive @throws IOException
[ "Adds", "all", "file", "sources", "in", "the", "specified", "module", "s", "artifacts", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L110-L128
340
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java
ZipFileSubsystemInputStreamSources.addSubsystemFileSourceFromModule
public boolean addSubsystemFileSourceFromModule(String subsystem, FeaturePack.Module module, ArtifactFileResolver artifactFileResolver) throws IOException { // the subsystem templates are included in module artifacts files for (ModuleParseResult.ArtifactName artifactName : module.getModuleParseResult().getArtifacts()) { // resolve the artifact Artifact artifact = module.getFeaturePack().getArtifactResolver().getArtifact(artifactName.getArtifact()); if (artifact == null) { throw new RuntimeException("Could not resolve module resource artifact " + artifactName.getArtifactCoords() + " for feature pack " + module.getFeaturePack().getFeaturePackFile()); } // resolve the artifact file File artifactFile = artifactFileResolver.getArtifactFile(artifact); // get the subsystem template from the artifact file if (addSubsystemFileSourceFromZipFile(subsystem, artifactFile)) { return true; } } return false; }
java
public boolean addSubsystemFileSourceFromModule(String subsystem, FeaturePack.Module module, ArtifactFileResolver artifactFileResolver) throws IOException { // the subsystem templates are included in module artifacts files for (ModuleParseResult.ArtifactName artifactName : module.getModuleParseResult().getArtifacts()) { // resolve the artifact Artifact artifact = module.getFeaturePack().getArtifactResolver().getArtifact(artifactName.getArtifact()); if (artifact == null) { throw new RuntimeException("Could not resolve module resource artifact " + artifactName.getArtifactCoords() + " for feature pack " + module.getFeaturePack().getFeaturePackFile()); } // resolve the artifact file File artifactFile = artifactFileResolver.getArtifactFile(artifact); // get the subsystem template from the artifact file if (addSubsystemFileSourceFromZipFile(subsystem, artifactFile)) { return true; } } return false; }
[ "public", "boolean", "addSubsystemFileSourceFromModule", "(", "String", "subsystem", ",", "FeaturePack", ".", "Module", "module", ",", "ArtifactFileResolver", "artifactFileResolver", ")", "throws", "IOException", "{", "// the subsystem templates are included in module artifacts files", "for", "(", "ModuleParseResult", ".", "ArtifactName", "artifactName", ":", "module", ".", "getModuleParseResult", "(", ")", ".", "getArtifacts", "(", ")", ")", "{", "// resolve the artifact", "Artifact", "artifact", "=", "module", ".", "getFeaturePack", "(", ")", ".", "getArtifactResolver", "(", ")", ".", "getArtifact", "(", "artifactName", ".", "getArtifact", "(", ")", ")", ";", "if", "(", "artifact", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"Could not resolve module resource artifact \"", "+", "artifactName", ".", "getArtifactCoords", "(", ")", "+", "\" for feature pack \"", "+", "module", ".", "getFeaturePack", "(", ")", ".", "getFeaturePackFile", "(", ")", ")", ";", "}", "// resolve the artifact file", "File", "artifactFile", "=", "artifactFileResolver", ".", "getArtifactFile", "(", "artifact", ")", ";", "// get the subsystem template from the artifact file", "if", "(", "addSubsystemFileSourceFromZipFile", "(", "subsystem", ",", "artifactFile", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Adds the file source for the specified subsystem, from the specified module's artifacts. @param subsystem @param module @param artifactFileResolver @return true if such subsystem file source was found and added; false otherwise @throws IOException
[ "Adds", "the", "file", "source", "for", "the", "specified", "subsystem", "from", "the", "specified", "module", "s", "artifacts", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/util/ZipFileSubsystemInputStreamSources.java#L138-L154
341
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/pack/model/FeaturePack.java
FeaturePack.getSubsystems
public Set<String> getSubsystems() throws IOException, XMLStreamException { final Set<String> result = new HashSet<>(); for (ConfigFile configFile : description.getConfig().getDomainConfigFiles()) { for (Map<String, SubsystemConfig> subsystems : configFile.getSubsystemConfigs(featurePackFile).values()) { result.addAll(subsystems.keySet()); } } for (ConfigFile configFile : description.getConfig().getStandaloneConfigFiles()) { for (Map<String, SubsystemConfig> subsystems : configFile.getSubsystemConfigs(featurePackFile).values()) { result.addAll(subsystems.keySet()); } } for (ConfigFile configFile : description.getConfig().getHostConfigFiles()) { for (Map<String, SubsystemConfig> subsystems : configFile.getSubsystemConfigs(featurePackFile).values()) { result.addAll(subsystems.keySet()); } } return result; }
java
public Set<String> getSubsystems() throws IOException, XMLStreamException { final Set<String> result = new HashSet<>(); for (ConfigFile configFile : description.getConfig().getDomainConfigFiles()) { for (Map<String, SubsystemConfig> subsystems : configFile.getSubsystemConfigs(featurePackFile).values()) { result.addAll(subsystems.keySet()); } } for (ConfigFile configFile : description.getConfig().getStandaloneConfigFiles()) { for (Map<String, SubsystemConfig> subsystems : configFile.getSubsystemConfigs(featurePackFile).values()) { result.addAll(subsystems.keySet()); } } for (ConfigFile configFile : description.getConfig().getHostConfigFiles()) { for (Map<String, SubsystemConfig> subsystems : configFile.getSubsystemConfigs(featurePackFile).values()) { result.addAll(subsystems.keySet()); } } return result; }
[ "public", "Set", "<", "String", ">", "getSubsystems", "(", ")", "throws", "IOException", ",", "XMLStreamException", "{", "final", "Set", "<", "String", ">", "result", "=", "new", "HashSet", "<>", "(", ")", ";", "for", "(", "ConfigFile", "configFile", ":", "description", ".", "getConfig", "(", ")", ".", "getDomainConfigFiles", "(", ")", ")", "{", "for", "(", "Map", "<", "String", ",", "SubsystemConfig", ">", "subsystems", ":", "configFile", ".", "getSubsystemConfigs", "(", "featurePackFile", ")", ".", "values", "(", ")", ")", "{", "result", ".", "addAll", "(", "subsystems", ".", "keySet", "(", ")", ")", ";", "}", "}", "for", "(", "ConfigFile", "configFile", ":", "description", ".", "getConfig", "(", ")", ".", "getStandaloneConfigFiles", "(", ")", ")", "{", "for", "(", "Map", "<", "String", ",", "SubsystemConfig", ">", "subsystems", ":", "configFile", ".", "getSubsystemConfigs", "(", "featurePackFile", ")", ".", "values", "(", ")", ")", "{", "result", ".", "addAll", "(", "subsystems", ".", "keySet", "(", ")", ")", ";", "}", "}", "for", "(", "ConfigFile", "configFile", ":", "description", ".", "getConfig", "(", ")", ".", "getHostConfigFiles", "(", ")", ")", "{", "for", "(", "Map", "<", "String", ",", "SubsystemConfig", ">", "subsystems", ":", "configFile", ".", "getSubsystemConfigs", "(", "featurePackFile", ")", ".", "values", "(", ")", ")", "{", "result", ".", "addAll", "(", "subsystems", ".", "keySet", "(", ")", ")", ";", "}", "}", "return", "result", ";", "}" ]
Retrieves all subsystems included in the feature pack config files. @return @throws IOException @throws XMLStreamException
[ "Retrieves", "all", "subsystems", "included", "in", "the", "feature", "pack", "config", "files", "." ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/pack/model/FeaturePack.java#L166-L184
342
wildfly/wildfly-build-tools
provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java
StandaloneAetherArtifactFileResolver.getStandardRemoteRepositories
public static List<RemoteRepository> getStandardRemoteRepositories() { final List<RemoteRepository> remoteRepositories = new ArrayList<>(); remoteRepositories.add(new RemoteRepository.Builder("central","default","https://central.maven.org/maven2/").build()); remoteRepositories.add(new RemoteRepository.Builder("jboss-community-repository", "default", "https://repository.jboss.org/nexus/content/groups/public/").build()); return remoteRepositories; }
java
public static List<RemoteRepository> getStandardRemoteRepositories() { final List<RemoteRepository> remoteRepositories = new ArrayList<>(); remoteRepositories.add(new RemoteRepository.Builder("central","default","https://central.maven.org/maven2/").build()); remoteRepositories.add(new RemoteRepository.Builder("jboss-community-repository", "default", "https://repository.jboss.org/nexus/content/groups/public/").build()); return remoteRepositories; }
[ "public", "static", "List", "<", "RemoteRepository", ">", "getStandardRemoteRepositories", "(", ")", "{", "final", "List", "<", "RemoteRepository", ">", "remoteRepositories", "=", "new", "ArrayList", "<>", "(", ")", ";", "remoteRepositories", ".", "add", "(", "new", "RemoteRepository", ".", "Builder", "(", "\"central\"", ",", "\"default\"", ",", "\"https://central.maven.org/maven2/\"", ")", ".", "build", "(", ")", ")", ";", "remoteRepositories", ".", "add", "(", "new", "RemoteRepository", ".", "Builder", "(", "\"jboss-community-repository\"", ",", "\"default\"", ",", "\"https://repository.jboss.org/nexus/content/groups/public/\"", ")", ".", "build", "(", ")", ")", ";", "return", "remoteRepositories", ";", "}" ]
Retrieves the standard remote repositories, i.e., maven central and jboss.org @return
[ "Retrieves", "the", "standard", "remote", "repositories", "i", ".", "e", ".", "maven", "central", "and", "jboss", ".", "org" ]
520a5f2e58e6a24097d63fd65c51a8fc29847a61
https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java#L120-L125
343
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/util/WiQueryUtil.java
WiQueryUtil.getJQueryResourceReference
public static ResourceReference getJQueryResourceReference() { ResourceReference reference; if (Application.exists()) { reference = Application.get().getJavaScriptLibrarySettings().getJQueryReference(); } else { reference = JQueryResourceReference.get(); } return reference; }
java
public static ResourceReference getJQueryResourceReference() { ResourceReference reference; if (Application.exists()) { reference = Application.get().getJavaScriptLibrarySettings().getJQueryReference(); } else { reference = JQueryResourceReference.get(); } return reference; }
[ "public", "static", "ResourceReference", "getJQueryResourceReference", "(", ")", "{", "ResourceReference", "reference", ";", "if", "(", "Application", ".", "exists", "(", ")", ")", "{", "reference", "=", "Application", ".", "get", "(", ")", ".", "getJavaScriptLibrarySettings", "(", ")", ".", "getJQueryReference", "(", ")", ";", "}", "else", "{", "reference", "=", "JQueryResourceReference", ".", "get", "(", ")", ";", "}", "return", "reference", ";", "}" ]
Looks for the jQuery resource reference. First we see if the application knows where it is, in case the user has overriden it. If that fails we use the default resource reference.
[ "Looks", "for", "the", "jQuery", "resource", "reference", ".", "First", "we", "see", "if", "the", "application", "knows", "where", "it", "is", "in", "case", "the", "user", "has", "overriden", "it", ".", "If", "that", "fails", "we", "use", "the", "default", "resource", "reference", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/util/WiQueryUtil.java#L47-L59
344
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/JsScope.java
JsScope.render
@JsonValue public CharSequence render() { if (statement == null) { statement = new StringBuilder(); statement.append("function("); statement.append(scopeContext.scopeDeclaration()); statement.append(") {\n"); execute(scopeContext); statement.append(scopeContext.render()); closeScope(); } return statement.toString(); }
java
@JsonValue public CharSequence render() { if (statement == null) { statement = new StringBuilder(); statement.append("function("); statement.append(scopeContext.scopeDeclaration()); statement.append(") {\n"); execute(scopeContext); statement.append(scopeContext.render()); closeScope(); } return statement.toString(); }
[ "@", "JsonValue", "public", "CharSequence", "render", "(", ")", "{", "if", "(", "statement", "==", "null", ")", "{", "statement", "=", "new", "StringBuilder", "(", ")", ";", "statement", ".", "append", "(", "\"function(\"", ")", ";", "statement", ".", "append", "(", "scopeContext", ".", "scopeDeclaration", "(", ")", ")", ";", "statement", ".", "append", "(", "\") {\\n\"", ")", ";", "execute", "(", "scopeContext", ")", ";", "statement", ".", "append", "(", "scopeContext", ".", "render", "(", ")", ")", ";", "closeScope", "(", ")", ";", "}", "return", "statement", ".", "toString", "(", ")", ";", "}" ]
Renders the scope.
[ "Renders", "the", "scope", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/JsScope.java#L152-L166
345
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/accordion/Accordion.java
Accordion.setIcons
public Accordion setIcons(UiIcon header, UiIcon headerSelected) { setIcons(new AccordionIcon(header, headerSelected)); return this; }
java
public Accordion setIcons(UiIcon header, UiIcon headerSelected) { setIcons(new AccordionIcon(header, headerSelected)); return this; }
[ "public", "Accordion", "setIcons", "(", "UiIcon", "header", ",", "UiIcon", "headerSelected", ")", "{", "setIcons", "(", "new", "AccordionIcon", "(", "header", ",", "headerSelected", ")", ")", ";", "return", "this", ";", "}" ]
Icons to use for headers. @param header @param headerSelected @return instance of the current component
[ "Icons", "to", "use", "for", "headers", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/accordion/Accordion.java#L323-L327
346
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/InlineDatePicker.java
InlineDatePicker.hide
public void hide(AjaxRequestTarget ajaxRequestTarget, short speed) { ajaxRequestTarget.appendJavaScript(this.hide(speed).render().toString()); }
java
public void hide(AjaxRequestTarget ajaxRequestTarget, short speed) { ajaxRequestTarget.appendJavaScript(this.hide(speed).render().toString()); }
[ "public", "void", "hide", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "short", "speed", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "hide", "(", "speed", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to hide the datepicker within the ajax request @param ajaxRequestTarget @param speed The speed at which to close the date picker.
[ "Method", "to", "hide", "the", "datepicker", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/InlineDatePicker.java#L1274-L1277
347
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/InlineDatePicker.java
InlineDatePicker.setDate
public void setDate(AjaxRequestTarget ajaxRequestTarget, DateOption dateOption) { ajaxRequestTarget.appendJavaScript(this.setDate(dateOption).render().toString()); }
java
public void setDate(AjaxRequestTarget ajaxRequestTarget, DateOption dateOption) { ajaxRequestTarget.appendJavaScript(this.setDate(dateOption).render().toString()); }
[ "public", "void", "setDate", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "DateOption", "dateOption", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "setDate", "(", "dateOption", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to set the date of the datepicker within the ajax request @param ajaxRequestTarget @param dateOption Date to set
[ "Method", "to", "set", "the", "date", "of", "the", "datepicker", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/InlineDatePicker.java#L1319-L1322
348
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/autocomplete/Autocomplete.java
Autocomplete.search
public void search(AjaxRequestTarget ajaxRequestTarget, String value) { ajaxRequestTarget.appendJavaScript(this.search(value).render().toString()); }
java
public void search(AjaxRequestTarget ajaxRequestTarget, String value) { ajaxRequestTarget.appendJavaScript(this.search(value).render().toString()); }
[ "public", "void", "search", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "String", "value", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "search", "(", "value", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to search the autocomplete within the ajax request @param ajaxRequestTarget @param value String
[ "Method", "to", "search", "the", "autocomplete", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/autocomplete/Autocomplete.java#L551-L554
349
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/draggable/DraggableContainment.java
DraggableContainment.setArrayParam
public void setArrayParam(Integer x1, Integer y1, Integer x2, Integer y2) { ArrayItemOptions<IntegerItemOptions> tempArrayParam = new ArrayItemOptions<IntegerItemOptions>(); tempArrayParam.add(new IntegerItemOptions(x1)); tempArrayParam.add(new IntegerItemOptions(y1)); tempArrayParam.add(new IntegerItemOptions(x2)); tempArrayParam.add(new IntegerItemOptions(y2)); setParam(tempArrayParam, containmentEnumParam, null, null); }
java
public void setArrayParam(Integer x1, Integer y1, Integer x2, Integer y2) { ArrayItemOptions<IntegerItemOptions> tempArrayParam = new ArrayItemOptions<IntegerItemOptions>(); tempArrayParam.add(new IntegerItemOptions(x1)); tempArrayParam.add(new IntegerItemOptions(y1)); tempArrayParam.add(new IntegerItemOptions(x2)); tempArrayParam.add(new IntegerItemOptions(y2)); setParam(tempArrayParam, containmentEnumParam, null, null); }
[ "public", "void", "setArrayParam", "(", "Integer", "x1", ",", "Integer", "y1", ",", "Integer", "x2", ",", "Integer", "y2", ")", "{", "ArrayItemOptions", "<", "IntegerItemOptions", ">", "tempArrayParam", "=", "new", "ArrayItemOptions", "<", "IntegerItemOptions", ">", "(", ")", ";", "tempArrayParam", ".", "add", "(", "new", "IntegerItemOptions", "(", "x1", ")", ")", ";", "tempArrayParam", ".", "add", "(", "new", "IntegerItemOptions", "(", "y1", ")", ")", ";", "tempArrayParam", ".", "add", "(", "new", "IntegerItemOptions", "(", "x2", ")", ")", ";", "tempArrayParam", ".", "add", "(", "new", "IntegerItemOptions", "(", "y2", ")", ")", ";", "setParam", "(", "tempArrayParam", ",", "containmentEnumParam", ",", "null", ",", "null", ")", ";", "}" ]
Set's the array parameter @param x1 First x coordinate @param y1 First y coordinate @param x2 Second x coordinate @param y2 Second y coordinate
[ "Set", "s", "the", "array", "parameter" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/draggable/DraggableContainment.java#L256-L266
350
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.parseInteger
private int parseInteger(String value, int defaultValue) { try { return Integer.parseInt(value); } catch (NumberFormatException e) { return defaultValue; } }
java
private int parseInteger(String value, int defaultValue) { try { return Integer.parseInt(value); } catch (NumberFormatException e) { return defaultValue; } }
[ "private", "int", "parseInteger", "(", "String", "value", ",", "int", "defaultValue", ")", "{", "try", "{", "return", "Integer", ".", "parseInt", "(", "value", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "defaultValue", ";", "}", "}" ]
Parses an integer. @param value The value to parse. @return The parsed integer.
[ "Parses", "an", "integer", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L278-L288
351
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.setAjaxBeforeLoadEvent
public Tabs setAjaxBeforeLoadEvent(ITabsAjaxEvent beforeLoadEvent) { this.ajaxEvents.put(TabEvent.beforeLoad, beforeLoadEvent); setBeforeLoadEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.beforeLoad)); return this; }
java
public Tabs setAjaxBeforeLoadEvent(ITabsAjaxEvent beforeLoadEvent) { this.ajaxEvents.put(TabEvent.beforeLoad, beforeLoadEvent); setBeforeLoadEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.beforeLoad)); return this; }
[ "public", "Tabs", "setAjaxBeforeLoadEvent", "(", "ITabsAjaxEvent", "beforeLoadEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "TabEvent", ".", "beforeLoad", ",", "beforeLoadEvent", ")", ";", "setBeforeLoadEvent", "(", "new", "TabsAjaxJsScopeUiEvent", "(", "this", ",", "TabEvent", ".", "beforeLoad", ")", ")", ";", "return", "this", ";", "}" ]
Sets the call-back for the AJAX beforeLoad event. @param beforeLoadEvent The ITabsAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "beforeLoad", "event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L564-L569
352
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.setAjaxLoadEvent
public Tabs setAjaxLoadEvent(ITabsAjaxEvent loadEvent) { this.ajaxEvents.put(TabEvent.load, loadEvent); setLoadEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.load)); return this; }
java
public Tabs setAjaxLoadEvent(ITabsAjaxEvent loadEvent) { this.ajaxEvents.put(TabEvent.load, loadEvent); setLoadEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.load)); return this; }
[ "public", "Tabs", "setAjaxLoadEvent", "(", "ITabsAjaxEvent", "loadEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "TabEvent", ".", "load", ",", "loadEvent", ")", ";", "setLoadEvent", "(", "new", "TabsAjaxJsScopeUiEvent", "(", "this", ",", "TabEvent", ".", "load", ")", ")", ";", "return", "this", ";", "}" ]
Sets the call-back for the AJAX Load event. @param loadEvent The ITabsAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "Load", "event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L589-L594
353
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.setAjaxBeforeActivateEvent
public Tabs setAjaxBeforeActivateEvent(ITabsAjaxEvent beforeActivateEvent) { this.ajaxEvents.put(TabEvent.beforeActivate, beforeActivateEvent); setBeforeActivateEvent(new TabsAjaxBeforeActivateJsScopeUiEvent(this, TabEvent.beforeActivate, false)); return this; }
java
public Tabs setAjaxBeforeActivateEvent(ITabsAjaxEvent beforeActivateEvent) { this.ajaxEvents.put(TabEvent.beforeActivate, beforeActivateEvent); setBeforeActivateEvent(new TabsAjaxBeforeActivateJsScopeUiEvent(this, TabEvent.beforeActivate, false)); return this; }
[ "public", "Tabs", "setAjaxBeforeActivateEvent", "(", "ITabsAjaxEvent", "beforeActivateEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "TabEvent", ".", "beforeActivate", ",", "beforeActivateEvent", ")", ";", "setBeforeActivateEvent", "(", "new", "TabsAjaxBeforeActivateJsScopeUiEvent", "(", "this", ",", "TabEvent", ".", "beforeActivate", ",", "false", ")", ")", ";", "return", "this", ";", "}" ]
Sets the call-back for the AJAX beforeActivate event. @param beforeActivateEvent The ITabsAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "beforeActivate", "event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L614-L619
354
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.setAjaxActivateEvent
public Tabs setAjaxActivateEvent(ITabsAjaxEvent activateEvent) { this.ajaxEvents.put(TabEvent.activate, activateEvent); setActivateEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.activate)); return this; }
java
public Tabs setAjaxActivateEvent(ITabsAjaxEvent activateEvent) { this.ajaxEvents.put(TabEvent.activate, activateEvent); setActivateEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.activate)); return this; }
[ "public", "Tabs", "setAjaxActivateEvent", "(", "ITabsAjaxEvent", "activateEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "TabEvent", ".", "activate", ",", "activateEvent", ")", ";", "setActivateEvent", "(", "new", "TabsAjaxJsScopeUiEvent", "(", "this", ",", "TabEvent", ".", "activate", ")", ")", ";", "return", "this", ";", "}" ]
Sets the call-back for the AJAX activate event. @param activateEvent The ITabsAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "activate", "event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L654-L659
355
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.disable
public void disable(AjaxRequestTarget ajaxRequestTarget, int index) { ajaxRequestTarget.appendJavaScript(this.disable(index).render().toString()); }
java
public void disable(AjaxRequestTarget ajaxRequestTarget, int index) { ajaxRequestTarget.appendJavaScript(this.disable(index).render().toString()); }
[ "public", "void", "disable", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "int", "index", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "disable", "(", "index", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to disable a tab within the ajax request @param index Index tab to disable @param ajaxRequestTarget
[ "Method", "to", "disable", "a", "tab", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L722-L725
356
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.enable
public void enable(AjaxRequestTarget ajaxRequestTarget, int index) { ajaxRequestTarget.appendJavaScript(this.enable(index).render().toString()); }
java
public void enable(AjaxRequestTarget ajaxRequestTarget, int index) { ajaxRequestTarget.appendJavaScript(this.enable(index).render().toString()); }
[ "public", "void", "enable", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "int", "index", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "enable", "(", "index", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to enable a tab within the ajax request @param index Index tab to enable @param ajaxRequestTarget
[ "Method", "to", "enable", "a", "tab", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L766-L769
357
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
Tabs.load
public void load(AjaxRequestTarget ajaxRequestTarget, int index) { ajaxRequestTarget.appendJavaScript(this.load(index).render().toString()); }
java
public void load(AjaxRequestTarget ajaxRequestTarget, int index) { ajaxRequestTarget.appendJavaScript(this.load(index).render().toString()); }
[ "public", "void", "load", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "int", "index", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "load", "(", "index", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to reload the content of an Ajax tab programmatically within the ajax request @param index Index tab to select @param ajaxRequestTarget
[ "Method", "to", "reload", "the", "content", "of", "an", "Ajax", "tab", "programmatically", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L791-L794
358
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePickerOptions.java
DatePickerOptions.getNumberOfMonths
public DatePickerNumberOfMonths getNumberOfMonths() { IComplexOption numberOfMonths = getComplexOption("numberOfMonths"); if (numberOfMonths != null && numberOfMonths instanceof DatePickerNumberOfMonths) { return (DatePickerNumberOfMonths) numberOfMonths; } return new DatePickerNumberOfMonths(new Short("1")); }
java
public DatePickerNumberOfMonths getNumberOfMonths() { IComplexOption numberOfMonths = getComplexOption("numberOfMonths"); if (numberOfMonths != null && numberOfMonths instanceof DatePickerNumberOfMonths) { return (DatePickerNumberOfMonths) numberOfMonths; } return new DatePickerNumberOfMonths(new Short("1")); }
[ "public", "DatePickerNumberOfMonths", "getNumberOfMonths", "(", ")", "{", "IComplexOption", "numberOfMonths", "=", "getComplexOption", "(", "\"numberOfMonths\"", ")", ";", "if", "(", "numberOfMonths", "!=", "null", "&&", "numberOfMonths", "instanceof", "DatePickerNumberOfMonths", ")", "{", "return", "(", "DatePickerNumberOfMonths", ")", "numberOfMonths", ";", "}", "return", "new", "DatePickerNumberOfMonths", "(", "new", "Short", "(", "\"1\"", ")", ")", ";", "}" ]
Returns the number of months displayed on the date picker.
[ "Returns", "the", "number", "of", "months", "displayed", "on", "the", "date", "picker", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePickerOptions.java#L707-L717
359
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePickerOptions.java
DatePickerOptions.getShortYearCutoff
public DatePickerShortYearCutOff getShortYearCutoff() { IComplexOption shortYearCutoff = getComplexOption("shortYearCutoff"); if (shortYearCutoff != null && shortYearCutoff instanceof DatePickerShortYearCutOff) { return (DatePickerShortYearCutOff) shortYearCutoff; } return new DatePickerShortYearCutOff("+10"); }
java
public DatePickerShortYearCutOff getShortYearCutoff() { IComplexOption shortYearCutoff = getComplexOption("shortYearCutoff"); if (shortYearCutoff != null && shortYearCutoff instanceof DatePickerShortYearCutOff) { return (DatePickerShortYearCutOff) shortYearCutoff; } return new DatePickerShortYearCutOff("+10"); }
[ "public", "DatePickerShortYearCutOff", "getShortYearCutoff", "(", ")", "{", "IComplexOption", "shortYearCutoff", "=", "getComplexOption", "(", "\"shortYearCutoff\"", ")", ";", "if", "(", "shortYearCutoff", "!=", "null", "&&", "shortYearCutoff", "instanceof", "DatePickerShortYearCutOff", ")", "{", "return", "(", "DatePickerShortYearCutOff", ")", "shortYearCutoff", ";", "}", "return", "new", "DatePickerShortYearCutOff", "(", "\"+10\"", ")", ";", "}" ]
Returns the shortYearCutoff option value.
[ "Returns", "the", "shortYearCutoff", "option", "value", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePickerOptions.java#L777-L787
360
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/themes/ThemeUiHelper.java
ThemeUiHelper.hover
public static void hover(Component component, AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(hover(component).render().toString()); }
java
public static void hover(Component component, AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(hover(component).render().toString()); }
[ "public", "static", "void", "hover", "(", "Component", "component", ",", "AjaxRequestTarget", "ajaxRequestTarget", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "hover", "(", "component", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to insert the the hover style into the Ajax transaction @param component Wicket component @param ajaxRequestTarget Ajax transaction
[ "Method", "to", "insert", "the", "the", "hover", "style", "into", "the", "Ajax", "transaction" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/themes/ThemeUiHelper.java#L332-L335
361
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java
Options.getJavaScriptOptions
public CharSequence getJavaScriptOptions() { StringBuilder sb = new StringBuilder(); this.optionsRenderer.renderBefore(sb); int count = 0; for (Entry<String, Object> entry : options.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof IModelOption< ? >) value = ((IModelOption< ? >) value).wrapOnAssignment(owner); boolean isLast = !(count < options.size() - 1); if (value instanceof JsScope) { // Case of a JsScope sb.append(this.optionsRenderer.renderOption(key, ((JsScope) value).render(), isLast)); } else if (value instanceof ICollectionItemOptions) { // Case of an ICollectionItemOptions sb.append(this.optionsRenderer.renderOption(key, ((ICollectionItemOptions) value).getJavascriptOption(), isLast)); } else if (value instanceof IComplexOption) { // Case of an IComplexOption sb.append(this.optionsRenderer.renderOption(key, ((IComplexOption) value).getJavascriptOption(), isLast)); } else if (value instanceof ITypedOption< ? >) { // Case of an ITypedOption sb.append(this.optionsRenderer.renderOption(key, ((ITypedOption< ? >) value).getJavascriptOption(), isLast)); } else { // Other cases sb.append(this.optionsRenderer.renderOption(key, value, isLast)); } count++; } this.optionsRenderer.renderAfter(sb); return sb; }
java
public CharSequence getJavaScriptOptions() { StringBuilder sb = new StringBuilder(); this.optionsRenderer.renderBefore(sb); int count = 0; for (Entry<String, Object> entry : options.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof IModelOption< ? >) value = ((IModelOption< ? >) value).wrapOnAssignment(owner); boolean isLast = !(count < options.size() - 1); if (value instanceof JsScope) { // Case of a JsScope sb.append(this.optionsRenderer.renderOption(key, ((JsScope) value).render(), isLast)); } else if (value instanceof ICollectionItemOptions) { // Case of an ICollectionItemOptions sb.append(this.optionsRenderer.renderOption(key, ((ICollectionItemOptions) value).getJavascriptOption(), isLast)); } else if (value instanceof IComplexOption) { // Case of an IComplexOption sb.append(this.optionsRenderer.renderOption(key, ((IComplexOption) value).getJavascriptOption(), isLast)); } else if (value instanceof ITypedOption< ? >) { // Case of an ITypedOption sb.append(this.optionsRenderer.renderOption(key, ((ITypedOption< ? >) value).getJavascriptOption(), isLast)); } else { // Other cases sb.append(this.optionsRenderer.renderOption(key, value, isLast)); } count++; } this.optionsRenderer.renderAfter(sb); return sb; }
[ "public", "CharSequence", "getJavaScriptOptions", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "this", ".", "optionsRenderer", ".", "renderBefore", "(", "sb", ")", ";", "int", "count", "=", "0", ";", "for", "(", "Entry", "<", "String", ",", "Object", ">", "entry", ":", "options", ".", "entrySet", "(", ")", ")", "{", "String", "key", "=", "entry", ".", "getKey", "(", ")", ";", "Object", "value", "=", "entry", ".", "getValue", "(", ")", ";", "if", "(", "value", "instanceof", "IModelOption", "<", "?", ">", ")", "value", "=", "(", "(", "IModelOption", "<", "?", ">", ")", "value", ")", ".", "wrapOnAssignment", "(", "owner", ")", ";", "boolean", "isLast", "=", "!", "(", "count", "<", "options", ".", "size", "(", ")", "-", "1", ")", ";", "if", "(", "value", "instanceof", "JsScope", ")", "{", "// Case of a JsScope", "sb", ".", "append", "(", "this", ".", "optionsRenderer", ".", "renderOption", "(", "key", ",", "(", "(", "JsScope", ")", "value", ")", ".", "render", "(", ")", ",", "isLast", ")", ")", ";", "}", "else", "if", "(", "value", "instanceof", "ICollectionItemOptions", ")", "{", "// Case of an ICollectionItemOptions", "sb", ".", "append", "(", "this", ".", "optionsRenderer", ".", "renderOption", "(", "key", ",", "(", "(", "ICollectionItemOptions", ")", "value", ")", ".", "getJavascriptOption", "(", ")", ",", "isLast", ")", ")", ";", "}", "else", "if", "(", "value", "instanceof", "IComplexOption", ")", "{", "// Case of an IComplexOption", "sb", ".", "append", "(", "this", ".", "optionsRenderer", ".", "renderOption", "(", "key", ",", "(", "(", "IComplexOption", ")", "value", ")", ".", "getJavascriptOption", "(", ")", ",", "isLast", ")", ")", ";", "}", "else", "if", "(", "value", "instanceof", "ITypedOption", "<", "?", ">", ")", "{", "// Case of an ITypedOption", "sb", ".", "append", "(", "this", ".", "optionsRenderer", ".", "renderOption", "(", "key", ",", "(", "(", "ITypedOption", "<", "?", ">", ")", "value", ")", ".", "getJavascriptOption", "(", ")", ",", "isLast", ")", ")", ";", "}", "else", "{", "// Other cases", "sb", ".", "append", "(", "this", ".", "optionsRenderer", ".", "renderOption", "(", "key", ",", "value", ",", "isLast", ")", ")", ";", "}", "count", "++", ";", "}", "this", ".", "optionsRenderer", ".", "renderAfter", "(", "sb", ")", ";", "return", "sb", ";", "}" ]
Returns the JavaScript statement corresponding to options.
[ "Returns", "the", "JavaScript", "statement", "corresponding", "to", "options", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java#L216-L260
362
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java
Slider.setAnimate
public Slider setAnimate(AnimateEnum animate) { if (animate.equals(AnimateEnum.FAST)) this.options.put("animate", SliderAnimate.FAST); else if (animate.equals(AnimateEnum.NORMAL)) this.options.put("animate", SliderAnimate.NORMAL); else if (animate.equals(AnimateEnum.SLOW)) this.options.put("animate", SliderAnimate.SLOW); else unsetAnimate(); return this; }
java
public Slider setAnimate(AnimateEnum animate) { if (animate.equals(AnimateEnum.FAST)) this.options.put("animate", SliderAnimate.FAST); else if (animate.equals(AnimateEnum.NORMAL)) this.options.put("animate", SliderAnimate.NORMAL); else if (animate.equals(AnimateEnum.SLOW)) this.options.put("animate", SliderAnimate.SLOW); else unsetAnimate(); return this; }
[ "public", "Slider", "setAnimate", "(", "AnimateEnum", "animate", ")", "{", "if", "(", "animate", ".", "equals", "(", "AnimateEnum", ".", "FAST", ")", ")", "this", ".", "options", ".", "put", "(", "\"animate\"", ",", "SliderAnimate", ".", "FAST", ")", ";", "else", "if", "(", "animate", ".", "equals", "(", "AnimateEnum", ".", "NORMAL", ")", ")", "this", ".", "options", ".", "put", "(", "\"animate\"", ",", "SliderAnimate", ".", "NORMAL", ")", ";", "else", "if", "(", "animate", ".", "equals", "(", "AnimateEnum", ".", "SLOW", ")", ")", "this", ".", "options", ".", "put", "(", "\"animate\"", ",", "SliderAnimate", ".", "SLOW", ")", ";", "else", "unsetAnimate", "(", ")", ";", "return", "this", ";", "}" ]
Whether to slide handle smoothly when user click outside handle on the bar. Sets the animate using enum constants. @param animate @return instance of the current component
[ "Whether", "to", "slide", "handle", "smoothly", "when", "user", "click", "outside", "handle", "on", "the", "bar", ".", "Sets", "the", "animate", "using", "enum", "constants", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java#L160-L171
363
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java
Slider.setAnimate
public Slider setAnimate(Number number) { if (number != null && number.doubleValue() > 0) this.options.put("animate", new SliderAnimate(number)); return this; }
java
public Slider setAnimate(Number number) { if (number != null && number.doubleValue() > 0) this.options.put("animate", new SliderAnimate(number)); return this; }
[ "public", "Slider", "setAnimate", "(", "Number", "number", ")", "{", "if", "(", "number", "!=", "null", "&&", "number", ".", "doubleValue", "(", ")", ">", "0", ")", "this", ".", "options", ".", "put", "(", "\"animate\"", ",", "new", "SliderAnimate", "(", "number", ")", ")", ";", "return", "this", ";", "}" ]
Whether to slide handle smoothly when user click outside handle on the bar. @param number A number bigger than 0. @return instance of the current component
[ "Whether", "to", "slide", "handle", "smoothly", "when", "user", "click", "outside", "handle", "on", "the", "bar", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java#L180-L185
364
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java
Slider.setValues
public Slider setValues(Integer value1, Integer value2) { if (value1 != null && value2 != null) { ArrayItemOptions<IntegerItemOptions> options = new ArrayItemOptions<IntegerItemOptions>(); options.add(new IntegerItemOptions(value1)); options.add(new IntegerItemOptions(value2)); this.options.put("values", options); } return this; }
java
public Slider setValues(Integer value1, Integer value2) { if (value1 != null && value2 != null) { ArrayItemOptions<IntegerItemOptions> options = new ArrayItemOptions<IntegerItemOptions>(); options.add(new IntegerItemOptions(value1)); options.add(new IntegerItemOptions(value2)); this.options.put("values", options); } return this; }
[ "public", "Slider", "setValues", "(", "Integer", "value1", ",", "Integer", "value2", ")", "{", "if", "(", "value1", "!=", "null", "&&", "value2", "!=", "null", ")", "{", "ArrayItemOptions", "<", "IntegerItemOptions", ">", "options", "=", "new", "ArrayItemOptions", "<", "IntegerItemOptions", ">", "(", ")", ";", "options", ".", "add", "(", "new", "IntegerItemOptions", "(", "value1", ")", ")", ";", "options", ".", "add", "(", "new", "IntegerItemOptions", "(", "value2", ")", ")", ";", "this", ".", "options", ".", "put", "(", "\"values\"", ",", "options", ")", ";", "}", "return", "this", ";", "}" ]
This option can be used to specify multiple handles. If range is set to true, the length of 'values' should be 2. @param value1 @param value2 @return instance of the current component
[ "This", "option", "can", "be", "used", "to", "specify", "multiple", "handles", ".", "If", "range", "is", "set", "to", "true", "the", "length", "of", "values", "should", "be", "2", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java#L428-L439
365
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java
Slider.value
public void value(AjaxRequestTarget ajaxRequestTarget, int value) { ajaxRequestTarget.appendJavaScript(this.value(value).render().toString()); }
java
public void value(AjaxRequestTarget ajaxRequestTarget, int value) { ajaxRequestTarget.appendJavaScript(this.value(value).render().toString()); }
[ "public", "void", "value", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "int", "value", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "value", "(", "value", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to set the current value of the slider within the ajax request @param ajaxRequestTarget @param value
[ "Method", "to", "set", "the", "current", "value", "of", "the", "slider", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java#L585-L588
366
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java
Slider.values
public void values(AjaxRequestTarget ajaxRequestTarget, int index, int value) { ajaxRequestTarget.appendJavaScript(this.values(index, value).render().toString()); }
java
public void values(AjaxRequestTarget ajaxRequestTarget, int index, int value) { ajaxRequestTarget.appendJavaScript(this.values(index, value).render().toString()); }
[ "public", "void", "values", "(", "AjaxRequestTarget", "ajaxRequestTarget", ",", "int", "index", ",", "int", "value", ")", "{", "ajaxRequestTarget", ".", "appendJavaScript", "(", "this", ".", "values", "(", "index", ",", "value", ")", ".", "render", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
Method to set the current values of the slider within the ajax request @param ajaxRequestTarget @param index @param value
[ "Method", "to", "set", "the", "current", "values", "of", "the", "slider", "within", "the", "ajax", "request" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java#L630-L633
367
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/dialog/util/DialogUtilsBehavior.java
DialogUtilsBehavior.simpleDialog
public JsStatement simpleDialog(String title, String message) { JsStatement statement = new JsStatement(); statement.append("$.ui.dialog.wiquery.simpleDialog("); statement.append("" + Session.get().nextSequenceValue() + ", "); statement.append(DialogUtilsLanguages.getDialogUtilsLiteral(DialogUtilsLanguages .getDialogUtilsLanguages(getLocale())) + ", "); statement.append(JsUtils.quotes(title, true) + ", "); statement.append(JsUtils.doubleQuotes(message, true) + ")"); return statement; }
java
public JsStatement simpleDialog(String title, String message) { JsStatement statement = new JsStatement(); statement.append("$.ui.dialog.wiquery.simpleDialog("); statement.append("" + Session.get().nextSequenceValue() + ", "); statement.append(DialogUtilsLanguages.getDialogUtilsLiteral(DialogUtilsLanguages .getDialogUtilsLanguages(getLocale())) + ", "); statement.append(JsUtils.quotes(title, true) + ", "); statement.append(JsUtils.doubleQuotes(message, true) + ")"); return statement; }
[ "public", "JsStatement", "simpleDialog", "(", "String", "title", ",", "String", "message", ")", "{", "JsStatement", "statement", "=", "new", "JsStatement", "(", ")", ";", "statement", ".", "append", "(", "\"$.ui.dialog.wiquery.simpleDialog(\"", ")", ";", "statement", ".", "append", "(", "\"\"", "+", "Session", ".", "get", "(", ")", ".", "nextSequenceValue", "(", ")", "+", "\", \"", ")", ";", "statement", ".", "append", "(", "DialogUtilsLanguages", ".", "getDialogUtilsLiteral", "(", "DialogUtilsLanguages", ".", "getDialogUtilsLanguages", "(", "getLocale", "(", ")", ")", ")", "+", "\", \"", ")", ";", "statement", ".", "append", "(", "JsUtils", ".", "quotes", "(", "title", ",", "true", ")", "+", "\", \"", ")", ";", "statement", ".", "append", "(", "JsUtils", ".", "doubleQuotes", "(", "message", ",", "true", ")", "+", "\")\"", ")", ";", "return", "statement", ";", "}" ]
Method creating a simple dialog @param title Title @param message Message @return the required {@link JsStatement}
[ "Method", "creating", "a", "simple", "dialog" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/dialog/util/DialogUtilsBehavior.java#L372-L383
368
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/dialog/util/DialogUtilsBehavior.java
DialogUtilsBehavior.warningDialog
public JsStatement warningDialog(String message) { JsStatement statement = new JsStatement(); statement.append("$.ui.dialog.wiquery.warningDialog("); statement.append("" + Session.get().nextSequenceValue() + ", "); statement.append(DialogUtilsLanguages.getDialogUtilsLiteral(DialogUtilsLanguages .getDialogUtilsLanguages(getLocale())) + ", "); statement.append(JsUtils.doubleQuotes(message, true) + ", "); statement.append(JsUtils.quotes(RequestCycle.get().urlFor(WARNING_IMG, null)) + ")"); return statement; }
java
public JsStatement warningDialog(String message) { JsStatement statement = new JsStatement(); statement.append("$.ui.dialog.wiquery.warningDialog("); statement.append("" + Session.get().nextSequenceValue() + ", "); statement.append(DialogUtilsLanguages.getDialogUtilsLiteral(DialogUtilsLanguages .getDialogUtilsLanguages(getLocale())) + ", "); statement.append(JsUtils.doubleQuotes(message, true) + ", "); statement.append(JsUtils.quotes(RequestCycle.get().urlFor(WARNING_IMG, null)) + ")"); return statement; }
[ "public", "JsStatement", "warningDialog", "(", "String", "message", ")", "{", "JsStatement", "statement", "=", "new", "JsStatement", "(", ")", ";", "statement", ".", "append", "(", "\"$.ui.dialog.wiquery.warningDialog(\"", ")", ";", "statement", ".", "append", "(", "\"\"", "+", "Session", ".", "get", "(", ")", ".", "nextSequenceValue", "(", ")", "+", "\", \"", ")", ";", "statement", ".", "append", "(", "DialogUtilsLanguages", ".", "getDialogUtilsLiteral", "(", "DialogUtilsLanguages", ".", "getDialogUtilsLanguages", "(", "getLocale", "(", ")", ")", ")", "+", "\", \"", ")", ";", "statement", ".", "append", "(", "JsUtils", ".", "doubleQuotes", "(", "message", ",", "true", ")", "+", "\", \"", ")", ";", "statement", ".", "append", "(", "JsUtils", ".", "quotes", "(", "RequestCycle", ".", "get", "(", ")", ".", "urlFor", "(", "WARNING_IMG", ",", "null", ")", ")", "+", "\")\"", ")", ";", "return", "statement", ";", "}" ]
Method creating a warning Dialog @param message Message @return a {@link JsStatement}
[ "Method", "creating", "a", "warning", "Dialog" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/dialog/util/DialogUtilsBehavior.java#L416-L427
369
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
AjaxSlider.setAjaxStopEvent
public void setAjaxStopEvent(ISliderAjaxEvent ajaxStopEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxStopEvent, ajaxStopEvent); setStopEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxStopEvent)); }
java
public void setAjaxStopEvent(ISliderAjaxEvent ajaxStopEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxStopEvent, ajaxStopEvent); setStopEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxStopEvent)); }
[ "public", "void", "setAjaxStopEvent", "(", "ISliderAjaxEvent", "ajaxStopEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "SliderAjaxEvent", ".", "ajaxStopEvent", ",", "ajaxStopEvent", ")", ";", "setStopEvent", "(", "new", "SliderAjaxJsScopeUiEvent", "(", "this", ",", "SliderAjaxEvent", ".", "ajaxStopEvent", ")", ")", ";", "}" ]
Sets the call-back for the AJAX stop event. @param ajaxStopEvent The ISliderAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "stop", "event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java#L294-L298
370
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
AjaxSlider.setAjaxSlideEvent
public void setAjaxSlideEvent(ISliderAjaxEvent ajaxSlideEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxSlideEvent, ajaxSlideEvent); setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxSlideEvent)); }
java
public void setAjaxSlideEvent(ISliderAjaxEvent ajaxSlideEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxSlideEvent, ajaxSlideEvent); setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxSlideEvent)); }
[ "public", "void", "setAjaxSlideEvent", "(", "ISliderAjaxEvent", "ajaxSlideEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "SliderAjaxEvent", ".", "ajaxSlideEvent", ",", "ajaxSlideEvent", ")", ";", "setSlideEvent", "(", "new", "SliderAjaxJsScopeUiEvent", "(", "this", ",", "SliderAjaxEvent", ".", "ajaxSlideEvent", ")", ")", ";", "}" ]
Sets the call-back for the AJAX Slide Event. @param ajaxSlideEvent The ISliderAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "Slide", "Event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java#L306-L310
371
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
AjaxSlider.setAjaxStartEvent
public void setAjaxStartEvent(ISliderAjaxEvent ajaxStartEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxStartEvent, ajaxStartEvent); setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxStartEvent)); }
java
public void setAjaxStartEvent(ISliderAjaxEvent ajaxStartEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxStartEvent, ajaxStartEvent); setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxStartEvent)); }
[ "public", "void", "setAjaxStartEvent", "(", "ISliderAjaxEvent", "ajaxStartEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "SliderAjaxEvent", ".", "ajaxStartEvent", ",", "ajaxStartEvent", ")", ";", "setSlideEvent", "(", "new", "SliderAjaxJsScopeUiEvent", "(", "this", ",", "SliderAjaxEvent", ".", "ajaxStartEvent", ")", ")", ";", "}" ]
Sets the call-back for the AJAX Start Event. @param ajaxStartEvent The ISliderAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "Start", "Event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java#L318-L322
372
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
AjaxSlider.setAjaxChangeEvent
public void setAjaxChangeEvent(ISliderAjaxEvent ajaxChangeEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxChangeEvent, ajaxChangeEvent); setChangeEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxChangeEvent)); }
java
public void setAjaxChangeEvent(ISliderAjaxEvent ajaxChangeEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxChangeEvent, ajaxChangeEvent); setChangeEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxChangeEvent)); }
[ "public", "void", "setAjaxChangeEvent", "(", "ISliderAjaxEvent", "ajaxChangeEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "SliderAjaxEvent", ".", "ajaxChangeEvent", ",", "ajaxChangeEvent", ")", ";", "setChangeEvent", "(", "new", "SliderAjaxJsScopeUiEvent", "(", "this", ",", "SliderAjaxEvent", ".", "ajaxChangeEvent", ")", ")", ";", "}" ]
Sets the call-back for the AJAX Change Event. @param ajaxChangeEvent
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "Change", "Event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java#L329-L333
373
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/draggable/DraggableBehavior.java
DraggableBehavior.getSnapMode
public SnapModeEnum getSnapMode() { String literal = options.getLiteral("snapMode"); return literal == null ? SnapModeEnum.BOTH : SnapModeEnum.valueOf(literal.toUpperCase()); }
java
public SnapModeEnum getSnapMode() { String literal = options.getLiteral("snapMode"); return literal == null ? SnapModeEnum.BOTH : SnapModeEnum.valueOf(literal.toUpperCase()); }
[ "public", "SnapModeEnum", "getSnapMode", "(", ")", "{", "String", "literal", "=", "options", ".", "getLiteral", "(", "\"snapMode\"", ")", ";", "return", "literal", "==", "null", "?", "SnapModeEnum", ".", "BOTH", ":", "SnapModeEnum", ".", "valueOf", "(", "literal", ".", "toUpperCase", "(", ")", ")", ";", "}" ]
Returns the snapMode option
[ "Returns", "the", "snapMode", "option" ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/draggable/DraggableBehavior.java#L851-L855
374
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.blur
public static ChainableStatement blur(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.BLUR.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement blur(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.BLUR.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "blur", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "StateEvent", ".", "BLUR", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the blur event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "blur", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L77-L80
375
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.change
public static ChainableStatement change(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.CHANGE.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement change(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.CHANGE.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "change", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "StateEvent", ".", "CHANGE", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the change event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "change", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L99-L102
376
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.click
public static ChainableStatement click(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.CLICK.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement click(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.CLICK.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "click", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "CLICK", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the click event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "click", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L121-L124
377
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.dblclick
public static ChainableStatement dblclick(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.DBLCLICK.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement dblclick(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.DBLCLICK.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "dblclick", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "DBLCLICK", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the dblclick event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "dblclick", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L143-L146
378
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.die
public static ChainableStatement die(EventLabel eventLabel, JsScope jsScope) { return new DefaultChainableStatement("die", JsUtils.quotes(eventLabel.getEventLabel()), jsScope.render()); }
java
public static ChainableStatement die(EventLabel eventLabel, JsScope jsScope) { return new DefaultChainableStatement("die", JsUtils.quotes(eventLabel.getEventLabel()), jsScope.render()); }
[ "public", "static", "ChainableStatement", "die", "(", "EventLabel", "eventLabel", ",", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "\"die\"", ",", "JsUtils", ".", "quotes", "(", "eventLabel", ".", "getEventLabel", "(", ")", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
This does the opposite of live, it removes a bound live event. @param eventLabel Event @param jsScope Scope to use @return the jQuery code
[ "This", "does", "the", "opposite", "of", "live", "it", "removes", "a", "bound", "live", "event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L157-L161
379
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.error
public static ChainableStatement error(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.ERROR.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement error(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.ERROR.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "error", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "StateEvent", ".", "ERROR", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the error event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "error", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L180-L183
380
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.focus
public static ChainableStatement focus(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.FOCUS.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement focus(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.FOCUS.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "focus", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "StateEvent", ".", "FOCUS", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the focus event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "focus", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L202-L205
381
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.keydown
public static ChainableStatement keydown(JsScope jsScope) { return new DefaultChainableStatement(KeyboardEvent.KEYDOWN.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement keydown(JsScope jsScope) { return new DefaultChainableStatement(KeyboardEvent.KEYDOWN.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "keydown", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "KeyboardEvent", ".", "KEYDOWN", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the keydown event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "keydown", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L239-L243
382
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.keypress
public static ChainableStatement keypress(JsScope jsScope) { return new DefaultChainableStatement(KeyboardEvent.KEYPRESS.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement keypress(JsScope jsScope) { return new DefaultChainableStatement(KeyboardEvent.KEYPRESS.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "keypress", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "KeyboardEvent", ".", "KEYPRESS", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the keypress event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "keypress", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L262-L266
383
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.keyup
public static ChainableStatement keyup(JsScope jsScope) { return new DefaultChainableStatement(KeyboardEvent.KEYUP.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement keyup(JsScope jsScope) { return new DefaultChainableStatement(KeyboardEvent.KEYUP.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "keyup", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "KeyboardEvent", ".", "KEYUP", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the keyup event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "keyup", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L285-L288
384
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.load
public static ChainableStatement load(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.LOAD.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement load(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.LOAD.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "load", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "StateEvent", ".", "LOAD", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the load event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "load", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L313-L316
385
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.mousedown
public static ChainableStatement mousedown(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEDOWN.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement mousedown(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEDOWN.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "mousedown", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "MOUSEDOWN", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the mousedown event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "mousedown", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L325-L328
386
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.mouseenter
public static ChainableStatement mouseenter(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEENTER.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement mouseenter(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEENTER.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "mouseenter", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "MOUSEENTER", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the mouseenter event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "mouseenter", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L337-L341
387
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.mouseleave
public static ChainableStatement mouseleave(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSELEAVE.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement mouseleave(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSELEAVE.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "mouseleave", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "MOUSELEAVE", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the mouseleave event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "mouseleave", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L350-L354
388
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.mousemove
public static ChainableStatement mousemove(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEMOVE.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement mousemove(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEMOVE.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "mousemove", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "MOUSEMOVE", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the mousemove event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "mousemove", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L363-L366
389
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.mouseout
public static ChainableStatement mouseout(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEOUT.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement mouseout(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEOUT.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "mouseout", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "MOUSEOUT", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the mouseout event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "mouseout", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L375-L378
390
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.mouseover
public static ChainableStatement mouseover(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEOVER.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement mouseover(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEOVER.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "mouseover", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "MOUSEOVER", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the mouseover event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "mouseover", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L387-L390
391
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.mouseup
public static ChainableStatement mouseup(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEUP.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement mouseup(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.MOUSEUP.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "mouseup", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "MOUSEUP", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the mouseup event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "mouseup", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L399-L402
392
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.scroll
public static ChainableStatement scroll(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.SCROLL.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement scroll(JsScope jsScope) { return new DefaultChainableStatement(MouseEvent.SCROLL.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "scroll", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "MouseEvent", ".", "SCROLL", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the scroll event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "scroll", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L439-L442
393
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.select
public static ChainableStatement select(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.SELECT.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement select(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.SELECT.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "select", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "StateEvent", ".", "SELECT", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the select event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "select", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L461-L464
394
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.submit
public static ChainableStatement submit(JsScope jsScope) { return new DefaultChainableStatement(FormEvent.SUBMIT.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement submit(JsScope jsScope) { return new DefaultChainableStatement(FormEvent.SUBMIT.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "submit", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "FormEvent", ".", "SUBMIT", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the submit event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "submit", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L483-L486
395
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.toggle
public static ChainableStatement toggle(JsScope jsScope, JsScope jsScope2) { return new DefaultChainableStatement("toggle", jsScope.render(), jsScope2.render()); }
java
public static ChainableStatement toggle(JsScope jsScope, JsScope jsScope2) { return new DefaultChainableStatement("toggle", jsScope.render(), jsScope2.render()); }
[ "public", "static", "ChainableStatement", "toggle", "(", "JsScope", "jsScope", ",", "JsScope", "jsScope2", ")", "{", "return", "new", "DefaultChainableStatement", "(", "\"toggle\"", ",", "jsScope", ".", "render", "(", ")", ",", "jsScope2", ".", "render", "(", ")", ")", ";", "}" ]
Toggle among two function calls every other click. @param jsScope Scope to use @param jsScope2 Scope to use @return the jQuery code
[ "Toggle", "among", "two", "function", "calls", "every", "other", "click", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L497-L500
396
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.toggle
public static ChainableStatement toggle(JsScope jsScope, JsScope jsScope2, JsScope... jsScopes) { CharSequence[] args = null; if (jsScopes != null && jsScopes.length > 0) { args = new CharSequence[jsScopes.length + 2]; args[0] = jsScope.render(); args[1] = jsScope2.render(); Integer index = 2; for (JsScope scope : jsScopes) { args[index] = scope.render(); index++; } return new DefaultChainableStatement("toggle", args); } return toggle(jsScope, jsScope2); }
java
public static ChainableStatement toggle(JsScope jsScope, JsScope jsScope2, JsScope... jsScopes) { CharSequence[] args = null; if (jsScopes != null && jsScopes.length > 0) { args = new CharSequence[jsScopes.length + 2]; args[0] = jsScope.render(); args[1] = jsScope2.render(); Integer index = 2; for (JsScope scope : jsScopes) { args[index] = scope.render(); index++; } return new DefaultChainableStatement("toggle", args); } return toggle(jsScope, jsScope2); }
[ "public", "static", "ChainableStatement", "toggle", "(", "JsScope", "jsScope", ",", "JsScope", "jsScope2", ",", "JsScope", "...", "jsScopes", ")", "{", "CharSequence", "[", "]", "args", "=", "null", ";", "if", "(", "jsScopes", "!=", "null", "&&", "jsScopes", ".", "length", ">", "0", ")", "{", "args", "=", "new", "CharSequence", "[", "jsScopes", ".", "length", "+", "2", "]", ";", "args", "[", "0", "]", "=", "jsScope", ".", "render", "(", ")", ";", "args", "[", "1", "]", "=", "jsScope2", ".", "render", "(", ")", ";", "Integer", "index", "=", "2", ";", "for", "(", "JsScope", "scope", ":", "jsScopes", ")", "{", "args", "[", "index", "]", "=", "scope", ".", "render", "(", ")", ";", "index", "++", ";", "}", "return", "new", "DefaultChainableStatement", "(", "\"toggle\"", ",", "args", ")", ";", "}", "return", "toggle", "(", "jsScope", ",", "jsScope2", ")", ";", "}" ]
Toggle among two or more function calls every other click. @param jsScope Scope to use @param jsScope2 Scope to use @param jsScopes Additional functions @return the jQuery code
[ "Toggle", "among", "two", "or", "more", "function", "calls", "every", "other", "click", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L513-L534
397
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.trigger
public static ChainableStatement trigger(EventLabel eventLabel, CharSequence... data) { return new DefaultChainableStatement("trigger", JsUtils.quotes(eventLabel.getEventLabel()), JsUtils.array(data)); }
java
public static ChainableStatement trigger(EventLabel eventLabel, CharSequence... data) { return new DefaultChainableStatement("trigger", JsUtils.quotes(eventLabel.getEventLabel()), JsUtils.array(data)); }
[ "public", "static", "ChainableStatement", "trigger", "(", "EventLabel", "eventLabel", ",", "CharSequence", "...", "data", ")", "{", "return", "new", "DefaultChainableStatement", "(", "\"trigger\"", ",", "JsUtils", ".", "quotes", "(", "eventLabel", ".", "getEventLabel", "(", ")", ")", ",", "JsUtils", ".", "array", "(", "data", ")", ")", ";", "}" ]
Trigger an event on every matched element. @param eventLabel Event @param data Data for the scope @return the jQuery code
[ "Trigger", "an", "event", "on", "every", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L557-L561
398
WiQuery/wiquery
wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java
EventsHelper.unload
public static ChainableStatement unload(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.UNLOAD.getEventLabel(), jsScope.render()); }
java
public static ChainableStatement unload(JsScope jsScope) { return new DefaultChainableStatement(StateEvent.UNLOAD.getEventLabel(), jsScope.render()); }
[ "public", "static", "ChainableStatement", "unload", "(", "JsScope", "jsScope", ")", "{", "return", "new", "DefaultChainableStatement", "(", "StateEvent", ".", "UNLOAD", ".", "getEventLabel", "(", ")", ",", "jsScope", ".", "render", "(", ")", ")", ";", "}" ]
Bind a function to the unload event of each matched element. @param jsScope Scope to use @return the jQuery code
[ "Bind", "a", "function", "to", "the", "unload", "event", "of", "each", "matched", "element", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/javascript/helper/EventsHelper.java#L616-L619
399
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/position/PositionAlignmentOptions.java
PositionAlignmentOptions.setHorizontalAlignment
public PositionAlignmentOptions setHorizontalAlignment(PositionRelation horizontalAlignment, int offsetLeft) { switch (horizontalAlignment) { case LEFT: case CENTER: case RIGHT: break; default: throw new IllegalArgumentException("Illegal value for the horizontal alignment property"); } this.horizontalAlignment = horizontalAlignment; this.offsetLeft = offsetLeft; return this; }
java
public PositionAlignmentOptions setHorizontalAlignment(PositionRelation horizontalAlignment, int offsetLeft) { switch (horizontalAlignment) { case LEFT: case CENTER: case RIGHT: break; default: throw new IllegalArgumentException("Illegal value for the horizontal alignment property"); } this.horizontalAlignment = horizontalAlignment; this.offsetLeft = offsetLeft; return this; }
[ "public", "PositionAlignmentOptions", "setHorizontalAlignment", "(", "PositionRelation", "horizontalAlignment", ",", "int", "offsetLeft", ")", "{", "switch", "(", "horizontalAlignment", ")", "{", "case", "LEFT", ":", "case", "CENTER", ":", "case", "RIGHT", ":", "break", ";", "default", ":", "throw", "new", "IllegalArgumentException", "(", "\"Illegal value for the horizontal alignment property\"", ")", ";", "}", "this", ".", "horizontalAlignment", "=", "horizontalAlignment", ";", "this", ".", "offsetLeft", "=", "offsetLeft", ";", "return", "this", ";", "}" ]
Set the horizontalAlignment property with an offset. One of LEFT, CENTER, RIGHT. @param horizontalAlignment @param offsetLeft @return the instance
[ "Set", "the", "horizontalAlignment", "property", "with", "an", "offset", ".", "One", "of", "LEFT", "CENTER", "RIGHT", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/position/PositionAlignmentOptions.java#L208-L223