repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemGroupRenderer.java
WMenuItemGroupRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMenuItemGroup group = (WMenuItemGroup) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:menugroup"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttrib...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMenuItemGroup group = (WMenuItemGroup) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:menugroup"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttrib...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WMenuItemGroup", "group", "=", "(", "WMenuItemGroup", ")", "component", ";", "XmlStringBuilder", "xml", "=", "r...
Paints the given WMenuItemGroup. @param component the WMenuItemGroup to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WMenuItemGroup", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemGroupRenderer.java#L22-L36
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiDropdownRenderer.java
WMultiDropdownRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMultiDropdown dropdown = (WMultiDropdown) component; XmlStringBuilder xml = renderContext.getWriter(); String dataKey = dropdown.getListCacheKey(); boolean readOnly = dropdown.isReadOnly(); xml.appendTagOp...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMultiDropdown dropdown = (WMultiDropdown) component; XmlStringBuilder xml = renderContext.getWriter(); String dataKey = dropdown.getListCacheKey(); boolean readOnly = dropdown.isReadOnly(); xml.appendTagOp...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WMultiDropdown", "dropdown", "=", "(", "WMultiDropdown", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WMultiDropdown. @param component the WMultiDropdown to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WMultiDropdown", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiDropdownRenderer.java#L27-L89
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/transientcontainer/ExampleTablePanel.java
ExampleTablePanel.setData
public void setData(final List data) { // Bean properties to render String[] properties = new String[]{"colour", "shape", "animal"}; simpleTable.setDataModel(new SimpleBeanListTableDataModel(properties, data)); }
java
public void setData(final List data) { // Bean properties to render String[] properties = new String[]{"colour", "shape", "animal"}; simpleTable.setDataModel(new SimpleBeanListTableDataModel(properties, data)); }
[ "public", "void", "setData", "(", "final", "List", "data", ")", "{", "// Bean properties to render", "String", "[", "]", "properties", "=", "new", "String", "[", "]", "{", "\"colour\"", ",", "\"shape\"", ",", "\"animal\"", "}", ";", "simpleTable", ".", "setD...
Sets the table data. @param data a list of {@link ExampleDataBean}s.
[ "Sets", "the", "table", "data", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/transientcontainer/ExampleTablePanel.java#L46-L51
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java
WFieldSet.setMandatory
public void setMandatory(final boolean mandatory, final String message) { setFlag(ComponentModel.MANDATORY_FLAG, mandatory); getOrCreateComponentModel().errorMessage = message; }
java
public void setMandatory(final boolean mandatory, final String message) { setFlag(ComponentModel.MANDATORY_FLAG, mandatory); getOrCreateComponentModel().errorMessage = message; }
[ "public", "void", "setMandatory", "(", "final", "boolean", "mandatory", ",", "final", "String", "message", ")", "{", "setFlag", "(", "ComponentModel", ".", "MANDATORY_FLAG", ",", "mandatory", ")", ";", "getOrCreateComponentModel", "(", ")", ".", "errorMessage", ...
Set whether or not this field set is mandatory, and customise the error message that will be displayed. @param mandatory true for mandatory, false for optional. @param message the message to display to the user on mandatory validation failure.
[ "Set", "whether", "or", "not", "this", "field", "set", "is", "mandatory", "and", "customise", "the", "error", "message", "that", "will", "be", "displayed", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java#L110-L113
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java
WFieldSet.hasInputWithValue
private boolean hasInputWithValue() { // Visit all children of the fieldset of type Input AbstractVisitorWithResult<Boolean> visitor = new AbstractVisitorWithResult<Boolean>() { @Override public WComponentTreeVisitor.VisitorResult visit(final WComponent comp) { // Check if the component is an Input and h...
java
private boolean hasInputWithValue() { // Visit all children of the fieldset of type Input AbstractVisitorWithResult<Boolean> visitor = new AbstractVisitorWithResult<Boolean>() { @Override public WComponentTreeVisitor.VisitorResult visit(final WComponent comp) { // Check if the component is an Input and h...
[ "private", "boolean", "hasInputWithValue", "(", ")", "{", "// Visit all children of the fieldset of type Input", "AbstractVisitorWithResult", "<", "Boolean", ">", "visitor", "=", "new", "AbstractVisitorWithResult", "<", "Boolean", ">", "(", ")", "{", "@", "Override", "p...
Checks at least one input component has a value. @return true if the field set contains an input with a value
[ "Checks", "at", "least", "one", "input", "component", "has", "a", "value", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java#L152-L171
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeItemUtil.java
TreeItemUtil.processJsonToTree
private static void processJsonToTree(final TreeItemIdNode parentNode, final JsonObject json) { String id = json.getAsJsonPrimitive("id").getAsString(); JsonPrimitive expandableJson = json.getAsJsonPrimitive("expandable"); TreeItemIdNode node = new TreeItemIdNode(id); if (expandableJson != null && expandableJ...
java
private static void processJsonToTree(final TreeItemIdNode parentNode, final JsonObject json) { String id = json.getAsJsonPrimitive("id").getAsString(); JsonPrimitive expandableJson = json.getAsJsonPrimitive("expandable"); TreeItemIdNode node = new TreeItemIdNode(id); if (expandableJson != null && expandableJ...
[ "private", "static", "void", "processJsonToTree", "(", "final", "TreeItemIdNode", "parentNode", ",", "final", "JsonObject", "json", ")", "{", "String", "id", "=", "json", ".", "getAsJsonPrimitive", "(", "\"id\"", ")", ".", "getAsString", "(", ")", ";", "JsonPr...
Iterate over the JSON objects to create the tree structure. @param parentNode the parent node @param json the current JSON object
[ "Iterate", "over", "the", "JSON", "objects", "to", "create", "the", "tree", "structure", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeItemUtil.java#L247-L265
train
ebean-orm/ebean-querybean
src/main/java/io/ebean/typequery/TQRootBean.java
TQRootBean.fetchQuery
public R fetchQuery(String path, String properties) { query.fetchQuery(path, properties); return root; }
java
public R fetchQuery(String path, String properties) { query.fetchQuery(path, properties); return root; }
[ "public", "R", "fetchQuery", "(", "String", "path", ",", "String", "properties", ")", "{", "query", ".", "fetchQuery", "(", "path", ",", "properties", ")", ";", "return", "root", ";", "}" ]
Specify a path and properties to load using a "query join". <pre>{@code List<Customer> customers = new QCustomer() // eager fetch contacts using a "query join" .fetchQuery("contacts", "email, firstName, lastName") .findList(); }</pre> @param path the property path of an associated (OneToOne, OneToMany, ManyToOne or...
[ "Specify", "a", "path", "and", "properties", "to", "load", "using", "a", "query", "join", "." ]
821650cb817c9c0fdcc97f93408dc79170b12423
https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQRootBean.java#L322-L325
train
ebean-orm/ebean-querybean
src/main/java/io/ebean/typequery/TQRootBean.java
TQRootBean.pushExprList
private R pushExprList(ExpressionList<T> list) { if (textMode) { textStack.push(list); } else { whereStack.push(list); } return root; }
java
private R pushExprList(ExpressionList<T> list) { if (textMode) { textStack.push(list); } else { whereStack.push(list); } return root; }
[ "private", "R", "pushExprList", "(", "ExpressionList", "<", "T", ">", "list", ")", "{", "if", "(", "textMode", ")", "{", "textStack", ".", "push", "(", "list", ")", ";", "}", "else", "{", "whereStack", ".", "push", "(", "list", ")", ";", "}", "retu...
Push the expression list onto the appropriate stack.
[ "Push", "the", "expression", "list", "onto", "the", "appropriate", "stack", "." ]
821650cb817c9c0fdcc97f93408dc79170b12423
https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQRootBean.java#L1330-L1337
train
ebean-orm/ebean-querybean
src/main/java/io/ebean/typequery/TQRootBean.java
TQRootBean.peekExprList
protected ExpressionList<T> peekExprList() { if (textMode) { // return the current text expression list return _peekText(); } if (whereStack == null) { whereStack = new ArrayStack<>(); whereStack.push(query.where()); } // return the current expression list return whereS...
java
protected ExpressionList<T> peekExprList() { if (textMode) { // return the current text expression list return _peekText(); } if (whereStack == null) { whereStack = new ArrayStack<>(); whereStack.push(query.where()); } // return the current expression list return whereS...
[ "protected", "ExpressionList", "<", "T", ">", "peekExprList", "(", ")", "{", "if", "(", "textMode", ")", "{", "// return the current text expression list", "return", "_peekText", "(", ")", ";", "}", "if", "(", "whereStack", "==", "null", ")", "{", "whereStack"...
Return the current expression list that expressions should be added to.
[ "Return", "the", "current", "expression", "list", "that", "expressions", "should", "be", "added", "to", "." ]
821650cb817c9c0fdcc97f93408dc79170b12423
https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQRootBean.java#L1983-L1996
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.notEquals
public ExpressionBuilder notEquals(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.NOT_EQUAL, trigger, compare); appendExpression(exp); return this; }
java
public ExpressionBuilder notEquals(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.NOT_EQUAL, trigger, compare); appendExpression(exp); return this; }
[ "public", "ExpressionBuilder", "notEquals", "(", "final", "SubordinateTrigger", "trigger", ",", "final", "Object", "compare", ")", "{", "BooleanExpression", "exp", "=", "new", "CompareExpression", "(", "CompareType", ".", "NOT_EQUAL", ",", "trigger", ",", "compare",...
Appends a not equals test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder.
[ "Appends", "a", "not", "equals", "test", "to", "the", "condition", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L77-L82
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.lessThan
public ExpressionBuilder lessThan(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.LESS_THAN, trigger, compare); appendExpression(exp); return this; }
java
public ExpressionBuilder lessThan(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.LESS_THAN, trigger, compare); appendExpression(exp); return this; }
[ "public", "ExpressionBuilder", "lessThan", "(", "final", "SubordinateTrigger", "trigger", ",", "final", "Object", "compare", ")", "{", "BooleanExpression", "exp", "=", "new", "CompareExpression", "(", "CompareType", ".", "LESS_THAN", ",", "trigger", ",", "compare", ...
Appends a less than test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder.
[ "Appends", "a", "less", "than", "test", "to", "the", "condition", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L91-L96
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.lessThanOrEquals
public ExpressionBuilder lessThanOrEquals(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.LESS_THAN_OR_EQUAL, trigger, compare); appendExpression(exp); return this; }
java
public ExpressionBuilder lessThanOrEquals(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.LESS_THAN_OR_EQUAL, trigger, compare); appendExpression(exp); return this; }
[ "public", "ExpressionBuilder", "lessThanOrEquals", "(", "final", "SubordinateTrigger", "trigger", ",", "final", "Object", "compare", ")", "{", "BooleanExpression", "exp", "=", "new", "CompareExpression", "(", "CompareType", ".", "LESS_THAN_OR_EQUAL", ",", "trigger", "...
Appends a less than or equals test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder.
[ "Appends", "a", "less", "than", "or", "equals", "test", "to", "the", "condition", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L105-L111
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.greaterThan
public ExpressionBuilder greaterThan(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.GREATER_THAN, trigger, compare); appendExpression(exp); return this; }
java
public ExpressionBuilder greaterThan(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.GREATER_THAN, trigger, compare); appendExpression(exp); return this; }
[ "public", "ExpressionBuilder", "greaterThan", "(", "final", "SubordinateTrigger", "trigger", ",", "final", "Object", "compare", ")", "{", "BooleanExpression", "exp", "=", "new", "CompareExpression", "(", "CompareType", ".", "GREATER_THAN", ",", "trigger", ",", "comp...
Appends a greater than test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder.
[ "Appends", "a", "greater", "than", "test", "to", "the", "condition", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L120-L125
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.greaterThanOrEquals
public ExpressionBuilder greaterThanOrEquals(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.GREATER_THAN_OR_EQUAL, trigger, compare); appendExpression(exp); return this; }
java
public ExpressionBuilder greaterThanOrEquals(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.GREATER_THAN_OR_EQUAL, trigger, compare); appendExpression(exp); return this; }
[ "public", "ExpressionBuilder", "greaterThanOrEquals", "(", "final", "SubordinateTrigger", "trigger", ",", "final", "Object", "compare", ")", "{", "BooleanExpression", "exp", "=", "new", "CompareExpression", "(", "CompareType", ".", "GREATER_THAN_OR_EQUAL", ",", "trigger...
Appends a greater than or equals test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder.
[ "Appends", "a", "greater", "than", "or", "equals", "test", "to", "the", "condition", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L134-L141
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.matches
public ExpressionBuilder matches(final SubordinateTrigger trigger, final String compare) { BooleanExpression exp = new CompareExpression(CompareType.MATCH, trigger, compare); appendExpression(exp); return this; }
java
public ExpressionBuilder matches(final SubordinateTrigger trigger, final String compare) { BooleanExpression exp = new CompareExpression(CompareType.MATCH, trigger, compare); appendExpression(exp); return this; }
[ "public", "ExpressionBuilder", "matches", "(", "final", "SubordinateTrigger", "trigger", ",", "final", "String", "compare", ")", "{", "BooleanExpression", "exp", "=", "new", "CompareExpression", "(", "CompareType", ".", "MATCH", ",", "trigger", ",", "compare", ")"...
Appends a matches test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder.
[ "Appends", "a", "matches", "test", "to", "the", "condition", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L150-L155
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.or
public ExpressionBuilder or() { GroupExpression lastGroupExpression = stack.isEmpty() ? null : stack.peek(); if (lhsExpression == null) { throw new SyntaxException("Syntax exception: OR missing LHS operand"); } else if (lastGroupExpression == null) { GroupExpression or = new GroupExpression(GroupExpression...
java
public ExpressionBuilder or() { GroupExpression lastGroupExpression = stack.isEmpty() ? null : stack.peek(); if (lhsExpression == null) { throw new SyntaxException("Syntax exception: OR missing LHS operand"); } else if (lastGroupExpression == null) { GroupExpression or = new GroupExpression(GroupExpression...
[ "public", "ExpressionBuilder", "or", "(", ")", "{", "GroupExpression", "lastGroupExpression", "=", "stack", ".", "isEmpty", "(", ")", "?", "null", ":", "stack", ".", "peek", "(", ")", ";", "if", "(", "lhsExpression", "==", "null", ")", "{", "throw", "new...
Appends an OR expression to the RHS of the expression. The current RHS of the expression must be an Operand. @return this ExpressionBuilder.
[ "Appends", "an", "OR", "expression", "to", "the", "RHS", "of", "the", "expression", ".", "The", "current", "RHS", "of", "the", "expression", "must", "be", "an", "Operand", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L165-L204
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.and
public ExpressionBuilder and() { GroupExpression lastGroupExpression = stack.isEmpty() ? null : stack.peek(); if (lhsExpression == null) { throw new SyntaxException("Syntax exception: AND missing LHS operand"); } else if (lastGroupExpression == null) { GroupExpression and = new GroupExpression(GroupExpress...
java
public ExpressionBuilder and() { GroupExpression lastGroupExpression = stack.isEmpty() ? null : stack.peek(); if (lhsExpression == null) { throw new SyntaxException("Syntax exception: AND missing LHS operand"); } else if (lastGroupExpression == null) { GroupExpression and = new GroupExpression(GroupExpress...
[ "public", "ExpressionBuilder", "and", "(", ")", "{", "GroupExpression", "lastGroupExpression", "=", "stack", ".", "isEmpty", "(", ")", "?", "null", ":", "stack", ".", "peek", "(", ")", ";", "if", "(", "lhsExpression", "==", "null", ")", "{", "throw", "ne...
Appends an AND expression to the RHS of the expression. The current RHS of the expression must be an Operand. @return this ExpressionBuilder.
[ "Appends", "an", "AND", "expression", "to", "the", "RHS", "of", "the", "expression", ".", "The", "current", "RHS", "of", "the", "expression", "must", "be", "an", "Operand", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L211-L239
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.not
public ExpressionBuilder not(final ExpressionBuilder exp) { // Note - NOT Expressions are not added to the stack (like the other group expressions AND and OR) and are // treated the same as a "compare" expression. // It is expected a NOT Expression is used by itself or with an AND or NOT. GroupExpression not = ...
java
public ExpressionBuilder not(final ExpressionBuilder exp) { // Note - NOT Expressions are not added to the stack (like the other group expressions AND and OR) and are // treated the same as a "compare" expression. // It is expected a NOT Expression is used by itself or with an AND or NOT. GroupExpression not = ...
[ "public", "ExpressionBuilder", "not", "(", "final", "ExpressionBuilder", "exp", ")", "{", "// Note - NOT Expressions are not added to the stack (like the other group expressions AND and OR) and are", "// treated the same as a \"compare\" expression.", "// It is expected a NOT Expression is use...
Appends a NOT expression to this expression. @param exp the builder containing the expression to NOT with the current expression. @return this ExpressionBuilder.
[ "Appends", "a", "NOT", "expression", "to", "this", "expression", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L269-L279
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.appendExpression
private void appendExpression(final BooleanExpression newExpression) { if (lhsExpression != null) { throw new SyntaxException("Syntax exception: use AND or OR to join expressions"); } lhsExpression = newExpression; GroupExpression currentExpression = stack.isEmpty() ? null : stack.peek(); if (currentExp...
java
private void appendExpression(final BooleanExpression newExpression) { if (lhsExpression != null) { throw new SyntaxException("Syntax exception: use AND or OR to join expressions"); } lhsExpression = newExpression; GroupExpression currentExpression = stack.isEmpty() ? null : stack.peek(); if (currentExp...
[ "private", "void", "appendExpression", "(", "final", "BooleanExpression", "newExpression", ")", "{", "if", "(", "lhsExpression", "!=", "null", ")", "{", "throw", "new", "SyntaxException", "(", "\"Syntax exception: use AND or OR to join expressions\"", ")", ";", "}", "...
Appends the given expression to this expression. @param newExpression the expression to append.
[ "Appends", "the", "given", "expression", "to", "this", "expression", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L286-L300
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.validate
public boolean validate() { try { BooleanExpression built = expression.getExpression(); if (built == null) { // nothing to evaluate. return false; } // First check the nesting (an expression must not contain itself) checkNesting(built, new ArrayList<BooleanExpression>()); // If the expres...
java
public boolean validate() { try { BooleanExpression built = expression.getExpression(); if (built == null) { // nothing to evaluate. return false; } // First check the nesting (an expression must not contain itself) checkNesting(built, new ArrayList<BooleanExpression>()); // If the expres...
[ "public", "boolean", "validate", "(", ")", "{", "try", "{", "BooleanExpression", "built", "=", "expression", ".", "getExpression", "(", ")", ";", "if", "(", "built", "==", "null", ")", "{", "// nothing to evaluate.", "return", "false", ";", "}", "// First ch...
Determines whether the current expression is syntactically correct. @return true if the current expression is valid, false if not.
[ "Determines", "whether", "the", "current", "expression", "is", "syntactically", "correct", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L320-L340
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.checkNesting
private static void checkNesting(final BooleanExpression expression, final List<BooleanExpression> visitedExpressions) { if (visitedExpressions.contains(expression)) { // Unfortunately, we can't give much more information - even calling toString() will overflow the stack. throw new SyntaxException("An expres...
java
private static void checkNesting(final BooleanExpression expression, final List<BooleanExpression> visitedExpressions) { if (visitedExpressions.contains(expression)) { // Unfortunately, we can't give much more information - even calling toString() will overflow the stack. throw new SyntaxException("An expres...
[ "private", "static", "void", "checkNesting", "(", "final", "BooleanExpression", "expression", ",", "final", "List", "<", "BooleanExpression", ">", "visitedExpressions", ")", "{", "if", "(", "visitedExpressions", ".", "contains", "(", "expression", ")", ")", "{", ...
Checks nesting of expressions to ensure we don't end up in an infinite recursive loop during evaluation. @param expression the expression to check @param visitedExpressions a list of expressions which have been visited so far.
[ "Checks", "nesting", "of", "expressions", "to", "ensure", "we", "don", "t", "end", "up", "in", "an", "infinite", "recursive", "loop", "during", "evaluation", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L348-L363
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java
WDropdownOptionsExample.getDropDownControls
private WFieldSet getDropDownControls() { WFieldSet fieldSet = new WFieldSet("Drop down configuration"); WFieldLayout layout = new WFieldLayout(); layout.setLabelWidth(25); fieldSet.add(layout); rbsDDType.setButtonLayout(WRadioButtonSelect.LAYOUT_FLAT); rbsDDType.setSelected(WDropdown.DropdownType.NATIVE);...
java
private WFieldSet getDropDownControls() { WFieldSet fieldSet = new WFieldSet("Drop down configuration"); WFieldLayout layout = new WFieldLayout(); layout.setLabelWidth(25); fieldSet.add(layout); rbsDDType.setButtonLayout(WRadioButtonSelect.LAYOUT_FLAT); rbsDDType.setSelected(WDropdown.DropdownType.NATIVE);...
[ "private", "WFieldSet", "getDropDownControls", "(", ")", "{", "WFieldSet", "fieldSet", "=", "new", "WFieldSet", "(", "\"Drop down configuration\"", ")", ";", "WFieldLayout", "layout", "=", "new", "WFieldLayout", "(", ")", ";", "layout", ".", "setLabelWidth", "(", ...
build the drop down controls. @return a field set containing the dropdown controls.
[ "build", "the", "drop", "down", "controls", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java#L161-L213
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java
WDropdownOptionsExample.applySettings
private void applySettings() { container.reset(); infoPanel.reset(); // create the list of options. List<String> options = new ArrayList<>(Arrays.asList(OPTIONS_ARRAY)); if (cbNullOption.isSelected()) { options.add(0, ""); } // create the dropdown. final WDropdown dropdown = new WDropdown(options)...
java
private void applySettings() { container.reset(); infoPanel.reset(); // create the list of options. List<String> options = new ArrayList<>(Arrays.asList(OPTIONS_ARRAY)); if (cbNullOption.isSelected()) { options.add(0, ""); } // create the dropdown. final WDropdown dropdown = new WDropdown(options)...
[ "private", "void", "applySettings", "(", ")", "{", "container", ".", "reset", "(", ")", ";", "infoPanel", ".", "reset", "(", ")", ";", "// create the list of options.", "List", "<", "String", ">", "options", "=", "new", "ArrayList", "<>", "(", "Arrays", "....
Apply the settings from the control table to the drop down.
[ "Apply", "the", "settings", "from", "the", "control", "table", "to", "the", "drop", "down", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java#L234-L324
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java
WDropdownOptionsExample.buildSubordinatePanel
private void buildSubordinatePanel(final WDropdown dropdown, final String value, final WComponentGroup<SubordinateTarget> group, final WSubordinateControl control) { // create the panel. WPanel panel = new WPanel(); WStyledText subordinateInfo = new WStyledText(); subordinateInfo.setWhitespaceMode(Whitesp...
java
private void buildSubordinatePanel(final WDropdown dropdown, final String value, final WComponentGroup<SubordinateTarget> group, final WSubordinateControl control) { // create the panel. WPanel panel = new WPanel(); WStyledText subordinateInfo = new WStyledText(); subordinateInfo.setWhitespaceMode(Whitesp...
[ "private", "void", "buildSubordinatePanel", "(", "final", "WDropdown", "dropdown", ",", "final", "String", "value", ",", "final", "WComponentGroup", "<", "SubordinateTarget", ">", "group", ",", "final", "WSubordinateControl", "control", ")", "{", "// create the panel....
Builds a panel for the subordinate control, including the rule for that particular option. @param dropdown the subordinate trigger. @param value the dropdown option to be added @param group the group @param control the subordinate control
[ "Builds", "a", "panel", "for", "the", "subordinate", "control", "including", "the", "rule", "for", "that", "particular", "option", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownOptionsExample.java#L334-L353
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java
MockHttpServletResponse.setDateHeader
@Override public void setDateHeader(final String name, final long value) { headers.put(name, String.valueOf(value)); }
java
@Override public void setDateHeader(final String name, final long value) { headers.put(name, String.valueOf(value)); }
[ "@", "Override", "public", "void", "setDateHeader", "(", "final", "String", "name", ",", "final", "long", "value", ")", "{", "headers", ".", "put", "(", "name", ",", "String", ".", "valueOf", "(", "value", ")", ")", ";", "}" ]
Sets a date header. @param name the header name. @param value the header value.
[ "Sets", "a", "date", "header", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java#L175-L178
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java
MockHttpServletResponse.setIntHeader
@Override public void setIntHeader(final String name, final int value) { headers.put(name, String.valueOf(value)); }
java
@Override public void setIntHeader(final String name, final int value) { headers.put(name, String.valueOf(value)); }
[ "@", "Override", "public", "void", "setIntHeader", "(", "final", "String", "name", ",", "final", "int", "value", ")", "{", "headers", ".", "put", "(", "name", ",", "String", ".", "valueOf", "(", "value", ")", ")", ";", "}" ]
Sets an integer header. @param name the header name. @param value the header value.
[ "Sets", "an", "integer", "header", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java#L197-L200
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/AbstractAction.java
AbstractAction.execute
@Override public void execute() { if (target instanceof WComponentGroup<?>) { for (WComponent component : ((WComponentGroup<WComponent>) target).getComponents()) { if (component instanceof SubordinateTarget) { applyAction((SubordinateTarget) component, value); } } } else { // Leaf. applyAc...
java
@Override public void execute() { if (target instanceof WComponentGroup<?>) { for (WComponent component : ((WComponentGroup<WComponent>) target).getComponents()) { if (component instanceof SubordinateTarget) { applyAction((SubordinateTarget) component, value); } } } else { // Leaf. applyAc...
[ "@", "Override", "public", "void", "execute", "(", ")", "{", "if", "(", "target", "instanceof", "WComponentGroup", "<", "?", ">", ")", "{", "for", "(", "WComponent", "component", ":", "(", "(", "WComponentGroup", "<", "WComponent", ">", ")", "target", ")...
Execute the action.
[ "Execute", "the", "action", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/AbstractAction.java#L78-L91
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WStyledTextRenderer.java
WStyledTextRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WStyledText text = (WStyledText) component; XmlStringBuilder xml = renderContext.getWriter(); String textString = text.getText(); if (textString != null && textString.length() > 0) { xml.appendTagOpen("ui:...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WStyledText text = (WStyledText) component; XmlStringBuilder xml = renderContext.getWriter(); String textString = text.getText(); if (textString != null && textString.length() > 0) { xml.appendTagOpen("ui:...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WStyledText", "text", "=", "(", "WStyledText", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderCo...
Paints the given WStyledText. @param component the WStyledText to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WStyledText", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WStyledTextRenderer.java#L26-L107
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WStyledTextRenderer.java
WStyledTextRenderer.writeParagraphs
private static void writeParagraphs(final String text, final XmlStringBuilder xml) { if (!Util.empty(text)) { int start = 0; int end = text.length() - 1; // Set the start index to the first non-linebreak, so we don't emit leading ui:nl tags for (; start < end; start++) { char c = text.charAt(start); ...
java
private static void writeParagraphs(final String text, final XmlStringBuilder xml) { if (!Util.empty(text)) { int start = 0; int end = text.length() - 1; // Set the start index to the first non-linebreak, so we don't emit leading ui:nl tags for (; start < end; start++) { char c = text.charAt(start); ...
[ "private", "static", "void", "writeParagraphs", "(", "final", "String", "text", ",", "final", "XmlStringBuilder", "xml", ")", "{", "if", "(", "!", "Util", ".", "empty", "(", "text", ")", ")", "{", "int", "start", "=", "0", ";", "int", "end", "=", "te...
Writes out paragraph delimited content. @param text the String content to output. @param xml the XmlStringBuilder to paint to.
[ "Writes", "out", "paragraph", "delimited", "content", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WStyledTextRenderer.java#L115-L155
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java
UicStatsAsHtml.write
public static void write(final PrintWriter writer, final UicStats stats) { writer.println("<dl>"); writer.print("<dt>Total root wcomponents found in UIC</dt>"); writer.println("<dd>" + stats.getRootWCs().size() + "</dd>"); writer.print("<dt>Size of UIC (by serialization)</dt>"); writer.println("<dd>" + stat...
java
public static void write(final PrintWriter writer, final UicStats stats) { writer.println("<dl>"); writer.print("<dt>Total root wcomponents found in UIC</dt>"); writer.println("<dd>" + stats.getRootWCs().size() + "</dd>"); writer.print("<dt>Size of UIC (by serialization)</dt>"); writer.println("<dd>" + stat...
[ "public", "static", "void", "write", "(", "final", "PrintWriter", "writer", ",", "final", "UicStats", "stats", ")", "{", "writer", ".", "println", "(", "\"<dl>\"", ")", ";", "writer", ".", "print", "(", "\"<dt>Total root wcomponents found in UIC</dt>\"", ")", ";...
Writes out the given statistics in HTML format. @param writer the writer to write to. @param stats the stats to write.
[ "Writes", "out", "the", "given", "statistics", "in", "HTML", "format", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java#L32-L57
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java
UicStatsAsHtml.writeProfileForTree
private static void writeProfileForTree(final PrintWriter writer, final Map<WComponent, UicStats.Stat> treeStats) { // Copy all the stats into a list so we can sort and cull. List<UicStats.Stat> statList = new ArrayList<>(treeStats.values()); Comparator<UicStats.Stat> comparator = new Comparator<UicStats.Stat...
java
private static void writeProfileForTree(final PrintWriter writer, final Map<WComponent, UicStats.Stat> treeStats) { // Copy all the stats into a list so we can sort and cull. List<UicStats.Stat> statList = new ArrayList<>(treeStats.values()); Comparator<UicStats.Stat> comparator = new Comparator<UicStats.Stat...
[ "private", "static", "void", "writeProfileForTree", "(", "final", "PrintWriter", "writer", ",", "final", "Map", "<", "WComponent", ",", "UicStats", ".", "Stat", ">", "treeStats", ")", "{", "// Copy all the stats into a list so we can sort and cull.", "List", "<", "Uic...
Writes the stats for a single component. @param writer the writer to write the stats to. @param treeStats the stats for the component.
[ "Writes", "the", "stats", "for", "a", "single", "component", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java#L65-L95
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java
UicStatsAsHtml.writeHeader
private static void writeHeader(final PrintWriter writer) { writer.println("<table>"); writer.println("<thead>"); writer.print("<tr>"); writer.print("<th>Class</th>"); writer.print("<th>Model</th>"); writer.print("<th>Size</th>"); writer.print("<th>Ref.</th>"); writer.print("<th>Name</th>"); writer.pr...
java
private static void writeHeader(final PrintWriter writer) { writer.println("<table>"); writer.println("<thead>"); writer.print("<tr>"); writer.print("<th>Class</th>"); writer.print("<th>Model</th>"); writer.print("<th>Size</th>"); writer.print("<th>Ref.</th>"); writer.print("<th>Name</th>"); writer.pr...
[ "private", "static", "void", "writeHeader", "(", "final", "PrintWriter", "writer", ")", "{", "writer", ".", "println", "(", "\"<table>\"", ")", ";", "writer", ".", "println", "(", "\"<thead>\"", ")", ";", "writer", ".", "print", "(", "\"<tr>\"", ")", ";", ...
Writes the stats header HTML. @param writer the writer to write the header to
[ "Writes", "the", "stats", "header", "HTML", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java#L102-L114
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java
UicStatsAsHtml.writeRow
private static void writeRow(final PrintWriter writer, final UicStats.Stat stat) { writer.print("<tr>"); writer.print("<td>" + stat.getClassName() + "</td>"); writer.print("<td>" + stat.getModelStateAsString() + "</td>"); if (stat.getSerializedSize() > 0) { writer.print("<td>" + stat.getSerializedSize() + "...
java
private static void writeRow(final PrintWriter writer, final UicStats.Stat stat) { writer.print("<tr>"); writer.print("<td>" + stat.getClassName() + "</td>"); writer.print("<td>" + stat.getModelStateAsString() + "</td>"); if (stat.getSerializedSize() > 0) { writer.print("<td>" + stat.getSerializedSize() + "...
[ "private", "static", "void", "writeRow", "(", "final", "PrintWriter", "writer", ",", "final", "UicStats", ".", "Stat", "stat", ")", "{", "writer", ".", "print", "(", "\"<tr>\"", ")", ";", "writer", ".", "print", "(", "\"<td>\"", "+", "stat", ".", "getCla...
Writes a row containing a single stat. @param writer the writer to write the row to. @param stat the stat to write.
[ "Writes", "a", "row", "containing", "a", "single", "stat", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStatsAsHtml.java#L131-L152
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCancelButtonExample.java
WCancelButtonExample.changePage
private void changePage(final int direction) { int currentPage = pages.indexOf(cardManager.getVisible()); currentPage = Math.min(2, Math.max(0, currentPage + direction)); cardManager.makeVisible(pages.get(currentPage)); prevButton.setDisabled(currentPage == 0); nextButton.setDisabled(currentPage == 2); fi...
java
private void changePage(final int direction) { int currentPage = pages.indexOf(cardManager.getVisible()); currentPage = Math.min(2, Math.max(0, currentPage + direction)); cardManager.makeVisible(pages.get(currentPage)); prevButton.setDisabled(currentPage == 0); nextButton.setDisabled(currentPage == 2); fi...
[ "private", "void", "changePage", "(", "final", "int", "direction", ")", "{", "int", "currentPage", "=", "pages", ".", "indexOf", "(", "cardManager", ".", "getVisible", "(", ")", ")", ";", "currentPage", "=", "Math", ".", "min", "(", "2", ",", "Math", "...
Handles a pagination request. @param direction the direction and amount of pages to move through.
[ "Handles", "a", "pagination", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCancelButtonExample.java#L153-L164
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WVideoRenderer.java
WVideoRenderer.trackKindToString
private String trackKindToString(final Track.Kind kind) { if (kind == null) { return null; } switch (kind) { case SUBTITLES: return "subtitles"; case CAPTIONS: return "captions"; case DESCRIPTIONS: return "descriptions"; case CHAPTERS: return "chapters"; case METADATA: r...
java
private String trackKindToString(final Track.Kind kind) { if (kind == null) { return null; } switch (kind) { case SUBTITLES: return "subtitles"; case CAPTIONS: return "captions"; case DESCRIPTIONS: return "descriptions"; case CHAPTERS: return "chapters"; case METADATA: r...
[ "private", "String", "trackKindToString", "(", "final", "Track", ".", "Kind", "kind", ")", "{", "if", "(", "kind", "==", "null", ")", "{", "return", "null", ";", "}", "switch", "(", "kind", ")", "{", "case", "SUBTITLES", ":", "return", "\"subtitles\"", ...
Converts a Track kind to the client track kind identifier. @param kind the Track Kind to convert. @return a client track kind identifier, or null if it could not be converted.
[ "Converts", "a", "Track", "kind", "to", "the", "client", "track", "kind", "identifier", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WVideoRenderer.java#L154-L179
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.processAction
public void processAction() throws IOException { if (isDisposed()) { LOG.error("Skipping action phase. Attempt to reuse disposed ContainerHelper instance"); return; } try { // Check user context has been prepared if (getNewConversation() == null) { throw new IllegalStateException( "User con...
java
public void processAction() throws IOException { if (isDisposed()) { LOG.error("Skipping action phase. Attempt to reuse disposed ContainerHelper instance"); return; } try { // Check user context has been prepared if (getNewConversation() == null) { throw new IllegalStateException( "User con...
[ "public", "void", "processAction", "(", ")", "throws", "IOException", "{", "if", "(", "isDisposed", "(", ")", ")", "{", "LOG", ".", "error", "(", "\"Skipping action phase. Attempt to reuse disposed ContainerHelper instance\"", ")", ";", "return", ";", "}", "try", ...
Support standard processing of the action phase of a request. @throws IOException if there is an IO error on writing a response.
[ "Support", "standard", "processing", "of", "the", "action", "phase", "of", "a", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L136-L192
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.render
public void render() throws IOException { if (isDisposed()) { LOG.debug("Skipping render phase."); return; } try { // Check user context has been prepared if (getNewConversation() == null) { throw new IllegalStateException( "User context has not been prepared before the render phase"); }...
java
public void render() throws IOException { if (isDisposed()) { LOG.debug("Skipping render phase."); return; } try { // Check user context has been prepared if (getNewConversation() == null) { throw new IllegalStateException( "User context has not been prepared before the render phase"); }...
[ "public", "void", "render", "(", ")", "throws", "IOException", "{", "if", "(", "isDisposed", "(", ")", ")", "{", "LOG", ".", "debug", "(", "\"Skipping render phase.\"", ")", ";", "return", ";", "}", "try", "{", "// Check user context has been prepared", "if", ...
Support standard processing of the render phase of a request. @throws IOException IO Exception
[ "Support", "standard", "processing", "of", "the", "render", "phase", "of", "a", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L199-L271
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.cycleUIContext
protected void cycleUIContext() { boolean cycleIt = ConfigurationProperties.getDeveloperClusterEmulation(); if (cycleIt) { UIContext uic = getUIContext(); if (uic instanceof UIContextWrap) { LOG.info("Cycling the UIContext to simulate clustering"); ((UIContextWrap) uic).cycle(); } } }
java
protected void cycleUIContext() { boolean cycleIt = ConfigurationProperties.getDeveloperClusterEmulation(); if (cycleIt) { UIContext uic = getUIContext(); if (uic instanceof UIContextWrap) { LOG.info("Cycling the UIContext to simulate clustering"); ((UIContextWrap) uic).cycle(); } } }
[ "protected", "void", "cycleUIContext", "(", ")", "{", "boolean", "cycleIt", "=", "ConfigurationProperties", ".", "getDeveloperClusterEmulation", "(", ")", ";", "if", "(", "cycleIt", ")", "{", "UIContext", "uic", "=", "getUIContext", "(", ")", ";", "if", "(", ...
Call this method to simulate what would happen if the UIContext was serialized due to clustering of servers.
[ "Call", "this", "method", "to", "simulate", "what", "would", "happen", "if", "the", "UIContext", "was", "serialized", "due", "to", "clustering", "of", "servers", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L324-L335
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.prepareRequest
protected void prepareRequest() { LOG.debug("Preparing for request by adding headers and environment to top wcomponent"); // Configure the UIContext to handle this request. UIContext uiContext = getUIContext(); // Add WEnvironment if not already done. // If the component is new, then it will not have a WEnv...
java
protected void prepareRequest() { LOG.debug("Preparing for request by adding headers and environment to top wcomponent"); // Configure the UIContext to handle this request. UIContext uiContext = getUIContext(); // Add WEnvironment if not already done. // If the component is new, then it will not have a WEnv...
[ "protected", "void", "prepareRequest", "(", ")", "{", "LOG", ".", "debug", "(", "\"Preparing for request by adding headers and environment to top wcomponent\"", ")", ";", "// Configure the UIContext to handle this request.", "UIContext", "uiContext", "=", "getUIContext", "(", "...
Prepare the session for the current request.
[ "Prepare", "the", "session", "for", "the", "current", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L361-L392
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.propogateError
private void propogateError(final Throwable error) { // Unhandled runtime exceptions from action phase // must be remembered for subsequent renders if (getRequest() == null) { LOG.error("Unable to remember error from action phase beyond this request"); } else { LOG.debug("Remembering error from action pha...
java
private void propogateError(final Throwable error) { // Unhandled runtime exceptions from action phase // must be remembered for subsequent renders if (getRequest() == null) { LOG.error("Unable to remember error from action phase beyond this request"); } else { LOG.debug("Remembering error from action pha...
[ "private", "void", "propogateError", "(", "final", "Throwable", "error", ")", "{", "// Unhandled runtime exceptions from action phase", "// must be remembered for subsequent renders", "if", "(", "getRequest", "(", ")", "==", "null", ")", "{", "LOG", ".", "error", "(", ...
Propogates an error from the action phase to the render phase. @param error the error to propogate.
[ "Propogates", "an", "error", "from", "the", "action", "phase", "to", "the", "render", "phase", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L561-L570
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.havePropogatedError
private boolean havePropogatedError() { Request req = getRequest(); return req != null && req.getAttribute(ACTION_ERROR_KEY) != null; }
java
private boolean havePropogatedError() { Request req = getRequest(); return req != null && req.getAttribute(ACTION_ERROR_KEY) != null; }
[ "private", "boolean", "havePropogatedError", "(", ")", "{", "Request", "req", "=", "getRequest", "(", ")", ";", "return", "req", "!=", "null", "&&", "req", ".", "getAttribute", "(", "ACTION_ERROR_KEY", ")", "!=", "null", ";", "}" ]
Indicates whether there is an error which has been propogated from the action to the render phase. @return true if there is a propogated escape, false otherwise.
[ "Indicates", "whether", "there", "is", "an", "error", "which", "has", "been", "propogated", "from", "the", "action", "to", "the", "render", "phase", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L577-L580
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.getPropogatedError
private Throwable getPropogatedError() { Request req = getRequest(); if (req != null) { return (Throwable) req.getAttribute(ACTION_ERROR_KEY); } return null; }
java
private Throwable getPropogatedError() { Request req = getRequest(); if (req != null) { return (Throwable) req.getAttribute(ACTION_ERROR_KEY); } return null; }
[ "private", "Throwable", "getPropogatedError", "(", ")", "{", "Request", "req", "=", "getRequest", "(", ")", ";", "if", "(", "req", "!=", "null", ")", "{", "return", "(", "Throwable", ")", "req", ".", "getAttribute", "(", "ACTION_ERROR_KEY", ")", ";", "}"...
Retrieves an error which has been propogated from the action to the render phase. @return the propogated escape, or null if there isn't one.
[ "Retrieves", "an", "error", "which", "has", "been", "propogated", "from", "the", "action", "to", "the", "render", "phase", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L587-L595
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.handleError
public void handleError(final Throwable error) throws IOException { LOG.debug("Start handleError..."); // Should the session be removed upon error? boolean terminate = ConfigurationProperties.getTerminateSessionOnError(); // If we are unfriendly, terminate the session if (terminate) { invalidateSession()...
java
public void handleError(final Throwable error) throws IOException { LOG.debug("Start handleError..."); // Should the session be removed upon error? boolean terminate = ConfigurationProperties.getTerminateSessionOnError(); // If we are unfriendly, terminate the session if (terminate) { invalidateSession()...
[ "public", "void", "handleError", "(", "final", "Throwable", "error", ")", "throws", "IOException", "{", "LOG", ".", "debug", "(", "\"Start handleError...\"", ")", ";", "// Should the session be removed upon error?", "boolean", "terminate", "=", "ConfigurationProperties", ...
Last resort error handling. @param error the error to handle. @throws IOException if there is an error writing the error HTML.
[ "Last", "resort", "error", "handling", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L603-L634
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java
AbstractContainerHelper.renderErrorPageToHTML
protected String renderErrorPageToHTML(final WComponent errorPage) { // Check if using the default error page boolean defaultErrorPage = errorPage instanceof FatalErrorPage; String html = null; // If not default implementation of error page, Transform error page to HTML if (!defaultErrorPage) { // Set U...
java
protected String renderErrorPageToHTML(final WComponent errorPage) { // Check if using the default error page boolean defaultErrorPage = errorPage instanceof FatalErrorPage; String html = null; // If not default implementation of error page, Transform error page to HTML if (!defaultErrorPage) { // Set U...
[ "protected", "String", "renderErrorPageToHTML", "(", "final", "WComponent", "errorPage", ")", "{", "// Check if using the default error page", "boolean", "defaultErrorPage", "=", "errorPage", "instanceof", "FatalErrorPage", ";", "String", "html", "=", "null", ";", "// If ...
Render the error page component to HTML. @param errorPage the error page component @return the error page as HTML
[ "Render", "the", "error", "page", "component", "to", "HTML", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AbstractContainerHelper.java#L642-L678
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldLayoutRenderer.java
WFieldLayoutRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFieldLayout fieldLayout = (WFieldLayout) component; XmlStringBuilder xml = renderContext.getWriter(); int labelWidth = fieldLayout.getLabelWidth(); String title = fieldLayout.getTitle(); xml.appendTagOpen(...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFieldLayout fieldLayout = (WFieldLayout) component; XmlStringBuilder xml = renderContext.getWriter(); int labelWidth = fieldLayout.getLabelWidth(); String title = fieldLayout.getTitle(); xml.appendTagOpen(...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WFieldLayout", "fieldLayout", "=", "(", "WFieldLayout", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WFieldLayout. @param component the WFieldLayout to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WFieldLayout", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldLayoutRenderer.java#L23-L51
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WAbbrTextRenderer.java
WAbbrTextRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WAbbrText abbrText = (WAbbrText) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("abbr"); xml.appendOptionalAttribute("title", abbrText.getToolTip()); xml.appendOptionalAttrib...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WAbbrText abbrText = (WAbbrText) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("abbr"); xml.appendOptionalAttribute("title", abbrText.getToolTip()); xml.appendOptionalAttrib...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WAbbrText", "abbrText", "=", "(", "WAbbrText", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderCo...
Paints the given WAbbrText. @param component the WAbbrText to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WAbbrText", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WAbbrTextRenderer.java#L23-L34
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java
MockHttpServletRequest.getCookies
@Override public Cookie[] getCookies() { Collection<Cookie> entries = cookies.values(); return entries.toArray(new Cookie[0]); }
java
@Override public Cookie[] getCookies() { Collection<Cookie> entries = cookies.values(); return entries.toArray(new Cookie[0]); }
[ "@", "Override", "public", "Cookie", "[", "]", "getCookies", "(", ")", "{", "Collection", "<", "Cookie", ">", "entries", "=", "cookies", ".", "values", "(", ")", ";", "return", "entries", ".", "toArray", "(", "new", "Cookie", "[", "0", "]", ")", ";",...
Get all the cookies on this request. @return An array of all Cookie objects associated with this request.
[ "Get", "all", "the", "cookies", "on", "this", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java#L83-L87
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java
MockHttpServletRequest.setCookie
public void setCookie(final String name, final String value) { if (name != null) { Cookie cookie = new Cookie(name, value); cookies.put(name, cookie); } }
java
public void setCookie(final String name, final String value) { if (name != null) { Cookie cookie = new Cookie(name, value); cookies.put(name, cookie); } }
[ "public", "void", "setCookie", "(", "final", "String", "name", ",", "final", "String", "value", ")", "{", "if", "(", "name", "!=", "null", ")", "{", "Cookie", "cookie", "=", "new", "Cookie", "(", "name", ",", "value", ")", ";", "cookies", ".", "put",...
Sets a cookie on this request instance. @param name The cookie name. @param value The value of the cookie to set.
[ "Sets", "a", "cookie", "on", "this", "request", "instance", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java#L94-L99
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java
MockHttpServletRequest.setParameter
public void setParameter(final String name, final String value) { String[] currentValue = (String[]) parameters.get(name); if (currentValue == null) { currentValue = new String[]{value}; } else { // convert the current values into a new array.. String[] newValues = new String[currentValue.length + 1]; ...
java
public void setParameter(final String name, final String value) { String[] currentValue = (String[]) parameters.get(name); if (currentValue == null) { currentValue = new String[]{value}; } else { // convert the current values into a new array.. String[] newValues = new String[currentValue.length + 1]; ...
[ "public", "void", "setParameter", "(", "final", "String", "name", ",", "final", "String", "value", ")", "{", "String", "[", "]", "currentValue", "=", "(", "String", "[", "]", ")", "parameters", ".", "get", "(", "name", ")", ";", "if", "(", "currentValu...
Sets a parameter. If the parameter already exists, another value will be added to the parameter values. @param name the parameter name @param value the parameter value
[ "Sets", "a", "parameter", ".", "If", "the", "parameter", "already", "exists", "another", "value", "will", "be", "added", "to", "the", "parameter", "values", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java#L490-L504
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Factory.java
Factory.newInstance
public static <T> T newInstance(final Class<T> interfaz) { String classname = ConfigurationProperties.getFactoryImplementation(interfaz.getName()); if (classname == null) { // Hmmm - this is bad. For the time being let's dump the parameters. LOG.fatal("No implementing class for " + interfaz.getName()); LO...
java
public static <T> T newInstance(final Class<T> interfaz) { String classname = ConfigurationProperties.getFactoryImplementation(interfaz.getName()); if (classname == null) { // Hmmm - this is bad. For the time being let's dump the parameters. LOG.fatal("No implementing class for " + interfaz.getName()); LO...
[ "public", "static", "<", "T", ">", "T", "newInstance", "(", "final", "Class", "<", "T", ">", "interfaz", ")", "{", "String", "classname", "=", "ConfigurationProperties", ".", "getFactoryImplementation", "(", "interfaz", ".", "getName", "(", ")", ")", ";", ...
Given an interface, instantiate a class implementing that interface. The classname to instantiate is obtained by looking in the runtime {@link Config configuration}, under the bordertech.wcomponents.factory.impl.&lt;interface name&gt; key. @param <T> the interface type. @param interfaz the interface to instantiate an...
[ "Given", "an", "interface", "instantiate", "a", "class", "implementing", "that", "interface", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Factory.java#L46-L64
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectPairRenderer.java
WMultiSelectPairRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMultiSelectPair multiSelectPair = (WMultiSelectPair) component; XmlStringBuilder xml = renderContext.getWriter(); boolean readOnly = multiSelectPair.isReadOnly(); xml.appendTagOpen("ui:multiselectpair"); x...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMultiSelectPair multiSelectPair = (WMultiSelectPair) component; XmlStringBuilder xml = renderContext.getWriter(); boolean readOnly = multiSelectPair.isReadOnly(); xml.appendTagOpen("ui:multiselectpair"); x...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WMultiSelectPair", "multiSelectPair", "=", "(", "WMultiSelectPair", ")", "component", ";", "XmlStringBuilder", "xml...
Paints the given WMultiSelectPair. @param component the WMultiSelectPair to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WMultiSelectPair", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectPairRenderer.java#L29-L75
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectPairRenderer.java
WMultiSelectPairRenderer.renderOrderedOptions
private int renderOrderedOptions(final WMultiSelectPair multiSelectPair, final List<?> options, final int startIndex, final XmlStringBuilder xml, final boolean renderSelectionsOnly) { List<?> selections = multiSelectPair.getSelected(); int optionIndex = startIndex; // We can't just render all the unselect...
java
private int renderOrderedOptions(final WMultiSelectPair multiSelectPair, final List<?> options, final int startIndex, final XmlStringBuilder xml, final boolean renderSelectionsOnly) { List<?> selections = multiSelectPair.getSelected(); int optionIndex = startIndex; // We can't just render all the unselect...
[ "private", "int", "renderOrderedOptions", "(", "final", "WMultiSelectPair", "multiSelectPair", ",", "final", "List", "<", "?", ">", "options", ",", "final", "int", "startIndex", ",", "final", "XmlStringBuilder", "xml", ",", "final", "boolean", "renderSelectionsOnly"...
Renders the options in selection order. Note, though, that this does not support the legacy allowNull or setSelected using String representations. @param multiSelectPair the WMultiSelectPair to paint. @param options the options to render @param startIndex the starting option index @param xml the XmlStringBuilder to pa...
[ "Renders", "the", "options", "in", "selection", "order", ".", "Note", "though", "that", "this", "does", "not", "support", "the", "legacy", "allowNull", "or", "setSelected", "using", "String", "representations", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectPairRenderer.java#L89-L145
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectPairRenderer.java
WMultiSelectPairRenderer.renderUnorderedOptions
private int renderUnorderedOptions(final WMultiSelectPair multiSelectPair, final List<?> options, final int startIndex, final XmlStringBuilder xml, final boolean renderSelectionsOnly) { List<?> selections = multiSelectPair.getSelected(); int optionIndex = startIndex; for (Object option : options) { if (...
java
private int renderUnorderedOptions(final WMultiSelectPair multiSelectPair, final List<?> options, final int startIndex, final XmlStringBuilder xml, final boolean renderSelectionsOnly) { List<?> selections = multiSelectPair.getSelected(); int optionIndex = startIndex; for (Object option : options) { if (...
[ "private", "int", "renderUnorderedOptions", "(", "final", "WMultiSelectPair", "multiSelectPair", ",", "final", "List", "<", "?", ">", "options", ",", "final", "int", "startIndex", ",", "final", "XmlStringBuilder", "xml", ",", "final", "boolean", "renderSelectionsOnl...
Renders the options in list order. @param multiSelectPair the WMultiSelectPair to paint. @param options the options to render @param startIndex the starting option index @param xml the XmlStringBuilder to paint to. @param renderSelectionsOnly true to only render selected options, false to render all options. @return ...
[ "Renders", "the", "options", "in", "list", "order", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectPairRenderer.java#L158-L183
train
podio/podio-java
src/main/java/com/podio/conversation/ConversationAPI.java
ConversationAPI.getConversationsOnObject
public List<Conversation> getConversationsOnObject(Reference object) { return getResourceFactory().getApiResource( "/conversation/" + object.toURLFragment()).get( new GenericType<List<Conversation>>() { }); }
java
public List<Conversation> getConversationsOnObject(Reference object) { return getResourceFactory().getApiResource( "/conversation/" + object.toURLFragment()).get( new GenericType<List<Conversation>>() { }); }
[ "public", "List", "<", "Conversation", ">", "getConversationsOnObject", "(", "Reference", "object", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/conversation/\"", "+", "object", ".", "toURLFragment", "(", ")", ")", ".", "ge...
Returns a list of all the conversations on the object that the active user is part of. @param object The object to get conversations on @return The list of conversations
[ "Returns", "a", "list", "of", "all", "the", "conversations", "on", "the", "object", "that", "the", "active", "user", "is", "part", "of", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/conversation/ConversationAPI.java#L90-L95
train
podio/podio-java
src/main/java/com/podio/conversation/ConversationAPI.java
ConversationAPI.addReply
public int addReply(int conversationId, String text) { return getResourceFactory() .getApiResource("/conversation/" + conversationId + "/reply") .entity(new MessageCreate(text), MediaType.APPLICATION_JSON_TYPE) .get(MessageCreateResponse.class).getMessageId(); }
java
public int addReply(int conversationId, String text) { return getResourceFactory() .getApiResource("/conversation/" + conversationId + "/reply") .entity(new MessageCreate(text), MediaType.APPLICATION_JSON_TYPE) .get(MessageCreateResponse.class).getMessageId(); }
[ "public", "int", "addReply", "(", "int", "conversationId", ",", "String", "text", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/conversation/\"", "+", "conversationId", "+", "\"/reply\"", ")", ".", "entity", "(", "new", "M...
Creates a reply to the conversation. @param conversationId The id of the conversation to reply to @param text The text of the reply @return The id of the new message
[ "Creates", "a", "reply", "to", "the", "conversation", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/conversation/ConversationAPI.java#L106-L112
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WApplicationRenderer.java
WApplicationRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WApplication application = (WApplication) component; XmlStringBuilder xml = renderContext.getWriter(); UIContext uic = UIContextHolder.getCurrent(); String focusId = uic.getFocussedId(); // Check that this...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WApplication application = (WApplication) component; XmlStringBuilder xml = renderContext.getWriter(); UIContext uic = UIContextHolder.getCurrent(); String focusId = uic.getFocussedId(); // Check that this...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WApplication", "application", "=", "(", "WApplication", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WApplication. @param component the WApplication to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WApplication", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WApplicationRenderer.java#L35-L104
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WShufflerExample.java
WShufflerExample.preparePaintComponent
@Override protected void preparePaintComponent(final Request request) { StringBuffer text = new StringBuffer("Options: "); for (Object option : shuffler.getOptions()) { text.append(option).append(", "); } order.setText(text.toString()); }
java
@Override protected void preparePaintComponent(final Request request) { StringBuffer text = new StringBuffer("Options: "); for (Object option : shuffler.getOptions()) { text.append(option).append(", "); } order.setText(text.toString()); }
[ "@", "Override", "protected", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "StringBuffer", "text", "=", "new", "StringBuffer", "(", "\"Options: \"", ")", ";", "for", "(", "Object", "option", ":", "shuffler", ".", "getOptions", ...
Concatenate the options to display in the text field. @param request the current request being processed
[ "Concatenate", "the", "options", "to", "display", "in", "the", "text", "field", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WShufflerExample.java#L71-L80
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiTextFieldRenderer.java
WMultiTextFieldRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMultiTextField textField = (WMultiTextField) component; XmlStringBuilder xml = renderContext.getWriter(); boolean readOnly = textField.isReadOnly(); String[] values = textField.getTextInputs(); xml.appen...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMultiTextField textField = (WMultiTextField) component; XmlStringBuilder xml = renderContext.getWriter(); boolean readOnly = textField.isReadOnly(); String[] values = textField.getTextInputs(); xml.appen...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WMultiTextField", "textField", "=", "(", "WMultiTextField", ")", "component", ";", "XmlStringBuilder", "xml", "="...
Paints the given WMultiTextField. @param component the WMultiTextField to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WMultiTextField", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiTextFieldRenderer.java#L27-L78
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WTextExample.java
WTextExample.fakeServiceCall
private static ExampleBean fakeServiceCall(final String text) { ExampleBean exampleBean = new ExampleBean(); exampleBean.setBeanAttribute("(beanAttribute) " + text); ExampleBean.DummyInnerBean dummyInnerBean = new ExampleBean.DummyInnerBean(); dummyInnerBean.setInnerAttribute("(innerBean.innerAttribute) " + te...
java
private static ExampleBean fakeServiceCall(final String text) { ExampleBean exampleBean = new ExampleBean(); exampleBean.setBeanAttribute("(beanAttribute) " + text); ExampleBean.DummyInnerBean dummyInnerBean = new ExampleBean.DummyInnerBean(); dummyInnerBean.setInnerAttribute("(innerBean.innerAttribute) " + te...
[ "private", "static", "ExampleBean", "fakeServiceCall", "(", "final", "String", "text", ")", "{", "ExampleBean", "exampleBean", "=", "new", "ExampleBean", "(", ")", ";", "exampleBean", ".", "setBeanAttribute", "(", "\"(beanAttribute) \"", "+", "text", ")", ";", "...
Fakes a service call and just returns dummy data. @param text the text to insert in the dummy data. @return a ExampleBean containing the specified text.
[ "Fakes", "a", "service", "call", "and", "just", "returns", "dummy", "data", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WTextExample.java#L124-L133
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.processRequest
public static void processRequest(final HttpServletHelper helper, final WComponent ui, final InterceptorComponent interceptorChain) throws ServletException, IOException { try { // Tell the support container about the top most web component // that will service the request/response. if (interceptorChain =...
java
public static void processRequest(final HttpServletHelper helper, final WComponent ui, final InterceptorComponent interceptorChain) throws ServletException, IOException { try { // Tell the support container about the top most web component // that will service the request/response. if (interceptorChain =...
[ "public", "static", "void", "processRequest", "(", "final", "HttpServletHelper", "helper", ",", "final", "WComponent", "ui", ",", "final", "InterceptorComponent", "interceptorChain", ")", "throws", "ServletException", ",", "IOException", "{", "try", "{", "// Tell the ...
This method does the real work in servicing the http request. It integrates wcomponents into a servlet environment via a servlet specific helper class. @param helper the servlet helper @param ui the application ui @param interceptorChain the chain of interceptors @throws ServletException a servlet exception @throws IO...
[ "This", "method", "does", "the", "real", "work", "in", "servicing", "the", "http", "request", ".", "It", "integrates", "wcomponents", "into", "a", "servlet", "environment", "via", "a", "servlet", "specific", "helper", "class", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L173-L202
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.handleStaticResourceRequest
public static void handleStaticResourceRequest(final HttpServletRequest request, final HttpServletResponse response) { String staticRequest = request.getParameter(WServlet.STATIC_RESOURCE_PARAM_NAME); try { InternalResource staticResource = InternalResourceMap.getResource(staticRequest); boolean headersOn...
java
public static void handleStaticResourceRequest(final HttpServletRequest request, final HttpServletResponse response) { String staticRequest = request.getParameter(WServlet.STATIC_RESOURCE_PARAM_NAME); try { InternalResource staticResource = InternalResourceMap.getResource(staticRequest); boolean headersOn...
[ "public", "static", "void", "handleStaticResourceRequest", "(", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ")", "{", "String", "staticRequest", "=", "request", ".", "getParameter", "(", "WServlet", ".", "STATIC_RESOURCE_PA...
Handles a request for static resources. @param request the http request. @param response the http response.
[ "Handles", "a", "request", "for", "static", "resources", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L218-L270
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.handleThemeResourceRequest
public static void handleThemeResourceRequest(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { if (req.getHeader("If-Modified-Since") != null) { resp.reset(); resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return; } String fileName = req.g...
java
public static void handleThemeResourceRequest(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { if (req.getHeader("If-Modified-Since") != null) { resp.reset(); resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return; } String fileName = req.g...
[ "public", "static", "void", "handleThemeResourceRequest", "(", "final", "HttpServletRequest", "req", ",", "final", "HttpServletResponse", "resp", ")", "throws", "ServletException", ",", "IOException", "{", "if", "(", "req", ".", "getHeader", "(", "\"If-Modified-Since\...
Serves up a file from the theme. In practice it is generally a bad idea to use this servlet to serve up static resources. Instead it would make more sense to move CSS, JS, HTML resources to a CDN or similar. @param req the request with the file name in parameter "f", or following the servlet path. @param resp the res...
[ "Serves", "up", "a", "file", "from", "the", "theme", ".", "In", "practice", "it", "is", "generally", "a", "bad", "idea", "to", "use", "this", "servlet", "to", "serve", "up", "static", "resources", ".", "Instead", "it", "would", "make", "more", "sense", ...
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L291-L366
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.checkThemeFile
private static boolean checkThemeFile(final String name) { return !(Util.empty(name) // name must exist || name.contains("..") // prevent directory traversal || name.charAt(0) == '/' // all theme references should be relative || name.indexOf(':') != -1 // forbid use of protocols such as jar:, http: etc. ...
java
private static boolean checkThemeFile(final String name) { return !(Util.empty(name) // name must exist || name.contains("..") // prevent directory traversal || name.charAt(0) == '/' // all theme references should be relative || name.indexOf(':') != -1 // forbid use of protocols such as jar:, http: etc. ...
[ "private", "static", "boolean", "checkThemeFile", "(", "final", "String", "name", ")", "{", "return", "!", "(", "Util", ".", "empty", "(", "name", ")", "// name must exist", "||", "name", ".", "contains", "(", "\"..\"", ")", "// prevent directory traversal", "...
Performs basic sanity checks on the file being requested. @param name the file name @return true if the requested file name is ok, false if not.
[ "Performs", "basic", "sanity", "checks", "on", "the", "file", "being", "requested", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L374-L380
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.createInterceptorChain
public static InterceptorComponent createInterceptorChain(final HttpServletRequest request) { // Allow for multi part parameters Map<String, String[]> parameters = getRequestParameters(request); InterceptorComponent[] chain; if (parameters.get(WServlet.DATA_LIST_PARAM_NAME) != null) { // Datalist chain = ...
java
public static InterceptorComponent createInterceptorChain(final HttpServletRequest request) { // Allow for multi part parameters Map<String, String[]> parameters = getRequestParameters(request); InterceptorComponent[] chain; if (parameters.get(WServlet.DATA_LIST_PARAM_NAME) != null) { // Datalist chain = ...
[ "public", "static", "InterceptorComponent", "createInterceptorChain", "(", "final", "HttpServletRequest", "request", ")", "{", "// Allow for multi part parameters", "Map", "<", "String", ",", "String", "[", "]", ">", "parameters", "=", "getRequestParameters", "(", "requ...
Creates a new interceptor chain to handle the given request. @param request the request to handle @return a new interceptor chain for the request.
[ "Creates", "a", "new", "interceptor", "chain", "to", "handle", "the", "given", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L388-L454
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.getRequestParameters
public static Map<String, String[]> getRequestParameters(final HttpServletRequest request) { if (request.getAttribute(REQUEST_PROCESSED_KEY) == null) { setupRequestParameters(request); } return (Map<String, String[]>) request.getAttribute(REQUEST_PARAMETERS_KEY); }
java
public static Map<String, String[]> getRequestParameters(final HttpServletRequest request) { if (request.getAttribute(REQUEST_PROCESSED_KEY) == null) { setupRequestParameters(request); } return (Map<String, String[]>) request.getAttribute(REQUEST_PARAMETERS_KEY); }
[ "public", "static", "Map", "<", "String", ",", "String", "[", "]", ">", "getRequestParameters", "(", "final", "HttpServletRequest", "request", ")", "{", "if", "(", "request", ".", "getAttribute", "(", "REQUEST_PROCESSED_KEY", ")", "==", "null", ")", "{", "se...
Get a map of request parameters allowing for multi part form fields. @param request the request being processed @return a map of parameters on the request
[ "Get", "a", "map", "of", "request", "parameters", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L531-L536
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.getRequestParameterValue
public static String getRequestParameterValue(final HttpServletRequest request, final String key) { String[] values = getRequestParameterValues(request, key); return values == null || values.length == 0 ? null : values[0]; }
java
public static String getRequestParameterValue(final HttpServletRequest request, final String key) { String[] values = getRequestParameterValues(request, key); return values == null || values.length == 0 ? null : values[0]; }
[ "public", "static", "String", "getRequestParameterValue", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "key", ")", "{", "String", "[", "]", "values", "=", "getRequestParameterValues", "(", "request", ",", "key", ")", ";", "return", "val...
Get a value for a request parameter allowing for multi part form fields. @param request the request being processed @param key the parameter key to return @return the parameter value
[ "Get", "a", "value", "for", "a", "request", "parameter", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L545-L548
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.getRequestParameterValues
public static String[] getRequestParameterValues(final HttpServletRequest request, final String key) { return getRequestParameters(request).get(key); }
java
public static String[] getRequestParameterValues(final HttpServletRequest request, final String key) { return getRequestParameters(request).get(key); }
[ "public", "static", "String", "[", "]", "getRequestParameterValues", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "key", ")", "{", "return", "getRequestParameters", "(", "request", ")", ".", "get", "(", "key", ")", ";", "}" ]
Get the values for a request parameter allowing for multi part form fields. @param request the request being processed @param key the parameter key to return @return the parameter values
[ "Get", "the", "values", "for", "a", "request", "parameter", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L557-L559
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.getRequestFileItems
public static Map<String, FileItem[]> getRequestFileItems(final HttpServletRequest request) { if (request.getAttribute(REQUEST_PROCESSED_KEY) == null) { setupRequestParameters(request); } return (Map<String, FileItem[]>) request.getAttribute(REQUEST_FILES_KEY); }
java
public static Map<String, FileItem[]> getRequestFileItems(final HttpServletRequest request) { if (request.getAttribute(REQUEST_PROCESSED_KEY) == null) { setupRequestParameters(request); } return (Map<String, FileItem[]>) request.getAttribute(REQUEST_FILES_KEY); }
[ "public", "static", "Map", "<", "String", ",", "FileItem", "[", "]", ">", "getRequestFileItems", "(", "final", "HttpServletRequest", "request", ")", "{", "if", "(", "request", ".", "getAttribute", "(", "REQUEST_PROCESSED_KEY", ")", "==", "null", ")", "{", "s...
Get a map of file items in the request allowing for multi part form fields. @param request the request being processed @return a map of files on the request
[ "Get", "a", "map", "of", "file", "items", "in", "the", "request", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L567-L572
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.getRequestFileItemValue
public static FileItem getRequestFileItemValue(final HttpServletRequest request, final String key) { FileItem[] values = getRequestFileItemValues(request, key); return values == null || values.length == 0 ? null : values[0]; }
java
public static FileItem getRequestFileItemValue(final HttpServletRequest request, final String key) { FileItem[] values = getRequestFileItemValues(request, key); return values == null || values.length == 0 ? null : values[0]; }
[ "public", "static", "FileItem", "getRequestFileItemValue", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "key", ")", "{", "FileItem", "[", "]", "values", "=", "getRequestFileItemValues", "(", "request", ",", "key", ")", ";", "return", "v...
Get a file item value from the request allowing for multi part form fields. @param request the request being processed @param key the file parameter key to return @return the file item value
[ "Get", "a", "file", "item", "value", "from", "the", "request", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L581-L584
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.getRequestFileItemValues
public static FileItem[] getRequestFileItemValues(final HttpServletRequest request, final String key) { return getRequestFileItems(request).get(key); }
java
public static FileItem[] getRequestFileItemValues(final HttpServletRequest request, final String key) { return getRequestFileItems(request).get(key); }
[ "public", "static", "FileItem", "[", "]", "getRequestFileItemValues", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "key", ")", "{", "return", "getRequestFileItems", "(", "request", ")", ".", "get", "(", "key", ")", ";", "}" ]
Get file item values from the request allowing for multi part form fields. @param request the request being processed @param key the file parameter key to return @return the file item values
[ "Get", "file", "item", "values", "from", "the", "request", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L593-L595
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.setupRequestParameters
public static void setupRequestParameters(final HttpServletRequest request) { // Check already processed if (request.getAttribute(REQUEST_PROCESSED_KEY) != null) { return; } Map<String, String[]> parameters = new HashMap<>(); Map<String, FileItem[]> files = new HashMap<>(); extractParameterMap(request...
java
public static void setupRequestParameters(final HttpServletRequest request) { // Check already processed if (request.getAttribute(REQUEST_PROCESSED_KEY) != null) { return; } Map<String, String[]> parameters = new HashMap<>(); Map<String, FileItem[]> files = new HashMap<>(); extractParameterMap(request...
[ "public", "static", "void", "setupRequestParameters", "(", "final", "HttpServletRequest", "request", ")", "{", "// Check already processed", "if", "(", "request", ".", "getAttribute", "(", "REQUEST_PROCESSED_KEY", ")", "!=", "null", ")", "{", "return", ";", "}", "...
Process the request parameters allowing for multi part form fields. @param request the request being processed
[ "Process", "the", "request", "parameters", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L602-L617
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.extractParameterMap
public static void extractParameterMap(final HttpServletRequest request, final Map<String, String[]> parameters, final Map<String, FileItem[]> files) { if (isMultipart(request)) { ServletFileUpload upload = new ServletFileUpload(); upload.setFileItemFactory(new DiskFileItemFactory()); try { List file...
java
public static void extractParameterMap(final HttpServletRequest request, final Map<String, String[]> parameters, final Map<String, FileItem[]> files) { if (isMultipart(request)) { ServletFileUpload upload = new ServletFileUpload(); upload.setFileItemFactory(new DiskFileItemFactory()); try { List file...
[ "public", "static", "void", "extractParameterMap", "(", "final", "HttpServletRequest", "request", ",", "final", "Map", "<", "String", ",", "String", "[", "]", ">", "parameters", ",", "final", "Map", "<", "String", ",", "FileItem", "[", "]", ">", "files", "...
Extract the parameters and file items allowing for multi part form fields. @param request the request being processed @param parameters the map to store non-file request parameters in. @param files the map to store the uploaded file parameters in.
[ "Extract", "the", "parameters", "and", "file", "items", "allowing", "for", "multi", "part", "form", "fields", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L626-L649
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java
ServletUtil.extractCookie
public static String extractCookie(final HttpServletRequest request, final String name) { for (Cookie cookie : request.getCookies()) { if (cookie.getName().equals(name)) { return cookie.getValue(); } } return null; }
java
public static String extractCookie(final HttpServletRequest request, final String name) { for (Cookie cookie : request.getCookies()) { if (cookie.getName().equals(name)) { return cookie.getValue(); } } return null; }
[ "public", "static", "String", "extractCookie", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "name", ")", "{", "for", "(", "Cookie", "cookie", ":", "request", ".", "getCookies", "(", ")", ")", "{", "if", "(", "cookie", ".", "getNam...
Find the value of a cookie on the request, by name. @param request The request on which to check for the cookie. @param name The name of the cookie we want the value of. @return The value of the cookie, if present, otherwise null.
[ "Find", "the", "value", "of", "a", "cookie", "on", "the", "request", "by", "name", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L657-L664
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WRadioButtonSubmitOnChangeExample.java
WRadioButtonSubmitOnChangeExample.updateRegion
private void updateRegion() { actMessagePanel.setVisible(false); if (rbtACT.isSelected()) { actMessagePanel.setVisible(true); regionFields.setVisible(true); regionSelector.setOptions(new String[]{null, "Belconnen", "City", "Woden"}); regionSelector.setVisible(true); } else if (rbtNSW.isSelected()) { ...
java
private void updateRegion() { actMessagePanel.setVisible(false); if (rbtACT.isSelected()) { actMessagePanel.setVisible(true); regionFields.setVisible(true); regionSelector.setOptions(new String[]{null, "Belconnen", "City", "Woden"}); regionSelector.setVisible(true); } else if (rbtNSW.isSelected()) { ...
[ "private", "void", "updateRegion", "(", ")", "{", "actMessagePanel", ".", "setVisible", "(", "false", ")", ";", "if", "(", "rbtACT", ".", "isSelected", "(", ")", ")", "{", "actMessagePanel", ".", "setVisible", "(", "true", ")", ";", "regionFields", ".", ...
Updates the visibility and options present in the region selector, depending on the state selector's value.
[ "Updates", "the", "visibility", "and", "options", "present", "in", "the", "region", "selector", "depending", "on", "the", "state", "selector", "s", "value", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WRadioButtonSubmitOnChangeExample.java#L89-L112
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java
WWindow.setContent
public void setContent(final WComponent content) { WindowModel model = getOrCreateComponentModel(); // If the previous content had been wrapped, then remove it from the wrapping WApplication. if (model.wrappedContent != null && model.wrappedContent != model.content) { model.wrappedContent.removeAll(); } ...
java
public void setContent(final WComponent content) { WindowModel model = getOrCreateComponentModel(); // If the previous content had been wrapped, then remove it from the wrapping WApplication. if (model.wrappedContent != null && model.wrappedContent != model.content) { model.wrappedContent.removeAll(); } ...
[ "public", "void", "setContent", "(", "final", "WComponent", "content", ")", "{", "WindowModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "// If the previous content had been wrapped, then remove it from the wrapping WApplication.", "if", "(", "model", ".", ...
Set the WComponent that will handle the content for this pop up window. @param content the window content.
[ "Set", "the", "WComponent", "that", "will", "handle", "the", "content", "for", "this", "pop", "up", "window", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java#L86-L107
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java
WWindow.setTitle
public void setTitle(final String title) { String currTitle = getTitle(); if (!Objects.equals(title, currTitle)) { getOrCreateComponentModel().title = title; } }
java
public void setTitle(final String title) { String currTitle = getTitle(); if (!Objects.equals(title, currTitle)) { getOrCreateComponentModel().title = title; } }
[ "public", "void", "setTitle", "(", "final", "String", "title", ")", "{", "String", "currTitle", "=", "getTitle", "(", ")", ";", "if", "(", "!", "Objects", ".", "equals", "(", "title", ",", "currTitle", ")", ")", "{", "getOrCreateComponentModel", "(", ")"...
Sets the window title. @param title The title to set.
[ "Sets", "the", "window", "title", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java#L128-L134
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java
WWindow.getUrl
public String getUrl() { Environment env = getEnvironment(); Map<String, String> parameters = env.getHiddenParameters(); parameters.put(WWINDOW_REQUEST_PARAM_KEY, getId()); // Override the step count with WWindow step parameters.put(Environment.STEP_VARIABLE, String.valueOf(getStep())); String url = env.ge...
java
public String getUrl() { Environment env = getEnvironment(); Map<String, String> parameters = env.getHiddenParameters(); parameters.put(WWINDOW_REQUEST_PARAM_KEY, getId()); // Override the step count with WWindow step parameters.put(Environment.STEP_VARIABLE, String.valueOf(getStep())); String url = env.ge...
[ "public", "String", "getUrl", "(", ")", "{", "Environment", "env", "=", "getEnvironment", "(", ")", ";", "Map", "<", "String", ",", "String", ">", "parameters", "=", "env", ".", "getHiddenParameters", "(", ")", ";", "parameters", ".", "put", "(", "WWINDO...
Returns a dynamic URL that this wwindow component can be accessed from. @return the URL to access this wwindow component.
[ "Returns", "a", "dynamic", "URL", "that", "this", "wwindow", "component", "can", "be", "accessed", "from", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java#L348-L358
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java
WWindow.preparePaintComponent
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); // Check if window in request (might not have gone through handle request, eg Step error) boolean targeted = isPresent(request); setTargeted(targeted); if (getState() == ACTIVE_STATE && isTargeted(...
java
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); // Check if window in request (might not have gone through handle request, eg Step error) boolean targeted = isPresent(request); setTargeted(targeted); if (getState() == ACTIVE_STATE && isTargeted(...
[ "@", "Override", "protected", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "super", ".", "preparePaintComponent", "(", "request", ")", ";", "// Check if window in request (might not have gone through handle request, eg Step error)", "boolean", ...
Override preparePaintComponent to clear the scratch map before the window content is being painted. @param request the request being responded to.
[ "Override", "preparePaintComponent", "to", "clear", "the", "scratch", "map", "before", "the", "window", "content", "is", "being", "painted", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java#L409-L420
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java
WWindow.paintComponent
@Override protected void paintComponent(final RenderContext renderContext) { if (getState() == DISPLAY_STATE) { setState(ACTIVE_STATE); showWindow(renderContext); } else if (getState() == ACTIVE_STATE && isTargeted()) { getComponentModel().wrappedContent.paint(renderContext); } }
java
@Override protected void paintComponent(final RenderContext renderContext) { if (getState() == DISPLAY_STATE) { setState(ACTIVE_STATE); showWindow(renderContext); } else if (getState() == ACTIVE_STATE && isTargeted()) { getComponentModel().wrappedContent.paint(renderContext); } }
[ "@", "Override", "protected", "void", "paintComponent", "(", "final", "RenderContext", "renderContext", ")", "{", "if", "(", "getState", "(", ")", "==", "DISPLAY_STATE", ")", "{", "setState", "(", "ACTIVE_STATE", ")", ";", "showWindow", "(", "renderContext", "...
Override paintComponent in order to paint the window or its content, depending on the window state. @param renderContext the RenderContext to send the output to.
[ "Override", "paintComponent", "in", "order", "to", "paint", "the", "window", "or", "its", "content", "depending", "on", "the", "window", "state", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java#L427-L435
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java
WWindow.showWindow
protected void showWindow(final RenderContext renderContext) { // Get current step int current = UIContextHolder.getCurrent().getEnvironment().getStep(); // Get window current step (may have already been launched) int window = getStep(); // Combine step counts to make previous window (if still open) invalid ...
java
protected void showWindow(final RenderContext renderContext) { // Get current step int current = UIContextHolder.getCurrent().getEnvironment().getStep(); // Get window current step (may have already been launched) int window = getStep(); // Combine step counts to make previous window (if still open) invalid ...
[ "protected", "void", "showWindow", "(", "final", "RenderContext", "renderContext", ")", "{", "// Get current step", "int", "current", "=", "UIContextHolder", ".", "getCurrent", "(", ")", ".", "getEnvironment", "(", ")", ".", "getStep", "(", ")", ";", "// Get win...
Emits the mark-up which pops up the window. @param renderContext the RenderContext to send the output to.
[ "Emits", "the", "mark", "-", "up", "which", "pops", "up", "the", "window", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WWindow.java#L448-L499
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFileWidgetRenderer.java
WFileWidgetRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFileWidget fileWidget = (WFileWidget) component; XmlStringBuilder xml = renderContext.getWriter(); boolean readOnly = fileWidget.isReadOnly(); xml.appendTagOpen(TAG_NAME); xml.appendAttribute("id", compone...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFileWidget fileWidget = (WFileWidget) component; XmlStringBuilder xml = renderContext.getWriter(); boolean readOnly = fileWidget.isReadOnly(); xml.appendTagOpen(TAG_NAME); xml.appendAttribute("id", compone...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WFileWidget", "fileWidget", "=", "(", "WFileWidget", ")", "component", ";", "XmlStringBuilder", "xml", "=", "re...
Paints the given WFileWidget. @param component the WFileWidget to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WFileWidget", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFileWidgetRenderer.java#L29-L61
train
podio/podio-java
src/main/java/com/podio/org/OrgAPI.java
OrgAPI.createOrganization
public OrganizationCreateResponse createOrganization(OrganizationCreate data) { return getResourceFactory().getApiResource("/org/") .entity(data, MediaType.APPLICATION_JSON_TYPE) .post(OrganizationCreateResponse.class); }
java
public OrganizationCreateResponse createOrganization(OrganizationCreate data) { return getResourceFactory().getApiResource("/org/") .entity(data, MediaType.APPLICATION_JSON_TYPE) .post(OrganizationCreateResponse.class); }
[ "public", "OrganizationCreateResponse", "createOrganization", "(", "OrganizationCreate", "data", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/org/\"", ")", ".", "entity", "(", "data", ",", "MediaType", ".", "APPLICATION_JSON_TYPE...
Creates a new organization @param data The data for the new organization @return The data for the newly created organization
[ "Creates", "a", "new", "organization" ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L27-L31
train
podio/podio-java
src/main/java/com/podio/org/OrgAPI.java
OrgAPI.updateOrganization
public void updateOrganization(int orgId, OrganizationCreate data) { getResourceFactory().getApiResource("/org/" + orgId) .entity(data, MediaType.APPLICATION_JSON_TYPE).put(); }
java
public void updateOrganization(int orgId, OrganizationCreate data) { getResourceFactory().getApiResource("/org/" + orgId) .entity(data, MediaType.APPLICATION_JSON_TYPE).put(); }
[ "public", "void", "updateOrganization", "(", "int", "orgId", ",", "OrganizationCreate", "data", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/org/\"", "+", "orgId", ")", ".", "entity", "(", "data", ",", "MediaType", ".", "APPLICATIO...
Updates an organization with new name and logo. Note that the URL of the organization will not change even though the name changes. @param orgId The id of the organization @param data The new data
[ "Updates", "an", "organization", "with", "new", "name", "and", "logo", ".", "Note", "that", "the", "URL", "of", "the", "organization", "will", "not", "change", "even", "though", "the", "name", "changes", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L42-L45
train
podio/podio-java
src/main/java/com/podio/org/OrgAPI.java
OrgAPI.getOrganizationByURL
public OrganizationMini getOrganizationByURL(String url) { return getResourceFactory().getApiResource("/org/url") .queryParam("url", url).get(OrganizationMini.class); }
java
public OrganizationMini getOrganizationByURL(String url) { return getResourceFactory().getApiResource("/org/url") .queryParam("url", url).get(OrganizationMini.class); }
[ "public", "OrganizationMini", "getOrganizationByURL", "(", "String", "url", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/org/url\"", ")", ".", "queryParam", "(", "\"url\"", ",", "url", ")", ".", "get", "(", "OrganizationMin...
Returns the organization with the given full URL. The URL does not have to be truncated to the root, it can be to any resource on the URL. @param url The URL to find the organization for @return The organization
[ "Returns", "the", "organization", "with", "the", "given", "full", "URL", ".", "The", "URL", "does", "not", "have", "to", "be", "truncated", "to", "the", "root", "it", "can", "be", "to", "any", "resource", "on", "the", "URL", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L77-L80
train
podio/podio-java
src/main/java/com/podio/org/OrgAPI.java
OrgAPI.getSharedOrganizations
public List<OrganizationWithSpaces> getSharedOrganizations(int userId) { return getResourceFactory().getApiResource("/org/shared/" + userId) .get(new GenericType<List<OrganizationWithSpaces>>() { }); }
java
public List<OrganizationWithSpaces> getSharedOrganizations(int userId) { return getResourceFactory().getApiResource("/org/shared/" + userId) .get(new GenericType<List<OrganizationWithSpaces>>() { }); }
[ "public", "List", "<", "OrganizationWithSpaces", ">", "getSharedOrganizations", "(", "int", "userId", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/org/shared/\"", "+", "userId", ")", ".", "get", "(", "new", "GenericType", "...
Returns the organizations and spaces that the logged in user shares with the specified user. The organizations and spaces will be returned sorted by name. @param userId The id of the user @return The organizations with spaces that are shared with the user
[ "Returns", "the", "organizations", "and", "spaces", "that", "the", "logged", "in", "user", "shares", "with", "the", "specified", "user", ".", "The", "organizations", "and", "spaces", "will", "be", "returned", "sorted", "by", "name", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L91-L95
train
podio/podio-java
src/main/java/com/podio/org/OrgAPI.java
OrgAPI.getSpaces
public List<Space> getSpaces(int orgId) { return getResourceFactory().getApiResource("/org/" + orgId + "/space/") .get(new GenericType<List<Space>>() { }); }
java
public List<Space> getSpaces(int orgId) { return getResourceFactory().getApiResource("/org/" + orgId + "/space/") .get(new GenericType<List<Space>>() { }); }
[ "public", "List", "<", "Space", ">", "getSpaces", "(", "int", "orgId", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/org/\"", "+", "orgId", "+", "\"/space/\"", ")", ".", "get", "(", "new", "GenericType", "<", "List", ...
Returns all the spaces for the organization. @param orgId The id of the organization @return The spaces in the organization
[ "Returns", "all", "the", "spaces", "for", "the", "organization", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L121-L125
train
podio/podio-java
src/main/java/com/podio/org/OrgAPI.java
OrgAPI.getEndMemberInfo
public EndMemberInfo getEndMemberInfo(int orgId, int userId) { return getResourceFactory().getApiResource( "/org/" + orgId + "/member/" + userId + "/end_member_info").get( EndMemberInfo.class); }
java
public EndMemberInfo getEndMemberInfo(int orgId, int userId) { return getResourceFactory().getApiResource( "/org/" + orgId + "/member/" + userId + "/end_member_info").get( EndMemberInfo.class); }
[ "public", "EndMemberInfo", "getEndMemberInfo", "(", "int", "orgId", ",", "int", "userId", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/org/\"", "+", "orgId", "+", "\"/member/\"", "+", "userId", "+", "\"/end_member_info\"", ...
Returns information about what would happen if this user would be removed from the org @param orgId The id of the organization @param userId The id of the user @return The information about the users workspace memberships in the org
[ "Returns", "information", "about", "what", "would", "happen", "if", "this", "user", "would", "be", "removed", "from", "the", "org" ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L224-L228
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WImageEditor.java
WImageEditor.setUseCamera
public void setUseCamera(final boolean useCamera) { if (useCamera != getUseCamera()) { ImageEditModel model = getOrCreateComponentModel(); model.useCamera = useCamera; } }
java
public void setUseCamera(final boolean useCamera) { if (useCamera != getUseCamera()) { ImageEditModel model = getOrCreateComponentModel(); model.useCamera = useCamera; } }
[ "public", "void", "setUseCamera", "(", "final", "boolean", "useCamera", ")", "{", "if", "(", "useCamera", "!=", "getUseCamera", "(", ")", ")", "{", "ImageEditModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "model", ".", "useCamera", "=", "u...
Set to true if you wish to allow the user to capture an image from an attached camera. This feature is completely dependent on browser support and will essentially be ignored if the browser does not provide the necessary APIs. @param useCamera the overlay image URL.
[ "Set", "to", "true", "if", "you", "wish", "to", "allow", "the", "user", "to", "capture", "an", "image", "from", "an", "attached", "camera", ".", "This", "feature", "is", "completely", "dependent", "on", "browser", "support", "and", "will", "essentially", "...
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WImageEditor.java#L55-L60
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WImageEditor.java
WImageEditor.setIsFace
public void setIsFace(final boolean isFace) { if (isFace != getIsFace()) { ImageEditModel model = getOrCreateComponentModel(); model.isFace = isFace; } }
java
public void setIsFace(final boolean isFace) { if (isFace != getIsFace()) { ImageEditModel model = getOrCreateComponentModel(); model.isFace = isFace; } }
[ "public", "void", "setIsFace", "(", "final", "boolean", "isFace", ")", "{", "if", "(", "isFace", "!=", "getIsFace", "(", ")", ")", "{", "ImageEditModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "model", ".", "isFace", "=", "isFace", ";", ...
Set to true to turn on face detection. @param isFace turn face detection on or off.
[ "Set", "to", "true", "to", "turn", "on", "face", "detection", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WImageEditor.java#L74-L79
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WImageEditor.java
WImageEditor.setRenderInline
public void setRenderInline(final boolean renderInline) { if (renderInline != getRenderInline()) { ImageEditModel model = getOrCreateComponentModel(); model.renderInline = renderInline; } }
java
public void setRenderInline(final boolean renderInline) { if (renderInline != getRenderInline()) { ImageEditModel model = getOrCreateComponentModel(); model.renderInline = renderInline; } }
[ "public", "void", "setRenderInline", "(", "final", "boolean", "renderInline", ")", "{", "if", "(", "renderInline", "!=", "getRenderInline", "(", ")", ")", "{", "ImageEditModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "model", ".", "renderInlin...
If true then the image editor will render where it is added in the tree instead of in a popup. @param renderInline Set to true to render inline.
[ "If", "true", "then", "the", "image", "editor", "will", "render", "where", "it", "is", "added", "in", "the", "tree", "instead", "of", "in", "a", "popup", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WImageEditor.java#L93-L98
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFigureRenderer.java
WFigureRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFigure figure = (WFigure) component; XmlStringBuilder xml = renderContext.getWriter(); boolean renderChildren = isRenderContent(figure); xml.appendTagOpen("ui:figure"); xml.appendAttribute("id", component...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFigure figure = (WFigure) component; XmlStringBuilder xml = renderContext.getWriter(); boolean renderChildren = isRenderContent(figure); xml.appendTagOpen("ui:figure"); xml.appendAttribute("id", component...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WFigure", "figure", "=", "(", "WFigure", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderContext"...
Paints the given WFigure. @param component the WFigure to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WFigure", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFigureRenderer.java#L25-L74
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/AppPreferenceParameterExample.java
AppPreferenceParameterExample.preparePaintComponent
@Override public void preparePaintComponent(final Request request) { if (!this.isInitialised() || resetButton.isPressed()) { String preferredState = request.getAppPreferenceParameter("example.preferred.state"); stateSelector.setSelected(preferredState); this.setInitialised(true); } }
java
@Override public void preparePaintComponent(final Request request) { if (!this.isInitialised() || resetButton.isPressed()) { String preferredState = request.getAppPreferenceParameter("example.preferred.state"); stateSelector.setSelected(preferredState); this.setInitialised(true); } }
[ "@", "Override", "public", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "if", "(", "!", "this", ".", "isInitialised", "(", ")", "||", "resetButton", ".", "isPressed", "(", ")", ")", "{", "String", "preferredState", "=", "r...
Override preparePaintComponent to set the initial selection from the app preferences. The selection is set the first time the example is accessed or when the reset button is used. @param request the request being responded to.
[ "Override", "preparePaintComponent", "to", "set", "the", "initial", "selection", "from", "the", "app", "preferences", ".", "The", "selection", "is", "set", "the", "first", "time", "the", "example", "is", "accessed", "or", "when", "the", "reset", "button", "is"...
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/AppPreferenceParameterExample.java#L44-L51
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.addColumn
public void addColumn(final WTableColumn column) { columns.add(column); WDataTableRowRenderer renderer = (WDataTableRowRenderer) repeater.getRepeatedComponent(); renderer.addColumn(column, columns.getChildCount() - 1); }
java
public void addColumn(final WTableColumn column) { columns.add(column); WDataTableRowRenderer renderer = (WDataTableRowRenderer) repeater.getRepeatedComponent(); renderer.addColumn(column, columns.getChildCount() - 1); }
[ "public", "void", "addColumn", "(", "final", "WTableColumn", "column", ")", "{", "columns", ".", "add", "(", "column", ")", ";", "WDataTableRowRenderer", "renderer", "=", "(", "WDataTableRowRenderer", ")", "repeater", ".", "getRepeatedComponent", "(", ")", ";", ...
Adds a column to the table. @param column the column to add.
[ "Adds", "a", "column", "to", "the", "table", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L249-L253
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.setDataModel
public void setDataModel(final TableDataModel dataModel) { getOrCreateComponentModel().dataModel = dataModel; getOrCreateComponentModel().rowIndexMapping = null; if (dataModel instanceof BeanTableDataModel) { ((BeanTableDataModel) dataModel).setBeanProvider(new DataTableBeanProvider(this)); ((BeanTableData...
java
public void setDataModel(final TableDataModel dataModel) { getOrCreateComponentModel().dataModel = dataModel; getOrCreateComponentModel().rowIndexMapping = null; if (dataModel instanceof BeanTableDataModel) { ((BeanTableDataModel) dataModel).setBeanProvider(new DataTableBeanProvider(this)); ((BeanTableData...
[ "public", "void", "setDataModel", "(", "final", "TableDataModel", "dataModel", ")", "{", "getOrCreateComponentModel", "(", ")", ".", "dataModel", "=", "dataModel", ";", "getOrCreateComponentModel", "(", ")", ".", "rowIndexMapping", "=", "null", ";", "if", "(", "...
Sets the data model. @param dataModel The dataModel to set.
[ "Sets", "the", "data", "model", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L320-L337
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.setPaginationMode
public void setPaginationMode(final PaginationMode paginationMode) { getOrCreateComponentModel().paginationMode = PaginationMode.SERVER.equals(paginationMode) ? PaginationMode.DYNAMIC : paginationMode; }
java
public void setPaginationMode(final PaginationMode paginationMode) { getOrCreateComponentModel().paginationMode = PaginationMode.SERVER.equals(paginationMode) ? PaginationMode.DYNAMIC : paginationMode; }
[ "public", "void", "setPaginationMode", "(", "final", "PaginationMode", "paginationMode", ")", "{", "getOrCreateComponentModel", "(", ")", ".", "paginationMode", "=", "PaginationMode", ".", "SERVER", ".", "equals", "(", "paginationMode", ")", "?", "PaginationMode", "...
Sets the pagination mode. Mode.SERVER mapped to Mode.DYNAMIC to overcome accessibility problem. @param paginationMode The paginationMode to set.
[ "Sets", "the", "pagination", "mode", ".", "Mode", ".", "SERVER", "mapped", "to", "Mode", ".", "DYNAMIC", "to", "overcome", "accessibility", "problem", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L642-L645
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.setExpandMode
public void setExpandMode(final ExpandMode expandMode) { getOrCreateComponentModel().expandMode = ExpandMode.SERVER.equals(expandMode) ? ExpandMode.DYNAMIC : expandMode; }
java
public void setExpandMode(final ExpandMode expandMode) { getOrCreateComponentModel().expandMode = ExpandMode.SERVER.equals(expandMode) ? ExpandMode.DYNAMIC : expandMode; }
[ "public", "void", "setExpandMode", "(", "final", "ExpandMode", "expandMode", ")", "{", "getOrCreateComponentModel", "(", ")", ".", "expandMode", "=", "ExpandMode", ".", "SERVER", ".", "equals", "(", "expandMode", ")", "?", "ExpandMode", ".", "DYNAMIC", ":", "e...
Sets the row expansion mode. ExpandMode.SERVER mapped to ExpandMode.DYNAMIC to overcome accessibility problems. @param expandMode The expand mode to set.
[ "Sets", "the", "row", "expansion", "mode", ".", "ExpandMode", ".", "SERVER", "mapped", "to", "ExpandMode", ".", "DYNAMIC", "to", "overcome", "accessibility", "problems", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L760-L763
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.handleRequest
@Override public void handleRequest(final Request request) { super.handleRequest(request); if (isPresent(request)) { if (getExpandMode() != ExpandMode.NONE) { handleExpansionRequest(request); } if (getSelectMode() != SelectMode.NONE) { handleSelectionRequest(request); } if (getPaginationM...
java
@Override public void handleRequest(final Request request) { super.handleRequest(request); if (isPresent(request)) { if (getExpandMode() != ExpandMode.NONE) { handleExpansionRequest(request); } if (getSelectMode() != SelectMode.NONE) { handleSelectionRequest(request); } if (getPaginationM...
[ "@", "Override", "public", "void", "handleRequest", "(", "final", "Request", "request", ")", "{", "super", ".", "handleRequest", "(", "request", ")", ";", "if", "(", "isPresent", "(", "request", ")", ")", "{", "if", "(", "getExpandMode", "(", ")", "!=", ...
Override handleRequest to add table-specific functionality such as pagination and row selection. @param request the request being responded to.
[ "Override", "handleRequest", "to", "add", "table", "-", "specific", "functionality", "such", "as", "pagination", "and", "row", "selection", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L972-L997
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.handleFilterRequest
private void handleFilterRequest(final Request request) { String[] paramValues = request.getParameterValues(getId() + ".filters"); if (paramValues == null) { setActiveFilters(new ArrayList<String>(0)); } else { List<String> filters = Arrays.asList(paramValues); setActiveFilters(filters); } }
java
private void handleFilterRequest(final Request request) { String[] paramValues = request.getParameterValues(getId() + ".filters"); if (paramValues == null) { setActiveFilters(new ArrayList<String>(0)); } else { List<String> filters = Arrays.asList(paramValues); setActiveFilters(filters); } }
[ "private", "void", "handleFilterRequest", "(", "final", "Request", "request", ")", "{", "String", "[", "]", "paramValues", "=", "request", ".", "getParameterValues", "(", "getId", "(", ")", "+", "\".filters\"", ")", ";", "if", "(", "paramValues", "==", "null...
Handles a request containing filtering data. @param request the request containing filtering data.
[ "Handles", "a", "request", "containing", "filtering", "data", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L1065-L1074
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.getCurrentPageStartRow
private int getCurrentPageStartRow() { int startRow = 0; if (getPaginationMode() != PaginationMode.NONE) { int rowsPerPage = getRowsPerPage(); TableDataModel model = getDataModel(); if (model instanceof TreeTableDataModel) { // For tree tables, pagination only occurs on first-level nodes (ie. those ...
java
private int getCurrentPageStartRow() { int startRow = 0; if (getPaginationMode() != PaginationMode.NONE) { int rowsPerPage = getRowsPerPage(); TableDataModel model = getDataModel(); if (model instanceof TreeTableDataModel) { // For tree tables, pagination only occurs on first-level nodes (ie. those ...
[ "private", "int", "getCurrentPageStartRow", "(", ")", "{", "int", "startRow", "=", "0", ";", "if", "(", "getPaginationMode", "(", ")", "!=", "PaginationMode", ".", "NONE", ")", "{", "int", "rowsPerPage", "=", "getRowsPerPage", "(", ")", ";", "TableDataModel"...
Retrieves the starting row index for the current page. Will always return zero for tables which are not paginated. @return the starting row index for the current page.
[ "Retrieves", "the", "starting", "row", "index", "for", "the", "current", "page", ".", "Will", "always", "return", "zero", "for", "tables", "which", "are", "not", "paginated", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L1141-L1163
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java
WDataTable.getCurrentPageEndRow
private int getCurrentPageEndRow() { TableDataModel model = getDataModel(); int rowsPerPage = getRowsPerPage(); int endRow = model.getRowCount() - 1; if (getPaginationMode() != PaginationMode.NONE) { if (model instanceof TreeTableDataModel) { // For tree tables, pagination only occurs on first-level nod...
java
private int getCurrentPageEndRow() { TableDataModel model = getDataModel(); int rowsPerPage = getRowsPerPage(); int endRow = model.getRowCount() - 1; if (getPaginationMode() != PaginationMode.NONE) { if (model instanceof TreeTableDataModel) { // For tree tables, pagination only occurs on first-level nod...
[ "private", "int", "getCurrentPageEndRow", "(", ")", "{", "TableDataModel", "model", "=", "getDataModel", "(", ")", ";", "int", "rowsPerPage", "=", "getRowsPerPage", "(", ")", ";", "int", "endRow", "=", "model", ".", "getRowCount", "(", ")", "-", "1", ";", ...
Retrieves the ending row index for the current page. Will always return the row count minus 1 for tables which are not paginated. @return the starting row index for the current page.
[ "Retrieves", "the", "ending", "row", "index", "for", "the", "current", "page", ".", "Will", "always", "return", "the", "row", "count", "minus", "1", "for", "tables", "which", "are", "not", "paginated", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDataTable.java#L1171-L1195
train