id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
46,100
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/SmartTable.java
SmartTable.removeStyleNames
public void removeStyleNames (int row, int column, String... styles) { for (String style : styles) { getFlexCellFormatter().removeStyleName(row, column, style); } }
java
public void removeStyleNames (int row, int column, String... styles) { for (String style : styles) { getFlexCellFormatter().removeStyleName(row, column, style); } }
[ "public", "void", "removeStyleNames", "(", "int", "row", ",", "int", "column", ",", "String", "...", "styles", ")", "{", "for", "(", "String", "style", ":", "styles", ")", "{", "getFlexCellFormatter", "(", ")", ".", "removeStyleName", "(", "row", ",", "c...
Removes the specified style names on the specified row and column.
[ "Removes", "the", "specified", "style", "names", "on", "the", "specified", "row", "and", "column", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/SmartTable.java#L362-L367
46,101
ebean-orm/ebean-mocker
src/main/java/io/ebean/MethodCall.java
MethodCall.with
public MethodCall with(String name1, Object arg1) { return with(name1, arg1, null, null, null, null); }
java
public MethodCall with(String name1, Object arg1) { return with(name1, arg1, null, null, null, null); }
[ "public", "MethodCall", "with", "(", "String", "name1", ",", "Object", "arg1", ")", "{", "return", "with", "(", "name1", ",", "arg1", ",", "null", ",", "null", ",", "null", ",", "null", ")", ";", "}" ]
Add the single argument.
[ "Add", "the", "single", "argument", "." ]
98c14a58253e8cd40b2a0c9b49526a307079389a
https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/MethodCall.java#L29-L31
46,102
ebean-orm/ebean-mocker
src/main/java/io/ebean/MethodCall.java
MethodCall.with
public MethodCall with(String name1, Object arg1, String name2, Object arg2) { return with(name1, arg1, name2, arg2, null, null); }
java
public MethodCall with(String name1, Object arg1, String name2, Object arg2) { return with(name1, arg1, name2, arg2, null, null); }
[ "public", "MethodCall", "with", "(", "String", "name1", ",", "Object", "arg1", ",", "String", "name2", ",", "Object", "arg2", ")", "{", "return", "with", "(", "name1", ",", "arg1", ",", "name2", ",", "arg2", ",", "null", ",", "null", ")", ";", "}" ]
Add the two arguments.
[ "Add", "the", "two", "arguments", "." ]
98c14a58253e8cd40b2a0c9b49526a307079389a
https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/MethodCall.java#L36-L38
46,103
ebean-orm/ebean-mocker
src/main/java/io/ebean/MethodCall.java
MethodCall.with
public MethodCall with(String name1, Object arg1, String name2, Object arg2, String name3, Object arg3, String name4, Object arg4) { args.put(name1, arg1); if (name2 != null) { args.put(name2, arg2); if (name3 != null) { args.put(name3, arg3); if (name4 != null) { args.put(...
java
public MethodCall with(String name1, Object arg1, String name2, Object arg2, String name3, Object arg3, String name4, Object arg4) { args.put(name1, arg1); if (name2 != null) { args.put(name2, arg2); if (name3 != null) { args.put(name3, arg3); if (name4 != null) { args.put(...
[ "public", "MethodCall", "with", "(", "String", "name1", ",", "Object", "arg1", ",", "String", "name2", ",", "Object", "arg2", ",", "String", "name3", ",", "Object", "arg3", ",", "String", "name4", ",", "Object", "arg4", ")", "{", "args", ".", "put", "(...
Add four arguments.
[ "Add", "four", "arguments", "." ]
98c14a58253e8cd40b2a0c9b49526a307079389a
https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/MethodCall.java#L50-L62
46,104
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/Functions.java
Functions.forMap
public static <K, V> Function<K, V> forMap (final Map<K, ? extends V> map, final V defaultValue) { return new Function<K, V>() { public V apply (K key) { V value = map.get(key); return (value != null || map.containsKey(key)) ? value : defaultValue; } ...
java
public static <K, V> Function<K, V> forMap (final Map<K, ? extends V> map, final V defaultValue) { return new Function<K, V>() { public V apply (K key) { V value = map.get(key); return (value != null || map.containsKey(key)) ? value : defaultValue; } ...
[ "public", "static", "<", "K", ",", "V", ">", "Function", "<", "K", ",", "V", ">", "forMap", "(", "final", "Map", "<", "K", ",", "?", "extends", "V", ">", "map", ",", "final", "V", "defaultValue", ")", "{", "return", "new", "Function", "<", "K", ...
Returns a function which performs a map lookup with a default value. The function created by this method returns defaultValue for all inputs that do not belong to the map's key set.
[ "Returns", "a", "function", "which", "performs", "a", "map", "lookup", "with", "a", "default", "value", ".", "The", "function", "created", "by", "this", "method", "returns", "defaultValue", "for", "all", "inputs", "that", "do", "not", "belong", "to", "the", ...
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/Functions.java#L45-L53
46,105
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/Functions.java
Functions.forPredicate
public static <T> Function<T, Boolean> forPredicate (final Predicate<T> predicate) { return new Function<T, Boolean>() { public Boolean apply (T arg) { return predicate.apply(arg); } }; }
java
public static <T> Function<T, Boolean> forPredicate (final Predicate<T> predicate) { return new Function<T, Boolean>() { public Boolean apply (T arg) { return predicate.apply(arg); } }; }
[ "public", "static", "<", "T", ">", "Function", "<", "T", ",", "Boolean", ">", "forPredicate", "(", "final", "Predicate", "<", "T", ">", "predicate", ")", "{", "return", "new", "Function", "<", "T", ",", "Boolean", ">", "(", ")", "{", "public", "Boole...
Returns a function that returns the same boolean output as the given predicate for all inputs.
[ "Returns", "a", "function", "that", "returns", "the", "same", "boolean", "output", "as", "the", "given", "predicate", "for", "all", "inputs", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/Functions.java#L59-L66
46,106
xebialabs/overcast
src/main/java/com/xebialabs/overcast/OvercastProperties.java
OvercastProperties.getOvercastPropertyNames
public static Set<String> getOvercastPropertyNames(final String path) { Config overcastConfig = getOvercastConfig(); if (!overcastConfig.hasPath(path)) { return new HashSet<>(); } Config cfg = overcastConfig.getConfig(path); Set<String> result = new HashSet<>(); ...
java
public static Set<String> getOvercastPropertyNames(final String path) { Config overcastConfig = getOvercastConfig(); if (!overcastConfig.hasPath(path)) { return new HashSet<>(); } Config cfg = overcastConfig.getConfig(path); Set<String> result = new HashSet<>(); ...
[ "public", "static", "Set", "<", "String", ">", "getOvercastPropertyNames", "(", "final", "String", "path", ")", "{", "Config", "overcastConfig", "=", "getOvercastConfig", "(", ")", ";", "if", "(", "!", "overcastConfig", ".", "hasPath", "(", "path", ")", ")",...
Get set of property names directly below path.
[ "Get", "set", "of", "property", "names", "directly", "below", "path", "." ]
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/OvercastProperties.java#L53-L66
46,107
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/WindowUtil.java
WindowUtil.getScrollIntoView
public static int getScrollIntoView (Widget target) { int top = Window.getScrollTop(), height = Window.getClientHeight(); int ttop = target.getAbsoluteTop(), theight = target.getOffsetHeight(); // if the target widget is taller than the browser window, or is above the current scroll ...
java
public static int getScrollIntoView (Widget target) { int top = Window.getScrollTop(), height = Window.getClientHeight(); int ttop = target.getAbsoluteTop(), theight = target.getOffsetHeight(); // if the target widget is taller than the browser window, or is above the current scroll ...
[ "public", "static", "int", "getScrollIntoView", "(", "Widget", "target", ")", "{", "int", "top", "=", "Window", ".", "getScrollTop", "(", ")", ",", "height", "=", "Window", ".", "getClientHeight", "(", ")", ";", "int", "ttop", "=", "target", ".", "getAbs...
Returns the vertical scroll position needed to place the specified target widget in view, while trying to minimize scrolling.
[ "Returns", "the", "vertical", "scroll", "position", "needed", "to", "place", "the", "specified", "target", "widget", "in", "view", "while", "trying", "to", "minimize", "scrolling", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/WindowUtil.java#L74-L88
46,108
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/WindowUtil.java
WindowUtil.getScrollToMiddle
public static int getScrollToMiddle (Widget target) { int wheight = Window.getClientHeight(), theight = target.getOffsetHeight(); int ttop = target.getAbsoluteTop(); return Math.max(ttop, ttop + (wheight - theight)); }
java
public static int getScrollToMiddle (Widget target) { int wheight = Window.getClientHeight(), theight = target.getOffsetHeight(); int ttop = target.getAbsoluteTop(); return Math.max(ttop, ttop + (wheight - theight)); }
[ "public", "static", "int", "getScrollToMiddle", "(", "Widget", "target", ")", "{", "int", "wheight", "=", "Window", ".", "getClientHeight", "(", ")", ",", "theight", "=", "target", ".", "getOffsetHeight", "(", ")", ";", "int", "ttop", "=", "target", ".", ...
Returns the vertical scroll position needed to center the target widget vertically in the browser viewport. If the widget is taller than the viewport, its top is returned.
[ "Returns", "the", "vertical", "scroll", "position", "needed", "to", "center", "the", "target", "widget", "vertically", "in", "the", "browser", "viewport", ".", "If", "the", "widget", "is", "taller", "than", "the", "viewport", "its", "top", "is", "returned", ...
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/WindowUtil.java#L103-L108
46,109
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/WindowUtil.java
WindowUtil.isScrolledIntoView
public static boolean isScrolledIntoView (Widget target, int minPixels) { int wtop = Window.getScrollTop(), wheight = Window.getClientHeight(); int ttop = target.getAbsoluteTop(); if (ttop > wtop) { return (wtop + wheight - ttop > minPixels); } else { return (...
java
public static boolean isScrolledIntoView (Widget target, int minPixels) { int wtop = Window.getScrollTop(), wheight = Window.getClientHeight(); int ttop = target.getAbsoluteTop(); if (ttop > wtop) { return (wtop + wheight - ttop > minPixels); } else { return (...
[ "public", "static", "boolean", "isScrolledIntoView", "(", "Widget", "target", ",", "int", "minPixels", ")", "{", "int", "wtop", "=", "Window", ".", "getScrollTop", "(", ")", ",", "wheight", "=", "Window", ".", "getClientHeight", "(", ")", ";", "int", "ttop...
Returns true if the target widget is vertically scrolled into view. @param minPixels the minimum number of pixels that must be visible to count as "in view".
[ "Returns", "true", "if", "the", "target", "widget", "is", "vertically", "scrolled", "into", "view", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/WindowUtil.java#L133-L142
46,110
stackify/stackify-metrics
src/main/java/com/stackify/metric/impl/MetricAggregate.java
MetricAggregate.fromMetricIdentity
public static MetricAggregate fromMetricIdentity(final MetricIdentity identity, final long currentMinute) { Preconditions.checkNotNull(identity); return new MetricAggregate(identity, currentMinute); }
java
public static MetricAggregate fromMetricIdentity(final MetricIdentity identity, final long currentMinute) { Preconditions.checkNotNull(identity); return new MetricAggregate(identity, currentMinute); }
[ "public", "static", "MetricAggregate", "fromMetricIdentity", "(", "final", "MetricIdentity", "identity", ",", "final", "long", "currentMinute", ")", "{", "Preconditions", ".", "checkNotNull", "(", "identity", ")", ";", "return", "new", "MetricAggregate", "(", "ident...
Creates a MetricAggregate @param identity The metric identity @param currentMinute Current minute @return The MetricAggregate
[ "Creates", "a", "MetricAggregate" ]
6827d516085e4b29a3e54da963eebb2955822a5c
https://github.com/stackify/stackify-metrics/blob/6827d516085e4b29a3e54da963eebb2955822a5c/src/main/java/com/stackify/metric/impl/MetricAggregate.java#L52-L55
46,111
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/Console.java
Console.log
public static void log (String message, Object... args) { StringBuilder sb = new StringBuilder(); sb.append(message); if (args.length > 1) { sb.append(" ["); for (int ii = 0, ll = args.length/2; ii < ll; ii++) { if (ii > 0) { sb.app...
java
public static void log (String message, Object... args) { StringBuilder sb = new StringBuilder(); sb.append(message); if (args.length > 1) { sb.append(" ["); for (int ii = 0, ll = args.length/2; ii < ll; ii++) { if (ii > 0) { sb.app...
[ "public", "static", "void", "log", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "message", ")", ";", "if", "(", "args", ".", "length", "...
Formats and logs a message. If we are running in HostedMode the log message will be reported to its console. If we're running in Firefox, the log message will be sent to Firebug if it is enabled.
[ "Formats", "and", "logs", "a", "message", ".", "If", "we", "are", "running", "in", "HostedMode", "the", "log", "message", "will", "be", "reported", "to", "its", "console", ".", "If", "we", "re", "running", "in", "Firefox", "the", "log", "message", "will"...
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/Console.java#L36-L59
46,112
threerings/gwt-utils
src/main/java/com/threerings/gwt/tools/I18nSync.java
I18nSync.main
public static void main (String[] args) { if (args.length <= 1) { System.err.println("Usage: I18nSyncTask rootDir rootDir/com/mypackage/Foo.properties " + "[.../Bar.properties ...]"); System.exit(255); } File rootDir = new File(args[0])...
java
public static void main (String[] args) { if (args.length <= 1) { System.err.println("Usage: I18nSyncTask rootDir rootDir/com/mypackage/Foo.properties " + "[.../Bar.properties ...]"); System.exit(255); } File rootDir = new File(args[0])...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "<=", "1", ")", "{", "System", ".", "err", ".", "println", "(", "\"Usage: I18nSyncTask rootDir rootDir/com/mypackage/Foo.properties \"", "+", "\"[....
Entry point for command line tool.
[ "Entry", "point", "for", "command", "line", "tool", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/tools/I18nSync.java#L42-L67
46,113
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/Callbacks.java
Callbacks.map
public static <T, P> AsyncCallback<T> map (AsyncCallback<P> target, final Function<T, P> f) { return new ChainedCallback<T, P>(target) { @Override public void onSuccess (T result) { forwardSuccess(f.apply(result)); } }; }
java
public static <T, P> AsyncCallback<T> map (AsyncCallback<P> target, final Function<T, P> f) { return new ChainedCallback<T, P>(target) { @Override public void onSuccess (T result) { forwardSuccess(f.apply(result)); } }; }
[ "public", "static", "<", "T", ",", "P", ">", "AsyncCallback", "<", "T", ">", "map", "(", "AsyncCallback", "<", "P", ">", "target", ",", "final", "Function", "<", "T", ",", "P", ">", "f", ")", "{", "return", "new", "ChainedCallback", "<", "T", ",", ...
Creates a chained callback that maps the result using the supplied function and passes the mapped result to the target callback.
[ "Creates", "a", "chained", "callback", "that", "maps", "the", "result", "using", "the", "supplied", "function", "and", "passes", "the", "mapped", "result", "to", "the", "target", "callback", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/Callbacks.java#L39-L46
46,114
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/Callbacks.java
Callbacks.before
public static <T> AsyncCallback<T> before (AsyncCallback<T> target, final Function<T, Void> preOp) { return new ChainedCallback<T, T>(target) { @Override public void onSuccess (T result) { preOp.apply(result); forward...
java
public static <T> AsyncCallback<T> before (AsyncCallback<T> target, final Function<T, Void> preOp) { return new ChainedCallback<T, T>(target) { @Override public void onSuccess (T result) { preOp.apply(result); forward...
[ "public", "static", "<", "T", ">", "AsyncCallback", "<", "T", ">", "before", "(", "AsyncCallback", "<", "T", ">", "target", ",", "final", "Function", "<", "T", ",", "Void", ">", "preOp", ")", "{", "return", "new", "ChainedCallback", "<", "T", ",", "T...
Creates a chained callback that calls the supplied pre-operation before passing the result on to the supplied target callback.
[ "Creates", "a", "chained", "callback", "that", "calls", "the", "supplied", "pre", "-", "operation", "before", "passing", "the", "result", "on", "to", "the", "supplied", "target", "callback", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/Callbacks.java#L52-L61
46,115
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/Callbacks.java
Callbacks.disabler
public static <T> AsyncCallback<T> disabler (AsyncCallback<T> callback, final HasEnabled... disablees) { for (HasEnabled widget : disablees) { widget.setEnabled(false); } return new ChainedCallback<T, T>(callback) { @Ov...
java
public static <T> AsyncCallback<T> disabler (AsyncCallback<T> callback, final HasEnabled... disablees) { for (HasEnabled widget : disablees) { widget.setEnabled(false); } return new ChainedCallback<T, T>(callback) { @Ov...
[ "public", "static", "<", "T", ">", "AsyncCallback", "<", "T", ">", "disabler", "(", "AsyncCallback", "<", "T", ">", "callback", ",", "final", "HasEnabled", "...", "disablees", ")", "{", "for", "(", "HasEnabled", "widget", ":", "disablees", ")", "{", "wid...
Immediately disables the specified widgets, and wraps the supplied callback in one that will reenable those widgets when the callback returns successfully or with failure.
[ "Immediately", "disables", "the", "specified", "widgets", "and", "wraps", "the", "supplied", "callback", "in", "one", "that", "will", "reenable", "those", "widgets", "when", "the", "callback", "returns", "successfully", "or", "with", "failure", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/Callbacks.java#L67-L87
46,116
icode/ameba
src/main/java/ameba/db/ebean/support/ModelResourceStructure.java
ModelResourceStructure.tryConvertId
@SuppressWarnings("unchecked") protected final MODEL_ID tryConvertId(Object id) { try { return (MODEL_ID) getModelBeanDescriptor().convertId(id); } catch (Exception e) { throw new UnprocessableEntityException(Messages.get("info.query.id.unprocessable.entity"), e); } ...
java
@SuppressWarnings("unchecked") protected final MODEL_ID tryConvertId(Object id) { try { return (MODEL_ID) getModelBeanDescriptor().convertId(id); } catch (Exception e) { throw new UnprocessableEntityException(Messages.get("info.query.id.unprocessable.entity"), e); } ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "final", "MODEL_ID", "tryConvertId", "(", "Object", "id", ")", "{", "try", "{", "return", "(", "MODEL_ID", ")", "getModelBeanDescriptor", "(", ")", ".", "convertId", "(", "id", ")", ";", "}", ...
convert to id @param id string id @return MODEL_ID @throws NotFoundException response status 404
[ "convert", "to", "id" ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L137-L144
46,117
icode/ameba
src/main/java/ameba/db/ebean/support/ModelResourceStructure.java
ModelResourceStructure.deleteMultipleModel
protected boolean deleteMultipleModel(Set<MODEL_ID> idCollection, boolean permanent) throws Exception { if (permanent) { server.deleteAllPermanent(modelType, idCollection); } else { server.deleteAll(modelType, idCollection); } return permanent; }
java
protected boolean deleteMultipleModel(Set<MODEL_ID> idCollection, boolean permanent) throws Exception { if (permanent) { server.deleteAllPermanent(modelType, idCollection); } else { server.deleteAll(modelType, idCollection); } return permanent; }
[ "protected", "boolean", "deleteMultipleModel", "(", "Set", "<", "MODEL_ID", ">", "idCollection", ",", "boolean", "permanent", ")", "throws", "Exception", "{", "if", "(", "permanent", ")", "{", "server", ".", "deleteAllPermanent", "(", "modelType", ",", "idCollec...
delete multiple Model @param idCollection model id collection @param permanent a boolean. @return if true delete from physical device, if logical delete return false, response status 202 @throws java.lang.Exception if any.
[ "delete", "multiple", "Model" ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L482-L489
46,118
icode/ameba
src/main/java/ameba/db/ebean/support/ModelResourceStructure.java
ModelResourceStructure.deleteModel
protected boolean deleteModel(MODEL_ID id, boolean permanent) throws Exception { if (permanent) { server.deletePermanent(modelType, id); } else { server.delete(modelType, id); } return permanent; }
java
protected boolean deleteModel(MODEL_ID id, boolean permanent) throws Exception { if (permanent) { server.deletePermanent(modelType, id); } else { server.delete(modelType, id); } return permanent; }
[ "protected", "boolean", "deleteModel", "(", "MODEL_ID", "id", ",", "boolean", "permanent", ")", "throws", "Exception", "{", "if", "(", "permanent", ")", "{", "server", ".", "deletePermanent", "(", "modelType", ",", "id", ")", ";", "}", "else", "{", "server...
delete a model @param id model id @param permanent a boolean. @return if true delete from physical device, if logical delete return false, response status 202 @throws java.lang.Exception if any.
[ "delete", "a", "model" ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L521-L528
46,119
icode/ameba
src/main/java/ameba/db/ebean/support/ModelResourceStructure.java
ModelResourceStructure.findByIds
public Response findByIds(@NotNull @PathParam("ids") URI_ID id, @NotNull @PathParam("ids") final PathSegment ids, @QueryParam("include_deleted") final boolean includeDeleted) throws Exception { final Query<MODEL> query = server.find(modelType); ...
java
public Response findByIds(@NotNull @PathParam("ids") URI_ID id, @NotNull @PathParam("ids") final PathSegment ids, @QueryParam("include_deleted") final boolean includeDeleted) throws Exception { final Query<MODEL> query = server.find(modelType); ...
[ "public", "Response", "findByIds", "(", "@", "NotNull", "@", "PathParam", "(", "\"ids\"", ")", "URI_ID", "id", ",", "@", "NotNull", "@", "PathParam", "(", "\"ids\"", ")", "final", "PathSegment", "ids", ",", "@", "QueryParam", "(", "\"include_deleted\"", ")",...
Find a model or model list given its Ids. @param id The id use for path matching type @param ids the id of the model. @param includeDeleted a boolean. @return a {@link javax.ws.rs.core.Response} object. @throws java.lang.Exception if any. @see javax.ws.rs.GET @see AbstractModelResource#findByIds
[ "Find", "a", "model", "or", "model", "list", "given", "its", "Ids", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L552-L591
46,120
icode/ameba
src/main/java/ameba/db/ebean/support/ModelResourceStructure.java
ModelResourceStructure.fetchHistoryAsOf
public Response fetchHistoryAsOf(@PathParam("id") URI_ID id, @PathParam("asof") final Timestamp asOf) throws Exception { final MODEL_ID mId = tryConvertId(id); matchedFetchHistoryAsOf(mId, asOf); final Query<MODEL> query = server.find(modelType); def...
java
public Response fetchHistoryAsOf(@PathParam("id") URI_ID id, @PathParam("asof") final Timestamp asOf) throws Exception { final MODEL_ID mId = tryConvertId(id); matchedFetchHistoryAsOf(mId, asOf); final Query<MODEL> query = server.find(modelType); def...
[ "public", "Response", "fetchHistoryAsOf", "(", "@", "PathParam", "(", "\"id\"", ")", "URI_ID", "id", ",", "@", "PathParam", "(", "\"asof\"", ")", "final", "Timestamp", "asOf", ")", "throws", "Exception", "{", "final", "MODEL_ID", "mId", "=", "tryConvertId", ...
find history as of timestamp @param id model id @param asOf Timestamp @return history model @throws java.lang.Exception any error
[ "find", "history", "as", "of", "timestamp" ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L904-L924
46,121
icode/ameba
src/main/java/ameba/message/filtering/EntityFieldsUtils.java
EntityFieldsUtils.parseQueryFields
public static String parseQueryFields(UriInfo uriInfo) { List<String> selectables = uriInfo.getQueryParameters() .get(EntityFieldsScopeResolver.FIELDS_PARAM_NAME); StringBuilder builder = new StringBuilder(); if (selectables != null) { for (int i = 0; i < selectables....
java
public static String parseQueryFields(UriInfo uriInfo) { List<String> selectables = uriInfo.getQueryParameters() .get(EntityFieldsScopeResolver.FIELDS_PARAM_NAME); StringBuilder builder = new StringBuilder(); if (selectables != null) { for (int i = 0; i < selectables....
[ "public", "static", "String", "parseQueryFields", "(", "UriInfo", "uriInfo", ")", "{", "List", "<", "String", ">", "selectables", "=", "uriInfo", ".", "getQueryParameters", "(", ")", ".", "get", "(", "EntityFieldsScopeResolver", ".", "FIELDS_PARAM_NAME", ")", ";...
Parse and return a BeanPathProperties format from UriInfo @param uriInfo uri info @return query fields
[ "Parse", "and", "return", "a", "BeanPathProperties", "format", "from", "UriInfo" ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/filtering/EntityFieldsUtils.java#L33-L55
46,122
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/EnumListBox.java
EnumListBox.setSelectedValue
public void setSelectedValue (E value) { String valstr = value.toString(); for (int ii = 0; ii < getItemCount(); ii++) { if (getValue(ii).equals(valstr)) { setSelectedIndex(ii); break; } } }
java
public void setSelectedValue (E value) { String valstr = value.toString(); for (int ii = 0; ii < getItemCount(); ii++) { if (getValue(ii).equals(valstr)) { setSelectedIndex(ii); break; } } }
[ "public", "void", "setSelectedValue", "(", "E", "value", ")", "{", "String", "valstr", "=", "value", ".", "toString", "(", ")", ";", "for", "(", "int", "ii", "=", "0", ";", "ii", "<", "getItemCount", "(", ")", ";", "ii", "++", ")", "{", "if", "("...
Selects the specified value.
[ "Selects", "the", "specified", "value", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/EnumListBox.java#L56-L65
46,123
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/EnumListBox.java
EnumListBox.getSelectedEnum
public E getSelectedEnum () { int selidx = getSelectedIndex(); return (selidx < 0) ? null : Enum.valueOf(_eclass, getValue(selidx)); }
java
public E getSelectedEnum () { int selidx = getSelectedIndex(); return (selidx < 0) ? null : Enum.valueOf(_eclass, getValue(selidx)); }
[ "public", "E", "getSelectedEnum", "(", ")", "{", "int", "selidx", "=", "getSelectedIndex", "(", ")", ";", "return", "(", "selidx", "<", "0", ")", "?", "null", ":", "Enum", ".", "valueOf", "(", "_eclass", ",", "getValue", "(", "selidx", ")", ")", ";",...
Returns the currently selected value, or null if no value is selected.
[ "Returns", "the", "currently", "selected", "value", "or", "null", "if", "no", "value", "is", "selected", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/EnumListBox.java#L70-L74
46,124
icode/ameba
src/main/java/ameba/message/internal/BeanPathProperties.java
BeanPathProperties.hasPath
public boolean hasPath(String path) { Props props = pathMap.get(path); return props != null && !props.isEmpty(); }
java
public boolean hasPath(String path) { Props props = pathMap.get(path); return props != null && !props.isEmpty(); }
[ "public", "boolean", "hasPath", "(", "String", "path", ")", "{", "Props", "props", "=", "pathMap", ".", "get", "(", "path", ")", ";", "return", "props", "!=", "null", "&&", "!", "props", ".", "isEmpty", "(", ")", ";", "}" ]
Return true if the path is defined and has properties. @param path path @return true is has path
[ "Return", "true", "if", "the", "path", "is", "defined", "and", "has", "properties", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/BeanPathProperties.java#L97-L100
46,125
icode/ameba
src/main/java/ameba/message/internal/BeanPathProperties.java
BeanPathProperties.getProperties
public Set<String> getProperties(String path) { Props props = pathMap.get(path); return props == null ? null : props.getProperties(); }
java
public Set<String> getProperties(String path) { Props props = pathMap.get(path); return props == null ? null : props.getProperties(); }
[ "public", "Set", "<", "String", ">", "getProperties", "(", "String", "path", ")", "{", "Props", "props", "=", "pathMap", ".", "get", "(", "path", ")", ";", "return", "props", "==", "null", "?", "null", ":", "props", ".", "getProperties", "(", ")", ";...
Get the properties for a given path. @param path path @return properties
[ "Get", "the", "properties", "for", "a", "given", "path", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/BeanPathProperties.java#L108-L111
46,126
icode/ameba
src/main/java/ameba/message/internal/BeanPathProperties.java
BeanPathProperties.put
public void put(String path, Set<String> properties) { pathMap.put(path, new Props(this, null, path, properties)); }
java
public void put(String path, Set<String> properties) { pathMap.put(path, new Props(this, null, path, properties)); }
[ "public", "void", "put", "(", "String", "path", ",", "Set", "<", "String", ">", "properties", ")", "{", "pathMap", ".", "put", "(", "path", ",", "new", "Props", "(", "this", ",", "null", ",", "path", ",", "properties", ")", ")", ";", "}" ]
Set the properties for a given path. @param path path @param properties properties set
[ "Set", "the", "properties", "for", "a", "given", "path", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/BeanPathProperties.java#L130-L132
46,127
icode/ameba
src/main/java/ameba/message/internal/BeanPathProperties.java
BeanPathProperties.each
public void each(Each<Props> each) { for (Map.Entry<String, Props> entry : pathMap.entrySet()) { Props props = entry.getValue(); each.execute(props); } }
java
public void each(Each<Props> each) { for (Map.Entry<String, Props> entry : pathMap.entrySet()) { Props props = entry.getValue(); each.execute(props); } }
[ "public", "void", "each", "(", "Each", "<", "Props", ">", "each", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Props", ">", "entry", ":", "pathMap", ".", "entrySet", "(", ")", ")", "{", "Props", "props", "=", "entry", ".", "get...
Each these path properties as fetch paths to the query. @param each each process
[ "Each", "these", "path", "properties", "as", "fetch", "paths", "to", "the", "query", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/message/internal/BeanPathProperties.java#L168-L175
46,128
udoprog/tiny-async-java
tiny-async-core/src/main/java/eu/toolchain/concurrent/RetryCallHelper.java
RetryCallHelper.finished
public void finished() { final ScheduledFuture<?> scheduled = nextCall.getAndSet(null); if (scheduled != null) { scheduled.cancel(true); } }
java
public void finished() { final ScheduledFuture<?> scheduled = nextCall.getAndSet(null); if (scheduled != null) { scheduled.cancel(true); } }
[ "public", "void", "finished", "(", ")", "{", "final", "ScheduledFuture", "<", "?", ">", "scheduled", "=", "nextCall", ".", "getAndSet", "(", "null", ")", ";", "if", "(", "scheduled", "!=", "null", ")", "{", "scheduled", ".", "cancel", "(", "true", ")",...
Must be called when the target completable finishes to clean up any potential scheduled _future_ events.
[ "Must", "be", "called", "when", "the", "target", "completable", "finishes", "to", "clean", "up", "any", "potential", "scheduled", "_future_", "events", "." ]
987706d4b7f2d13b45eefdc6c54ea63ce64b3310
https://github.com/udoprog/tiny-async-java/blob/987706d4b7f2d13b45eefdc6c54ea63ce64b3310/tiny-async-core/src/main/java/eu/toolchain/concurrent/RetryCallHelper.java#L121-L127
46,129
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Bindings.java
Bindings.bindEnabled
public static void bindEnabled (Value<Boolean> value, final FocusWidget... targets) { value.addListenerAndTrigger(new Value.Listener<Boolean>() { public void valueChanged (Boolean enabled) { for (FocusWidget target : targets) { target.setEnabled(enabled); ...
java
public static void bindEnabled (Value<Boolean> value, final FocusWidget... targets) { value.addListenerAndTrigger(new Value.Listener<Boolean>() { public void valueChanged (Boolean enabled) { for (FocusWidget target : targets) { target.setEnabled(enabled); ...
[ "public", "static", "void", "bindEnabled", "(", "Value", "<", "Boolean", ">", "value", ",", "final", "FocusWidget", "...", "targets", ")", "{", "value", ".", "addListenerAndTrigger", "(", "new", "Value", ".", "Listener", "<", "Boolean", ">", "(", ")", "{",...
Binds the enabledness state of the target widget to the supplied boolean value.
[ "Binds", "the", "enabledness", "state", "of", "the", "target", "widget", "to", "the", "supplied", "boolean", "value", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L59-L68
46,130
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Bindings.java
Bindings.bindVisible
public static void bindVisible (Value<Boolean> value, final Widget... targets) { value.addListenerAndTrigger(new Value.Listener<Boolean>() { public void valueChanged (Boolean visible) { for (Widget target : targets) { target.setVisible(visible); ...
java
public static void bindVisible (Value<Boolean> value, final Widget... targets) { value.addListenerAndTrigger(new Value.Listener<Boolean>() { public void valueChanged (Boolean visible) { for (Widget target : targets) { target.setVisible(visible); ...
[ "public", "static", "void", "bindVisible", "(", "Value", "<", "Boolean", ">", "value", ",", "final", "Widget", "...", "targets", ")", "{", "value", ".", "addListenerAndTrigger", "(", "new", "Value", ".", "Listener", "<", "Boolean", ">", "(", ")", "{", "p...
Binds the visible state of the target widget to the supplied boolean value.
[ "Binds", "the", "visible", "state", "of", "the", "target", "widget", "to", "the", "supplied", "boolean", "value", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L73-L82
46,131
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Bindings.java
Bindings.bindHovered
public static <T extends HasMouseOverHandlers & HasMouseOutHandlers> void bindHovered ( final Value<Boolean> value, T... targets) { HoverHandler handler = new HoverHandler(value); for (T target : targets) { target.addMouseOverHandler(handler); target.addMouseOutHandle...
java
public static <T extends HasMouseOverHandlers & HasMouseOutHandlers> void bindHovered ( final Value<Boolean> value, T... targets) { HoverHandler handler = new HoverHandler(value); for (T target : targets) { target.addMouseOverHandler(handler); target.addMouseOutHandle...
[ "public", "static", "<", "T", "extends", "HasMouseOverHandlers", "&", "HasMouseOutHandlers", ">", "void", "bindHovered", "(", "final", "Value", "<", "Boolean", ">", "value", ",", "T", "...", "targets", ")", "{", "HoverHandler", "handler", "=", "new", "HoverHan...
Binds the hovered state of the supplied target widgets to the supplied boolean value. The supplied value will be toggled to true when the mouse is hovering over any of the supplied targets and false otherwise.
[ "Binds", "the", "hovered", "state", "of", "the", "supplied", "target", "widgets", "to", "the", "supplied", "boolean", "value", ".", "The", "supplied", "value", "will", "be", "toggled", "to", "true", "when", "the", "mouse", "is", "hovering", "over", "any", ...
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L108-L116
46,132
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Bindings.java
Bindings.bindLabel
public static void bindLabel (final Value<String> value, final HasText target) { value.addListenerAndTrigger(new Value.Listener<String>() { public void valueChanged (String value) { // avoid updating the target if the value is already the same; in the case where /...
java
public static void bindLabel (final Value<String> value, final HasText target) { value.addListenerAndTrigger(new Value.Listener<String>() { public void valueChanged (String value) { // avoid updating the target if the value is already the same; in the case where /...
[ "public", "static", "void", "bindLabel", "(", "final", "Value", "<", "String", ">", "value", ",", "final", "HasText", "target", ")", "{", "value", ".", "addListenerAndTrigger", "(", "new", "Value", ".", "Listener", "<", "String", ">", "(", ")", "{", "pub...
Binds the specified string value to the supplied text-having widget. The binding is one-way, in that only changes to the value will be reflected in the text-having widget. It is expected that no other changes will be made to the widget.
[ "Binds", "the", "specified", "string", "value", "to", "the", "supplied", "text", "-", "having", "widget", ".", "The", "binding", "is", "one", "-", "way", "in", "that", "only", "changes", "to", "the", "value", "will", "be", "reflected", "in", "the", "text...
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L142-L154
46,133
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Bindings.java
Bindings.makeToggler
public static ClickHandler makeToggler (final Value<Boolean> value) { Preconditions.checkNotNull(value, "value"); return new ClickHandler() { public void onClick (ClickEvent event) { value.update(!value.get()); } }; }
java
public static ClickHandler makeToggler (final Value<Boolean> value) { Preconditions.checkNotNull(value, "value"); return new ClickHandler() { public void onClick (ClickEvent event) { value.update(!value.get()); } }; }
[ "public", "static", "ClickHandler", "makeToggler", "(", "final", "Value", "<", "Boolean", ">", "value", ")", "{", "Preconditions", ".", "checkNotNull", "(", "value", ",", "\"value\"", ")", ";", "return", "new", "ClickHandler", "(", ")", "{", "public", "void"...
Returns a click handler that toggles the supplied boolean value when clicked.
[ "Returns", "a", "click", "handler", "that", "toggles", "the", "supplied", "boolean", "value", "when", "clicked", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L180-L188
46,134
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Bindings.java
Bindings.bindStateStyle
public static void bindStateStyle (Value<Boolean> value, final String onStyle, final String offStyle, final Widget... targets) { value.addListenerAndTrigger(new Value.Listener<Boolean>() { public void valueChanged (Boolean value) { String ad...
java
public static void bindStateStyle (Value<Boolean> value, final String onStyle, final String offStyle, final Widget... targets) { value.addListenerAndTrigger(new Value.Listener<Boolean>() { public void valueChanged (Boolean value) { String ad...
[ "public", "static", "void", "bindStateStyle", "(", "Value", "<", "Boolean", ">", "value", ",", "final", "String", "onStyle", ",", "final", "String", "offStyle", ",", "final", "Widget", "...", "targets", ")", "{", "value", ".", "addListenerAndTrigger", "(", "...
Configures either `onStyle` or `offStyle` on the supplied target widgets depending on the state of the supplied boolean `value`. @param onStyle the style name to be applied when the value is true, or null. @param offStyle the style name to be applied when the value is false, or null.
[ "Configures", "either", "onStyle", "or", "offStyle", "on", "the", "supplied", "target", "widgets", "depending", "on", "the", "state", "of", "the", "supplied", "boolean", "value", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L197-L220
46,135
icode/ameba
src/main/java/ameba/db/migration/resources/MigrationResource.java
MigrationResource.resolved
private List<MigrationInfo> resolved(MigrationInfo[] migrationInfos) { if (migrationInfos.length == 0) throw new NotFoundException(); List<MigrationInfo> resolvedMigrations = Lists.newArrayList(); for (MigrationInfo migrationInfo : migrationInfos) { if (migrationInfo.getS...
java
private List<MigrationInfo> resolved(MigrationInfo[] migrationInfos) { if (migrationInfos.length == 0) throw new NotFoundException(); List<MigrationInfo> resolvedMigrations = Lists.newArrayList(); for (MigrationInfo migrationInfo : migrationInfos) { if (migrationInfo.getS...
[ "private", "List", "<", "MigrationInfo", ">", "resolved", "(", "MigrationInfo", "[", "]", "migrationInfos", ")", "{", "if", "(", "migrationInfos", ".", "length", "==", "0", ")", "throw", "new", "NotFoundException", "(", ")", ";", "List", "<", "MigrationInfo"...
Retrieves the full set of infos about the migrations resolved on the classpath. @return The resolved migrations. An empty array if none.
[ "Retrieves", "the", "full", "set", "of", "infos", "about", "the", "migrations", "resolved", "on", "the", "classpath", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/migration/resources/MigrationResource.java#L405-L416
46,136
icode/ameba
src/main/java/ameba/db/migration/resources/MigrationResource.java
MigrationResource.failed
private List<MigrationInfo> failed(MigrationInfo[] migrationInfos) { if (migrationInfos.length == 0) throw new NotFoundException(); List<MigrationInfo> failedMigrations = Lists.newArrayList(); for (MigrationInfo migrationInfo : migrationInfos) { if (migrationInfo.getState...
java
private List<MigrationInfo> failed(MigrationInfo[] migrationInfos) { if (migrationInfos.length == 0) throw new NotFoundException(); List<MigrationInfo> failedMigrations = Lists.newArrayList(); for (MigrationInfo migrationInfo : migrationInfos) { if (migrationInfo.getState...
[ "private", "List", "<", "MigrationInfo", ">", "failed", "(", "MigrationInfo", "[", "]", "migrationInfos", ")", "{", "if", "(", "migrationInfos", ".", "length", "==", "0", ")", "throw", "new", "NotFoundException", "(", ")", ";", "List", "<", "MigrationInfo", ...
Retrieves the full set of infos about the migrations that failed. @return The failed migrations. An empty array if none.
[ "Retrieves", "the", "full", "set", "of", "infos", "about", "the", "migrations", "that", "failed", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/migration/resources/MigrationResource.java#L423-L434
46,137
icode/ameba
src/main/java/ameba/db/migration/resources/MigrationResource.java
MigrationResource.future
private List<MigrationInfo> future(MigrationInfo[] migrationInfos) { if (migrationInfos.length == 0) throw new NotFoundException(); List<MigrationInfo> futureMigrations = Lists.newArrayList(); for (MigrationInfo migrationInfo : migrationInfos) { if ((migrationInfo.getStat...
java
private List<MigrationInfo> future(MigrationInfo[] migrationInfos) { if (migrationInfos.length == 0) throw new NotFoundException(); List<MigrationInfo> futureMigrations = Lists.newArrayList(); for (MigrationInfo migrationInfo : migrationInfos) { if ((migrationInfo.getStat...
[ "private", "List", "<", "MigrationInfo", ">", "future", "(", "MigrationInfo", "[", "]", "migrationInfos", ")", "{", "if", "(", "migrationInfos", ".", "length", "==", "0", ")", "throw", "new", "NotFoundException", "(", ")", ";", "List", "<", "MigrationInfo", ...
Retrieves the full set of infos about future migrations applied to the DB. @return The future migrations. An empty array if none.
[ "Retrieves", "the", "full", "set", "of", "infos", "about", "future", "migrations", "applied", "to", "the", "DB", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/migration/resources/MigrationResource.java#L441-L453
46,138
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/libvirt/jdom/DiskXml.java
DiskXml.updateDisks
public static void updateDisks(Document domainXml, List<StorageVol> volumes) throws LibvirtException { XPathFactory xpf = XPathFactory.instance(); XPathExpression<Element> diskExpr = xpf.compile(XPATH_DISK, Filters.element()); XPathExpression<Attribute> fileExpr = xpf.compile(XPATH_DISK_FILE, Fi...
java
public static void updateDisks(Document domainXml, List<StorageVol> volumes) throws LibvirtException { XPathFactory xpf = XPathFactory.instance(); XPathExpression<Element> diskExpr = xpf.compile(XPATH_DISK, Filters.element()); XPathExpression<Attribute> fileExpr = xpf.compile(XPATH_DISK_FILE, Fi...
[ "public", "static", "void", "updateDisks", "(", "Document", "domainXml", ",", "List", "<", "StorageVol", ">", "volumes", ")", "throws", "LibvirtException", "{", "XPathFactory", "xpf", "=", "XPathFactory", ".", "instance", "(", ")", ";", "XPathExpression", "<", ...
update the disks in the domain XML. It is assumed that the the size of the volumes is the same as the number of disk elements and that the order is the same.
[ "update", "the", "disks", "in", "the", "domain", "XML", ".", "It", "is", "assumed", "that", "the", "the", "size", "of", "the", "volumes", "is", "the", "same", "as", "the", "number", "of", "disk", "elements", "and", "that", "the", "order", "is", "the", ...
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/jdom/DiskXml.java#L51-L62
46,139
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/libvirt/jdom/DiskXml.java
DiskXml.getDisks
public static List<Disk> getDisks(Connect connect, Document domainXml) { try { List<Disk> ret = new ArrayList<>(); XPathFactory xpf = XPathFactory.instance(); XPathExpression<Element> diskExpr = xpf.compile(XPATH_DISK, Filters.element()); XPathExpression<Attribute...
java
public static List<Disk> getDisks(Connect connect, Document domainXml) { try { List<Disk> ret = new ArrayList<>(); XPathFactory xpf = XPathFactory.instance(); XPathExpression<Element> diskExpr = xpf.compile(XPATH_DISK, Filters.element()); XPathExpression<Attribute...
[ "public", "static", "List", "<", "Disk", ">", "getDisks", "(", "Connect", "connect", ",", "Document", "domainXml", ")", "{", "try", "{", "List", "<", "Disk", ">", "ret", "=", "new", "ArrayList", "<>", "(", ")", ";", "XPathFactory", "xpf", "=", "XPathFa...
Get the disks connected to the domain.
[ "Get", "the", "disks", "connected", "to", "the", "domain", "." ]
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/jdom/DiskXml.java#L65-L87
46,140
tminglei/form-binder-java
src/main/java/com/github/tminglei/bind/Simple.java
Simple.mapping
public static GroupMapping mapping(Map.Entry<String, Mapping<?>>... fields) { return new GroupMapping(Arrays.asList(fields)); }
java
public static GroupMapping mapping(Map.Entry<String, Mapping<?>>... fields) { return new GroupMapping(Arrays.asList(fields)); }
[ "public", "static", "GroupMapping", "mapping", "(", "Map", ".", "Entry", "<", "String", ",", "Mapping", "<", "?", ">", ">", "...", "fields", ")", "{", "return", "new", "GroupMapping", "(", "Arrays", ".", "asList", "(", "fields", ")", ")", ";", "}" ]
shortcut method to construct group mapping @param fields fields for the group mapping @return new created mapping
[ "shortcut", "method", "to", "construct", "group", "mapping" ]
4c0bd1e8f81ae56b21142bb525ee6b4deb7f92ab
https://github.com/tminglei/form-binder-java/blob/4c0bd1e8f81ae56b21142bb525ee6b4deb7f92ab/src/main/java/com/github/tminglei/bind/Simple.java#L45-L47
46,141
tminglei/form-binder-java
src/main/java/com/github/tminglei/bind/Simple.java
Simple.field
public static Map.Entry<String, Mapping<?>> field(String name, Mapping<?> mapping) { return FrameworkUtils.entry(name, mapping); }
java
public static Map.Entry<String, Mapping<?>> field(String name, Mapping<?> mapping) { return FrameworkUtils.entry(name, mapping); }
[ "public", "static", "Map", ".", "Entry", "<", "String", ",", "Mapping", "<", "?", ">", ">", "field", "(", "String", "name", ",", "Mapping", "<", "?", ">", "mapping", ")", "{", "return", "FrameworkUtils", ".", "entry", "(", "name", ",", "mapping", ")"...
helper method to construct group field mapping @param name field name (short name) @param mapping the related mapping @return field entry
[ "helper", "method", "to", "construct", "group", "field", "mapping" ]
4c0bd1e8f81ae56b21142bb525ee6b4deb7f92ab
https://github.com/tminglei/form-binder-java/blob/4c0bd1e8f81ae56b21142bb525ee6b4deb7f92ab/src/main/java/com/github/tminglei/bind/Simple.java#L55-L57
46,142
MaxxtonGroup/microdocs
example/customer-service/src/main/java/com/example/service/customer/service/CustomerService.java
CustomerService.removeCustomer
public boolean removeCustomer(Long customerId) { Customer customer = getCustomer(customerId); if(customer != null){ customerRepository.delete(customer); return true; } return false; }
java
public boolean removeCustomer(Long customerId) { Customer customer = getCustomer(customerId); if(customer != null){ customerRepository.delete(customer); return true; } return false; }
[ "public", "boolean", "removeCustomer", "(", "Long", "customerId", ")", "{", "Customer", "customer", "=", "getCustomer", "(", "customerId", ")", ";", "if", "(", "customer", "!=", "null", ")", "{", "customerRepository", ".", "delete", "(", "customer", ")", ";"...
Remove customer from the repository @param customerId the id of the customer @return true if the customer is removed, false if no customer with the given id exists
[ "Remove", "customer", "from", "the", "repository" ]
fdc80f203d68145af3e8d28d13de63ddfa3e6953
https://github.com/MaxxtonGroup/microdocs/blob/fdc80f203d68145af3e8d28d13de63ddfa3e6953/example/customer-service/src/main/java/com/example/service/customer/service/CustomerService.java#L64-L71
46,143
icode/ameba
src/main/java/ameba/lib/Fibers.java
Fibers.parkAndSerialize
public static void parkAndSerialize(final FiberWriter writer) { try { Fiber.parkAndSerialize(writer); } catch (SuspendExecution e) { throw RuntimeSuspendExecution.of(e); } }
java
public static void parkAndSerialize(final FiberWriter writer) { try { Fiber.parkAndSerialize(writer); } catch (SuspendExecution e) { throw RuntimeSuspendExecution.of(e); } }
[ "public", "static", "void", "parkAndSerialize", "(", "final", "FiberWriter", "writer", ")", "{", "try", "{", "Fiber", ".", "parkAndSerialize", "(", "writer", ")", ";", "}", "catch", "(", "SuspendExecution", "e", ")", "{", "throw", "RuntimeSuspendExecution", "....
Parks the fiber and allows the given callback to serialize it. @param writer a callback that can serialize the fiber.
[ "Parks", "the", "fiber", "and", "allows", "the", "given", "callback", "to", "serialize", "it", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Fibers.java#L178-L184
46,144
icode/ameba
src/main/java/ameba/lib/Fibers.java
Fibers.unparkSerialized
public static <V> Fiber<V> unparkSerialized(byte[] serFiber, FiberScheduler scheduler) { return Fiber.unparkSerialized(serFiber, scheduler); }
java
public static <V> Fiber<V> unparkSerialized(byte[] serFiber, FiberScheduler scheduler) { return Fiber.unparkSerialized(serFiber, scheduler); }
[ "public", "static", "<", "V", ">", "Fiber", "<", "V", ">", "unparkSerialized", "(", "byte", "[", "]", "serFiber", ",", "FiberScheduler", "scheduler", ")", "{", "return", "Fiber", ".", "unparkSerialized", "(", "serFiber", ",", "scheduler", ")", ";", "}" ]
Deserializes a fiber from the given byte array and unparks it. @param serFiber The byte array containing a fiber's serialized form. @param scheduler The {@link FiberScheduler} to use for scheduling the fiber. @return The deserialized, running fiber.
[ "Deserializes", "a", "fiber", "from", "the", "given", "byte", "array", "and", "unparks", "it", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Fibers.java#L193-L195
46,145
icode/ameba
src/main/java/ameba/lib/Fibers.java
Fibers.runInFiber
public static <V> V runInFiber(FiberScheduler scheduler, SuspendableCallable<V> target) throws ExecutionException, InterruptedException { return FiberUtil.runInFiber(scheduler, target); }
java
public static <V> V runInFiber(FiberScheduler scheduler, SuspendableCallable<V> target) throws ExecutionException, InterruptedException { return FiberUtil.runInFiber(scheduler, target); }
[ "public", "static", "<", "V", ">", "V", "runInFiber", "(", "FiberScheduler", "scheduler", ",", "SuspendableCallable", "<", "V", ">", "target", ")", "throws", "ExecutionException", ",", "InterruptedException", "{", "return", "FiberUtil", ".", "runInFiber", "(", "...
Runs an action in a new fiber, awaits the fiber's termination, and returns its result. @param <V> @param scheduler the {@link FiberScheduler} to use when scheduling the fiber. @param target the operation @return the operations return value @throws ExecutionException @throws InterruptedException
[ "Runs", "an", "action", "in", "a", "new", "fiber", "awaits", "the", "fiber", "s", "termination", "and", "returns", "its", "result", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Fibers.java#L262-L264
46,146
icode/ameba
src/main/java/ameba/lib/Fibers.java
Fibers.runInFiber
public static void runInFiber(FiberScheduler scheduler, SuspendableRunnable target) throws ExecutionException, InterruptedException { FiberUtil.runInFiber(scheduler, target); }
java
public static void runInFiber(FiberScheduler scheduler, SuspendableRunnable target) throws ExecutionException, InterruptedException { FiberUtil.runInFiber(scheduler, target); }
[ "public", "static", "void", "runInFiber", "(", "FiberScheduler", "scheduler", ",", "SuspendableRunnable", "target", ")", "throws", "ExecutionException", ",", "InterruptedException", "{", "FiberUtil", ".", "runInFiber", "(", "scheduler", ",", "target", ")", ";", "}" ...
Runs an action in a new fiber and awaits the fiber's termination. @param scheduler the {@link FiberScheduler} to use when scheduling the fiber. @param target the operation @throws ExecutionException @throws InterruptedException
[ "Runs", "an", "action", "in", "a", "new", "fiber", "and", "awaits", "the", "fiber", "s", "termination", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Fibers.java#L287-L289
46,147
MaxxtonGroup/microdocs
example/order-service/src/main/java/com/example/service/order/controller/OrderController.java
OrderController.getOrder
@RequestMapping(path = "", method = RequestMethod.GET) public Page<Order> getOrder(Pageable pageable) { return orderService.getOrders(pageable); }
java
@RequestMapping(path = "", method = RequestMethod.GET) public Page<Order> getOrder(Pageable pageable) { return orderService.getOrders(pageable); }
[ "@", "RequestMapping", "(", "path", "=", "\"\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "Page", "<", "Order", ">", "getOrder", "(", "Pageable", "pageable", ")", "{", "return", "orderService", ".", "getOrders", "(", "pageable", ")",...
Get page of orders @param pageable define which page to request @response 200 @return List of orders
[ "Get", "page", "of", "orders" ]
fdc80f203d68145af3e8d28d13de63ddfa3e6953
https://github.com/MaxxtonGroup/microdocs/blob/fdc80f203d68145af3e8d28d13de63ddfa3e6953/example/order-service/src/main/java/com/example/service/order/controller/OrderController.java#L30-L33
46,148
MaxxtonGroup/microdocs
example/order-service/src/main/java/com/example/service/order/controller/OrderController.java
OrderController.getOrder
@RequestMapping(path = "/{orderId}", method = {RequestMethod.GET, RequestMethod.POST}) public ResponseEntity<Order> getOrder(@PathVariable("orderId") Long orderId) { Order order = orderService.getOrder(orderId); if(order != null){ return new ResponseEntity(order, HttpStatus.OK); ...
java
@RequestMapping(path = "/{orderId}", method = {RequestMethod.GET, RequestMethod.POST}) public ResponseEntity<Order> getOrder(@PathVariable("orderId") Long orderId) { Order order = orderService.getOrder(orderId); if(order != null){ return new ResponseEntity(order, HttpStatus.OK); ...
[ "@", "RequestMapping", "(", "path", "=", "\"/{orderId}\"", ",", "method", "=", "{", "RequestMethod", ".", "GET", ",", "RequestMethod", ".", "POST", "}", ")", "public", "ResponseEntity", "<", "Order", ">", "getOrder", "(", "@", "PathVariable", "(", "\"orderId...
Get order by id @param orderId order id @response 200 @response 404 @return Order or not found
[ "Get", "order", "by", "id" ]
fdc80f203d68145af3e8d28d13de63ddfa3e6953
https://github.com/MaxxtonGroup/microdocs/blob/fdc80f203d68145af3e8d28d13de63ddfa3e6953/example/order-service/src/main/java/com/example/service/order/controller/OrderController.java#L42-L49
46,149
MaxxtonGroup/microdocs
example/order-service/src/main/java/com/example/service/order/controller/OrderController.java
OrderController.updateStatus
@RequestMapping(path="/{orderId}/status", method = RequestMethod.PUT) public ResponseEntity<Order> updateStatus(@PathVariable("orderId") Long orderId, @RequestParam("status") OrderStatus status){ Order order = orderService.updateStatus(orderId, status); if(order != null){ return new Resp...
java
@RequestMapping(path="/{orderId}/status", method = RequestMethod.PUT) public ResponseEntity<Order> updateStatus(@PathVariable("orderId") Long orderId, @RequestParam("status") OrderStatus status){ Order order = orderService.updateStatus(orderId, status); if(order != null){ return new Resp...
[ "@", "RequestMapping", "(", "path", "=", "\"/{orderId}/status\"", ",", "method", "=", "RequestMethod", ".", "PUT", ")", "public", "ResponseEntity", "<", "Order", ">", "updateStatus", "(", "@", "PathVariable", "(", "\"orderId\"", ")", "Long", "orderId", ",", "@...
Update order status @param orderId id of the order @param status new order status @response 200 @response 404 @return Order with the new status
[ "Update", "order", "status" ]
fdc80f203d68145af3e8d28d13de63ddfa3e6953
https://github.com/MaxxtonGroup/microdocs/blob/fdc80f203d68145af3e8d28d13de63ddfa3e6953/example/order-service/src/main/java/com/example/service/order/controller/OrderController.java#L75-L82
46,150
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java
VirtualboxDriver.vmExists
public boolean vmExists(final String vmOrUuid) { String[] lines = execute("list", "vms").split("\\s"); for (String line : lines) { if (line.endsWith("{" + vmOrUuid + "}") || line.startsWith("\"" + vmOrUuid + "\"")) return true; } return false; }
java
public boolean vmExists(final String vmOrUuid) { String[] lines = execute("list", "vms").split("\\s"); for (String line : lines) { if (line.endsWith("{" + vmOrUuid + "}") || line.startsWith("\"" + vmOrUuid + "\"")) return true; } return false; }
[ "public", "boolean", "vmExists", "(", "final", "String", "vmOrUuid", ")", "{", "String", "[", "]", "lines", "=", "execute", "(", "\"list\"", ",", "\"vms\"", ")", ".", "split", "(", "\"\\\\s\"", ")", ";", "for", "(", "String", "line", ":", "lines", ")",...
Checks if VM exists. Accepts UUID or VM name as an argument.
[ "Checks", "if", "VM", "exists", ".", "Accepts", "UUID", "or", "VM", "name", "as", "an", "argument", "." ]
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java#L44-L51
46,151
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java
VirtualboxDriver.loadSnapshot
public void loadSnapshot(String vm, String snapshotUuid) { if (!EnumSet.of(POWEROFF, SAVED).contains(vmState(vm))) { powerOff(vm); } execute("snapshot", vm, "restore", snapshotUuid); start(vm); }
java
public void loadSnapshot(String vm, String snapshotUuid) { if (!EnumSet.of(POWEROFF, SAVED).contains(vmState(vm))) { powerOff(vm); } execute("snapshot", vm, "restore", snapshotUuid); start(vm); }
[ "public", "void", "loadSnapshot", "(", "String", "vm", ",", "String", "snapshotUuid", ")", "{", "if", "(", "!", "EnumSet", ".", "of", "(", "POWEROFF", ",", "SAVED", ")", ".", "contains", "(", "vmState", "(", "vm", ")", ")", ")", "{", "powerOff", "(",...
Shuts down if running, restores the snapshot and starts VM.
[ "Shuts", "down", "if", "running", "restores", "the", "snapshot", "and", "starts", "VM", "." ]
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java#L56-L62
46,152
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java
VirtualboxDriver.execute
public String execute(String... command) { return commandProcessor.run(aCommand("VBoxManage").withArguments(command)).getOutput(); }
java
public String execute(String... command) { return commandProcessor.run(aCommand("VBoxManage").withArguments(command)).getOutput(); }
[ "public", "String", "execute", "(", "String", "...", "command", ")", "{", "return", "commandProcessor", ".", "run", "(", "aCommand", "(", "\"VBoxManage\"", ")", ".", "withArguments", "(", "command", ")", ")", ".", "getOutput", "(", ")", ";", "}" ]
Executes custom VBoxManage command
[ "Executes", "custom", "VBoxManage", "command" ]
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java#L96-L98
46,153
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java
VirtualboxDriver.setExtraData
public void setExtraData(String vm, String k, String v) { execute("setextradata", vm, k, v); }
java
public void setExtraData(String vm, String k, String v) { execute("setextradata", vm, k, v); }
[ "public", "void", "setExtraData", "(", "String", "vm", ",", "String", "k", ",", "String", "v", ")", "{", "execute", "(", "\"setextradata\"", ",", "vm", ",", "k", ",", "v", ")", ";", "}" ]
Sets extra data on the VM
[ "Sets", "extra", "data", "on", "the", "VM" ]
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/virtualbox/VirtualboxDriver.java#L103-L105
46,154
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/Value.java
Value.update
public void update (T value) { // store our new current value _value = value; // notify our listeners; we snapshot our listeners before iterating to avoid problems if // listeners add or remove themselves while we're dispatching this notification for (Listener<T> listener : ...
java
public void update (T value) { // store our new current value _value = value; // notify our listeners; we snapshot our listeners before iterating to avoid problems if // listeners add or remove themselves while we're dispatching this notification for (Listener<T> listener : ...
[ "public", "void", "update", "(", "T", "value", ")", "{", "// store our new current value", "_value", "=", "value", ";", "// notify our listeners; we snapshot our listeners before iterating to avoid problems if", "// listeners add or remove themselves while we're dispatching this notifica...
Updates this value and notifies all listeners. This will notify the listeners regardless of whether the supplied value differs from the current value.
[ "Updates", "this", "value", "and", "notifies", "all", "listeners", ".", "This", "will", "notify", "the", "listeners", "regardless", "of", "whether", "the", "supplied", "value", "differs", "from", "the", "current", "value", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/Value.java#L94-L104
46,155
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/PagedWidget.java
PagedWidget.displayPage
public void displayPage (final int page, boolean forceRefresh) { if (_page == page && !forceRefresh) { return; // NOOP! } // Display the now loading widget, if necessary. configureLoadingNavi(_controls, 0, _infoCol); _page = Math.max(page, 0); final boo...
java
public void displayPage (final int page, boolean forceRefresh) { if (_page == page && !forceRefresh) { return; // NOOP! } // Display the now loading widget, if necessary. configureLoadingNavi(_controls, 0, _infoCol); _page = Math.max(page, 0); final boo...
[ "public", "void", "displayPage", "(", "final", "int", "page", ",", "boolean", "forceRefresh", ")", "{", "if", "(", "_page", "==", "page", "&&", "!", "forceRefresh", ")", "{", "return", ";", "// NOOP!", "}", "// Display the now loading widget, if necessary.", "co...
Displays the specified page. Does nothing if we are already displaying that page unless forceRefresh is true.
[ "Displays", "the", "specified", "page", ".", "Does", "nothing", "if", "we", "are", "already", "displaying", "that", "page", "unless", "forceRefresh", "is", "true", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L160-L196
46,156
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/PagedWidget.java
PagedWidget.removeItem
public void removeItem (T item) { if (_model == null) { return; // if we have no model, stop here } // remove the item from our data model _model.removeItem(item); // force a relayout of this page displayPage(_page, true); }
java
public void removeItem (T item) { if (_model == null) { return; // if we have no model, stop here } // remove the item from our data model _model.removeItem(item); // force a relayout of this page displayPage(_page, true); }
[ "public", "void", "removeItem", "(", "T", "item", ")", "{", "if", "(", "_model", "==", "null", ")", "{", "return", ";", "// if we have no model, stop here", "}", "// remove the item from our data model", "_model", ".", "removeItem", "(", "item", ")", ";", "// fo...
Removes the specified item from the panel. If the item is currently being displayed, its interface element will be removed as well.
[ "Removes", "the", "specified", "item", "from", "the", "panel", ".", "If", "the", "item", "is", "currently", "being", "displayed", "its", "interface", "element", "will", "be", "removed", "as", "well", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L202-L211
46,157
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/PagedWidget.java
PagedWidget.configureNavi
protected void configureNavi (FlexTable controls, int row, int col, int start, int limit, int total) { HorizontalPanel panel = new HorizontalPanel(); panel.add(new Label("Page:")); // TODO: i18n // determine which pages we want to show int page = 1+...
java
protected void configureNavi (FlexTable controls, int row, int col, int start, int limit, int total) { HorizontalPanel panel = new HorizontalPanel(); panel.add(new Label("Page:")); // TODO: i18n // determine which pages we want to show int page = 1+...
[ "protected", "void", "configureNavi", "(", "FlexTable", "controls", ",", "int", "row", ",", "int", "col", ",", "int", "start", ",", "int", "limit", ",", "int", "total", ")", "{", "HorizontalPanel", "panel", "=", "new", "HorizontalPanel", "(", ")", ";", "...
Get the text that should be shown in the header bar between the "prev" and "next" buttons.
[ "Get", "the", "text", "that", "should", "be", "shown", "in", "the", "header", "bar", "between", "the", "prev", "and", "next", "buttons", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L228-L272
46,158
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/PagedWidget.java
PagedWidget.reportFailure
protected void reportFailure (Throwable caught) { java.util.logging.Logger.getLogger("PagedWidget").warning("Failure to page: " + caught); }
java
protected void reportFailure (Throwable caught) { java.util.logging.Logger.getLogger("PagedWidget").warning("Failure to page: " + caught); }
[ "protected", "void", "reportFailure", "(", "Throwable", "caught", ")", "{", "java", ".", "util", ".", "logging", ".", "Logger", ".", "getLogger", "(", "\"PagedWidget\"", ")", ".", "warning", "(", "\"Failure to page: \"", "+", "caught", ")", ";", "}" ]
Report a service failure.
[ "Report", "a", "service", "failure", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L366-L369
46,159
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/EscapeClickAdapter.java
EscapeClickAdapter.onKeyPress
public void onKeyPress (KeyPressEvent event) { if (event.getCharCode() == KeyCodes.KEY_ESCAPE) { _onEscape.onClick(null); } }
java
public void onKeyPress (KeyPressEvent event) { if (event.getCharCode() == KeyCodes.KEY_ESCAPE) { _onEscape.onClick(null); } }
[ "public", "void", "onKeyPress", "(", "KeyPressEvent", "event", ")", "{", "if", "(", "event", ".", "getCharCode", "(", ")", "==", "KeyCodes", ".", "KEY_ESCAPE", ")", "{", "_onEscape", ".", "onClick", "(", "null", ")", ";", "}", "}" ]
from interface KeyPressHandler
[ "from", "interface", "KeyPressHandler" ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/EscapeClickAdapter.java#L41-L46
46,160
icode/ameba
src/main/java/ameba/mvc/template/internal/TemplateHelper.java
TemplateHelper.getResourceMethodProducibleTypes
private static List<MediaType> getResourceMethodProducibleTypes(final ExtendedUriInfo extendedUriInfo) { if (extendedUriInfo.getMatchedResourceMethod() != null && !extendedUriInfo.getMatchedResourceMethod().getProducedTypes().isEmpty()) { return extendedUriInfo.getMatchedResourceMeth...
java
private static List<MediaType> getResourceMethodProducibleTypes(final ExtendedUriInfo extendedUriInfo) { if (extendedUriInfo.getMatchedResourceMethod() != null && !extendedUriInfo.getMatchedResourceMethod().getProducedTypes().isEmpty()) { return extendedUriInfo.getMatchedResourceMeth...
[ "private", "static", "List", "<", "MediaType", ">", "getResourceMethodProducibleTypes", "(", "final", "ExtendedUriInfo", "extendedUriInfo", ")", "{", "if", "(", "extendedUriInfo", ".", "getMatchedResourceMethod", "(", ")", "!=", "null", "&&", "!", "extendedUriInfo", ...
Return a list of producible media types of the last matched resource method. @param extendedUriInfo uri info to obtain resource method from. @return list of producible media types of the last matched resource method.
[ "Return", "a", "list", "of", "producible", "media", "types", "of", "the", "last", "matched", "resource", "method", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/TemplateHelper.java#L100-L106
46,161
icode/ameba
src/main/java/ameba/mvc/template/internal/TemplateHelper.java
TemplateHelper.getTemplateOutputEncoding
public static Charset getTemplateOutputEncoding(Configuration configuration, String suffix) { final String enc = PropertiesHelper.getValue(configuration.getProperties(), MvcFeature.ENCODING + suffix, String.class, null); if (enc == null) { return DEFAULT_ENCODING; } e...
java
public static Charset getTemplateOutputEncoding(Configuration configuration, String suffix) { final String enc = PropertiesHelper.getValue(configuration.getProperties(), MvcFeature.ENCODING + suffix, String.class, null); if (enc == null) { return DEFAULT_ENCODING; } e...
[ "public", "static", "Charset", "getTemplateOutputEncoding", "(", "Configuration", "configuration", ",", "String", "suffix", ")", "{", "final", "String", "enc", "=", "PropertiesHelper", ".", "getValue", "(", "configuration", ".", "getProperties", "(", ")", ",", "Mv...
Get output encoding from configuration. @param configuration Configuration. @param suffix Template processor suffix of the to configuration property {@link org.glassfish.jersey.server.mvc.MvcFeature#ENCODING}. @return Encoding read from configuration properties or a default encoding if no encoding is configured...
[ "Get", "output", "encoding", "from", "configuration", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/TemplateHelper.java#L152-L160
46,162
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/libvirt/jdom/InterfaceXml.java
InterfaceXml.getMacs
public static Map<String, String> getMacs(Document domainXml) { Map<String, String> macs = new HashMap<>(); XPathFactory xpf = XPathFactory.instance(); XPathExpression<Element> interfaces = xpf.compile("/domain/devices/interface", Filters.element()); for (Element iface : interfaces.evalu...
java
public static Map<String, String> getMacs(Document domainXml) { Map<String, String> macs = new HashMap<>(); XPathFactory xpf = XPathFactory.instance(); XPathExpression<Element> interfaces = xpf.compile("/domain/devices/interface", Filters.element()); for (Element iface : interfaces.evalu...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getMacs", "(", "Document", "domainXml", ")", "{", "Map", "<", "String", ",", "String", ">", "macs", "=", "new", "HashMap", "<>", "(", ")", ";", "XPathFactory", "xpf", "=", "XPathFactory", "...
Get a map of mac addresses of interfaces defined on the domain. This is somewhat limited at the moment. It is assumed that only one network interface with mac is connected to a bridge or network. For instance if you have a bridged network device connected to 'br0' then you will find it's MAC address with the key 'br0'.
[ "Get", "a", "map", "of", "mac", "addresses", "of", "interfaces", "defined", "on", "the", "domain", ".", "This", "is", "somewhat", "limited", "at", "the", "moment", ".", "It", "is", "assumed", "that", "only", "one", "network", "interface", "with", "mac", ...
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/jdom/InterfaceXml.java#L40-L66
46,163
ebean-orm/ebean-mocker
src/main/java/io/ebean/MockiEbean.java
MockiEbean.runWithMock
public static <V> V runWithMock(EbeanServer mock, Callable<V> test) throws Exception { return start(mock).run(test); }
java
public static <V> V runWithMock(EbeanServer mock, Callable<V> test) throws Exception { return start(mock).run(test); }
[ "public", "static", "<", "V", ">", "V", "runWithMock", "(", "EbeanServer", "mock", ",", "Callable", "<", "V", ">", "test", ")", "throws", "Exception", "{", "return", "start", "(", "mock", ")", ".", "run", "(", "test", ")", ";", "}" ]
Run the test runnable using the mock EbeanServer and restoring the original EbeanServer afterward. @param mock the mock instance that becomes the default EbeanServer @param test typically some test code as a callable
[ "Run", "the", "test", "runnable", "using", "the", "mock", "EbeanServer", "and", "restoring", "the", "original", "EbeanServer", "afterward", "." ]
98c14a58253e8cd40b2a0c9b49526a307079389a
https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/MockiEbean.java#L107-L110
46,164
ebean-orm/ebean-mocker
src/main/java/io/ebean/MockiEbean.java
MockiEbean.run
public <V> V run(Callable<V> testCallable) throws Exception { try { beforeRun(); return testCallable.call(); } finally { afterRun(); restoreOriginal(); } }
java
public <V> V run(Callable<V> testCallable) throws Exception { try { beforeRun(); return testCallable.call(); } finally { afterRun(); restoreOriginal(); } }
[ "public", "<", "V", ">", "V", "run", "(", "Callable", "<", "V", ">", "testCallable", ")", "throws", "Exception", "{", "try", "{", "beforeRun", "(", ")", ";", "return", "testCallable", ".", "call", "(", ")", ";", "}", "finally", "{", "afterRun", "(", ...
Run the test callable restoring the original EbeanServer afterwards.
[ "Run", "the", "test", "callable", "restoring", "the", "original", "EbeanServer", "afterwards", "." ]
98c14a58253e8cd40b2a0c9b49526a307079389a
https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/MockiEbean.java#L164-L172
46,165
ebean-orm/ebean-mocker
src/main/java/io/ebean/MockiEbean.java
MockiEbean.restoreOriginal
public void restoreOriginal() { if (original == null) { throw new IllegalStateException("Original EbeanServer instance is null"); } if (original.getName() == null) { throw new IllegalStateException("Original EbeanServer name is null"); } // restore the original EbeanServer back Ebea...
java
public void restoreOriginal() { if (original == null) { throw new IllegalStateException("Original EbeanServer instance is null"); } if (original.getName() == null) { throw new IllegalStateException("Original EbeanServer name is null"); } // restore the original EbeanServer back Ebea...
[ "public", "void", "restoreOriginal", "(", ")", "{", "if", "(", "original", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Original EbeanServer instance is null\"", ")", ";", "}", "if", "(", "original", ".", "getName", "(", ")", "==", ...
Restore the original EbeanServer implementation as the default EbeanServer.
[ "Restore", "the", "original", "EbeanServer", "implementation", "as", "the", "default", "EbeanServer", "." ]
98c14a58253e8cd40b2a0c9b49526a307079389a
https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/MockiEbean.java#L200-L210
46,166
icode/ameba
src/main/java/ameba/db/ebean/internal/ModelInterceptor.java
ModelInterceptor.getSingleIntegerParam
protected static Integer getSingleIntegerParam(List<String> list) { String s = getSingleParam(list); if (s != null) { try { return Integer.valueOf(s); } catch (NumberFormatException e) { return null; } } return null; ...
java
protected static Integer getSingleIntegerParam(List<String> list) { String s = getSingleParam(list); if (s != null) { try { return Integer.valueOf(s); } catch (NumberFormatException e) { return null; } } return null; ...
[ "protected", "static", "Integer", "getSingleIntegerParam", "(", "List", "<", "String", ">", "list", ")", "{", "String", "s", "=", "getSingleParam", "(", "list", ")", ";", "if", "(", "s", "!=", "null", ")", "{", "try", "{", "return", "Integer", ".", "va...
Return a single Integer parameter. @param list a {@link java.util.List} object. @return a {@link java.lang.Integer} object.
[ "Return", "a", "single", "Integer", "parameter", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/internal/ModelInterceptor.java#L143-L153
46,167
icode/ameba
src/main/java/ameba/db/ebean/internal/ModelInterceptor.java
ModelInterceptor.getSingleParam
protected static String getSingleParam(List<String> list) { if (list != null && list.size() == 1) { return list.get(0); } return null; }
java
protected static String getSingleParam(List<String> list) { if (list != null && list.size() == 1) { return list.get(0); } return null; }
[ "protected", "static", "String", "getSingleParam", "(", "List", "<", "String", ">", "list", ")", "{", "if", "(", "list", "!=", "null", "&&", "list", ".", "size", "(", ")", "==", "1", ")", "{", "return", "list", ".", "get", "(", "0", ")", ";", "}"...
Return a single parameter value. @param list a {@link java.util.List} object. @return a {@link java.lang.String} object.
[ "Return", "a", "single", "parameter", "value", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/internal/ModelInterceptor.java#L161-L166
46,168
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/InputUtil.java
InputUtil.requireNonEmpty
public static <T extends FocusWidget & HasText> String requireNonEmpty (T widget, String error) { String text = widget.getText().trim(); if (text.length() == 0) { Popups.errorBelow(error, widget); widget.setFocus(true); throw new InputException(); } ...
java
public static <T extends FocusWidget & HasText> String requireNonEmpty (T widget, String error) { String text = widget.getText().trim(); if (text.length() == 0) { Popups.errorBelow(error, widget); widget.setFocus(true); throw new InputException(); } ...
[ "public", "static", "<", "T", "extends", "FocusWidget", "&", "HasText", ">", "String", "requireNonEmpty", "(", "T", "widget", ",", "String", "error", ")", "{", "String", "text", "=", "widget", ".", "getText", "(", ")", ".", "trim", "(", ")", ";", "if",...
Returns a text widget's value, making sure it is non-empty. @throws InputException if the widget has no text
[ "Returns", "a", "text", "widget", "s", "value", "making", "sure", "it", "is", "non", "-", "empty", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/InputUtil.java#L23-L32
46,169
alexvasilkov/Events
sample/src/main/java/com/alexvasilkov/events/sample/ui/util/Tints.java
Tints.tint
public static void tint(View view, Tint tint) { final ColorStateList color = tint.getColor(view.getContext()); if (view instanceof ImageView) { tint(((ImageView) view).getDrawable(), color); } else if (view instanceof TextView) { TextView text = (TextView) view; ...
java
public static void tint(View view, Tint tint) { final ColorStateList color = tint.getColor(view.getContext()); if (view instanceof ImageView) { tint(((ImageView) view).getDrawable(), color); } else if (view instanceof TextView) { TextView text = (TextView) view; ...
[ "public", "static", "void", "tint", "(", "View", "view", ",", "Tint", "tint", ")", "{", "final", "ColorStateList", "color", "=", "tint", ".", "getColor", "(", "view", ".", "getContext", "(", ")", ")", ";", "if", "(", "view", "instanceof", "ImageView", ...
Tints ImageView drawable or TextView compound drawables to given tint color.
[ "Tints", "ImageView", "drawable", "or", "TextView", "compound", "drawables", "to", "given", "tint", "color", "." ]
4208e11fab35d99229fe6c3b3d434ca1948f3fc5
https://github.com/alexvasilkov/Events/blob/4208e11fab35d99229fe6c3b3d434ca1948f3fc5/sample/src/main/java/com/alexvasilkov/events/sample/ui/util/Tints.java#L69-L86
46,170
xebialabs/overcast
src/main/java/com/xebialabs/overcast/support/libvirt/DomainWrapper.java
DomainWrapper.cloneWithBackingStore
public DomainWrapper cloneWithBackingStore(String cloneName, List<Filesystem> mappings) { logger.info("Creating clone from {}", getName()); try { // duplicate definition of base Document cloneXmlDocument = domainXml.clone(); setDomainName(cloneXmlDocument, cloneName)...
java
public DomainWrapper cloneWithBackingStore(String cloneName, List<Filesystem> mappings) { logger.info("Creating clone from {}", getName()); try { // duplicate definition of base Document cloneXmlDocument = domainXml.clone(); setDomainName(cloneXmlDocument, cloneName)...
[ "public", "DomainWrapper", "cloneWithBackingStore", "(", "String", "cloneName", ",", "List", "<", "Filesystem", ">", "mappings", ")", "{", "logger", ".", "info", "(", "\"Creating clone from {}\"", ",", "getName", "(", ")", ")", ";", "try", "{", "// duplicate def...
Clone the domain. All disks are cloned using the original disk as backing store. The names of the disks are created by suffixing the original disk name with a number.
[ "Clone", "the", "domain", ".", "All", "disks", "are", "cloned", "using", "the", "original", "disk", "as", "backing", "store", ".", "The", "names", "of", "the", "disks", "are", "created", "by", "suffixing", "the", "original", "disk", "name", "with", "a", ...
716e57b66870c9afe51edc3b6045863a34fb0061
https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/DomainWrapper.java#L108-L139
46,171
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/SimpleDataModel.java
SimpleDataModel.newModel
public static <T> SimpleDataModel<T> newModel (List<T> items) { return new SimpleDataModel<T>(items); }
java
public static <T> SimpleDataModel<T> newModel (List<T> items) { return new SimpleDataModel<T>(items); }
[ "public", "static", "<", "T", ">", "SimpleDataModel", "<", "T", ">", "newModel", "(", "List", "<", "T", ">", "items", ")", "{", "return", "new", "SimpleDataModel", "<", "T", ">", "(", "items", ")", ";", "}" ]
Creates a new simple data model with the supplied list of items.
[ "Creates", "a", "new", "simple", "data", "model", "with", "the", "supplied", "list", "of", "items", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/SimpleDataModel.java#L40-L43
46,172
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/SimpleDataModel.java
SimpleDataModel.filter
public SimpleDataModel<T> filter (Predicate<T> pred) { // if (Predicates.alwaysTrue().equals(pred)) { // return this; // optimization // } List<T> items = new ArrayList<T>(); for (T item : _items) { if (pred.apply(item)) { items.add(item); ...
java
public SimpleDataModel<T> filter (Predicate<T> pred) { // if (Predicates.alwaysTrue().equals(pred)) { // return this; // optimization // } List<T> items = new ArrayList<T>(); for (T item : _items) { if (pred.apply(item)) { items.add(item); ...
[ "public", "SimpleDataModel", "<", "T", ">", "filter", "(", "Predicate", "<", "T", ">", "pred", ")", "{", "// if (Predicates.alwaysTrue().equals(pred)) {", "// return this; // optimization", "// }", "List", "<", "T", ">", "items", "=", "new", "...
Returns a data model that contains only items that match the supplied predicate.
[ "Returns", "a", "data", "model", "that", "contains", "only", "items", "that", "match", "the", "supplied", "predicate", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/SimpleDataModel.java#L56-L68
46,173
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/SimpleDataModel.java
SimpleDataModel.addItem
public void addItem (int index, T item) { if (_items == null) { return; } _items.add(index, item); }
java
public void addItem (int index, T item) { if (_items == null) { return; } _items.add(index, item); }
[ "public", "void", "addItem", "(", "int", "index", ",", "T", "item", ")", "{", "if", "(", "_items", "==", "null", ")", "{", "return", ";", "}", "_items", ".", "add", "(", "index", ",", "item", ")", ";", "}" ]
Adds an item to this model. Does not force the refresh of any display.
[ "Adds", "an", "item", "to", "this", "model", ".", "Does", "not", "force", "the", "refresh", "of", "any", "display", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/SimpleDataModel.java#L73-L79
46,174
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/SimpleDataModel.java
SimpleDataModel.updateItem
public void updateItem (T item) { if (_items == null) { return; } int idx = _items.indexOf(item); if (idx == -1) { _items.add(0, item); } else { _items.set(idx, item); } }
java
public void updateItem (T item) { if (_items == null) { return; } int idx = _items.indexOf(item); if (idx == -1) { _items.add(0, item); } else { _items.set(idx, item); } }
[ "public", "void", "updateItem", "(", "T", "item", ")", "{", "if", "(", "_items", "==", "null", ")", "{", "return", ";", "}", "int", "idx", "=", "_items", ".", "indexOf", "(", "item", ")", ";", "if", "(", "idx", "==", "-", "1", ")", "{", "_items...
Updates the specified item if found in the model, prepends it otherwise.
[ "Updates", "the", "specified", "item", "if", "found", "in", "the", "model", "prepends", "it", "otherwise", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/SimpleDataModel.java#L84-L95
46,175
threerings/gwt-utils
src/main/java/com/threerings/gwt/util/SimpleDataModel.java
SimpleDataModel.findItem
public T findItem (Predicate<T> p) { if (_items == null) { return null; } for (T item : _items) { if (p.apply(item)) { return item; } } return null; }
java
public T findItem (Predicate<T> p) { if (_items == null) { return null; } for (T item : _items) { if (p.apply(item)) { return item; } } return null; }
[ "public", "T", "findItem", "(", "Predicate", "<", "T", ">", "p", ")", "{", "if", "(", "_items", "==", "null", ")", "{", "return", "null", ";", "}", "for", "(", "T", "item", ":", "_items", ")", "{", "if", "(", "p", ".", "apply", "(", "item", "...
Returns the first item that matches the supplied predicate or null if no items in this model matches the predicate.
[ "Returns", "the", "first", "item", "that", "matches", "the", "supplied", "predicate", "or", "null", "if", "no", "items", "in", "this", "model", "matches", "the", "predicate", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/SimpleDataModel.java#L101-L112
46,176
icode/ameba
src/main/java/ameba/db/ebean/EbeanFinder.java
EbeanFinder.byId
@SuppressWarnings("unchecked") public <M extends T> M byId(ID id) { return (M) server().find(getModelType(), id); }
java
@SuppressWarnings("unchecked") public <M extends T> M byId(ID id) { return (M) server().find(getModelType(), id); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "M", "extends", "T", ">", "M", "byId", "(", "ID", "id", ")", "{", "return", "(", "M", ")", "server", "(", ")", ".", "find", "(", "getModelType", "(", ")", ",", "id", ")", ";", "}"...
Retrieves an entity by ID. @param id a ID object. @return a M object.
[ "Retrieves", "an", "entity", "by", "ID", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/EbeanFinder.java#L69-L72
46,177
icode/ameba
src/main/java/ameba/db/ebean/EbeanFinder.java
EbeanFinder.ref
@SuppressWarnings("unchecked") public <M extends T> M ref(ID id) { return (M) server().getReference(getModelType(), id); }
java
@SuppressWarnings("unchecked") public <M extends T> M ref(ID id) { return (M) server().getReference(getModelType(), id); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "M", "extends", "T", ">", "M", "ref", "(", "ID", "id", ")", "{", "return", "(", "M", ")", "server", "(", ")", ".", "getReference", "(", "getModelType", "(", ")", ",", "id", ")", ";"...
Retrieves an entity reference for this ID. @param id a ID object. @return a M object.
[ "Retrieves", "an", "entity", "reference", "for", "this", "ID", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/EbeanFinder.java#L80-L83
46,178
icode/ameba
src/main/java/ameba/db/ebean/EbeanFinder.java
EbeanFinder.findMap
@SuppressWarnings("unchecked") public <M extends T> Map<?, M> findMap() { return (Map<?, M>) query().findMap(); }
java
@SuppressWarnings("unchecked") public <M extends T> Map<?, M> findMap() { return (Map<?, M>) query().findMap(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "M", "extends", "T", ">", "Map", "<", "?", ",", "M", ">", "findMap", "(", ")", "{", "return", "(", "Map", "<", "?", ",", "M", ">", ")", "query", "(", ")", ".", "findMap", "(", "...
Executes the query and returns the results as a map of objects. @return a {@link java.util.Map} object.
[ "Executes", "the", "query", "and", "returns", "the", "results", "as", "a", "map", "of", "objects", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/EbeanFinder.java#L251-L254
46,179
icode/ameba
src/main/java/ameba/db/ebean/EbeanFinder.java
EbeanFinder.findSet
@SuppressWarnings("unchecked") public <M extends T> Set<M> findSet() { return (Set<M>) query().findSet(); }
java
@SuppressWarnings("unchecked") public <M extends T> Set<M> findSet() { return (Set<M>) query().findSet(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "M", "extends", "T", ">", "Set", "<", "M", ">", "findSet", "(", ")", "{", "return", "(", "Set", "<", "M", ">", ")", "query", "(", ")", ".", "findSet", "(", ")", ";", "}" ]
Executes the query and returns the results as a set of objects. @return a {@link java.util.Set} object.
[ "Executes", "the", "query", "and", "returns", "the", "results", "as", "a", "set", "of", "objects", "." ]
9d4956e935898e41331b2745e400ef869cd265e0
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/EbeanFinder.java#L279-L282
46,180
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newSimplePanel
public static SimplePanel newSimplePanel (String styleName, Widget widget) { SimplePanel panel = new SimplePanel(); if (widget != null) { panel.setWidget(widget); } return setStyleNames(panel, styleName); }
java
public static SimplePanel newSimplePanel (String styleName, Widget widget) { SimplePanel panel = new SimplePanel(); if (widget != null) { panel.setWidget(widget); } return setStyleNames(panel, styleName); }
[ "public", "static", "SimplePanel", "newSimplePanel", "(", "String", "styleName", ",", "Widget", "widget", ")", "{", "SimplePanel", "panel", "=", "new", "SimplePanel", "(", ")", ";", "if", "(", "widget", "!=", "null", ")", "{", "panel", ".", "setWidget", "(...
Creates a SimplePanel with the supplied style and widget
[ "Creates", "a", "SimplePanel", "with", "the", "supplied", "style", "and", "widget" ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L58-L65
46,181
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newFlowPanel
public static FlowPanel newFlowPanel (String styleName, Widget... contents) { FlowPanel panel = new FlowPanel(); for (Widget child : contents) { if (child != null) { panel.add(child); } } return setStyleNames(panel, styleName); }
java
public static FlowPanel newFlowPanel (String styleName, Widget... contents) { FlowPanel panel = new FlowPanel(); for (Widget child : contents) { if (child != null) { panel.add(child); } } return setStyleNames(panel, styleName); }
[ "public", "static", "FlowPanel", "newFlowPanel", "(", "String", "styleName", ",", "Widget", "...", "contents", ")", "{", "FlowPanel", "panel", "=", "new", "FlowPanel", "(", ")", ";", "for", "(", "Widget", "child", ":", "contents", ")", "{", "if", "(", "c...
Creates a FlowPanel with the provided style and widgets.
[ "Creates", "a", "FlowPanel", "with", "the", "provided", "style", "and", "widgets", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L78-L87
46,182
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newScrollPanelX
public static ScrollPanel newScrollPanelX (Widget contents, int maxWidth) { ScrollPanel panel = new ScrollPanel(contents); DOM.setStyleAttribute(panel.getElement(), "maxWidth", maxWidth + "px"); return panel; }
java
public static ScrollPanel newScrollPanelX (Widget contents, int maxWidth) { ScrollPanel panel = new ScrollPanel(contents); DOM.setStyleAttribute(panel.getElement(), "maxWidth", maxWidth + "px"); return panel; }
[ "public", "static", "ScrollPanel", "newScrollPanelX", "(", "Widget", "contents", ",", "int", "maxWidth", ")", "{", "ScrollPanel", "panel", "=", "new", "ScrollPanel", "(", "contents", ")", ";", "DOM", ".", "setStyleAttribute", "(", "panel", ".", "getElement", "...
Wraps the supplied contents in a scroll panel with the specified maximum width.
[ "Wraps", "the", "supplied", "contents", "in", "a", "scroll", "panel", "with", "the", "specified", "maximum", "width", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L119-L124
46,183
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newScrollPanelY
public static ScrollPanel newScrollPanelY (Widget contents, int maxHeight) { ScrollPanel panel = new ScrollPanel(contents); DOM.setStyleAttribute(panel.getElement(), "maxHeight", maxHeight + "px"); return panel; }
java
public static ScrollPanel newScrollPanelY (Widget contents, int maxHeight) { ScrollPanel panel = new ScrollPanel(contents); DOM.setStyleAttribute(panel.getElement(), "maxHeight", maxHeight + "px"); return panel; }
[ "public", "static", "ScrollPanel", "newScrollPanelY", "(", "Widget", "contents", ",", "int", "maxHeight", ")", "{", "ScrollPanel", "panel", "=", "new", "ScrollPanel", "(", "contents", ")", ";", "DOM", ".", "setStyleAttribute", "(", "panel", ".", "getElement", ...
Wraps the supplied contents in a scroll panel with the specified maximum height.
[ "Wraps", "the", "supplied", "contents", "in", "a", "scroll", "panel", "with", "the", "specified", "maximum", "height", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L129-L134
46,184
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newRow
public static HorizontalPanel newRow (String styleName, Widget... contents) { return newRow(HasAlignment.ALIGN_MIDDLE, styleName, contents); }
java
public static HorizontalPanel newRow (String styleName, Widget... contents) { return newRow(HasAlignment.ALIGN_MIDDLE, styleName, contents); }
[ "public", "static", "HorizontalPanel", "newRow", "(", "String", "styleName", ",", "Widget", "...", "contents", ")", "{", "return", "newRow", "(", "HasAlignment", ".", "ALIGN_MIDDLE", ",", "styleName", ",", "contents", ")", ";", "}" ]
Creates a row of widgets in a horizontal panel with a 5 pixel gap between them.
[ "Creates", "a", "row", "of", "widgets", "in", "a", "horizontal", "panel", "with", "a", "5", "pixel", "gap", "between", "them", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L147-L150
46,185
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newRow
public static HorizontalPanel newRow (HasAlignment.VerticalAlignmentConstant valign, String styleName, Widget... contents) { HorizontalPanel row = new HorizontalPanel(); row.setVerticalAlignment(valign); if (styleName != null) { row.setSt...
java
public static HorizontalPanel newRow (HasAlignment.VerticalAlignmentConstant valign, String styleName, Widget... contents) { HorizontalPanel row = new HorizontalPanel(); row.setVerticalAlignment(valign); if (styleName != null) { row.setSt...
[ "public", "static", "HorizontalPanel", "newRow", "(", "HasAlignment", ".", "VerticalAlignmentConstant", "valign", ",", "String", "styleName", ",", "Widget", "...", "contents", ")", "{", "HorizontalPanel", "row", "=", "new", "HorizontalPanel", "(", ")", ";", "row",...
Creates a row of widgets in a horizontal panel with a 5 pixel gap between them. The supplied style name is added to the container panel.
[ "Creates", "a", "row", "of", "widgets", "in", "a", "horizontal", "panel", "with", "a", "5", "pixel", "gap", "between", "them", ".", "The", "supplied", "style", "name", "is", "added", "to", "the", "container", "panel", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L156-L173
46,186
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newLabel
public static Label newLabel (String text, String... styles) { return setStyleNames(new Label(text), styles); }
java
public static Label newLabel (String text, String... styles) { return setStyleNames(new Label(text), styles); }
[ "public", "static", "Label", "newLabel", "(", "String", "text", ",", "String", "...", "styles", ")", "{", "return", "setStyleNames", "(", "new", "Label", "(", "text", ")", ",", "styles", ")", ";", "}" ]
Creates a label with the supplied text and style and optional additional styles.
[ "Creates", "a", "label", "with", "the", "supplied", "text", "and", "style", "and", "optional", "additional", "styles", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L178-L181
46,187
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newInlineLabel
public static InlineLabel newInlineLabel (String text, String... styles) { return setStyleNames(new InlineLabel(text), styles); }
java
public static InlineLabel newInlineLabel (String text, String... styles) { return setStyleNames(new InlineLabel(text), styles); }
[ "public", "static", "InlineLabel", "newInlineLabel", "(", "String", "text", ",", "String", "...", "styles", ")", "{", "return", "setStyleNames", "(", "new", "InlineLabel", "(", "text", ")", ",", "styles", ")", ";", "}" ]
Creates an inline label with optional styles.
[ "Creates", "an", "inline", "label", "with", "optional", "styles", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L186-L189
46,188
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newActionLabel
public static Label newActionLabel (String text, ClickHandler onClick) { return newActionLabel(text, null, onClick); }
java
public static Label newActionLabel (String text, ClickHandler onClick) { return newActionLabel(text, null, onClick); }
[ "public", "static", "Label", "newActionLabel", "(", "String", "text", ",", "ClickHandler", "onClick", ")", "{", "return", "newActionLabel", "(", "text", ",", "null", ",", "onClick", ")", ";", "}" ]
Creates a label that triggers an action using the supplied text and handler.
[ "Creates", "a", "label", "that", "triggers", "an", "action", "using", "the", "supplied", "text", "and", "handler", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L194-L197
46,189
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newActionLabel
public static Label newActionLabel (String text, String style, ClickHandler onClick) { return makeActionLabel(newLabel(text, style), onClick); }
java
public static Label newActionLabel (String text, String style, ClickHandler onClick) { return makeActionLabel(newLabel(text, style), onClick); }
[ "public", "static", "Label", "newActionLabel", "(", "String", "text", ",", "String", "style", ",", "ClickHandler", "onClick", ")", "{", "return", "makeActionLabel", "(", "newLabel", "(", "text", ",", "style", ")", ",", "onClick", ")", ";", "}" ]
Creates a label that triggers an action using the supplied text and handler. The label will be styled as specified with an additional style that configures the mouse pointer and adds underline to the text.
[ "Creates", "a", "label", "that", "triggers", "an", "action", "using", "the", "supplied", "text", "and", "handler", ".", "The", "label", "will", "be", "styled", "as", "specified", "with", "an", "additional", "style", "that", "configures", "the", "mouse", "poi...
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L204-L207
46,190
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.makeActionLabel
public static Label makeActionLabel (Label label, ClickHandler onClick) { return makeActionable(label, onClick, null); }
java
public static Label makeActionLabel (Label label, ClickHandler onClick) { return makeActionable(label, onClick, null); }
[ "public", "static", "Label", "makeActionLabel", "(", "Label", "label", ",", "ClickHandler", "onClick", ")", "{", "return", "makeActionable", "(", "label", ",", "onClick", ",", "null", ")", ";", "}" ]
Makes the supplied label into an action label. The label will be styled such that it configures the mouse pointer and adds underline to the text.
[ "Makes", "the", "supplied", "label", "into", "an", "action", "label", ".", "The", "label", "will", "be", "styled", "such", "that", "it", "configures", "the", "mouse", "pointer", "and", "adds", "underline", "to", "the", "text", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L213-L216
46,191
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.makeActionable
public static <T extends Widget & HasClickHandlers> T makeActionable ( final T target, final ClickHandler onClick, Value<Boolean> enabled) { if (onClick != null) { if (enabled != null) { enabled.addListenerAndTrigger(new Value.Listener<Boolean>() { pub...
java
public static <T extends Widget & HasClickHandlers> T makeActionable ( final T target, final ClickHandler onClick, Value<Boolean> enabled) { if (onClick != null) { if (enabled != null) { enabled.addListenerAndTrigger(new Value.Listener<Boolean>() { pub...
[ "public", "static", "<", "T", "extends", "Widget", "&", "HasClickHandlers", ">", "T", "makeActionable", "(", "final", "T", "target", ",", "final", "ClickHandler", "onClick", ",", "Value", "<", "Boolean", ">", "enabled", ")", "{", "if", "(", "onClick", "!="...
Makes the supplied widget "actionable" which means adding the "actionLabel" style to it and binding the supplied click handler. @param enabled an optional value that governs the enabled state of the target. When the value becomes false, the target's click handler and "actionLabel" style will be removed, when it become...
[ "Makes", "the", "supplied", "widget", "actionable", "which", "means", "adding", "the", "actionLabel", "style", "to", "it", "and", "binding", "the", "supplied", "click", "handler", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L226-L250
46,192
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newHTML
public static HTML newHTML (String text, String... styles) { return setStyleNames(new HTML(text), styles); }
java
public static HTML newHTML (String text, String... styles) { return setStyleNames(new HTML(text), styles); }
[ "public", "static", "HTML", "newHTML", "(", "String", "text", ",", "String", "...", "styles", ")", "{", "return", "setStyleNames", "(", "new", "HTML", "(", "text", ")", ",", "styles", ")", ";", "}" ]
Creates a new HTML element with the specified contents and style.
[ "Creates", "a", "new", "HTML", "element", "with", "the", "specified", "contents", "and", "style", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L255-L258
46,193
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newImage
public static Image newImage (String path, String... styles) { return setStyleNames(new Image(path), styles); }
java
public static Image newImage (String path, String... styles) { return setStyleNames(new Image(path), styles); }
[ "public", "static", "Image", "newImage", "(", "String", "path", ",", "String", "...", "styles", ")", "{", "return", "setStyleNames", "(", "new", "Image", "(", "path", ")", ",", "styles", ")", ";", "}" ]
Creates an image with the supplied path and style.
[ "Creates", "an", "image", "with", "the", "supplied", "path", "and", "style", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L279-L282
46,194
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.makeActionImage
public static Image makeActionImage (Image image, String tip, ClickHandler onClick) { if (tip != null) { image.setTitle(tip); } return makeActionable(image, onClick, null); }
java
public static Image makeActionImage (Image image, String tip, ClickHandler onClick) { if (tip != null) { image.setTitle(tip); } return makeActionable(image, onClick, null); }
[ "public", "static", "Image", "makeActionImage", "(", "Image", "image", ",", "String", "tip", ",", "ClickHandler", "onClick", ")", "{", "if", "(", "tip", "!=", "null", ")", "{", "image", ".", "setTitle", "(", "tip", ")", ";", "}", "return", "makeActionabl...
Makes an image into one that responds to clicking.
[ "Makes", "an", "image", "into", "one", "that", "responds", "to", "clicking", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L303-L309
46,195
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newTextBox
public static TextBox newTextBox (String text, int maxLength, int visibleLength) { return initTextBox(new TextBox(), text, maxLength, visibleLength); }
java
public static TextBox newTextBox (String text, int maxLength, int visibleLength) { return initTextBox(new TextBox(), text, maxLength, visibleLength); }
[ "public", "static", "TextBox", "newTextBox", "(", "String", "text", ",", "int", "maxLength", ",", "int", "visibleLength", ")", "{", "return", "initTextBox", "(", "new", "TextBox", "(", ")", ",", "text", ",", "maxLength", ",", "visibleLength", ")", ";", "}"...
Creates a text box with all of the configuration that you're bound to want to do.
[ "Creates", "a", "text", "box", "with", "all", "of", "the", "configuration", "that", "you", "re", "bound", "to", "want", "to", "do", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L324-L327
46,196
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.getText
public static String getText (TextBoxBase box, String defaultAsBlank) { String s = box.getText().trim(); return s.equals(defaultAsBlank) ? "" : s; }
java
public static String getText (TextBoxBase box, String defaultAsBlank) { String s = box.getText().trim(); return s.equals(defaultAsBlank) ? "" : s; }
[ "public", "static", "String", "getText", "(", "TextBoxBase", "box", ",", "String", "defaultAsBlank", ")", "{", "String", "s", "=", "box", ".", "getText", "(", ")", ".", "trim", "(", ")", ";", "return", "s", ".", "equals", "(", "defaultAsBlank", ")", "?...
Retrieve the text from the TextBox, unless it is the specified default, in which case we return "".
[ "Retrieve", "the", "text", "from", "the", "TextBox", "unless", "it", "is", "the", "specified", "default", "in", "which", "case", "we", "return", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L346-L350
46,197
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.initTextBox
public static TextBox initTextBox (TextBox box, String text, int maxLength, int visibleLength) { if (text != null) { box.setText(text); } box.setMaxLength(maxLength > 0 ? maxLength : 255); if (visibleLength > 0) { box.setVisibleLength(visibleLength); }...
java
public static TextBox initTextBox (TextBox box, String text, int maxLength, int visibleLength) { if (text != null) { box.setText(text); } box.setMaxLength(maxLength > 0 ? maxLength : 255); if (visibleLength > 0) { box.setVisibleLength(visibleLength); }...
[ "public", "static", "TextBox", "initTextBox", "(", "TextBox", "box", ",", "String", "text", ",", "int", "maxLength", ",", "int", "visibleLength", ")", "{", "if", "(", "text", "!=", "null", ")", "{", "box", ".", "setText", "(", "text", ")", ";", "}", ...
Configures a text box with all of the configuration that you're bound to want to do. This is useful for configuring a PasswordTextBox.
[ "Configures", "a", "text", "box", "with", "all", "of", "the", "configuration", "that", "you", "re", "bound", "to", "want", "to", "do", ".", "This", "is", "useful", "for", "configuring", "a", "PasswordTextBox", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L356-L366
46,198
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newTextArea
public static TextArea newTextArea (String text, int width, int height) { TextArea area = new TextArea(); if (text != null) { area.setText(text); } if (width > 0) { area.setCharacterWidth(width); } if (height > 0) { area.setVisibleL...
java
public static TextArea newTextArea (String text, int width, int height) { TextArea area = new TextArea(); if (text != null) { area.setText(text); } if (width > 0) { area.setCharacterWidth(width); } if (height > 0) { area.setVisibleL...
[ "public", "static", "TextArea", "newTextArea", "(", "String", "text", ",", "int", "width", ",", "int", "height", ")", "{", "TextArea", "area", "=", "new", "TextArea", "(", ")", ";", "if", "(", "text", "!=", "null", ")", "{", "area", ".", "setText", "...
Creates a text area with all of the configuration that you're bound to want to do. @param width the width of the text area or -1 to use the default (or CSS styled) width.
[ "Creates", "a", "text", "area", "with", "all", "of", "the", "configuration", "that", "you", "re", "bound", "to", "want", "to", "do", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L373-L386
46,199
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Widgets.java
Widgets.newTextArea
public static LimitedTextArea newTextArea (String text, int width, int height, int maxLength) { LimitedTextArea area = new LimitedTextArea(maxLength, width, height); if (text != null) { area.setText(text); } return area; }
java
public static LimitedTextArea newTextArea (String text, int width, int height, int maxLength) { LimitedTextArea area = new LimitedTextArea(maxLength, width, height); if (text != null) { area.setText(text); } return area; }
[ "public", "static", "LimitedTextArea", "newTextArea", "(", "String", "text", ",", "int", "width", ",", "int", "height", ",", "int", "maxLength", ")", "{", "LimitedTextArea", "area", "=", "new", "LimitedTextArea", "(", "maxLength", ",", "width", ",", "height", ...
Creates a limited text area with all of the configuration that you're bound to want to do. @param width the width of the text area or -1 to use the default (or CSS styled) width.
[ "Creates", "a", "limited", "text", "area", "with", "all", "of", "the", "configuration", "that", "you", "re", "bound", "to", "want", "to", "do", "." ]
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L393-L400