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/registry/UIRegistryAmicableImpl.java
UIRegistryAmicableImpl.loadUI
private static WComponent loadUI(final String key) { String classname = key.trim(); try { Class<?> clas = Class.forName(classname); if (WComponent.class.isAssignableFrom(clas)) { WComponent instance = (WComponent) clas.newInstance(); LOG.debug("WComponent successfully loaded with class name \"" + cl...
java
private static WComponent loadUI(final String key) { String classname = key.trim(); try { Class<?> clas = Class.forName(classname); if (WComponent.class.isAssignableFrom(clas)) { WComponent instance = (WComponent) clas.newInstance(); LOG.debug("WComponent successfully loaded with class name \"" + cl...
[ "private", "static", "WComponent", "loadUI", "(", "final", "String", "key", ")", "{", "String", "classname", "=", "key", ".", "trim", "(", ")", ";", "try", "{", "Class", "<", "?", ">", "clas", "=", "Class", ".", "forName", "(", "classname", ")", ";",...
Attempts to load a UI using the key as a class name. @param key The registration key. @return A WComponent if one could be loaded from the classpath, else an ErrorPage WComponent containing the problem.
[ "Attempts", "to", "load", "a", "UI", "using", "the", "key", "as", "a", "class", "name", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/registry/UIRegistryAmicableImpl.java#L107-L133
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WListExample.java
WListExample.addList
private void addList(final WList.Type type, final WList.Separator separator, final boolean renderBorder, final WComponent renderer) { WList list = new WList(type); if (separator != null) { list.setSeparator(separator); } list.setRenderBorder(renderBorder); list.setRepeatedComponent(renderer); add(li...
java
private void addList(final WList.Type type, final WList.Separator separator, final boolean renderBorder, final WComponent renderer) { WList list = new WList(type); if (separator != null) { list.setSeparator(separator); } list.setRenderBorder(renderBorder); list.setRepeatedComponent(renderer); add(li...
[ "private", "void", "addList", "(", "final", "WList", ".", "Type", "type", ",", "final", "WList", ".", "Separator", "separator", ",", "final", "boolean", "renderBorder", ",", "final", "WComponent", "renderer", ")", "{", "WList", "list", "=", "new", "WList", ...
Adds a list to the example. @param type the list type. @param separator the list item separator. @param renderBorder true to render a border around the list, false otherwise. @param renderer the component to use to render items in the list.
[ "Adds", "a", "list", "to", "the", "example", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WListExample.java#L60-L73
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuRenderer.java
WMenuRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMenu menu = (WMenu) component; XmlStringBuilder xml = renderContext.getWriter(); int rows = menu.getRows(); xml.appendTagOpen("ui:menu"); xml.appendAttribute("id", component.getId()); xml.appendOptionalA...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMenu menu = (WMenu) component; XmlStringBuilder xml = renderContext.getWriter(); int rows = menu.getRows(); xml.appendTagOpen("ui:menu"); xml.appendAttribute("id", component.getId()); xml.appendOptionalA...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WMenu", "menu", "=", "(", "WMenu", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderContext", "....
Paints the given WMenu. @param component the WMenu to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WMenu", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuRenderer.java#L22-L82
train
podio/podio-java
src/main/java/com/podio/search/SearchAPI.java
SearchAPI.searchInApp
public SearchInAppResponse searchInApp(int appId, String query, Boolean counts, Boolean highlights, Integer limit, Integer offset, ReferenceTypeSearchInApp refType, String searchFields) { WebResource resource = getResourceFactory().getApiResource("/search/app/" + appId +...
java
public SearchInAppResponse searchInApp(int appId, String query, Boolean counts, Boolean highlights, Integer limit, Integer offset, ReferenceTypeSearchInApp refType, String searchFields) { WebResource resource = getResourceFactory().getApiResource("/search/app/" + appId +...
[ "public", "SearchInAppResponse", "searchInApp", "(", "int", "appId", ",", "String", "query", ",", "Boolean", "counts", ",", "Boolean", "highlights", ",", "Integer", "limit", ",", "Integer", "offset", ",", "ReferenceTypeSearchInApp", "refType", ",", "String", "sear...
Searches in all items, files, and tasks in the application. The objects will be returned sorted descending by the time the object had any update. @param appId The id of the app to be searched in @param query The text to search for @param limit The number of results to return; up to 20 results are returned in one call....
[ "Searches", "in", "all", "items", "files", "and", "tasks", "in", "the", "application", ".", "The", "objects", "will", "be", "returned", "sorted", "descending", "by", "the", "time", "the", "object", "had", "any", "update", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/search/SearchAPI.java#L38-L62
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectRenderer.java
WMultiSelectRenderer.renderOption
private void renderOption(final WMultiSelect listBox, final Object option, final int optionIndex, final XmlStringBuilder html, final List<?> selections, final boolean renderSelectionsOnly) { boolean selected = selections.contains(option); if (selected || !renderSelectionsOnly) { // Get Code and Desc St...
java
private void renderOption(final WMultiSelect listBox, final Object option, final int optionIndex, final XmlStringBuilder html, final List<?> selections, final boolean renderSelectionsOnly) { boolean selected = selections.contains(option); if (selected || !renderSelectionsOnly) { // Get Code and Desc St...
[ "private", "void", "renderOption", "(", "final", "WMultiSelect", "listBox", ",", "final", "Object", "option", ",", "final", "int", "optionIndex", ",", "final", "XmlStringBuilder", "html", ",", "final", "List", "<", "?", ">", "selections", ",", "final", "boolea...
Renders a single option within the list box. @param listBox the list box being rendered. @param option the option to render. @param optionIndex the index of the option. OptionGroups are not counted. @param html the XmlStringBuilder to paint to. @param selections the list of selected options. @param renderSelectionsOnl...
[ "Renders", "a", "single", "option", "within", "the", "list", "box", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMultiSelectRenderer.java#L96-L113
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DebugStructureInterceptor.java
DebugStructureInterceptor.paint
@Override public void paint(final RenderContext renderContext) { super.paint(renderContext); if (!DebugUtil.isDebugFeaturesEnabled() || !(renderContext instanceof WebXmlRenderContext)) { return; } XmlStringBuilder xml = ((WebXmlRenderContext) renderContext).getWriter(); xml.appendTag("ui:debug"); wri...
java
@Override public void paint(final RenderContext renderContext) { super.paint(renderContext); if (!DebugUtil.isDebugFeaturesEnabled() || !(renderContext instanceof WebXmlRenderContext)) { return; } XmlStringBuilder xml = ((WebXmlRenderContext) renderContext).getWriter(); xml.appendTag("ui:debug"); wri...
[ "@", "Override", "public", "void", "paint", "(", "final", "RenderContext", "renderContext", ")", "{", "super", ".", "paint", "(", "renderContext", ")", ";", "if", "(", "!", "DebugUtil", ".", "isDebugFeaturesEnabled", "(", ")", "||", "!", "(", "renderContext"...
Override paint to render additional information for debugging purposes. @param renderContext the renderContext to send the output to.
[ "Override", "paint", "to", "render", "additional", "information", "for", "debugging", "purposes", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DebugStructureInterceptor.java#L30-L43
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DebugStructureInterceptor.java
DebugStructureInterceptor.writeDebugInfo
protected void writeDebugInfo(final WComponent component, final XmlStringBuilder xml) { if (component != null && (component.isVisible() || component instanceof WInvisibleContainer)) { xml.appendTagOpen("ui:debugInfo"); xml.appendAttribute("for", component.getId()); xml.appendAttribute("class", component.getC...
java
protected void writeDebugInfo(final WComponent component, final XmlStringBuilder xml) { if (component != null && (component.isVisible() || component instanceof WInvisibleContainer)) { xml.appendTagOpen("ui:debugInfo"); xml.appendAttribute("for", component.getId()); xml.appendAttribute("class", component.getC...
[ "protected", "void", "writeDebugInfo", "(", "final", "WComponent", "component", ",", "final", "XmlStringBuilder", "xml", ")", "{", "if", "(", "component", "!=", "null", "&&", "(", "component", ".", "isVisible", "(", ")", "||", "component", "instanceof", "WInvi...
Writes debugging information for the given component. @param component the component to write debugging information for. @param xml the writer to send the debug output to.
[ "Writes", "debugging", "information", "for", "the", "given", "component", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DebugStructureInterceptor.java#L51-L91
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DebugStructureInterceptor.java
DebugStructureInterceptor.getType
private String getType(final WComponent component) { for (Class<?> clazz = component.getClass(); clazz != null && WComponent.class. isAssignableFrom(clazz); clazz = clazz.getSuperclass()) { if ("com.github.bordertech.wcomponents".equals(clazz.getPackage().getName())) { return clazz.getName(); } } r...
java
private String getType(final WComponent component) { for (Class<?> clazz = component.getClass(); clazz != null && WComponent.class. isAssignableFrom(clazz); clazz = clazz.getSuperclass()) { if ("com.github.bordertech.wcomponents".equals(clazz.getPackage().getName())) { return clazz.getName(); } } r...
[ "private", "String", "getType", "(", "final", "WComponent", "component", ")", "{", "for", "(", "Class", "<", "?", ">", "clazz", "=", "component", ".", "getClass", "(", ")", ";", "clazz", "!=", "null", "&&", "WComponent", ".", "class", ".", "isAssignableF...
Tries to return the type of component. @param component the component to determine the type of. @return the component type, or null if the given component is not a core component.
[ "Tries", "to", "return", "the", "type", "of", "component", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DebugStructureInterceptor.java#L99-L108
train
BorderTech/wcomponents
wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/LdeSessionUtil.java
LdeSessionUtil.deserializeSessionAttributes
public static void deserializeSessionAttributes(final HttpSession session) { File file = new File(SERIALIZE_SESSION_NAME); FileInputStream fis = null; ObjectInputStream ois = null; if (file.canRead()) { try { fis = new FileInputStream(file); ois = new ObjectInputStream(fis); List data = (List) ...
java
public static void deserializeSessionAttributes(final HttpSession session) { File file = new File(SERIALIZE_SESSION_NAME); FileInputStream fis = null; ObjectInputStream ois = null; if (file.canRead()) { try { fis = new FileInputStream(file); ois = new ObjectInputStream(fis); List data = (List) ...
[ "public", "static", "void", "deserializeSessionAttributes", "(", "final", "HttpSession", "session", ")", "{", "File", "file", "=", "new", "File", "(", "SERIALIZE_SESSION_NAME", ")", ";", "FileInputStream", "fis", "=", "null", ";", "ObjectInputStream", "ois", "=", ...
Attempts to deserialize the persisted session attributes into the given session. @param session the session to restore the attributes to.
[ "Attempts", "to", "deserialize", "the", "persisted", "session", "attributes", "into", "the", "given", "session", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/LdeSessionUtil.java#L48-L77
train
BorderTech/wcomponents
wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/LdeSessionUtil.java
LdeSessionUtil.serializeSessionAttributes
public static synchronized void serializeSessionAttributes(final HttpSession session) { if (session != null) { File file = new File(SERIALIZE_SESSION_NAME); if (!file.exists() || file.canWrite()) { // Retrieve the session attributes List data = new ArrayList(); for (Enumeration keyEnum = session.g...
java
public static synchronized void serializeSessionAttributes(final HttpSession session) { if (session != null) { File file = new File(SERIALIZE_SESSION_NAME); if (!file.exists() || file.canWrite()) { // Retrieve the session attributes List data = new ArrayList(); for (Enumeration keyEnum = session.g...
[ "public", "static", "synchronized", "void", "serializeSessionAttributes", "(", "final", "HttpSession", "session", ")", "{", "if", "(", "session", "!=", "null", ")", "{", "File", "file", "=", "new", "File", "(", "SERIALIZE_SESSION_NAME", ")", ";", "if", "(", ...
Serializes the session attributes of the given session. @param session the session to persist.
[ "Serializes", "the", "session", "attributes", "of", "the", "given", "session", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/LdeSessionUtil.java#L84-L129
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java
StepCountUtil.incrementSessionStep
public static void incrementSessionStep(final UIContext uic) { int step = uic.getEnvironment().getStep(); uic.getEnvironment().setStep(step + 1); }
java
public static void incrementSessionStep(final UIContext uic) { int step = uic.getEnvironment().getStep(); uic.getEnvironment().setStep(step + 1); }
[ "public", "static", "void", "incrementSessionStep", "(", "final", "UIContext", "uic", ")", "{", "int", "step", "=", "uic", ".", "getEnvironment", "(", ")", ".", "getStep", "(", ")", ";", "uic", ".", "getEnvironment", "(", ")", ".", "setStep", "(", "step"...
Increments the step that is recorded in session. @param uic the current user's session
[ "Increments", "the", "step", "that", "is", "recorded", "in", "session", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java#L48-L51
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java
StepCountUtil.getRequestStep
public static int getRequestStep(final Request request) { String val = request.getParameter(Environment.STEP_VARIABLE); if (val == null) { return 0; } try { return Integer.parseInt(val); } catch (NumberFormatException ex) { return -1; } }
java
public static int getRequestStep(final Request request) { String val = request.getParameter(Environment.STEP_VARIABLE); if (val == null) { return 0; } try { return Integer.parseInt(val); } catch (NumberFormatException ex) { return -1; } }
[ "public", "static", "int", "getRequestStep", "(", "final", "Request", "request", ")", "{", "String", "val", "=", "request", ".", "getParameter", "(", "Environment", ".", "STEP_VARIABLE", ")", ";", "if", "(", "val", "==", "null", ")", "{", "return", "0", ...
Retrieves the value of the step variable from the given request. @param request the request being responded to. @return the request step present in the request, or -1 on error.
[ "Retrieves", "the", "value", "of", "the", "step", "variable", "from", "the", "given", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java#L59-L70
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java
StepCountUtil.isStepOnRequest
public static boolean isStepOnRequest(final Request request) { String val = request.getParameter(Environment.STEP_VARIABLE); return val != null; }
java
public static boolean isStepOnRequest(final Request request) { String val = request.getParameter(Environment.STEP_VARIABLE); return val != null; }
[ "public", "static", "boolean", "isStepOnRequest", "(", "final", "Request", "request", ")", "{", "String", "val", "=", "request", ".", "getParameter", "(", "Environment", ".", "STEP_VARIABLE", ")", ";", "return", "val", "!=", "null", ";", "}" ]
Checks if the step count is on the request. @param request the request being responded to. @return true if the step count is on the request
[ "Checks", "if", "the", "step", "count", "is", "on", "the", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java#L78-L81
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java
StepCountUtil.isCachedContentRequest
public static boolean isCachedContentRequest(final Request request) { // Get target id on request String targetId = request.getParameter(Environment.TARGET_ID); if (targetId == null) { return false; } // Get target ComponentWithContext targetWithContext = WebUtilities.getComponentById(targetId, true); ...
java
public static boolean isCachedContentRequest(final Request request) { // Get target id on request String targetId = request.getParameter(Environment.TARGET_ID); if (targetId == null) { return false; } // Get target ComponentWithContext targetWithContext = WebUtilities.getComponentById(targetId, true); ...
[ "public", "static", "boolean", "isCachedContentRequest", "(", "final", "Request", "request", ")", "{", "// Get target id on request", "String", "targetId", "=", "request", ".", "getParameter", "(", "Environment", ".", "TARGET_ID", ")", ";", "if", "(", "targetId", ...
Check if the request is for cached content. @param request the request being processed @return true if content is cached, otherwise false
[ "Check", "if", "the", "request", "is", "for", "cached", "content", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/StepCountUtil.java#L89-L123
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/SubSessionHttpServletRequestWrapper.java
SubSessionHttpServletRequestWrapper.getSubSession
private synchronized HttpSubSession getSubSession() { HttpSession backingSession = super.getSession(); Map<Integer, HttpSubSession> subsessions = (Map<Integer, HttpSubSession>) backingSession .getAttribute(SESSION_MAP_KEY); HttpSubSession subsession = subsessions.get(sessionId); subsession.setLastAccessedT...
java
private synchronized HttpSubSession getSubSession() { HttpSession backingSession = super.getSession(); Map<Integer, HttpSubSession> subsessions = (Map<Integer, HttpSubSession>) backingSession .getAttribute(SESSION_MAP_KEY); HttpSubSession subsession = subsessions.get(sessionId); subsession.setLastAccessedT...
[ "private", "synchronized", "HttpSubSession", "getSubSession", "(", ")", "{", "HttpSession", "backingSession", "=", "super", ".", "getSession", "(", ")", ";", "Map", "<", "Integer", ",", "HttpSubSession", ">", "subsessions", "=", "(", "Map", "<", "Integer", ","...
Retrieves the subsession for this request. If there is no existing subsession, a new one is created. @return the subsession for this request.
[ "Retrieves", "the", "subsession", "for", "this", "request", ".", "If", "there", "is", "no", "existing", "subsession", "a", "new", "one", "is", "created", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/SubSessionHttpServletRequestWrapper.java#L99-L108
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/InputBeanBindingExample.java
InputBeanBindingExample.addSubordinate
private void addSubordinate() { // Set up subordinate (to make mandatory/optional) WComponentGroup<SubordinateTarget> inputs = new WComponentGroup<>(); add(inputs); inputs.addToGroup(checkBoxSelect); inputs.addToGroup(multiDropdown); inputs.addToGroup(multiSelect); inputs.addToGroup(multiSelectPair); in...
java
private void addSubordinate() { // Set up subordinate (to make mandatory/optional) WComponentGroup<SubordinateTarget> inputs = new WComponentGroup<>(); add(inputs); inputs.addToGroup(checkBoxSelect); inputs.addToGroup(multiDropdown); inputs.addToGroup(multiSelect); inputs.addToGroup(multiSelectPair); in...
[ "private", "void", "addSubordinate", "(", ")", "{", "// Set up subordinate (to make mandatory/optional)", "WComponentGroup", "<", "SubordinateTarget", ">", "inputs", "=", "new", "WComponentGroup", "<>", "(", ")", ";", "add", "(", "inputs", ")", ";", "inputs", ".", ...
Setup the subordinate control.
[ "Setup", "the", "subordinate", "control", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/InputBeanBindingExample.java#L356-L400
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/InputBeanBindingExample.java
InputBeanBindingExample.addButtons
private void addButtons() { // Validation Button WButton buttonValidate = new WButton("Validate and Update Bean"); add(buttonValidate); buttonValidate.setAction(new ValidatingAction(messages.getValidationErrors(), layout) { @Override public void executeOnValid(final ActionEvent event) { WebUtilities.u...
java
private void addButtons() { // Validation Button WButton buttonValidate = new WButton("Validate and Update Bean"); add(buttonValidate); buttonValidate.setAction(new ValidatingAction(messages.getValidationErrors(), layout) { @Override public void executeOnValid(final ActionEvent event) { WebUtilities.u...
[ "private", "void", "addButtons", "(", ")", "{", "// Validation Button", "WButton", "buttonValidate", "=", "new", "WButton", "(", "\"Validate and Update Bean\"", ")", ";", "add", "(", "buttonValidate", ")", ";", "buttonValidate", ".", "setAction", "(", "new", "Vali...
Setup the action buttons.
[ "Setup", "the", "action", "buttons", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/InputBeanBindingExample.java#L405-L449
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractEnvironment.java
AbstractEnvironment.getWServletPath
@Override public String getWServletPath() { final String configValue = ConfigurationProperties.getServletSupportPath(); return configValue == null ? getPostPath() : getServletPath(configValue); }
java
@Override public String getWServletPath() { final String configValue = ConfigurationProperties.getServletSupportPath(); return configValue == null ? getPostPath() : getServletPath(configValue); }
[ "@", "Override", "public", "String", "getWServletPath", "(", ")", "{", "final", "String", "configValue", "=", "ConfigurationProperties", ".", "getServletSupportPath", "(", ")", ";", "return", "configValue", "==", "null", "?", "getPostPath", "(", ")", ":", "getSe...
Construct the path to the support servlet. Web components that need to construct a URL to target this servlet will use this method. @return the path to the AJAX servlet.
[ "Construct", "the", "path", "to", "the", "support", "servlet", ".", "Web", "components", "that", "need", "to", "construct", "a", "URL", "to", "target", "this", "servlet", "will", "use", "this", "method", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractEnvironment.java#L81-L87
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractEnvironment.java
AbstractEnvironment.getServletPath
private String getServletPath(final String relativePath) { if (relativePath == null) { LOG.error("relativePath must not be null"); } String context = getHostFreeBaseUrl(); if (!Util.empty(context)) { return context + relativePath; } return relativePath; }
java
private String getServletPath(final String relativePath) { if (relativePath == null) { LOG.error("relativePath must not be null"); } String context = getHostFreeBaseUrl(); if (!Util.empty(context)) { return context + relativePath; } return relativePath; }
[ "private", "String", "getServletPath", "(", "final", "String", "relativePath", ")", "{", "if", "(", "relativePath", "==", "null", ")", "{", "LOG", ".", "error", "(", "\"relativePath must not be null\"", ")", ";", "}", "String", "context", "=", "getHostFreeBaseUr...
Constructs the path to one of the various helper servlets. This is used by the more specific getXXXPath methods. @param relativePath the relative servlet path. @return the path to the servlet corresponding to the given parameter name.
[ "Constructs", "the", "path", "to", "one", "of", "the", "various", "helper", "servlets", ".", "This", "is", "used", "by", "the", "more", "specific", "getXXXPath", "methods", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractEnvironment.java#L95-L108
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/subordinate/SubordinateControlMandatoryExample.java
SubordinateControlMandatoryExample.build
private static WComponent build() { WContainer root = new WContainer(); WSubordinateControl control = new WSubordinateControl(); root.add(control); WFieldLayout layout = new WFieldLayout(); layout.setLabelWidth(25); layout.setMargin(new com.github.bordertech.wcomponents.Margin(0, 0, 12, 0)); WCheckBox c...
java
private static WComponent build() { WContainer root = new WContainer(); WSubordinateControl control = new WSubordinateControl(); root.add(control); WFieldLayout layout = new WFieldLayout(); layout.setLabelWidth(25); layout.setMargin(new com.github.bordertech.wcomponents.Margin(0, 0, 12, 0)); WCheckBox c...
[ "private", "static", "WComponent", "build", "(", ")", "{", "WContainer", "root", "=", "new", "WContainer", "(", ")", ";", "WSubordinateControl", "control", "=", "new", "WSubordinateControl", "(", ")", ";", "root", ".", "add", "(", "control", ")", ";", "WFi...
Creates the component to be added to the validation container. This is doen in a static method because the component is passed into the superclass constructor. @return the component to be added to the validation container.
[ "Creates", "the", "component", "to", "be", "added", "to", "the", "validation", "container", ".", "This", "is", "doen", "in", "a", "static", "method", "because", "the", "component", "is", "passed", "into", "the", "superclass", "constructor", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/subordinate/SubordinateControlMandatoryExample.java#L37-L71
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/ValidateXMLInterceptor.java
ValidateXMLInterceptor.paint
@Override public void paint(final RenderContext renderContext) { // Check interceptor is enabled if (!DebugValidateXML.isEnabled()) { super.paint(renderContext); return; } if (!(renderContext instanceof WebXmlRenderContext)) { LOG.warn("Unable to validate against a " + renderContext); super.paint(...
java
@Override public void paint(final RenderContext renderContext) { // Check interceptor is enabled if (!DebugValidateXML.isEnabled()) { super.paint(renderContext); return; } if (!(renderContext instanceof WebXmlRenderContext)) { LOG.warn("Unable to validate against a " + renderContext); super.paint(...
[ "@", "Override", "public", "void", "paint", "(", "final", "RenderContext", "renderContext", ")", "{", "// Check interceptor is enabled", "if", "(", "!", "DebugValidateXML", ".", "isEnabled", "(", ")", ")", "{", "super", ".", "paint", "(", "renderContext", ")", ...
Override paint to include XML Validation. @param renderContext the renderContext to send the output to.
[ "Override", "paint", "to", "include", "XML", "Validation", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/ValidateXMLInterceptor.java#L43-L96
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/ValidateXMLInterceptor.java
ValidateXMLInterceptor.paintOriginalXML
private void paintOriginalXML(final String originalXML, final PrintWriter writer) { // Replace any CDATA Sections embedded in XML String xml = originalXML.replaceAll("<!\\[CDATA\\[", "CDATASTART"); xml = xml.replaceAll("\\]\\]>", "CDATAFINISH"); // Paint Output writer.println("<div>"); writer.println("<!--...
java
private void paintOriginalXML(final String originalXML, final PrintWriter writer) { // Replace any CDATA Sections embedded in XML String xml = originalXML.replaceAll("<!\\[CDATA\\[", "CDATASTART"); xml = xml.replaceAll("\\]\\]>", "CDATAFINISH"); // Paint Output writer.println("<div>"); writer.println("<!--...
[ "private", "void", "paintOriginalXML", "(", "final", "String", "originalXML", ",", "final", "PrintWriter", "writer", ")", "{", "// Replace any CDATA Sections embedded in XML", "String", "xml", "=", "originalXML", ".", "replaceAll", "(", "\"<!\\\\[CDATA\\\\[\"", ",", "\"...
Paint the original XML wrapped in a CDATA Section. @param originalXML the original XML @param writer the output writer
[ "Paint", "the", "original", "XML", "wrapped", "in", "a", "CDATA", "Section", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/ValidateXMLInterceptor.java#L104-L117
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.preparePaintComponent
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!this.isInitialised()) { List recent = loadRecentList(); if (recent != null && !recent.isEmpty()) { String selection = (String) recent.get(0); displaySelection(selection); } this...
java
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); if (!this.isInitialised()) { List recent = loadRecentList(); if (recent != null && !recent.isEmpty()) { String selection = (String) recent.get(0); displaySelection(selection); } this...
[ "@", "Override", "protected", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "super", ".", "preparePaintComponent", "(", "request", ")", ";", "if", "(", "!", "this", ".", "isInitialised", "(", ")", ")", "{", "List", "recent", ...
When the example picker starts up, we want to display the last selection the user made in their previous session. We can do this because the list of recent selections is stored in a file on the file system. @param request the request being responded to.
[ "When", "the", "example", "picker", "starts", "up", "we", "want", "to", "display", "the", "last", "selection", "the", "user", "made", "in", "their", "previous", "session", ".", "We", "can", "do", "this", "because", "the", "list", "of", "recent", "selection...
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L227-L243
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.updateTitle
private void updateTitle() { String title; if (this.getCurrentComponent() == null) { title = "Example Picker"; } else { title = this.getCurrentComponent().getClass().getName(); } WApplication app = WebUtilities.getAncestorOfClass(WApplication.class, this); if (app != null) { app.setTitle(title);...
java
private void updateTitle() { String title; if (this.getCurrentComponent() == null) { title = "Example Picker"; } else { title = this.getCurrentComponent().getClass().getName(); } WApplication app = WebUtilities.getAncestorOfClass(WApplication.class, this); if (app != null) { app.setTitle(title);...
[ "private", "void", "updateTitle", "(", ")", "{", "String", "title", ";", "if", "(", "this", ".", "getCurrentComponent", "(", ")", "==", "null", ")", "{", "title", "=", "\"Example Picker\"", ";", "}", "else", "{", "title", "=", "this", ".", "getCurrentCom...
Updates the title, based on the selected example.
[ "Updates", "the", "title", "based", "on", "the", "selected", "example", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L248-L262
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.afterPaint
@Override protected void afterPaint(final RenderContext renderContext) { super.afterPaint(renderContext); if (profileBtn.isPressed()) { // UIC serialization stats UicStats stats = new UicStats(UIContextHolder.getCurrent()); WComponent currentComp = this.getCurrentComponent(); if (currentComp != null...
java
@Override protected void afterPaint(final RenderContext renderContext) { super.afterPaint(renderContext); if (profileBtn.isPressed()) { // UIC serialization stats UicStats stats = new UicStats(UIContextHolder.getCurrent()); WComponent currentComp = this.getCurrentComponent(); if (currentComp != null...
[ "@", "Override", "protected", "void", "afterPaint", "(", "final", "RenderContext", "renderContext", ")", "{", "super", ".", "afterPaint", "(", "renderContext", ")", ";", "if", "(", "profileBtn", ".", "isPressed", "(", ")", ")", "{", "// UIC serialization stats",...
Override afterPaint in order to paint the UIContext serialization statistics if the profile button has been pressed. @param renderContext the renderContext to send output to.
[ "Override", "afterPaint", "in", "order", "to", "paint", "the", "UIContext", "serialization", "statistics", "if", "the", "profile", "button", "has", "been", "pressed", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L270-L306
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.loadRecentList
private List loadRecentList() { try { InputStream in = new BufferedInputStream(new FileInputStream( RECENT_FILE_NAME)); XMLDecoder d = new XMLDecoder(in); Object result = d.readObject(); d.close(); return (List) result; } catch (FileNotFoundException ex) { // This is ok, it's probably the f...
java
private List loadRecentList() { try { InputStream in = new BufferedInputStream(new FileInputStream( RECENT_FILE_NAME)); XMLDecoder d = new XMLDecoder(in); Object result = d.readObject(); d.close(); return (List) result; } catch (FileNotFoundException ex) { // This is ok, it's probably the f...
[ "private", "List", "loadRecentList", "(", ")", "{", "try", "{", "InputStream", "in", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "RECENT_FILE_NAME", ")", ")", ";", "XMLDecoder", "d", "=", "new", "XMLDecoder", "(", "in", ")", ";", ...
Retrieves the list of recently selected examples from a file on the file system. @return the list of recently used examples.
[ "Retrieves", "the", "list", "of", "recently", "selected", "examples", "from", "a", "file", "on", "the", "file", "system", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L321-L335
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.getCurrentComponent
public Container getCurrentComponent() { Container currentComponent = null; if (((Container) (container.getChildAt(0))).getChildCount() > 0) { currentComponent = (Container) container.getChildAt(0); } return currentComponent; }
java
public Container getCurrentComponent() { Container currentComponent = null; if (((Container) (container.getChildAt(0))).getChildCount() > 0) { currentComponent = (Container) container.getChildAt(0); } return currentComponent; }
[ "public", "Container", "getCurrentComponent", "(", ")", "{", "Container", "currentComponent", "=", "null", ";", "if", "(", "(", "(", "Container", ")", "(", "container", ".", "getChildAt", "(", "0", ")", ")", ")", ".", "getChildCount", "(", ")", ">", "0",...
Retrieves the component that is currently being displayed by the example picker. @return the current example.
[ "Retrieves", "the", "component", "that", "is", "currently", "being", "displayed", "by", "the", "example", "picker", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L342-L350
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.displaySelection
public void displaySelection(final String selection) { WComponent selectedComponent = UIRegistry.getInstance().getUI(selection); if (selectedComponent == null) { // Can't load selected component. WMessages.getInstance(this).error( "Unable to load example: " + selection + ", see log for details."); re...
java
public void displaySelection(final String selection) { WComponent selectedComponent = UIRegistry.getInstance().getUI(selection); if (selectedComponent == null) { // Can't load selected component. WMessages.getInstance(this).error( "Unable to load example: " + selection + ", see log for details."); re...
[ "public", "void", "displaySelection", "(", "final", "String", "selection", ")", "{", "WComponent", "selectedComponent", "=", "UIRegistry", ".", "getInstance", "(", ")", ".", "getUI", "(", "selection", ")", ";", "if", "(", "selectedComponent", "==", "null", ")"...
Get the example picker to display the given selection. @param selection the class name of the wcomponent to be loaded and displayed.
[ "Get", "the", "example", "picker", "to", "display", "the", "given", "selection", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L357-L368
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.displaySelection
public void displaySelection(final WComponent selectedComponent) { WComponent currentComponent = getCurrentComponent(); if (selectedComponent == currentComponent) { // We are already displaying this component, so nothing to do. return; } // We have a new selection so display it. container.removeAll();...
java
public void displaySelection(final WComponent selectedComponent) { WComponent currentComponent = getCurrentComponent(); if (selectedComponent == currentComponent) { // We are already displaying this component, so nothing to do. return; } // We have a new selection so display it. container.removeAll();...
[ "public", "void", "displaySelection", "(", "final", "WComponent", "selectedComponent", ")", "{", "WComponent", "currentComponent", "=", "getCurrentComponent", "(", ")", ";", "if", "(", "selectedComponent", "==", "currentComponent", ")", "{", "// We are already displayin...
Get the example picker to display the given selected component. @param selectedComponent the wcomponent to be displayed.
[ "Get", "the", "example", "picker", "to", "display", "the", "given", "selected", "component", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L375-L386
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java
SimplePicker.storeRecentList
private void storeRecentList(final List recent) { try { if (recent == null) { return; } // Only keep the last 8 entries. while (recent.size() > 8) { recent.remove(recent.size() - 1); } OutputStream out = new BufferedOutputStream(new FileOutputStream( RECENT_FILE_NAME)); XMLEncoder ...
java
private void storeRecentList(final List recent) { try { if (recent == null) { return; } // Only keep the last 8 entries. while (recent.size() > 8) { recent.remove(recent.size() - 1); } OutputStream out = new BufferedOutputStream(new FileOutputStream( RECENT_FILE_NAME)); XMLEncoder ...
[ "private", "void", "storeRecentList", "(", "final", "List", "recent", ")", "{", "try", "{", "if", "(", "recent", "==", "null", ")", "{", "return", ";", "}", "// Only keep the last 8 entries.", "while", "(", "recent", ".", "size", "(", ")", ">", "8", ")",...
Store the list of recent selections to a file on the file system. @param recent the recent selections
[ "Store", "the", "list", "of", "recent", "selections", "to", "a", "file", "on", "the", "file", "system", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SimplePicker.java#L393-L412
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.setCurrentOperationDetails
public static void setCurrentOperationDetails(final AjaxOperation operation, final ComponentWithContext trigger) { if (operation == null) { THREAD_LOCAL_OPERATION.remove(); } else { THREAD_LOCAL_OPERATION.set(operation); } if (trigger == null) { THREAD_LOCAL_COMPONENT_WITH_CONTEXT.remove(); } else {...
java
public static void setCurrentOperationDetails(final AjaxOperation operation, final ComponentWithContext trigger) { if (operation == null) { THREAD_LOCAL_OPERATION.remove(); } else { THREAD_LOCAL_OPERATION.set(operation); } if (trigger == null) { THREAD_LOCAL_COMPONENT_WITH_CONTEXT.remove(); } else {...
[ "public", "static", "void", "setCurrentOperationDetails", "(", "final", "AjaxOperation", "operation", ",", "final", "ComponentWithContext", "trigger", ")", "{", "if", "(", "operation", "==", "null", ")", "{", "THREAD_LOCAL_OPERATION", ".", "remove", "(", ")", ";",...
Sets the current AJAX operation details. @param operation the current AJAX operation. @param trigger the current AJAX operation trigger and its context.
[ "Sets", "the", "current", "AJAX", "operation", "details", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L57-L69
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.registerComponents
public static AjaxOperation registerComponents(final List<String> targetIds, final String triggerId) { AjaxOperation operation = new AjaxOperation(triggerId, targetIds); registerAjaxOperation(operation); return operation; }
java
public static AjaxOperation registerComponents(final List<String> targetIds, final String triggerId) { AjaxOperation operation = new AjaxOperation(triggerId, targetIds); registerAjaxOperation(operation); return operation; }
[ "public", "static", "AjaxOperation", "registerComponents", "(", "final", "List", "<", "String", ">", "targetIds", ",", "final", "String", "triggerId", ")", "{", "AjaxOperation", "operation", "=", "new", "AjaxOperation", "(", "triggerId", ",", "targetIds", ")", "...
Registers one or more components as being AJAX capable. @param targetIds the components to register. Each component will be re-painted when the trigger occurs. @param triggerId the id of the trigger that will cause the components to be painted. @return the AjaxOperation control configuration object.
[ "Registers", "one", "or", "more", "components", "as", "being", "AJAX", "capable", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L100-L104
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.registerComponent
public static AjaxOperation registerComponent(final String targetId, final String triggerId) { AjaxOperation operation = new AjaxOperation(triggerId, targetId); registerAjaxOperation(operation); return operation; }
java
public static AjaxOperation registerComponent(final String targetId, final String triggerId) { AjaxOperation operation = new AjaxOperation(triggerId, targetId); registerAjaxOperation(operation); return operation; }
[ "public", "static", "AjaxOperation", "registerComponent", "(", "final", "String", "targetId", ",", "final", "String", "triggerId", ")", "{", "AjaxOperation", "operation", "=", "new", "AjaxOperation", "(", "triggerId", ",", "targetId", ")", ";", "registerAjaxOperatio...
Registers a single component as being AJAX capable. @param targetId the component to register. The component will be re-painted when the trigger occurs. @param triggerId the id of the trigger that will cause the component to be painted. @return the AjaxOperation control configuration object.
[ "Registers", "a", "single", "component", "as", "being", "AJAX", "capable", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L113-L117
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.getAjaxOperation
public static AjaxOperation getAjaxOperation(final String triggerId) { Map<String, AjaxOperation> operations = getRegisteredOperations(); return operations == null ? null : operations.get(triggerId); }
java
public static AjaxOperation getAjaxOperation(final String triggerId) { Map<String, AjaxOperation> operations = getRegisteredOperations(); return operations == null ? null : operations.get(triggerId); }
[ "public", "static", "AjaxOperation", "getAjaxOperation", "(", "final", "String", "triggerId", ")", "{", "Map", "<", "String", ",", "AjaxOperation", ">", "operations", "=", "getRegisteredOperations", "(", ")", ";", "return", "operations", "==", "null", "?", "null...
Retrieves the AjaxOperation that has been registered for the given trigger. This method will return null if there is no corresponding operation registered. @param triggerId the trigger id. @return the AjaxOperation corresponding to the trigger id.
[ "Retrieves", "the", "AjaxOperation", "that", "has", "been", "registered", "for", "the", "given", "trigger", ".", "This", "method", "will", "return", "null", "if", "there", "is", "no", "corresponding", "operation", "registered", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L162-L165
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.clearAllRegisteredOperations
public static void clearAllRegisteredOperations() { UIContext uic = UIContextHolder.getCurrentPrimaryUIContext(); if (uic != null) { uic.setFwkAttribute(AJAX_OPERATIONS_SESSION_KEY, null); } }
java
public static void clearAllRegisteredOperations() { UIContext uic = UIContextHolder.getCurrentPrimaryUIContext(); if (uic != null) { uic.setFwkAttribute(AJAX_OPERATIONS_SESSION_KEY, null); } }
[ "public", "static", "void", "clearAllRegisteredOperations", "(", ")", "{", "UIContext", "uic", "=", "UIContextHolder", ".", "getCurrentPrimaryUIContext", "(", ")", ";", "if", "(", "uic", "!=", "null", ")", "{", "uic", ".", "setFwkAttribute", "(", "AJAX_OPERATION...
Clear the registered AJAX operations for this user context.
[ "Clear", "the", "registered", "AJAX", "operations", "for", "this", "user", "context", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L170-L175
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.registerAjaxOperation
private static void registerAjaxOperation(final AjaxOperation operation) { UIContext uic = UIContextHolder.getCurrentPrimaryUIContext(); if (uic == null) { throw new SystemException("No User Context Available to Register AJAX Operations."); } Map<String, AjaxOperation> operations = (Map<String, AjaxOperation...
java
private static void registerAjaxOperation(final AjaxOperation operation) { UIContext uic = UIContextHolder.getCurrentPrimaryUIContext(); if (uic == null) { throw new SystemException("No User Context Available to Register AJAX Operations."); } Map<String, AjaxOperation> operations = (Map<String, AjaxOperation...
[ "private", "static", "void", "registerAjaxOperation", "(", "final", "AjaxOperation", "operation", ")", "{", "UIContext", "uic", "=", "UIContextHolder", ".", "getCurrentPrimaryUIContext", "(", ")", ";", "if", "(", "uic", "==", "null", ")", "{", "throw", "new", ...
The Ajax servlet needs access to the AjaxOperation Store the operation in the user context using the trigger Id, as this will be present in the Servlet HttpRequest. agreed key. The ajax id is passed in the url to the servlet so it can then access the context. @param operation the operation to register.
[ "The", "Ajax", "servlet", "needs", "access", "to", "the", "AjaxOperation", "Store", "the", "operation", "in", "the", "user", "context", "using", "the", "trigger", "Id", "as", "this", "will", "be", "present", "in", "the", "Servlet", "HttpRequest", ".", "agree...
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L193-L204
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WCheckBoxSelectRenderer.java
WCheckBoxSelectRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WCheckBoxSelect select = (WCheckBoxSelect) component; XmlStringBuilder xml = renderContext.getWriter(); int cols = select.getButtonColumns(); boolean readOnly = select.isReadOnly(); xml.appendTagOpen("ui:ch...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WCheckBoxSelect select = (WCheckBoxSelect) component; XmlStringBuilder xml = renderContext.getWriter(); int cols = select.getButtonColumns(); boolean readOnly = select.isReadOnly(); xml.appendTagOpen("ui:ch...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WCheckBoxSelect", "select", "=", "(", "WCheckBoxSelect", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WCheckBoxSelect. @param component the WCheckBoxSelect to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WCheckBoxSelect", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WCheckBoxSelectRenderer.java#L26-L92
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/SubordinateBuilder.java
SubordinateBuilder.build
public WSubordinateControl build() { if (!condition().validate()) { throw new SystemException("Invalid condition: " + condition); } if (getActionsWhenTrue().isEmpty() && getActionsWhenFalse().isEmpty()) { throw new SystemException("No actions to execute"); } WSubordinateControl subordinate = new WSubo...
java
public WSubordinateControl build() { if (!condition().validate()) { throw new SystemException("Invalid condition: " + condition); } if (getActionsWhenTrue().isEmpty() && getActionsWhenFalse().isEmpty()) { throw new SystemException("No actions to execute"); } WSubordinateControl subordinate = new WSubo...
[ "public", "WSubordinateControl", "build", "(", ")", "{", "if", "(", "!", "condition", "(", ")", ".", "validate", "(", ")", ")", "{", "throw", "new", "SystemException", "(", "\"Invalid condition: \"", "+", "condition", ")", ";", "}", "if", "(", "getActionsW...
This builds the SubordinateControl. This method will throw a SystemException if the condition is invalid, or there are no actions specified. @return a SubordinateControl built using this builder.
[ "This", "builds", "the", "SubordinateControl", ".", "This", "method", "will", "throw", "a", "SystemException", "if", "the", "condition", "is", "invalid", "or", "there", "are", "no", "actions", "specified", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/SubordinateBuilder.java#L138-L163
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java
PageShellInterceptor.preparePaint
@Override public void preparePaint(final Request request) { Headers headers = this.getUI().getHeaders(); headers.reset(); headers.setContentType(WebUtilities.CONTENT_TYPE_XML); super.preparePaint(request); }
java
@Override public void preparePaint(final Request request) { Headers headers = this.getUI().getHeaders(); headers.reset(); headers.setContentType(WebUtilities.CONTENT_TYPE_XML); super.preparePaint(request); }
[ "@", "Override", "public", "void", "preparePaint", "(", "final", "Request", "request", ")", "{", "Headers", "headers", "=", "this", ".", "getUI", "(", ")", ".", "getHeaders", "(", ")", ";", "headers", ".", "reset", "(", ")", ";", "headers", ".", "setCo...
Override preparePaint in order to prepare the headers. @param request the request being responded to.
[ "Override", "preparePaint", "in", "order", "to", "prepare", "the", "headers", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java#L25-L33
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java
PageShellInterceptor.paint
@Override public void paint(final RenderContext renderContext) { WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext; PrintWriter writer = webRenderContext.getWriter(); beforePaint(writer); getBackingComponent().paint(renderContext); afterPaint(writer); }
java
@Override public void paint(final RenderContext renderContext) { WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext; PrintWriter writer = webRenderContext.getWriter(); beforePaint(writer); getBackingComponent().paint(renderContext); afterPaint(writer); }
[ "@", "Override", "public", "void", "paint", "(", "final", "RenderContext", "renderContext", ")", "{", "WebXmlRenderContext", "webRenderContext", "=", "(", "WebXmlRenderContext", ")", "renderContext", ";", "PrintWriter", "writer", "=", "webRenderContext", ".", "getWrit...
Produce the html output. @param renderContext the renderContext to send the output to.
[ "Produce", "the", "html", "output", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java#L40-L48
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java
PageShellInterceptor.beforePaint
protected void beforePaint(final PrintWriter writer) { PageShell pageShell = Factory.newInstance(PageShell.class); pageShell.openDoc(writer); pageShell.writeHeader(writer); }
java
protected void beforePaint(final PrintWriter writer) { PageShell pageShell = Factory.newInstance(PageShell.class); pageShell.openDoc(writer); pageShell.writeHeader(writer); }
[ "protected", "void", "beforePaint", "(", "final", "PrintWriter", "writer", ")", "{", "PageShell", "pageShell", "=", "Factory", ".", "newInstance", "(", "PageShell", ".", "class", ")", ";", "pageShell", ".", "openDoc", "(", "writer", ")", ";", "pageShell", "....
Renders the content before the backing component. @param writer the writer to write to.
[ "Renders", "the", "content", "before", "the", "backing", "component", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java#L55-L60
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java
PageShellInterceptor.afterPaint
protected void afterPaint(final PrintWriter writer) { PageShell pageShell = Factory.newInstance(PageShell.class); pageShell.writeFooter(writer); pageShell.closeDoc(writer); }
java
protected void afterPaint(final PrintWriter writer) { PageShell pageShell = Factory.newInstance(PageShell.class); pageShell.writeFooter(writer); pageShell.closeDoc(writer); }
[ "protected", "void", "afterPaint", "(", "final", "PrintWriter", "writer", ")", "{", "PageShell", "pageShell", "=", "Factory", ".", "newInstance", "(", "PageShell", ".", "class", ")", ";", "pageShell", ".", "writeFooter", "(", "writer", ")", ";", "pageShell", ...
Renders the content after the backing component. @param writer the writer to write to.
[ "Renders", "the", "content", "after", "the", "backing", "component", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageShellInterceptor.java#L67-L72
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java
WButton.handleRequest
@Override public void handleRequest(final Request request) { // Clear pressed clearPressed(); String requestValue = request.getParameter(getId()); boolean pressed = "x".equals(requestValue); // Only process on a POST if (pressed && !"POST".equals(request.getMethod())) { LOG.warn("Button pressed on a r...
java
@Override public void handleRequest(final Request request) { // Clear pressed clearPressed(); String requestValue = request.getParameter(getId()); boolean pressed = "x".equals(requestValue); // Only process on a POST if (pressed && !"POST".equals(request.getMethod())) { LOG.warn("Button pressed on a r...
[ "@", "Override", "public", "void", "handleRequest", "(", "final", "Request", "request", ")", "{", "// Clear pressed", "clearPressed", "(", ")", ";", "String", "requestValue", "=", "request", ".", "getParameter", "(", "getId", "(", ")", ")", ";", "boolean", "...
Override handleRequest in order to perform processing for this component. This implementation checks whether the button has been pressed in the request. @param request the request being responded to.
[ "Override", "handleRequest", "in", "order", "to", "perform", "processing", "for", "this", "component", ".", "This", "implementation", "checks", "whether", "the", "button", "has", "been", "pressed", "in", "the", "request", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java#L134-L149
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java
WButton.preparePaintComponent
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); UIContext uic = UIContextHolder.getCurrent(); if (isAjax() && uic.getUI() != null) { AjaxTarget target = getAjaxTarget(); AjaxHelper.registerComponent(target.getId(), getId()); } }
java
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); UIContext uic = UIContextHolder.getCurrent(); if (isAjax() && uic.getUI() != null) { AjaxTarget target = getAjaxTarget(); AjaxHelper.registerComponent(target.getId(), getId()); } }
[ "@", "Override", "protected", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "super", ".", "preparePaintComponent", "(", "request", ")", ";", "UIContext", "uic", "=", "UIContextHolder", ".", "getCurrent", "(", ")", ";", "if", "(...
Override preparePaintComponent to register an AJAX operation if this button is AJAX enabled. @param request the request being responded to
[ "Override", "preparePaintComponent", "to", "register", "an", "AJAX", "operation", "if", "this", "button", "is", "AJAX", "enabled", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java#L156-L166
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java
WButton.getValue
public String getValue() { Object value = getData(); if (value != null) { return value.toString(); } String text = getText(); return text == null ? NO_VALUE : text; }
java
public String getValue() { Object value = getData(); if (value != null) { return value.toString(); } String text = getText(); return text == null ? NO_VALUE : text; }
[ "public", "String", "getValue", "(", ")", "{", "Object", "value", "=", "getData", "(", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "return", "value", ".", "toString", "(", ")", ";", "}", "String", "text", "=", "getText", "(", ")", ";", ...
Return the button value. By default the value is the same as the text placed on the button. @return the button value
[ "Return", "the", "button", "value", ".", "By", "default", "the", "value", "is", "the", "same", "as", "the", "text", "placed", "on", "the", "button", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java#L350-L358
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java
WButton.setImage
public void setImage(final Image image) { ButtonModel model = getOrCreateComponentModel(); model.image = image; model.imageUrl = null; }
java
public void setImage(final Image image) { ButtonModel model = getOrCreateComponentModel(); model.image = image; model.imageUrl = null; }
[ "public", "void", "setImage", "(", "final", "Image", "image", ")", "{", "ButtonModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "model", ".", "image", "=", "image", ";", "model", ".", "imageUrl", "=", "null", ";", "}" ]
Sets the image to display on the button. The text alternative for the image is generated from the button text. @param image the image, or null for no image
[ "Sets", "the", "image", "to", "display", "on", "the", "button", ".", "The", "text", "alternative", "for", "the", "image", "is", "generated", "from", "the", "button", "text", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java#L423-L427
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxWRadioButtonSelectExample.java
AjaxWRadioButtonSelectExample.preparePaintComponent
@Override protected void preparePaintComponent(final Request request) { if (OPTION_CONTENT1.equals(rbSelect.getSelected())) { content.setText("This is content 1"); } else if (OPTION_CONTENT2.equals(rbSelect.getSelected())) { content.setText("This is content 2"); } else if (OPTION_CONTENT3.equals(rbSelect.g...
java
@Override protected void preparePaintComponent(final Request request) { if (OPTION_CONTENT1.equals(rbSelect.getSelected())) { content.setText("This is content 1"); } else if (OPTION_CONTENT2.equals(rbSelect.getSelected())) { content.setText("This is content 2"); } else if (OPTION_CONTENT3.equals(rbSelect.g...
[ "@", "Override", "protected", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "if", "(", "OPTION_CONTENT1", ".", "equals", "(", "rbSelect", ".", "getSelected", "(", ")", ")", ")", "{", "content", ".", "setText", "(", "\"This is...
Set the content of the text field depending on the selected option in the radio button select. @param request the request being processed
[ "Set", "the", "content", "of", "the", "text", "field", "depending", "on", "the", "selected", "option", "in", "the", "radio", "button", "select", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxWRadioButtonSelectExample.java#L77-L88
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/Rule.java
Rule.execute
public void execute() { if (condition == null) { throw new SystemException("Rule cannot be executed as it has no condition"); } if (condition.isTrue()) { for (Action action : onTrue) { action.execute(); } } else { for (Action action : onFalse) { action.execute(); } } }
java
public void execute() { if (condition == null) { throw new SystemException("Rule cannot be executed as it has no condition"); } if (condition.isTrue()) { for (Action action : onTrue) { action.execute(); } } else { for (Action action : onFalse) { action.execute(); } } }
[ "public", "void", "execute", "(", ")", "{", "if", "(", "condition", "==", "null", ")", "{", "throw", "new", "SystemException", "(", "\"Rule cannot be executed as it has no condition\"", ")", ";", "}", "if", "(", "condition", ".", "isTrue", "(", ")", ")", "{"...
Executes the rule.
[ "Executes", "the", "rule", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/Rule.java#L119-L133
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/SubordinateControlHelper.java
SubordinateControlHelper.applyRegisteredControls
public static void applyRegisteredControls(final Request request, final boolean useRequestValues) { Set<String> controls = getRegisteredSubordinateControls(); if (controls == null) { return; } // Process Controls for (String controlId : controls) { // Find the Component for this ID ComponentWithCon...
java
public static void applyRegisteredControls(final Request request, final boolean useRequestValues) { Set<String> controls = getRegisteredSubordinateControls(); if (controls == null) { return; } // Process Controls for (String controlId : controls) { // Find the Component for this ID ComponentWithCon...
[ "public", "static", "void", "applyRegisteredControls", "(", "final", "Request", "request", ",", "final", "boolean", "useRequestValues", ")", "{", "Set", "<", "String", ">", "controls", "=", "getRegisteredSubordinateControls", "(", ")", ";", "if", "(", "controls", ...
Apply the registered Subordinate Controls. @param request the request being processed. @param useRequestValues the flag to indicate the controls should use values from the request.
[ "Apply", "the", "registered", "Subordinate", "Controls", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/SubordinateControlHelper.java#L73-L111
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/SubordinateControlHelper.java
SubordinateControlHelper.clearAllRegisteredControls
public static void clearAllRegisteredControls() { UIContext uic = UIContextHolder.getCurrentPrimaryUIContext(); if (uic != null) { uic.setFwkAttribute(SUBORDINATE_CONTROL_SESSION_KEY, null); } }
java
public static void clearAllRegisteredControls() { UIContext uic = UIContextHolder.getCurrentPrimaryUIContext(); if (uic != null) { uic.setFwkAttribute(SUBORDINATE_CONTROL_SESSION_KEY, null); } }
[ "public", "static", "void", "clearAllRegisteredControls", "(", ")", "{", "UIContext", "uic", "=", "UIContextHolder", ".", "getCurrentPrimaryUIContext", "(", ")", ";", "if", "(", "uic", "!=", "null", ")", "{", "uic", ".", "setFwkAttribute", "(", "SUBORDINATE_CONT...
Clear all registered Subordinate Controls on the session.
[ "Clear", "all", "registered", "Subordinate", "Controls", "on", "the", "session", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/SubordinateControlHelper.java#L116-L121
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
WDialog.setContent
public void setContent(final WComponent content) { getOrCreateComponentModel().content = content; // There should only be one content. holder.removeAll(); holder.add(content); }
java
public void setContent(final WComponent content) { getOrCreateComponentModel().content = content; // There should only be one content. holder.removeAll(); holder.add(content); }
[ "public", "void", "setContent", "(", "final", "WComponent", "content", ")", "{", "getOrCreateComponentModel", "(", ")", ".", "content", "=", "content", ";", "// There should only be one content.", "holder", ".", "removeAll", "(", ")", ";", "holder", ".", "add", ...
Set the WComponent which will handle the content for this dialog. @param content the dialog content.
[ "Set", "the", "WComponent", "which", "will", "handle", "the", "content", "for", "this", "dialog", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java#L155-L161
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
WDialog.setTitle
public void setTitle(final String title, final Serializable... args) { getOrCreateComponentModel().title = I18nUtilities.asMessage(title, args); }
java
public void setTitle(final String title, final Serializable... args) { getOrCreateComponentModel().title = I18nUtilities.asMessage(title, args); }
[ "public", "void", "setTitle", "(", "final", "String", "title", ",", "final", "Serializable", "...", "args", ")", "{", "getOrCreateComponentModel", "(", ")", ".", "title", "=", "I18nUtilities", ".", "asMessage", "(", "title", ",", "args", ")", ";", "}" ]
Sets the dialog title. @param title the title to set, using {@link MessageFormat} syntax. @param args optional arguments for the message format string.
[ "Sets", "the", "dialog", "title", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java#L264-L266
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
WDialog.setTrigger
public void setTrigger(final DialogOpenTrigger trigger) { // pre-1.2.3 compatibilty only: if (this.hasLegacyTriggerButton()) { DialogOpenTrigger theTrigger = getTrigger(); if (theTrigger instanceof WButton) { remove(theTrigger); } setLegacyTriggerButton(false); } // end of backwards compatibilit...
java
public void setTrigger(final DialogOpenTrigger trigger) { // pre-1.2.3 compatibilty only: if (this.hasLegacyTriggerButton()) { DialogOpenTrigger theTrigger = getTrigger(); if (theTrigger instanceof WButton) { remove(theTrigger); } setLegacyTriggerButton(false); } // end of backwards compatibilit...
[ "public", "void", "setTrigger", "(", "final", "DialogOpenTrigger", "trigger", ")", "{", "// pre-1.2.3 compatibilty only:", "if", "(", "this", ".", "hasLegacyTriggerButton", "(", ")", ")", "{", "DialogOpenTrigger", "theTrigger", "=", "getTrigger", "(", ")", ";", "i...
Set the component which will open the WDialog. @param trigger the WComponent which will open the dialog on click/change
[ "Set", "the", "component", "which", "will", "open", "the", "WDialog", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java#L273-L284
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
WDialog.handleTriggerOpenAction
protected void handleTriggerOpenAction(final Request request) { // Run the action (if set) final Action action = getTriggerOpenAction(); if (action != null) { final ActionEvent event = new ActionEvent(this, OPEN_DIALOG_ACTION); Runnable later = new Runnable() { @Override public void run() { act...
java
protected void handleTriggerOpenAction(final Request request) { // Run the action (if set) final Action action = getTriggerOpenAction(); if (action != null) { final ActionEvent event = new ActionEvent(this, OPEN_DIALOG_ACTION); Runnable later = new Runnable() { @Override public void run() { act...
[ "protected", "void", "handleTriggerOpenAction", "(", "final", "Request", "request", ")", "{", "// Run the action (if set)", "final", "Action", "action", "=", "getTriggerOpenAction", "(", ")", ";", "if", "(", "action", "!=", "null", ")", "{", "final", "ActionEvent"...
Run the trigger open action. @param request the request being processed
[ "Run", "the", "trigger", "open", "action", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java#L337-L350
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java
WDialog.isAjaxTargeted
public final boolean isAjaxTargeted() { // If the AJAX target is within the dialog, it should be visible. AjaxOperation operation = AjaxHelper.getCurrentOperation(); if (operation == null) { return false; } String dialogId = getId(); String containerId = operation.getTargetContainerId(); if (containe...
java
public final boolean isAjaxTargeted() { // If the AJAX target is within the dialog, it should be visible. AjaxOperation operation = AjaxHelper.getCurrentOperation(); if (operation == null) { return false; } String dialogId = getId(); String containerId = operation.getTargetContainerId(); if (containe...
[ "public", "final", "boolean", "isAjaxTargeted", "(", ")", "{", "// If the AJAX target is within the dialog, it should be visible.", "AjaxOperation", "operation", "=", "AjaxHelper", ".", "getCurrentOperation", "(", ")", ";", "if", "(", "operation", "==", "null", ")", "{"...
Indicates whether the dialog is currently the target of an AJAX operation. @return true if the dialog is currently AJAX targeted, otherwise false.
[ "Indicates", "whether", "the", "dialog", "is", "currently", "the", "target", "of", "an", "AJAX", "operation", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDialog.java#L376-L399
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.getAppsOnSpace
public List<Application> getAppsOnSpace(int spaceId) { return getResourceFactory().getApiResource( "/app/space/" + spaceId + "/").get( new GenericType<List<Application>>() { }); }
java
public List<Application> getAppsOnSpace(int spaceId) { return getResourceFactory().getApiResource( "/app/space/" + spaceId + "/").get( new GenericType<List<Application>>() { }); }
[ "public", "List", "<", "Application", ">", "getAppsOnSpace", "(", "int", "spaceId", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/space/\"", "+", "spaceId", "+", "\"/\"", ")", ".", "get", "(", "new", "GenericType", "...
Returns all the apps on the space that are visible. The apps are sorted by any custom ordering and else by name. @param spaceId The id of the space @return The list of apps on the given space
[ "Returns", "all", "the", "apps", "on", "the", "space", "that", "are", "visible", ".", "The", "apps", "are", "sorted", "by", "any", "custom", "ordering", "and", "else", "by", "name", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L45-L50
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.getTopApps
public List<Application> getTopApps(Integer limit) { WebResource resource = getResourceFactory().getApiResource("/app/top/"); if (limit != null) { resource = resource.queryParam("limit", limit.toString()); } return resource.get(new GenericType<List<Application>>() { }); }
java
public List<Application> getTopApps(Integer limit) { WebResource resource = getResourceFactory().getApiResource("/app/top/"); if (limit != null) { resource = resource.queryParam("limit", limit.toString()); } return resource.get(new GenericType<List<Application>>() { }); }
[ "public", "List", "<", "Application", ">", "getTopApps", "(", "Integer", "limit", ")", "{", "WebResource", "resource", "=", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/top/\"", ")", ";", "if", "(", "limit", "!=", "null", ")", "{", "...
Returns the top apps for the active user. This is the apps that the user have interacted with the most. @param limit The maximum number of apps to return, defaults to 4. @return The top apps for the active user
[ "Returns", "the", "top", "apps", "for", "the", "active", "user", ".", "This", "is", "the", "apps", "that", "the", "user", "have", "interacted", "with", "the", "most", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L60-L67
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.addApp
public int addApp(ApplicationCreate app) { return getResourceFactory().getApiResource("/app/") .entity(app, MediaType.APPLICATION_JSON_TYPE) .post(ApplicationCreateResponse.class).getId(); }
java
public int addApp(ApplicationCreate app) { return getResourceFactory().getApiResource("/app/") .entity(app, MediaType.APPLICATION_JSON_TYPE) .post(ApplicationCreateResponse.class).getId(); }
[ "public", "int", "addApp", "(", "ApplicationCreate", "app", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/\"", ")", ".", "entity", "(", "app", ",", "MediaType", ".", "APPLICATION_JSON_TYPE", ")", ".", "post", "(", "A...
Creates a new app on a space. @param app The definition for the new app @return The id of the newly created app
[ "Creates", "a", "new", "app", "on", "a", "space", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L76-L80
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.updateApp
public void updateApp(int appId, ApplicationUpdate app) { getResourceFactory().getApiResource("/app/" + appId) .entity(app, MediaType.APPLICATION_JSON).put(); }
java
public void updateApp(int appId, ApplicationUpdate app) { getResourceFactory().getApiResource("/app/" + appId) .entity(app, MediaType.APPLICATION_JSON).put(); }
[ "public", "void", "updateApp", "(", "int", "appId", ",", "ApplicationUpdate", "app", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/\"", "+", "appId", ")", ".", "entity", "(", "app", ",", "MediaType", ".", "APPLICATION_JSON", "...
Updates an app. The update can contain an new configuration for the app, addition of new fields as well as updates to the configuration of existing fields. Fields not included will not be deleted. To delete a field use the "delete field" operation. When adding/updating/deleting apps and fields, it can be simpler to on...
[ "Updates", "an", "app", ".", "The", "update", "can", "contain", "an", "new", "configuration", "for", "the", "app", "addition", "of", "new", "fields", "as", "well", "as", "updates", "to", "the", "configuration", "of", "existing", "fields", ".", "Fields", "n...
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L97-L100
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.addField
public int addField(int appId, ApplicationFieldCreate field) { return getResourceFactory().getApiResource("/app/" + appId + "/field/") .entity(field, MediaType.APPLICATION_JSON_TYPE) .post(ApplicationFieldCreateResponse.class).getId(); }
java
public int addField(int appId, ApplicationFieldCreate field) { return getResourceFactory().getApiResource("/app/" + appId + "/field/") .entity(field, MediaType.APPLICATION_JSON_TYPE) .post(ApplicationFieldCreateResponse.class).getId(); }
[ "public", "int", "addField", "(", "int", "appId", ",", "ApplicationFieldCreate", "field", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/\"", "+", "appId", "+", "\"/field/\"", ")", ".", "entity", "(", "field", ",", "M...
Adds a new field to an app @param appId The id of the the field should be added to @param field The definition of the new field @return The id of the newly created field
[ "Adds", "a", "new", "field", "to", "an", "app" ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L111-L115
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.updateField
public void updateField(int appId, int fieldId, ApplicationFieldConfiguration configuration) { getResourceFactory() .getApiResource("/app/" + appId + "/field/" + fieldId) .entity(configuration, MediaType.APPLICATION_JSON_TYPE).put(); }
java
public void updateField(int appId, int fieldId, ApplicationFieldConfiguration configuration) { getResourceFactory() .getApiResource("/app/" + appId + "/field/" + fieldId) .entity(configuration, MediaType.APPLICATION_JSON_TYPE).put(); }
[ "public", "void", "updateField", "(", "int", "appId", ",", "int", "fieldId", ",", "ApplicationFieldConfiguration", "configuration", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/\"", "+", "appId", "+", "\"/field/\"", "+", "fieldId",...
Updates the configuration of an app field. The type of the field cannot be updated, only the configuration. @param appId The id of the app the field is one @param fieldId The id of the field to be updated @param configuration The new configuration of the field
[ "Updates", "the", "configuration", "of", "an", "app", "field", ".", "The", "type", "of", "the", "field", "cannot", "be", "updated", "only", "the", "configuration", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L128-L133
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.install
public int install(int appId, int spaceId) { return getResourceFactory() .getApiResource("/app/" + appId + "/install") .entity(new ApplicationInstall(spaceId), MediaType.APPLICATION_JSON_TYPE) .post(ApplicationCreateResponse.class).getId(); }
java
public int install(int appId, int spaceId) { return getResourceFactory() .getApiResource("/app/" + appId + "/install") .entity(new ApplicationInstall(spaceId), MediaType.APPLICATION_JSON_TYPE) .post(ApplicationCreateResponse.class).getId(); }
[ "public", "int", "install", "(", "int", "appId", ",", "int", "spaceId", ")", "{", "return", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/\"", "+", "appId", "+", "\"/install\"", ")", ".", "entity", "(", "new", "ApplicationInstall", "(",...
Installs the app with the given id on the space. @param appId The id of the app to be installed @param spaceId The id of the space the app should be installed o n @return The id of the newly installed app
[ "Installs", "the", "app", "with", "the", "given", "id", "on", "the", "space", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L189-L195
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.updateOrder
public void updateOrder(int spaceId, List<Integer> appIds) { getResourceFactory().getApiResource("/app/space/" + spaceId + "/order") .entity(appIds, MediaType.APPLICATION_JSON_TYPE).put(); }
java
public void updateOrder(int spaceId, List<Integer> appIds) { getResourceFactory().getApiResource("/app/space/" + spaceId + "/order") .entity(appIds, MediaType.APPLICATION_JSON_TYPE).put(); }
[ "public", "void", "updateOrder", "(", "int", "spaceId", ",", "List", "<", "Integer", ">", "appIds", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/space/\"", "+", "spaceId", "+", "\"/order\"", ")", ".", "entity", "(", "appIds",...
Updates the order of the apps on the space. It should post all the apps from the space in the order required. @param spaceId The id of the space the apps are on @param appIds The ids of the apps in the new order
[ "Updates", "the", "order", "of", "the", "apps", "on", "the", "space", ".", "It", "should", "post", "all", "the", "apps", "from", "the", "space", "in", "the", "order", "required", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L206-L209
train
podio/podio-java
src/main/java/com/podio/app/AppAPI.java
AppAPI.deactivateApp
public void deactivateApp(int appId) { getResourceFactory().getApiResource("/app/" + appId + "/deactivate") .entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post(); }
java
public void deactivateApp(int appId) { getResourceFactory().getApiResource("/app/" + appId + "/deactivate") .entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post(); }
[ "public", "void", "deactivateApp", "(", "int", "appId", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/app/\"", "+", "appId", "+", "\"/deactivate\"", ")", ".", "entity", "(", "new", "Empty", "(", ")", ",", "MediaType", ".", "APPL...
Deactivates the app with the given id. This removes the app from the app navigator, and disables insertion of new items. @param appId The id of the app to deactivate
[ "Deactivates", "the", "app", "with", "the", "given", "id", ".", "This", "removes", "the", "app", "from", "the", "app", "navigator", "and", "disables", "insertion", "of", "new", "items", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L241-L244
train
podio/podio-java
src/main/java/com/podio/file/FileAPI.java
FileAPI.downloadFile
public void downloadFile(int fileId, java.io.File target, FileSize size) throws IOException { WebResource builder = getResourceFactory() .getFileResource("/" + fileId); if (size != null) { builder = builder.path("/" + size.name().toLowerCase()); } byte[] data = builder.get(byte[].class); FileUtils.w...
java
public void downloadFile(int fileId, java.io.File target, FileSize size) throws IOException { WebResource builder = getResourceFactory() .getFileResource("/" + fileId); if (size != null) { builder = builder.path("/" + size.name().toLowerCase()); } byte[] data = builder.get(byte[].class); FileUtils.w...
[ "public", "void", "downloadFile", "(", "int", "fileId", ",", "java", ".", "io", ".", "File", "target", ",", "FileSize", "size", ")", "throws", "IOException", "{", "WebResource", "builder", "=", "getResourceFactory", "(", ")", ".", "getFileResource", "(", "\"...
Downloads the file and saves it to given file @param fileId The id of the file to download @param target The target file to save the contents to @throws IOException If there was an error reading or writing the file
[ "Downloads", "the", "file", "and", "saves", "it", "to", "given", "file" ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/file/FileAPI.java#L40-L49
train
podio/podio-java
src/main/java/com/podio/file/FileAPI.java
FileAPI.uploadFile
public int uploadFile(String name, java.io.File file) { FileDataBodyPart filePart = new FileDataBodyPart("source", file); // Work around for bug in cherrypy FormDataContentDisposition.FormDataContentDispositionBuilder builder = FormDataContentDisposition .name(filePart.getName()); builder.fileName(file.getN...
java
public int uploadFile(String name, java.io.File file) { FileDataBodyPart filePart = new FileDataBodyPart("source", file); // Work around for bug in cherrypy FormDataContentDisposition.FormDataContentDispositionBuilder builder = FormDataContentDisposition .name(filePart.getName()); builder.fileName(file.getN...
[ "public", "int", "uploadFile", "(", "String", "name", ",", "java", ".", "io", ".", "File", "file", ")", "{", "FileDataBodyPart", "filePart", "=", "new", "FileDataBodyPart", "(", "\"source\"", ",", "file", ")", ";", "// Work around for bug in cherrypy", "FormData...
Uploads the file to the API
[ "Uploads", "the", "file", "to", "the", "API" ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/file/FileAPI.java#L54-L72
train
podio/podio-java
src/main/java/com/podio/file/FileAPI.java
FileAPI.updateFile
public void updateFile(int fileId, FileUpdate update) { getResourceFactory().getApiResource("/file/" + fileId) .entity(update, MediaType.APPLICATION_JSON_TYPE).put(); }
java
public void updateFile(int fileId, FileUpdate update) { getResourceFactory().getApiResource("/file/" + fileId) .entity(update, MediaType.APPLICATION_JSON_TYPE).put(); }
[ "public", "void", "updateFile", "(", "int", "fileId", ",", "FileUpdate", "update", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/file/\"", "+", "fileId", ")", ".", "entity", "(", "update", ",", "MediaType", ".", "APPLICATION_JSON_TY...
Used to update the description of the file.
[ "Used", "to", "update", "the", "description", "of", "the", "file", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/file/FileAPI.java#L123-L126
train
podio/podio-java
src/main/java/com/podio/file/FileAPI.java
FileAPI.getOnApp
public List<File> getOnApp(int appId, Integer limit, Integer offset) { WebResource resource = getResourceFactory().getApiResource( "/file/app/" + appId + "/"); if (limit != null) { resource = resource.queryParam("limit", limit.toString()); } if (offset != null) { resource = resource.queryParam("offset...
java
public List<File> getOnApp(int appId, Integer limit, Integer offset) { WebResource resource = getResourceFactory().getApiResource( "/file/app/" + appId + "/"); if (limit != null) { resource = resource.queryParam("limit", limit.toString()); } if (offset != null) { resource = resource.queryParam("offset...
[ "public", "List", "<", "File", ">", "getOnApp", "(", "int", "appId", ",", "Integer", "limit", ",", "Integer", "offset", ")", "{", "WebResource", "resource", "=", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/file/app/\"", "+", "appId", "+",...
Returns all the files related to the items in the application. This includes files both on the item itself and in comments on the item. @param limit The maximum number of files to be returned. Defaults to 50 and cannot be higher than 100. @param offset The offset to use when returning files to be used for pagination. ...
[ "Returns", "all", "the", "files", "related", "to", "the", "items", "in", "the", "application", ".", "This", "includes", "files", "both", "on", "the", "item", "itself", "and", "in", "comments", "on", "the", "item", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/file/FileAPI.java#L146-L158
train
podio/podio-java
src/main/java/com/podio/file/FileAPI.java
FileAPI.getOnSpace
public List<File> getOnSpace(int spaceId, Integer limit, Integer offset) { WebResource resource = getResourceFactory().getApiResource( "/file/space/" + spaceId + "/"); if (limit != null) { resource = resource.queryParam("limit", limit.toString()); } if (offset != null) { resource = resource.queryParam...
java
public List<File> getOnSpace(int spaceId, Integer limit, Integer offset) { WebResource resource = getResourceFactory().getApiResource( "/file/space/" + spaceId + "/"); if (limit != null) { resource = resource.queryParam("limit", limit.toString()); } if (offset != null) { resource = resource.queryParam...
[ "public", "List", "<", "File", ">", "getOnSpace", "(", "int", "spaceId", ",", "Integer", "limit", ",", "Integer", "offset", ")", "{", "WebResource", "resource", "=", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/file/space/\"", "+", "spaceId"...
Returns all the files on the space order by the file name. @param limit The maximum number of files to be returned. Defaults to 50 and cannot be higher than 100. @param offset The offset to use when returning files to be used for pagination. Defaults to 0 (no offset).
[ "Returns", "all", "the", "files", "on", "the", "space", "order", "by", "the", "file", "name", "." ]
a520b23bac118c957ce02cdd8ff42a6c7d17b49a
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/file/FileAPI.java#L170-L182
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validator/AbstractFieldValidator.java
AbstractFieldValidator.validate
@Override public List<Diagnostic> validate(final List<Diagnostic> diags) { if (!isValid()) { List<Serializable> argList = getMessageArguments(); Serializable[] args = argList.toArray(new Serializable[argList.size()]); diags.add(new DiagnosticImpl(Diagnostic.ERROR, input, getErrorMessage(), args)); } r...
java
@Override public List<Diagnostic> validate(final List<Diagnostic> diags) { if (!isValid()) { List<Serializable> argList = getMessageArguments(); Serializable[] args = argList.toArray(new Serializable[argList.size()]); diags.add(new DiagnosticImpl(Diagnostic.ERROR, input, getErrorMessage(), args)); } r...
[ "@", "Override", "public", "List", "<", "Diagnostic", ">", "validate", "(", "final", "List", "<", "Diagnostic", ">", "diags", ")", "{", "if", "(", "!", "isValid", "(", ")", ")", "{", "List", "<", "Serializable", ">", "argList", "=", "getMessageArguments"...
Validates the input field. @param diags the list of Diagnostics to add validation errors to. @return the updated list of validation errors.
[ "Validates", "the", "input", "field", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validator/AbstractFieldValidator.java#L123-L133
train
ebean-orm/ebean-querybean
src/main/java/io/ebean/typequery/PBaseNumber.java
PBaseNumber.between
public R between(int lower, int upper) { expr().between(_name, lower, upper); return _root; }
java
public R between(int lower, int upper) { expr().between(_name, lower, upper); return _root; }
[ "public", "R", "between", "(", "int", "lower", ",", "int", "upper", ")", "{", "expr", "(", ")", ".", "between", "(", "_name", ",", "lower", ",", "upper", ")", ";", "return", "_root", ";", "}" ]
Between lower and upper values. @param lower the lower bind value @param upper the upper bind value @return the root query bean instance
[ "Between", "lower", "and", "upper", "values", "." ]
821650cb817c9c0fdcc97f93408dc79170b12423
https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/PBaseNumber.java#L105-L108
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldSetRenderer.java
WFieldSetRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFieldSet fieldSet = (WFieldSet) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:fieldset"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttribute("cla...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFieldSet fieldSet = (WFieldSet) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:fieldset"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttribute("cla...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WFieldSet", "fieldSet", "=", "(", "WFieldSet", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderCo...
Paints the given WFieldSet. @param component the WFieldSet to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WFieldSet", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldSetRenderer.java#L23-L78
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WApplicationExample.java
WApplicationExample.findApplication
private WApplication findApplication() { WApplication appl = WApplication.instance(this); if (appl == null) { messages.addMessage(new Message(Message.WARNING_MESSAGE, "There is no WApplication available for this example.")); } return appl; }
java
private WApplication findApplication() { WApplication appl = WApplication.instance(this); if (appl == null) { messages.addMessage(new Message(Message.WARNING_MESSAGE, "There is no WApplication available for this example.")); } return appl; }
[ "private", "WApplication", "findApplication", "(", ")", "{", "WApplication", "appl", "=", "WApplication", ".", "instance", "(", "this", ")", ";", "if", "(", "appl", "==", "null", ")", "{", "messages", ".", "addMessage", "(", "new", "Message", "(", "Message...
Find the closest WApplication instance. @return the closest WApplication instance
[ "Find", "the", "closest", "WApplication", "instance", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WApplicationExample.java#L105-L114
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java
WTemplate.addTaggedComponent
public void addTaggedComponent(final String tag, final WComponent component) { if (Util.empty(tag)) { throw new IllegalArgumentException("A tag must be provided."); } if (component == null) { throw new IllegalArgumentException("A component must be provided."); } TemplateModel model = getOrCreateCompone...
java
public void addTaggedComponent(final String tag, final WComponent component) { if (Util.empty(tag)) { throw new IllegalArgumentException("A tag must be provided."); } if (component == null) { throw new IllegalArgumentException("A component must be provided."); } TemplateModel model = getOrCreateCompone...
[ "public", "void", "addTaggedComponent", "(", "final", "String", "tag", ",", "final", "WComponent", "component", ")", "{", "if", "(", "Util", ".", "empty", "(", "tag", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"A tag must be provided.\"", ...
Add a tagged component to be included in the template. The component will be rendered in place of the corresponding tag in the template. @param tag the tag for this component in the template @param component the component to add
[ "Add", "a", "tagged", "component", "to", "be", "included", "in", "the", "template", ".", "The", "component", "will", "be", "rendered", "in", "place", "of", "the", "corresponding", "tag", "in", "the", "template", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L132-L153
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java
WTemplate.removeTaggedComponent
public void removeTaggedComponent(final WComponent component) { TemplateModel model = getOrCreateComponentModel(); if (model.taggedComponents != null) { // Find tag String tag = null; for (Map.Entry<String, WComponent> entry : model.taggedComponents.entrySet()) { if (entry.getValue().equals(component))...
java
public void removeTaggedComponent(final WComponent component) { TemplateModel model = getOrCreateComponentModel(); if (model.taggedComponents != null) { // Find tag String tag = null; for (Map.Entry<String, WComponent> entry : model.taggedComponents.entrySet()) { if (entry.getValue().equals(component))...
[ "public", "void", "removeTaggedComponent", "(", "final", "WComponent", "component", ")", "{", "TemplateModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "if", "(", "model", ".", "taggedComponents", "!=", "null", ")", "{", "// Find tag", "String", ...
Remove a tagged component via the component instance. @param component the tagged component to remove
[ "Remove", "a", "tagged", "component", "via", "the", "component", "instance", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L160-L175
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java
WTemplate.removeTaggedComponent
public void removeTaggedComponent(final String tag) { TemplateModel model = getOrCreateComponentModel(); if (model.taggedComponents != null) { WComponent component = model.taggedComponents.remove(tag); if (model.taggedComponents.isEmpty()) { model.taggedComponents = null; } if (component != null) { ...
java
public void removeTaggedComponent(final String tag) { TemplateModel model = getOrCreateComponentModel(); if (model.taggedComponents != null) { WComponent component = model.taggedComponents.remove(tag); if (model.taggedComponents.isEmpty()) { model.taggedComponents = null; } if (component != null) { ...
[ "public", "void", "removeTaggedComponent", "(", "final", "String", "tag", ")", "{", "TemplateModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "if", "(", "model", ".", "taggedComponents", "!=", "null", ")", "{", "WComponent", "component", "=", ...
Remove a tagged component by its tag. @param tag the tag of the component to remove
[ "Remove", "a", "tagged", "component", "by", "its", "tag", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L182-L193
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java
WTemplate.addParameter
public void addParameter(final String tag, final Object value) { if (Util.empty(tag)) { throw new IllegalArgumentException("A tag must be provided"); } TemplateModel model = getOrCreateComponentModel(); if (model.parameters == null) { model.parameters = new HashMap<>(); } model.parameters.put(tag, va...
java
public void addParameter(final String tag, final Object value) { if (Util.empty(tag)) { throw new IllegalArgumentException("A tag must be provided"); } TemplateModel model = getOrCreateComponentModel(); if (model.parameters == null) { model.parameters = new HashMap<>(); } model.parameters.put(tag, va...
[ "public", "void", "addParameter", "(", "final", "String", "tag", ",", "final", "Object", "value", ")", "{", "if", "(", "Util", ".", "empty", "(", "tag", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"A tag must be provided\"", ")", ";", ...
Add a template parameter. @param tag the tag for the template parameter @param value the value for the template parameter
[ "Add", "a", "template", "parameter", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L223-L233
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java
WTemplate.setEngineName
public void setEngineName(final TemplateRendererFactory.TemplateEngine templateEngine) { setEngineName(templateEngine == null ? null : templateEngine.getEngineName()); }
java
public void setEngineName(final TemplateRendererFactory.TemplateEngine templateEngine) { setEngineName(templateEngine == null ? null : templateEngine.getEngineName()); }
[ "public", "void", "setEngineName", "(", "final", "TemplateRendererFactory", ".", "TemplateEngine", "templateEngine", ")", "{", "setEngineName", "(", "templateEngine", "==", "null", "?", "null", ":", "templateEngine", ".", "getEngineName", "(", ")", ")", ";", "}" ]
Set a predefined template engine. If null then the default engine is used. @param templateEngine the provided template engine or null to use the default engine
[ "Set", "a", "predefined", "template", "engine", ".", "If", "null", "then", "the", "default", "engine", "is", "used", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L277-L279
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java
WTemplate.removeEngineOption
public void removeEngineOption(final String key) { TemplateModel model = getOrCreateComponentModel(); if (model.engineOptions != null) { model.engineOptions.remove(key); } }
java
public void removeEngineOption(final String key) { TemplateModel model = getOrCreateComponentModel(); if (model.engineOptions != null) { model.engineOptions.remove(key); } }
[ "public", "void", "removeEngineOption", "(", "final", "String", "key", ")", "{", "TemplateModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "if", "(", "model", ".", "engineOptions", "!=", "null", ")", "{", "model", ".", "engineOptions", ".", ...
Remove a template engine option. @param key the engine option to remove
[ "Remove", "a", "template", "engine", "option", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L329-L334
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DateUtilities.java
DateUtilities.createDate
public static Date createDate(final int day, final int month, final int year) { Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(Calendar.DAY_OF_MONTH, day); cal.set(Calendar.MONTH, month - 1); cal.set(Calendar.YEAR, year); return cal.getTime(); }
java
public static Date createDate(final int day, final int month, final int year) { Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(Calendar.DAY_OF_MONTH, day); cal.set(Calendar.MONTH, month - 1); cal.set(Calendar.YEAR, year); return cal.getTime(); }
[ "public", "static", "Date", "createDate", "(", "final", "int", "day", ",", "final", "int", "month", ",", "final", "int", "year", ")", "{", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "cal", ".", "clear", "(", ")", ";", "cal...
Creates a date from the given components. @param day the day of the month, 1-31. @param month the month, 1-12. @param year the year. @return a date with the specified settings.
[ "Creates", "a", "date", "from", "the", "given", "components", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DateUtilities.java#L29-L38
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/HeadLineInterceptor.java
HeadLineInterceptor.preparePaint
@Override public void preparePaint(final Request request) { // Headers // The WHeaders comes from the root WComponent and is a // mechanism for WComponents to add their own headers // (eg more JavaScript references). Headers headers = this.getUI().getHeaders(); headers.reset(); super.preparePaint(reque...
java
@Override public void preparePaint(final Request request) { // Headers // The WHeaders comes from the root WComponent and is a // mechanism for WComponents to add their own headers // (eg more JavaScript references). Headers headers = this.getUI().getHeaders(); headers.reset(); super.preparePaint(reque...
[ "@", "Override", "public", "void", "preparePaint", "(", "final", "Request", "request", ")", "{", "// Headers", "// The WHeaders comes from the root WComponent and is a", "// mechanism for WComponents to add their own headers", "// (eg more JavaScript references).", "Headers", "header...
Override preparePaint in order to perform processing specific to this interceptor. Any old headers are cleared out before preparePaint is called on the main UI. @param request the request being responded to.
[ "Override", "preparePaint", "in", "order", "to", "perform", "processing", "specific", "to", "this", "interceptor", ".", "Any", "old", "headers", "are", "cleared", "out", "before", "preparePaint", "is", "called", "on", "the", "main", "UI", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/HeadLineInterceptor.java#L23-L34
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/HeadLineInterceptor.java
HeadLineInterceptor.paint
@Override public void paint(final RenderContext renderContext) { if (renderContext instanceof WebXmlRenderContext) { PageContentHelper.addAllHeadlines(((WebXmlRenderContext) renderContext).getWriter(), getUI().getHeaders()); } getBackingComponent().paint(renderContext); }
java
@Override public void paint(final RenderContext renderContext) { if (renderContext instanceof WebXmlRenderContext) { PageContentHelper.addAllHeadlines(((WebXmlRenderContext) renderContext).getWriter(), getUI().getHeaders()); } getBackingComponent().paint(renderContext); }
[ "@", "Override", "public", "void", "paint", "(", "final", "RenderContext", "renderContext", ")", "{", "if", "(", "renderContext", "instanceof", "WebXmlRenderContext", ")", "{", "PageContentHelper", ".", "addAllHeadlines", "(", "(", "(", "WebXmlRenderContext", ")", ...
Override paint in order to perform processing specific to this interceptor. This implementation is responsible for rendering the headlines for the UI. @param renderContext the renderContext to send the output to.
[ "Override", "paint", "in", "order", "to", "perform", "processing", "specific", "to", "this", "interceptor", ".", "This", "implementation", "is", "responsible", "for", "rendering", "the", "headlines", "for", "the", "UI", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/HeadLineInterceptor.java#L42-L50
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java
WCardManager.handleRequest
@Override public void handleRequest(final Request request) { super.handleRequest(request); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.serviceRequest(request); } }
java
@Override public void handleRequest(final Request request) { super.handleRequest(request); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.serviceRequest(request); } }
[ "@", "Override", "public", "void", "handleRequest", "(", "final", "Request", "request", ")", "{", "super", ".", "handleRequest", "(", "request", ")", ";", "WComponent", "visibleDialog", "=", "getVisible", "(", ")", ";", "if", "(", "visibleDialog", "!=", "nul...
Since none of the children are visible to standard processing, handleRequest has been overridden so that the visible card is processed. @param request the request being responded to.
[ "Since", "none", "of", "the", "children", "are", "visible", "to", "standard", "processing", "handleRequest", "has", "been", "overridden", "so", "that", "the", "visible", "card", "is", "processed", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java#L112-L121
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java
WCardManager.preparePaintComponent
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.preparePaint(request); } }
java
@Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.preparePaint(request); } }
[ "@", "Override", "protected", "void", "preparePaintComponent", "(", "final", "Request", "request", ")", "{", "super", ".", "preparePaintComponent", "(", "request", ")", ";", "WComponent", "visibleDialog", "=", "getVisible", "(", ")", ";", "if", "(", "visibleDial...
Since none of the children are visible to standard processing, preparePaintComponent has been overridden so that the visible card is prepared. @param request the request being responded to.
[ "Since", "none", "of", "the", "children", "are", "visible", "to", "standard", "processing", "preparePaintComponent", "has", "been", "overridden", "so", "that", "the", "visible", "card", "is", "prepared", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java#L129-L138
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java
WCardManager.paintComponent
@Override protected void paintComponent(final RenderContext renderContext) { super.paintComponent(renderContext); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.paint(renderContext); } }
java
@Override protected void paintComponent(final RenderContext renderContext) { super.paintComponent(renderContext); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.paint(renderContext); } }
[ "@", "Override", "protected", "void", "paintComponent", "(", "final", "RenderContext", "renderContext", ")", "{", "super", ".", "paintComponent", "(", "renderContext", ")", ";", "WComponent", "visibleDialog", "=", "getVisible", "(", ")", ";", "if", "(", "visible...
Since none of the children are visible to standard processing, paintComponent has been overridden so that the visible card is painted. @param renderContext the RenderContext to paint to.
[ "Since", "none", "of", "the", "children", "are", "visible", "to", "standard", "processing", "paintComponent", "has", "been", "overridden", "so", "that", "the", "visible", "card", "is", "painted", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java#L146-L155
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java
WCardManager.validateComponent
@Override protected void validateComponent(final List<Diagnostic> diags) { super.validateComponent(diags); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.validate(diags); } }
java
@Override protected void validateComponent(final List<Diagnostic> diags) { super.validateComponent(diags); WComponent visibleDialog = getVisible(); if (visibleDialog != null) { visibleDialog.validate(diags); } }
[ "@", "Override", "protected", "void", "validateComponent", "(", "final", "List", "<", "Diagnostic", ">", "diags", ")", "{", "super", ".", "validateComponent", "(", "diags", ")", ";", "WComponent", "visibleDialog", "=", "getVisible", "(", ")", ";", "if", "(",...
Since none of the children are visible to standard processing, validateComponent has been overridden so that the visible card is processed. @param diags the list to add validation diagnostics to.
[ "Since", "none", "of", "the", "children", "are", "visible", "to", "standard", "processing", "validateComponent", "has", "been", "overridden", "so", "that", "the", "visible", "card", "is", "processed", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java#L163-L172
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java
WCardManager.showErrorIndicators
@Override public void showErrorIndicators(final List<Diagnostic> diags) { WComponent visibleComponent = getVisible(); visibleComponent.showErrorIndicators(diags); }
java
@Override public void showErrorIndicators(final List<Diagnostic> diags) { WComponent visibleComponent = getVisible(); visibleComponent.showErrorIndicators(diags); }
[ "@", "Override", "public", "void", "showErrorIndicators", "(", "final", "List", "<", "Diagnostic", ">", "diags", ")", "{", "WComponent", "visibleComponent", "=", "getVisible", "(", ")", ";", "visibleComponent", ".", "showErrorIndicators", "(", "diags", ")", ";",...
Override method to show Error indicators on the visible card. @param diags the list of diagnostics containing errors.
[ "Override", "method", "to", "show", "Error", "indicators", "on", "the", "visible", "card", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java#L179-L183
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java
WCardManager.showWarningIndicators
@Override public void showWarningIndicators(final List<Diagnostic> diags) { WComponent visibleComponent = getVisible(); visibleComponent.showWarningIndicators(diags); }
java
@Override public void showWarningIndicators(final List<Diagnostic> diags) { WComponent visibleComponent = getVisible(); visibleComponent.showWarningIndicators(diags); }
[ "@", "Override", "public", "void", "showWarningIndicators", "(", "final", "List", "<", "Diagnostic", ">", "diags", ")", "{", "WComponent", "visibleComponent", "=", "getVisible", "(", ")", ";", "visibleComponent", ".", "showWarningIndicators", "(", "diags", ")", ...
Override method to show Warning indicators on the visible card. @param diags the list of diagnostics containing warnings.
[ "Override", "method", "to", "show", "Warning", "indicators", "on", "the", "visible", "card", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WCardManager.java#L190-L194
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WListRenderer.java
WListRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WList list = (WList) component; XmlStringBuilder xml = renderContext.getWriter(); WList.Type type = list.getType(); WList.Separator separator = list.getSeparator(); Size gap = list.getSpace(); String gapSt...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WList list = (WList) component; XmlStringBuilder xml = renderContext.getWriter(); WList.Type type = list.getType(); WList.Separator separator = list.getSeparator(); Size gap = list.getSpace(); String gapSt...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WList", "list", "=", "(", "WList", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderContext", "....
Paints the given WList. @param component the WList to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WList", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WListRenderer.java#L28-L92
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java
WCheckBoxSelectExample.addInteractiveExamples
private void addInteractiveExamples() { add(new WHeading(HeadingLevel.H2, "Simple WCheckBoxSelect examples")); addExampleUsingLookupTable(); addExampleUsingArrayList(); addExampleUsingStringArray(); addInsideAFieldLayoutExamples(); add(new WHeading(HeadingLevel.H2, "Examples showing LAYOUT properties")); ...
java
private void addInteractiveExamples() { add(new WHeading(HeadingLevel.H2, "Simple WCheckBoxSelect examples")); addExampleUsingLookupTable(); addExampleUsingArrayList(); addExampleUsingStringArray(); addInsideAFieldLayoutExamples(); add(new WHeading(HeadingLevel.H2, "Examples showing LAYOUT properties")); ...
[ "private", "void", "addInteractiveExamples", "(", ")", "{", "add", "(", "new", "WHeading", "(", "HeadingLevel", ".", "H2", ",", "\"Simple WCheckBoxSelect examples\"", ")", ")", ";", "addExampleUsingLookupTable", "(", ")", ";", "addExampleUsingArrayList", "(", ")", ...
Simple interactive-state WCheckBoxSelect examples.
[ "Simple", "interactive", "-", "state", "WCheckBoxSelect", "examples", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L56-L76
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java
WCheckBoxSelectExample.addExampleUsingStringArray
private void addExampleUsingStringArray() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using a String array")); String[] options = new String[]{"Dog", "Cat", "Bird", "Turtle"}; final WCheckBoxSelect select = new WCheckBoxSelect(options); select.setToolTip("Animals"); select.setMandatory(true);...
java
private void addExampleUsingStringArray() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using a String array")); String[] options = new String[]{"Dog", "Cat", "Bird", "Turtle"}; final WCheckBoxSelect select = new WCheckBoxSelect(options); select.setToolTip("Animals"); select.setMandatory(true);...
[ "private", "void", "addExampleUsingStringArray", "(", ")", "{", "add", "(", "new", "WHeading", "(", "HeadingLevel", ".", "H3", ",", "\"WCheckBoxSelect created using a String array\"", ")", ")", ";", "String", "[", "]", "options", "=", "new", "String", "[", "]", ...
This example creates the WCheckBoxSelect from an array of Strings.
[ "This", "example", "creates", "the", "WCheckBoxSelect", "from", "an", "array", "of", "Strings", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L110-L137
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java
WCheckBoxSelectExample.addExampleUsingArrayList
private void addExampleUsingArrayList() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using an array list of options")); List<CarOption> options = new ArrayList<>(); options.add(new CarOption("1", "Ferrari", "F-360")); options.add(new CarOption("2", "Mercedez Benz", "amg")); options.add(new Car...
java
private void addExampleUsingArrayList() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using an array list of options")); List<CarOption> options = new ArrayList<>(); options.add(new CarOption("1", "Ferrari", "F-360")); options.add(new CarOption("2", "Mercedez Benz", "amg")); options.add(new Car...
[ "private", "void", "addExampleUsingArrayList", "(", ")", "{", "add", "(", "new", "WHeading", "(", "HeadingLevel", ".", "H3", ",", "\"WCheckBoxSelect created using an array list of options\"", ")", ")", ";", "List", "<", "CarOption", ">", "options", "=", "new", "Ar...
This example creates the WCheckBoxSelect from a List of CarOptions.
[ "This", "example", "creates", "the", "WCheckBoxSelect", "from", "a", "List", "of", "CarOptions", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L142-L171
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java
WCheckBoxSelectExample.addInsideAFieldLayoutExamples
private void addInsideAFieldLayoutExamples() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect inside a WFieldLayout")); add(new ExplanatoryText("When a WCheckBoxSelect is inside a WField its label is exposed in a way which appears and behaves like a regular " + "HTML label. This allows WCheckBoxSelects to b...
java
private void addInsideAFieldLayoutExamples() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect inside a WFieldLayout")); add(new ExplanatoryText("When a WCheckBoxSelect is inside a WField its label is exposed in a way which appears and behaves like a regular " + "HTML label. This allows WCheckBoxSelects to b...
[ "private", "void", "addInsideAFieldLayoutExamples", "(", ")", "{", "add", "(", "new", "WHeading", "(", "HeadingLevel", ".", "H3", ",", "\"WCheckBoxSelect inside a WFieldLayout\"", ")", ")", ";", "add", "(", "new", "ExplanatoryText", "(", "\"When a WCheckBoxSelect is i...
When a WCheckBoxSelect is added to a WFieldLayout the legend is moved. The first CheckBoxSelect has a frame, the second doesn't
[ "When", "a", "WCheckBoxSelect", "is", "added", "to", "a", "WFieldLayout", "the", "legend", "is", "moved", ".", "The", "first", "CheckBoxSelect", "has", "a", "frame", "the", "second", "doesn", "t" ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L177-L204
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java
WCheckBoxSelectExample.addColumnSelectExample
private void addColumnSelectExample() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect laid out in columns")); add(new ExplanatoryText("Setting the layout to COLUMN will make the check boxes be rendered in 'n' columns. The number of columns is" + " determined by the layoutColumnCount property.")); final W...
java
private void addColumnSelectExample() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect laid out in columns")); add(new ExplanatoryText("Setting the layout to COLUMN will make the check boxes be rendered in 'n' columns. The number of columns is" + " determined by the layoutColumnCount property.")); final W...
[ "private", "void", "addColumnSelectExample", "(", ")", "{", "add", "(", "new", "WHeading", "(", "HeadingLevel", ".", "H3", ",", "\"WCheckBoxSelect laid out in columns\"", ")", ")", ";", "add", "(", "new", "ExplanatoryText", "(", "\"Setting the layout to COLUMN will ma...
adds a WCheckBoxSelect with LAYOUT_COLUMN in 2 columns.
[ "adds", "a", "WCheckBoxSelect", "with", "LAYOUT_COLUMN", "in", "2", "columns", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L223-L257
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java
WCheckBoxSelectExample.addAntiPatternExamples
private void addAntiPatternExamples() { add(new WHeading(HeadingLevel.H2, "WCheckBoxSelect anti-pattern examples")); add(new WMessageBox( WMessageBox.WARN, "These examples are purposely bad and should not be used as samples of how to use WComponents but samples of how NOT to use them.")); add(new WHeadin...
java
private void addAntiPatternExamples() { add(new WHeading(HeadingLevel.H2, "WCheckBoxSelect anti-pattern examples")); add(new WMessageBox( WMessageBox.WARN, "These examples are purposely bad and should not be used as samples of how to use WComponents but samples of how NOT to use them.")); add(new WHeadin...
[ "private", "void", "addAntiPatternExamples", "(", ")", "{", "add", "(", "new", "WHeading", "(", "HeadingLevel", ".", "H2", ",", "\"WCheckBoxSelect anti-pattern examples\"", ")", ")", ";", "add", "(", "new", "WMessageBox", "(", "WMessageBox", ".", "WARN", ",", ...
Examples of what not to do when using WCheckBoxSelect.
[ "Examples", "of", "what", "not", "to", "do", "when", "using", "WCheckBoxSelect", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L405-L444
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WLinkRenderer.java
WLinkRenderer.paintAjaxTrigger
private void paintAjaxTrigger(final WLink link, final XmlStringBuilder xml) { AjaxTarget[] actionTargets = link.getActionTargets(); // Start tag xml.appendTagOpen("ui:ajaxtrigger"); xml.appendAttribute("triggerId", link.getId()); xml.appendClose(); if (actionTargets != null && actionTargets.length > 0) { ...
java
private void paintAjaxTrigger(final WLink link, final XmlStringBuilder xml) { AjaxTarget[] actionTargets = link.getActionTargets(); // Start tag xml.appendTagOpen("ui:ajaxtrigger"); xml.appendAttribute("triggerId", link.getId()); xml.appendClose(); if (actionTargets != null && actionTargets.length > 0) { ...
[ "private", "void", "paintAjaxTrigger", "(", "final", "WLink", "link", ",", "final", "XmlStringBuilder", "xml", ")", "{", "AjaxTarget", "[", "]", "actionTargets", "=", "link", ".", "getActionTargets", "(", ")", ";", "// Start tag", "xml", ".", "appendTagOpen", ...
Paint the AJAX trigger if the link has an action. @param link the link component being rendered @param xml the XmlStringBuilder to paint to.
[ "Paint", "the", "AJAX", "trigger", "if", "the", "link", "has", "an", "action", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WLinkRenderer.java#L130-L154
train
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/VelocityInterceptor.java
VelocityInterceptor.paint
@Override public void paint(final RenderContext renderContext) { if (!(renderContext instanceof WebXmlRenderContext)) { throw new SystemException("Unable to render to " + renderContext); } PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter(); Template template = null; try { templa...
java
@Override public void paint(final RenderContext renderContext) { if (!(renderContext instanceof WebXmlRenderContext)) { throw new SystemException("Unable to render to " + renderContext); } PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter(); Template template = null; try { templa...
[ "@", "Override", "public", "void", "paint", "(", "final", "RenderContext", "renderContext", ")", "{", "if", "(", "!", "(", "renderContext", "instanceof", "WebXmlRenderContext", ")", ")", "{", "throw", "new", "SystemException", "(", "\"Unable to render to \"", "+",...
Renders the component using the velocity template which has been provided. @param renderContext the context for rendering.
[ "Renders", "the", "component", "using", "the", "velocity", "template", "which", "has", "been", "provided", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/VelocityInterceptor.java#L63-L107
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownTriggerActionExample.java
WDropdownTriggerActionExample.getRegions
private static String[] getRegions(final String state) { if ("ACT".equals(state)) { return ACT_REGIONS; } else if ("VIC".equals(state)) { return VIC_REGIONS; } else { return null; } }
java
private static String[] getRegions(final String state) { if ("ACT".equals(state)) { return ACT_REGIONS; } else if ("VIC".equals(state)) { return VIC_REGIONS; } else { return null; } }
[ "private", "static", "String", "[", "]", "getRegions", "(", "final", "String", "state", ")", "{", "if", "(", "\"ACT\"", ".", "equals", "(", "state", ")", ")", "{", "return", "ACT_REGIONS", ";", "}", "else", "if", "(", "\"VIC\"", ".", "equals", "(", "...
Retrieves the regions in a state. @param state the state. @return the regions in the given state.
[ "Retrieves", "the", "regions", "in", "a", "state", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownTriggerActionExample.java#L151-L161
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownTriggerActionExample.java
WDropdownTriggerActionExample.getSuburbs
private static String[] getSuburbs(final String region) { if ("Tuggeranong".equals(region)) { return TUGGERANONG_SUBURBS; } else if ("Woden".equals(region)) { return WODEN_SUBURBS; } else if ("Melbourne".equals(region)) { return MELBOURNE_SUBURBS; } else if ("Mornington Peninsula".equals(region)) { ...
java
private static String[] getSuburbs(final String region) { if ("Tuggeranong".equals(region)) { return TUGGERANONG_SUBURBS; } else if ("Woden".equals(region)) { return WODEN_SUBURBS; } else if ("Melbourne".equals(region)) { return MELBOURNE_SUBURBS; } else if ("Mornington Peninsula".equals(region)) { ...
[ "private", "static", "String", "[", "]", "getSuburbs", "(", "final", "String", "region", ")", "{", "if", "(", "\"Tuggeranong\"", ".", "equals", "(", "region", ")", ")", "{", "return", "TUGGERANONG_SUBURBS", ";", "}", "else", "if", "(", "\"Woden\"", ".", ...
Retrieves the suburbs in a region. @param region the region. @return the suburbs in the given region.
[ "Retrieves", "the", "suburbs", "in", "a", "region", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDropdownTriggerActionExample.java#L169-L181
train
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/WCollapsibleOptionsExample.java
WCollapsibleOptionsExample.applySettings
private void applySettings() { // reset the container. container.reset(); // create the new collapsible. WText component1 = new WText("Here is some text that is collapsible via ajax."); WCollapsible collapsible1 = new WCollapsible(component1, "Collapsible", (CollapsibleMode) rbCollapsibleSelect.getSelect...
java
private void applySettings() { // reset the container. container.reset(); // create the new collapsible. WText component1 = new WText("Here is some text that is collapsible via ajax."); WCollapsible collapsible1 = new WCollapsible(component1, "Collapsible", (CollapsibleMode) rbCollapsibleSelect.getSelect...
[ "private", "void", "applySettings", "(", ")", "{", "// reset the container.", "container", ".", "reset", "(", ")", ";", "// create the new collapsible.", "WText", "component1", "=", "new", "WText", "(", "\"Here is some text that is collapsible via ajax.\"", ")", ";", "W...
applySettings creates the WCollapsible, and loads it into the container.
[ "applySettings", "creates", "the", "WCollapsible", "and", "loads", "it", "into", "the", "container", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/WCollapsibleOptionsExample.java#L97-L119
train