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/util/DefaultInternalConfiguration.java | DefaultInternalConfiguration.load | private void load(final String key, final String value, final String location) {
// Recursive bit
if (INCLUDE.equals(key)) {
load(parseStringArray(value));
} else {
backing.put(key, value);
if ("yes".equals(value) || "true".equals(value)) {
booleanBacking.add(key);
} else {
booleanBacking.rem... | java | private void load(final String key, final String value, final String location) {
// Recursive bit
if (INCLUDE.equals(key)) {
load(parseStringArray(value));
} else {
backing.put(key, value);
if ("yes".equals(value) || "true".equals(value)) {
booleanBacking.add(key);
} else {
booleanBacking.rem... | [
"private",
"void",
"load",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
",",
"final",
"String",
"location",
")",
"{",
"// Recursive bit",
"if",
"(",
"INCLUDE",
".",
"equals",
"(",
"key",
")",
")",
"{",
"load",
"(",
"parseStringArray",
... | Loads a single parameter into the configuration. This handles the special directives such as "include".
@param key the parameter key.
@param value the parameter value.
@param location the location where the parameter was defined. | [
"Loads",
"a",
"single",
"parameter",
"into",
"the",
"configuration",
".",
"This",
"handles",
"the",
"special",
"directives",
"such",
"as",
"include",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java#L558-L581 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java | DefaultInternalConfiguration.load | private void load(final String[] subFiles) {
for (int i = 0; i < subFiles.length; i++) {
load(subFiles[i]);
}
} | java | private void load(final String[] subFiles) {
for (int i = 0; i < subFiles.length; i++) {
load(subFiles[i]);
}
} | [
"private",
"void",
"load",
"(",
"final",
"String",
"[",
"]",
"subFiles",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"subFiles",
".",
"length",
";",
"i",
"++",
")",
"{",
"load",
"(",
"subFiles",
"[",
"i",
"]",
")",
";",
"}",
"}... | Loads the configuration from a set of files.
@param subFiles the files to load from. | [
"Loads",
"the",
"configuration",
"from",
"a",
"set",
"of",
"files",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java#L588-L592 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java | DefaultInternalConfiguration.getSubProperties | public Properties getSubProperties(final String prefix, final boolean truncate) {
String cacheKey = truncate + prefix;
Properties sub = subcontextCache.get(cacheKey);
if (sub != null) {
// make a copy so users can't change.
Properties copy = new Properties();
copy.putAll(sub);
return copy;
}
sub... | java | public Properties getSubProperties(final String prefix, final boolean truncate) {
String cacheKey = truncate + prefix;
Properties sub = subcontextCache.get(cacheKey);
if (sub != null) {
// make a copy so users can't change.
Properties copy = new Properties();
copy.putAll(sub);
return copy;
}
sub... | [
"public",
"Properties",
"getSubProperties",
"(",
"final",
"String",
"prefix",
",",
"final",
"boolean",
"truncate",
")",
"{",
"String",
"cacheKey",
"=",
"truncate",
"+",
"prefix",
";",
"Properties",
"sub",
"=",
"subcontextCache",
".",
"get",
"(",
"cacheKey",
")... | Returns a sub-set of the parameters contained in this configuration.
@param prefix the prefix of the parameter keys which should be included.
@param truncate if true, the prefix is truncated in the returned properties.
@return the properties sub-set, may be empty. | [
"Returns",
"a",
"sub",
"-",
"set",
"of",
"the",
"parameters",
"contained",
"in",
"this",
"configuration",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/DefaultInternalConfiguration.java#L633-L671 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExample.java | RepeaterExample.preparePaintComponent | @Override
public void preparePaintComponent(final Request request) {
if (!this.isInitialised()) {
// Give the repeater the list of data to display.
productRepeater.setData(fetchProductData());
// Remember that we've done the initialisation.
this.setInitialised(true);
}
} | java | @Override
public void preparePaintComponent(final Request request) {
if (!this.isInitialised()) {
// Give the repeater the list of data to display.
productRepeater.setData(fetchProductData());
// Remember that we've done the initialisation.
this.setInitialised(true);
}
} | [
"@",
"Override",
"public",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isInitialised",
"(",
")",
")",
"{",
"// Give the repeater the list of data to display.",
"productRepeater",
".",
"setData",
"(",
... | Override to initialise some data.
@param request the request being responded to. | [
"Override",
"to",
"initialise",
"some",
"data",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/RepeaterExample.java#L38-L47 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/HtmlToXMLUtil.java | HtmlToXMLUtil.unescapeToXML | public static String unescapeToXML(final String input) {
if (Util.empty(input)) {
return input;
}
// Check if input has encoded brackets
String encoded = WebUtilities.doubleEncodeBrackets(input);
String unescaped = UNESCAPE_HTML_TO_XML.translate(encoded);
String decoded = WebUtilities.doubleDecodeBracket... | java | public static String unescapeToXML(final String input) {
if (Util.empty(input)) {
return input;
}
// Check if input has encoded brackets
String encoded = WebUtilities.doubleEncodeBrackets(input);
String unescaped = UNESCAPE_HTML_TO_XML.translate(encoded);
String decoded = WebUtilities.doubleDecodeBracket... | [
"public",
"static",
"String",
"unescapeToXML",
"(",
"final",
"String",
"input",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"input",
")",
")",
"{",
"return",
"input",
";",
"}",
"// Check if input has encoded brackets",
"String",
"encoded",
"=",
"WebUtiliti... | Unescape HTML entities to safe XML.
<p>
Example</p>
<pre>
{@code StringEscapeHTMLToXMLUtil.unescapeToXML("•&Dagger}"); // returns "•‡"}
{@code StringEscapeHTMLToXMLUtil.unescapeToXML("<p>"); // returns "<p>" not "<p>"}
</pre>
@param input The String to unescape.
@return the input with all HTML4 chara... | [
"Unescape",
"HTML",
"entities",
"to",
"safe",
"XML",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/HtmlToXMLUtil.java#L51-L60 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/error/impl/DefaultSystemFailureMapper.java | DefaultSystemFailureMapper.toMessage | @Override
public Message toMessage(final Throwable throwable) {
LOG.error("The system is currently unavailable", throwable);
return new Message(Message.ERROR_MESSAGE, InternalMessages.DEFAULT_SYSTEM_ERROR);
} | java | @Override
public Message toMessage(final Throwable throwable) {
LOG.error("The system is currently unavailable", throwable);
return new Message(Message.ERROR_MESSAGE, InternalMessages.DEFAULT_SYSTEM_ERROR);
} | [
"@",
"Override",
"public",
"Message",
"toMessage",
"(",
"final",
"Throwable",
"throwable",
")",
"{",
"LOG",
".",
"error",
"(",
"\"The system is currently unavailable\"",
",",
"throwable",
")",
";",
"return",
"new",
"Message",
"(",
"Message",
".",
"ERROR_MESSAGE",
... | This method converts a java Throwable into a "user friendly" error message.
@param throwable the Throwable to convert
@return A {@link Message} containing the hard coded description "The system is currently unavailable." | [
"This",
"method",
"converts",
"a",
"java",
"Throwable",
"into",
"a",
"user",
"friendly",
"error",
"message",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/error/impl/DefaultSystemFailureMapper.java#L27-L31 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WAjaxControl.java | WAjaxControl.addTargets | public void addTargets(final List<? extends AjaxTarget> targets) {
if (targets != null) {
for (AjaxTarget target : targets) {
this.addTarget(target);
}
}
} | java | public void addTargets(final List<? extends AjaxTarget> targets) {
if (targets != null) {
for (AjaxTarget target : targets) {
this.addTarget(target);
}
}
} | [
"public",
"void",
"addTargets",
"(",
"final",
"List",
"<",
"?",
"extends",
"AjaxTarget",
">",
"targets",
")",
"{",
"if",
"(",
"targets",
"!=",
"null",
")",
"{",
"for",
"(",
"AjaxTarget",
"target",
":",
"targets",
")",
"{",
"this",
".",
"addTarget",
"("... | Add a list of target components that should be targets for this AJAX request.
@param targets the components that will be repainted for the AJAX request | [
"Add",
"a",
"list",
"of",
"target",
"components",
"that",
"should",
"be",
"targets",
"for",
"this",
"AJAX",
"request",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WAjaxControl.java#L104-L110 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WAjaxControl.java | WAjaxControl.addTarget | public void addTarget(final AjaxTarget target) {
AjaxControlModel model = getOrCreateComponentModel();
if (model.targets == null) {
model.targets = new ArrayList<>();
}
model.targets.add(target);
MemoryUtil.checkSize(model.targets.size(), this.getClass().getSimpleName());
} | java | public void addTarget(final AjaxTarget target) {
AjaxControlModel model = getOrCreateComponentModel();
if (model.targets == null) {
model.targets = new ArrayList<>();
}
model.targets.add(target);
MemoryUtil.checkSize(model.targets.size(), this.getClass().getSimpleName());
} | [
"public",
"void",
"addTarget",
"(",
"final",
"AjaxTarget",
"target",
")",
"{",
"AjaxControlModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"if",
"(",
"model",
".",
"targets",
"==",
"null",
")",
"{",
"model",
".",
"targets",
"=",
"new",
"A... | Add a single target WComponent to this AJAX control.
@param target a WComponent to be repainted | [
"Add",
"a",
"single",
"target",
"WComponent",
"to",
"this",
"AJAX",
"control",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WAjaxControl.java#L117-L126 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WAjaxControl.java | WAjaxControl.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
List<AjaxTarget> targets = getTargets();
if (targets != null && !targets.isEmpty()) {
WComponent triggerComponent = trigger == null ? this : trigger;
// The trigger maybe in a different context
... | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
List<AjaxTarget> targets = getTargets();
if (targets != null && !targets.isEmpty()) {
WComponent triggerComponent = trigger == null ? this : trigger;
// The trigger maybe in a different context
... | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"List",
"<",
"AjaxTarget",
">",
"targets",
"=",
"getTargets",
"(",
")",
";",
"if",
"... | Override preparePaintComponent in order to register the components for the current request.
@param request the request being responded to | [
"Override",
"preparePaintComponent",
"in",
"order",
"to",
"register",
"the",
"components",
"for",
"the",
"current",
"request",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WAjaxControl.java#L245-L268 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java | FilterableTableExample.setCaseSensitiveMatch | public void setCaseSensitiveMatch(final Boolean caseInsensitive) {
FilterableBeanBoundDataModel model = getFilterableTableModel();
if (model != null) {
model.setCaseSensitiveMatch(caseInsensitive);
}
} | java | public void setCaseSensitiveMatch(final Boolean caseInsensitive) {
FilterableBeanBoundDataModel model = getFilterableTableModel();
if (model != null) {
model.setCaseSensitiveMatch(caseInsensitive);
}
} | [
"public",
"void",
"setCaseSensitiveMatch",
"(",
"final",
"Boolean",
"caseInsensitive",
")",
"{",
"FilterableBeanBoundDataModel",
"model",
"=",
"getFilterableTableModel",
"(",
")",
";",
"if",
"(",
"model",
"!=",
"null",
")",
"{",
"model",
".",
"setCaseSensitiveMatch"... | Set the filter case sensitivity.
@param caseInsensitive If true the filter will not be case sensitive so, for example, "Smith" and "smith" will be
equivalent. | [
"Set",
"the",
"filter",
"case",
"sensitivity",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java#L138-L143 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java | FilterableTableExample.buildColumnHeader | private WDecoratedLabel buildColumnHeader(final String text, final WMenu menu) {
WDecoratedLabel label = new WDecoratedLabel(null, new WText(text), menu);
return label;
} | java | private WDecoratedLabel buildColumnHeader(final String text, final WMenu menu) {
WDecoratedLabel label = new WDecoratedLabel(null, new WText(text), menu);
return label;
} | [
"private",
"WDecoratedLabel",
"buildColumnHeader",
"(",
"final",
"String",
"text",
",",
"final",
"WMenu",
"menu",
")",
"{",
"WDecoratedLabel",
"label",
"=",
"new",
"WDecoratedLabel",
"(",
"null",
",",
"new",
"WText",
"(",
"text",
")",
",",
"menu",
")",
";",
... | Helper to create the table column heading's WDecoratedLabel.
@param text The readable text content of the column header
@param menu The WMenu we want in this column header.
@return WDecoratedLabel used to create a column heading. | [
"Helper",
"to",
"create",
"the",
"table",
"column",
"heading",
"s",
"WDecoratedLabel",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java#L152-L155 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java | FilterableTableExample.buildFilterMenus | private void buildFilterMenus() {
buildFilterSubMenu(firstNameFilterMenu, FIRST_NAME);
if (firstNameFilterMenu.getChildCount() == 0) {
firstNameFilterMenu.setVisible(false);
}
buildFilterSubMenu(lastNameFilterMenu, LAST_NAME);
if (lastNameFilterMenu.getChildCount() == 0) {
lastNameFilterMenu.setVisible... | java | private void buildFilterMenus() {
buildFilterSubMenu(firstNameFilterMenu, FIRST_NAME);
if (firstNameFilterMenu.getChildCount() == 0) {
firstNameFilterMenu.setVisible(false);
}
buildFilterSubMenu(lastNameFilterMenu, LAST_NAME);
if (lastNameFilterMenu.getChildCount() == 0) {
lastNameFilterMenu.setVisible... | [
"private",
"void",
"buildFilterMenus",
"(",
")",
"{",
"buildFilterSubMenu",
"(",
"firstNameFilterMenu",
",",
"FIRST_NAME",
")",
";",
"if",
"(",
"firstNameFilterMenu",
".",
"getChildCount",
"(",
")",
"==",
"0",
")",
"{",
"firstNameFilterMenu",
".",
"setVisible",
... | Builds the menu content for each column heading's filter menu. | [
"Builds",
"the",
"menu",
"content",
"for",
"each",
"column",
"heading",
"s",
"filter",
"menu",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java#L160-L175 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java | FilterableTableExample.setUpClearAllAction | private void setUpClearAllAction() {
/* if one or fewer of the filter menus are visible then we don't need the clear all menus button */
int visibleMenus = 0;
if (firstNameFilterMenu.isVisible()) {
visibleMenus++;
}
if (lastNameFilterMenu.isVisible()) {
visibleMenus++;
}
if (dobFilterMenu.isVisible(... | java | private void setUpClearAllAction() {
/* if one or fewer of the filter menus are visible then we don't need the clear all menus button */
int visibleMenus = 0;
if (firstNameFilterMenu.isVisible()) {
visibleMenus++;
}
if (lastNameFilterMenu.isVisible()) {
visibleMenus++;
}
if (dobFilterMenu.isVisible(... | [
"private",
"void",
"setUpClearAllAction",
"(",
")",
"{",
"/* if one or fewer of the filter menus are visible then we don't need the clear all menus button */",
"int",
"visibleMenus",
"=",
"0",
";",
"if",
"(",
"firstNameFilterMenu",
".",
"isVisible",
"(",
")",
")",
"{",
"vis... | Sets the state of the clearAllActions button based on the visibility of the filter menus and if the button is
visible sets its disabled state if nothing is filtered.
This is usability sugar, it is not necessary for the functionality of the filters. | [
"Sets",
"the",
"state",
"of",
"the",
"clearAllActions",
"button",
"based",
"on",
"the",
"visibility",
"of",
"the",
"filter",
"menus",
"and",
"if",
"the",
"button",
"is",
"visible",
"sets",
"its",
"disabled",
"state",
"if",
"nothing",
"is",
"filtered",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java#L213-L239 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java | FilterableTableExample.buildFilterSubMenu | private void buildFilterSubMenu(final WMenu menu, final int column) {
List<?> beanList = getFilterableTableModel().getFullBeanList();
int rows = (beanList == null) ? 0 : beanList.size();
if (rows == 0) {
return;
}
final List<String> found = new ArrayList<>();
final WDecoratedLabel filterSubMenuLabel =... | java | private void buildFilterSubMenu(final WMenu menu, final int column) {
List<?> beanList = getFilterableTableModel().getFullBeanList();
int rows = (beanList == null) ? 0 : beanList.size();
if (rows == 0) {
return;
}
final List<String> found = new ArrayList<>();
final WDecoratedLabel filterSubMenuLabel =... | [
"private",
"void",
"buildFilterSubMenu",
"(",
"final",
"WMenu",
"menu",
",",
"final",
"int",
"column",
")",
"{",
"List",
"<",
"?",
">",
"beanList",
"=",
"getFilterableTableModel",
"(",
")",
".",
"getFullBeanList",
"(",
")",
";",
"int",
"rows",
"=",
"(",
... | Creates and populates the sub-menu for each filter menu.
@param menu The WMenu we are currently populating.
@param column The column index of the table column the menu is in. This is used to get the data off the table's
Bean to put text content into the menu's items. | [
"Creates",
"and",
"populates",
"the",
"sub",
"-",
"menu",
"for",
"each",
"filter",
"menu",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/table/FilterableTableExample.java#L257-L313 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPopup.java | WPopup.setUrl | public void setUrl(final String url) {
String currUrl = getUrl();
if (!Objects.equals(url, currUrl)) {
getOrCreateComponentModel().url = url;
}
} | java | public void setUrl(final String url) {
String currUrl = getUrl();
if (!Objects.equals(url, currUrl)) {
getOrCreateComponentModel().url = url;
}
} | [
"public",
"void",
"setUrl",
"(",
"final",
"String",
"url",
")",
"{",
"String",
"currUrl",
"=",
"getUrl",
"(",
")",
";",
"if",
"(",
"!",
"Objects",
".",
"equals",
"(",
"url",
",",
"currUrl",
")",
")",
"{",
"getOrCreateComponentModel",
"(",
")",
".",
"... | Sets the URL.
@param url the URL to set. | [
"Sets",
"the",
"URL",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPopup.java#L116-L122 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPopup.java | WPopup.setTargetWindow | public void setTargetWindow(final String targetWindow) {
String currTargWin = getTargetWindow();
if (!Objects.equals(targetWindow, currTargWin)) {
getOrCreateComponentModel().targetWindow = targetWindow;
}
} | java | public void setTargetWindow(final String targetWindow) {
String currTargWin = getTargetWindow();
if (!Objects.equals(targetWindow, currTargWin)) {
getOrCreateComponentModel().targetWindow = targetWindow;
}
} | [
"public",
"void",
"setTargetWindow",
"(",
"final",
"String",
"targetWindow",
")",
"{",
"String",
"currTargWin",
"=",
"getTargetWindow",
"(",
")",
";",
"if",
"(",
"!",
"Objects",
".",
"equals",
"(",
"targetWindow",
",",
"currTargWin",
")",
")",
"{",
"getOrCre... | Sets the target window name.
@param targetWindow the target window name. | [
"Sets",
"the",
"target",
"window",
"name",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPopup.java#L138-L144 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/InfoDump.java | InfoDump.dumpWEnvironment | private void dumpWEnvironment() {
StringBuffer text = new StringBuffer();
Environment env = getEnvironment();
text.append("\n\nWEnvironment"
+ "\n------------");
text.append("\nAppId: ").append(env.getAppId());
text.append("\nBaseUrl: ").append(env.getBaseUrl());
text.append("\nHostFreeBaseUrl: ").ap... | java | private void dumpWEnvironment() {
StringBuffer text = new StringBuffer();
Environment env = getEnvironment();
text.append("\n\nWEnvironment"
+ "\n------------");
text.append("\nAppId: ").append(env.getAppId());
text.append("\nBaseUrl: ").append(env.getBaseUrl());
text.append("\nHostFreeBaseUrl: ").ap... | [
"private",
"void",
"dumpWEnvironment",
"(",
")",
"{",
"StringBuffer",
"text",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"Environment",
"env",
"=",
"getEnvironment",
"(",
")",
";",
"text",
".",
"append",
"(",
"\"\\n\\nWEnvironment\"",
"+",
"\"\\n------------\"",... | Appends the current environment to the console. | [
"Appends",
"the",
"current",
"environment",
"to",
"the",
"console",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/InfoDump.java#L87-L108 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Config.java | Config.copyConfiguration | public static Configuration copyConfiguration(final Configuration original) {
Configuration copy = new MapConfiguration(new HashMap<String, Object>());
for (Iterator<?> i = original.getKeys(); i.hasNext();) {
String key = (String) i.next();
Object value = original.getProperty(key);
if (value instanceof L... | java | public static Configuration copyConfiguration(final Configuration original) {
Configuration copy = new MapConfiguration(new HashMap<String, Object>());
for (Iterator<?> i = original.getKeys(); i.hasNext();) {
String key = (String) i.next();
Object value = original.getProperty(key);
if (value instanceof L... | [
"public",
"static",
"Configuration",
"copyConfiguration",
"(",
"final",
"Configuration",
"original",
")",
"{",
"Configuration",
"copy",
"=",
"new",
"MapConfiguration",
"(",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
")",
";",
"for",
"(",
... | Creates a deep-copy of the given configuration. This is useful for unit-testing.
@param original the configuration to copy.
@return a copy of the given configuration. | [
"Creates",
"a",
"deep",
"-",
"copy",
"of",
"the",
"given",
"configuration",
".",
"This",
"is",
"useful",
"for",
"unit",
"-",
"testing",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Config.java#L98-L113 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java | WFileWidget.getFileTypes | public List<String> getFileTypes() {
List<String> fileTypes = getComponentModel().fileTypes;
if (fileTypes == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(fileTypes);
} | java | public List<String> getFileTypes() {
List<String> fileTypes = getComponentModel().fileTypes;
if (fileTypes == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(fileTypes);
} | [
"public",
"List",
"<",
"String",
">",
"getFileTypes",
"(",
")",
"{",
"List",
"<",
"String",
">",
"fileTypes",
"=",
"getComponentModel",
"(",
")",
".",
"fileTypes",
";",
"if",
"(",
"fileTypes",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyL... | Returns a list of strings that determine the allowable file mime types accepted by the file input. If no types
have been added an empty list is returned. An empty list indicates that all file types are accepted.
@return The mime types accepted by this file input e.g. "text/plain", "text/html", "application/pdf". | [
"Returns",
"a",
"list",
"of",
"strings",
"that",
"determine",
"the",
"allowable",
"file",
"mime",
"types",
"accepted",
"by",
"the",
"file",
"input",
".",
"If",
"no",
"types",
"have",
"been",
"added",
"an",
"empty",
"list",
"is",
"returned",
".",
"An",
"e... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java#L62-L70 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java | WFileWidget.setFileTypes | public void setFileTypes(final String[] types) {
if (types == null) {
setFileTypes((List<String>) null);
} else {
setFileTypes(Arrays.asList(types));
}
} | java | public void setFileTypes(final String[] types) {
if (types == null) {
setFileTypes((List<String>) null);
} else {
setFileTypes(Arrays.asList(types));
}
} | [
"public",
"void",
"setFileTypes",
"(",
"final",
"String",
"[",
"]",
"types",
")",
"{",
"if",
"(",
"types",
"==",
"null",
")",
"{",
"setFileTypes",
"(",
"(",
"List",
"<",
"String",
">",
")",
"null",
")",
";",
"}",
"else",
"{",
"setFileTypes",
"(",
"... | Set each file type to be accepted by the WFileWidget.
@see #setFileTypes(java.util.List) for the file types
@param types The file types that will be accepted by the file input. | [
"Set",
"each",
"file",
"type",
"to",
"be",
"accepted",
"by",
"the",
"WFileWidget",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java#L79-L85 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java | WFileWidget.resetValidationState | private void resetValidationState() {
// if User Model exists it will be returned, othewise Shared Model is returned
final FileWidgetModel componentModel = getComponentModel();
// If Shared Model is returned then both fileType and fileSize are always valid
// If User Model is returned check if any if any is fal... | java | private void resetValidationState() {
// if User Model exists it will be returned, othewise Shared Model is returned
final FileWidgetModel componentModel = getComponentModel();
// If Shared Model is returned then both fileType and fileSize are always valid
// If User Model is returned check if any if any is fal... | [
"private",
"void",
"resetValidationState",
"(",
")",
"{",
"// if User Model exists it will be returned, othewise Shared Model is returned",
"final",
"FileWidgetModel",
"componentModel",
"=",
"getComponentModel",
"(",
")",
";",
"// If Shared Model is returned then both fileType and file... | Reset validation state. | [
"Reset",
"validation",
"state",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java#L213-L224 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java | WFileWidget.getInputStream | public InputStream getInputStream() throws IOException {
FileItemWrap wrapper = getValue();
if (wrapper != null) {
return wrapper.getInputStream();
}
return null;
} | java | public InputStream getInputStream() throws IOException {
FileItemWrap wrapper = getValue();
if (wrapper != null) {
return wrapper.getInputStream();
}
return null;
} | [
"public",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"IOException",
"{",
"FileItemWrap",
"wrapper",
"=",
"getValue",
"(",
")",
";",
"if",
"(",
"wrapper",
"!=",
"null",
")",
"{",
"return",
"wrapper",
".",
"getInputStream",
"(",
")",
";",
"}",
"ret... | Retrieves an input stream of the uploaded file's contents.
@return an input stream of the file's contents, or null if there was no file uploaded
@throws IOException if there is an error obtaining the input stream from the uploaded file. | [
"Retrieves",
"an",
"input",
"stream",
"of",
"the",
"uploaded",
"file",
"s",
"contents",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFileWidget.java#L325-L333 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTextArea.java | WTextArea.getData | @Override
public Object getData() {
Object data = super.getData();
if (isRichTextArea() && isSanitizeOnOutput() && data != null) {
return sanitizeOutputText(data.toString());
}
return data;
} | java | @Override
public Object getData() {
Object data = super.getData();
if (isRichTextArea() && isSanitizeOnOutput() && data != null) {
return sanitizeOutputText(data.toString());
}
return data;
} | [
"@",
"Override",
"public",
"Object",
"getData",
"(",
")",
"{",
"Object",
"data",
"=",
"super",
".",
"getData",
"(",
")",
";",
"if",
"(",
"isRichTextArea",
"(",
")",
"&&",
"isSanitizeOnOutput",
"(",
")",
"&&",
"data",
"!=",
"null",
")",
"{",
"return",
... | The data for this WTextArea. If the text area is not rich text its output is XML escaped so we can ignore
sanitization. If the text area is a rich text area then we check the sanitizeOnOutput flag as sanitization is
rather resource intensive.
@return The data for this WTextArea. | [
"The",
"data",
"for",
"this",
"WTextArea",
".",
"If",
"the",
"text",
"area",
"is",
"not",
"rich",
"text",
"its",
"output",
"is",
"XML",
"escaped",
"so",
"we",
"can",
"ignore",
"sanitization",
".",
"If",
"the",
"text",
"area",
"is",
"a",
"rich",
"text",... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTextArea.java#L31-L38 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTextArea.java | WTextArea.setData | @Override
public void setData(final Object data) {
if (isRichTextArea() && data instanceof String) {
super.setData(sanitizeInputText((String) data));
} else {
super.setData(data);
}
} | java | @Override
public void setData(final Object data) {
if (isRichTextArea() && data instanceof String) {
super.setData(sanitizeInputText((String) data));
} else {
super.setData(data);
}
} | [
"@",
"Override",
"public",
"void",
"setData",
"(",
"final",
"Object",
"data",
")",
"{",
"if",
"(",
"isRichTextArea",
"(",
")",
"&&",
"data",
"instanceof",
"String",
")",
"{",
"super",
".",
"setData",
"(",
"sanitizeInputText",
"(",
"(",
"String",
")",
"da... | Set data in this component. If the WTextArea is a rich text input we need to sanitize the input.
@param data The input data | [
"Set",
"data",
"in",
"this",
"component",
".",
"If",
"the",
"WTextArea",
"is",
"a",
"rich",
"text",
"input",
"we",
"need",
"to",
"sanitize",
"the",
"input",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTextArea.java#L45-L52 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/ValidationHelper.java | ValidationHelper.extractDiagnostics | public static List<Diagnostic> extractDiagnostics(final List<Diagnostic> diagnostics,
final int severity) {
ArrayList<Diagnostic> extract = new ArrayList<>();
for (Diagnostic diagnostic : diagnostics) {
if (diagnostic.getSeverity() == severity) {
extract.add(diagnostic);
}
}
return extract;
} | java | public static List<Diagnostic> extractDiagnostics(final List<Diagnostic> diagnostics,
final int severity) {
ArrayList<Diagnostic> extract = new ArrayList<>();
for (Diagnostic diagnostic : diagnostics) {
if (diagnostic.getSeverity() == severity) {
extract.add(diagnostic);
}
}
return extract;
} | [
"public",
"static",
"List",
"<",
"Diagnostic",
">",
"extractDiagnostics",
"(",
"final",
"List",
"<",
"Diagnostic",
">",
"diagnostics",
",",
"final",
"int",
"severity",
")",
"{",
"ArrayList",
"<",
"Diagnostic",
">",
"extract",
"=",
"new",
"ArrayList",
"<>",
"... | Extract diagnostics with a given severity from a list of Diagnostic objects. This is useful for picking errors
out from a list of diagnostics, for example.
@param diagnostics the list of diagnostics to look through.
@param severity the severity of diagnostics to extract.
@return a list of diagnostics with the given se... | [
"Extract",
"diagnostics",
"with",
"a",
"given",
"severity",
"from",
"a",
"list",
"of",
"Diagnostic",
"objects",
".",
"This",
"is",
"useful",
"for",
"picking",
"errors",
"out",
"from",
"a",
"list",
"of",
"diagnostics",
"for",
"example",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/ValidationHelper.java#L28-L39 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WCollapsibleRenderer.java | WCollapsibleRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WCollapsible collapsible = (WCollapsible) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent content = collapsible.getContent();
boolean collapsed = collapsible.isCollapsed();
xml.appen... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WCollapsible collapsible = (WCollapsible) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent content = collapsible.getContent();
boolean collapsed = collapsible.isCollapsed();
xml.appen... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WCollapsible",
"collapsible",
"=",
"(",
"WCollapsible",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
... | Paints the given WCollapsible.
@param component the WCollapsible to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WCollapsible",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WCollapsibleRenderer.java#L26-L89 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java | WMultiFileWidgetExample.toggleReadOnly | private void toggleReadOnly() {
allFiles.setReadOnly(!allFiles.isReadOnly());
imageFiles.setReadOnly(!imageFiles.isReadOnly());
textFiles.setReadOnly(!textFiles.isReadOnly());
pdfFiles.setReadOnly(!pdfFiles.isReadOnly());
} | java | private void toggleReadOnly() {
allFiles.setReadOnly(!allFiles.isReadOnly());
imageFiles.setReadOnly(!imageFiles.isReadOnly());
textFiles.setReadOnly(!textFiles.isReadOnly());
pdfFiles.setReadOnly(!pdfFiles.isReadOnly());
} | [
"private",
"void",
"toggleReadOnly",
"(",
")",
"{",
"allFiles",
".",
"setReadOnly",
"(",
"!",
"allFiles",
".",
"isReadOnly",
"(",
")",
")",
";",
"imageFiles",
".",
"setReadOnly",
"(",
"!",
"imageFiles",
".",
"isReadOnly",
"(",
")",
")",
";",
"textFiles",
... | Toggles the readonly state off all file widgets in the example. | [
"Toggles",
"the",
"readonly",
"state",
"off",
"all",
"file",
"widgets",
"in",
"the",
"example",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java#L175-L180 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java | WMultiFileWidgetExample.processFiles | private void processFiles() {
StringBuffer buf = new StringBuffer();
appendFileDetails(buf, allFiles);
appendFileDetails(buf, textFiles);
appendFileDetails(buf, pdfFiles);
console.setText(buf.toString());
} | java | private void processFiles() {
StringBuffer buf = new StringBuffer();
appendFileDetails(buf, allFiles);
appendFileDetails(buf, textFiles);
appendFileDetails(buf, pdfFiles);
console.setText(buf.toString());
} | [
"private",
"void",
"processFiles",
"(",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"appendFileDetails",
"(",
"buf",
",",
"allFiles",
")",
";",
"appendFileDetails",
"(",
"buf",
",",
"textFiles",
")",
";",
"appendFileDetails",
... | Outputs information on the uploaded files to the text area. | [
"Outputs",
"information",
"on",
"the",
"uploaded",
"files",
"to",
"the",
"text",
"area",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java#L185-L191 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java | WMultiFileWidgetExample.appendFileDetails | private void appendFileDetails(final StringBuffer buf, final WMultiFileWidget fileWidget) {
List<FileWidgetUpload> files = fileWidget.getFiles();
if (files != null) {
for (FileWidgetUpload file : files) {
String streamedSize;
try {
InputStream in = file.getFile().getInputStream();
int size =... | java | private void appendFileDetails(final StringBuffer buf, final WMultiFileWidget fileWidget) {
List<FileWidgetUpload> files = fileWidget.getFiles();
if (files != null) {
for (FileWidgetUpload file : files) {
String streamedSize;
try {
InputStream in = file.getFile().getInputStream();
int size =... | [
"private",
"void",
"appendFileDetails",
"(",
"final",
"StringBuffer",
"buf",
",",
"final",
"WMultiFileWidget",
"fileWidget",
")",
"{",
"List",
"<",
"FileWidgetUpload",
">",
"files",
"=",
"fileWidget",
".",
"getFiles",
"(",
")",
";",
"if",
"(",
"files",
"!=",
... | Appends details of the uploaded files to the given string buffer.
@param buf the buffer to append file details to.
@param fileWidget the WFieldWidget to obtain the files from. | [
"Appends",
"details",
"of",
"the",
"uploaded",
"files",
"to",
"the",
"given",
"string",
"buffer",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WMultiFileWidgetExample.java#L199-L223 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WContent.java | WContent.getUrl | public String getUrl() {
ContentAccess content = getContentAccess();
String mode = DisplayMode.PROMPT_TO_SAVE.equals(getDisplayMode()) ? "attach" : "inline";
// Check for a "static" resource
if (content instanceof InternalResource) {
String url = ((InternalResource) content).getTargetUrl();
// This magi... | java | public String getUrl() {
ContentAccess content = getContentAccess();
String mode = DisplayMode.PROMPT_TO_SAVE.equals(getDisplayMode()) ? "attach" : "inline";
// Check for a "static" resource
if (content instanceof InternalResource) {
String url = ((InternalResource) content).getTargetUrl();
// This magi... | [
"public",
"String",
"getUrl",
"(",
")",
"{",
"ContentAccess",
"content",
"=",
"getContentAccess",
"(",
")",
";",
"String",
"mode",
"=",
"DisplayMode",
".",
"PROMPT_TO_SAVE",
".",
"equals",
"(",
"getDisplayMode",
"(",
")",
")",
"?",
"\"attach\"",
":",
"\"inli... | Retrieves a dynamic URL which this targetable component can be accessed from.
@return the URL to access this targetable component. | [
"Retrieves",
"a",
"dynamic",
"URL",
"which",
"this",
"targetable",
"component",
"can",
"be",
"accessed",
"from",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WContent.java#L174-L214 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WListOptionsExample.java | WListOptionsExample.applySettings | private void applySettings() {
container.reset();
WList list = new WList((com.github.bordertech.wcomponents.WList.Type) ddType.getSelected());
List<String> selected = (List<String>) cgBeanFields.getSelected();
SimpleListRenderer renderer = new SimpleListRenderer(selected, cbRenderUsingFieldLayout.
isSelect... | java | private void applySettings() {
container.reset();
WList list = new WList((com.github.bordertech.wcomponents.WList.Type) ddType.getSelected());
List<String> selected = (List<String>) cgBeanFields.getSelected();
SimpleListRenderer renderer = new SimpleListRenderer(selected, cbRenderUsingFieldLayout.
isSelect... | [
"private",
"void",
"applySettings",
"(",
")",
"{",
"container",
".",
"reset",
"(",
")",
";",
"WList",
"list",
"=",
"new",
"WList",
"(",
"(",
"com",
".",
"github",
".",
"bordertech",
".",
"wcomponents",
".",
"WList",
".",
"Type",
")",
"ddType",
".",
"... | Apply settings is responsible for building the list to be displayed and adding it to the container. | [
"Apply",
"settings",
"is",
"responsible",
"for",
"building",
"the",
"list",
"to",
"be",
"displayed",
"and",
"adding",
"it",
"to",
"the",
"container",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WListOptionsExample.java#L142-L164 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WNumberFieldRenderer.java | WNumberFieldRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WNumberField field = (WNumberField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = field.isReadOnly();
BigDecimal value = field.getValue();
String userText = field.getText()... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WNumberField field = (WNumberField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = field.isReadOnly();
BigDecimal value = field.getValue();
String userText = field.getText()... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WNumberField",
"field",
"=",
"(",
"WNumberField",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"rende... | Paints the given WNumberField.
@param component the WNumberField to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WNumberField",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WNumberFieldRenderer.java#L25-L69 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/WhiteSpaceFilterPrintWriter.java | WhiteSpaceFilterPrintWriter.write | @Override
public void write(final int c) {
WhiteSpaceFilterStateMachine.StateChange change = stateMachine.nextState((char) c);
if (change.getOutputBytes() != null) {
for (int i = 0; i < change.getOutputBytes().length; i++) {
super.write(change.getOutputBytes()[i]);
}
}
if (!change.isSuppressCurrent... | java | @Override
public void write(final int c) {
WhiteSpaceFilterStateMachine.StateChange change = stateMachine.nextState((char) c);
if (change.getOutputBytes() != null) {
for (int i = 0; i < change.getOutputBytes().length; i++) {
super.write(change.getOutputBytes()[i]);
}
}
if (!change.isSuppressCurrent... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"final",
"int",
"c",
")",
"{",
"WhiteSpaceFilterStateMachine",
".",
"StateChange",
"change",
"=",
"stateMachine",
".",
"nextState",
"(",
"(",
"char",
")",
"c",
")",
";",
"if",
"(",
"change",
".",
"getOutputB... | Writes the given byte to the underlying output stream if it passes filtering.
@param c the byte to write. | [
"Writes",
"the",
"given",
"byte",
"to",
"the",
"underlying",
"output",
"stream",
"if",
"it",
"passes",
"filtering",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/WhiteSpaceFilterPrintWriter.java#L34-L47 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/WhiteSpaceFilterPrintWriter.java | WhiteSpaceFilterPrintWriter.write | @Override
public void write(final String string, final int off, final int len) {
for (int i = off; i < off + len; i++) {
write(string.charAt(i));
}
} | java | @Override
public void write(final String string, final int off, final int len) {
for (int i = off; i < off + len; i++) {
write(string.charAt(i));
}
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"final",
"String",
"string",
",",
"final",
"int",
"off",
",",
"final",
"int",
"len",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"off",
";",
"i",
"<",
"off",
"+",
"len",
";",
"i",
"++",
")",
"{",
"wri... | Writes the given String to the underlying output stream, filtering as necessary.
@param string the String to write.
@param off the position in the string to start writing data from.
@param len the number of characters to write. | [
"Writes",
"the",
"given",
"String",
"to",
"the",
"underlying",
"output",
"stream",
"filtering",
"as",
"necessary",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/WhiteSpaceFilterPrintWriter.java#L70-L75 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/Or.java | Or.execute | @Override
protected boolean execute(final Request request) {
for (Condition condition : conditions) {
if (condition.isTrue(request)) {
return true;
}
}
return false;
} | java | @Override
protected boolean execute(final Request request) {
for (Condition condition : conditions) {
if (condition.isTrue(request)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"protected",
"boolean",
"execute",
"(",
"final",
"Request",
"request",
")",
"{",
"for",
"(",
"Condition",
"condition",
":",
"conditions",
")",
"{",
"if",
"(",
"condition",
".",
"isTrue",
"(",
"request",
")",
")",
"{",
"return",
"true",
"... | Evaluates the condition using values on the Request. Note that this uses the short-circuit or operator, so
condition 'b' will not necessarily be evaluated.
@param request the request being processed.
@return true if either of the conditions are true, otherwise false | [
"Evaluates",
"the",
"condition",
"using",
"values",
"on",
"the",
"Request",
".",
"Note",
"that",
"this",
"uses",
"the",
"short",
"-",
"circuit",
"or",
"operator",
"so",
"condition",
"b",
"will",
"not",
"necessarily",
"be",
"evaluated",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/Or.java#L73-L82 | train |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/TQAssocBean.java | TQAssocBean.fetch | public R fetch(String properties) {
((TQRootBean) _root).query().fetch(_name, properties);
return _root;
} | java | public R fetch(String properties) {
((TQRootBean) _root).query().fetch(_name, properties);
return _root;
} | [
"public",
"R",
"fetch",
"(",
"String",
"properties",
")",
"{",
"(",
"(",
"TQRootBean",
")",
"_root",
")",
".",
"query",
"(",
")",
".",
"fetch",
"(",
"_name",
",",
"properties",
")",
";",
"return",
"_root",
";",
"}"
] | Eagerly fetch this association with the properties specified. | [
"Eagerly",
"fetch",
"this",
"association",
"with",
"the",
"properties",
"specified",
"."
] | 821650cb817c9c0fdcc97f93408dc79170b12423 | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQAssocBean.java#L58-L61 | train |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/TQAssocBean.java | TQAssocBean.fetchQuery | public R fetchQuery(String properties) {
((TQRootBean) _root).query().fetchQuery(_name, properties);
return _root;
} | java | public R fetchQuery(String properties) {
((TQRootBean) _root).query().fetchQuery(_name, properties);
return _root;
} | [
"public",
"R",
"fetchQuery",
"(",
"String",
"properties",
")",
"{",
"(",
"(",
"TQRootBean",
")",
"_root",
")",
".",
"query",
"(",
")",
".",
"fetchQuery",
"(",
"_name",
",",
"properties",
")",
";",
"return",
"_root",
";",
"}"
] | Eagerly fetch this association using a "query join" with the properties specified. | [
"Eagerly",
"fetch",
"this",
"association",
"using",
"a",
"query",
"join",
"with",
"the",
"properties",
"specified",
"."
] | 821650cb817c9c0fdcc97f93408dc79170b12423 | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQAssocBean.java#L66-L69 | train |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/TQAssocBean.java | TQAssocBean.fetchProperties | protected R fetchProperties(TQProperty<?>... props) {
((TQRootBean) _root).query().fetch(_name, properties(props));
return _root;
} | java | protected R fetchProperties(TQProperty<?>... props) {
((TQRootBean) _root).query().fetch(_name, properties(props));
return _root;
} | [
"protected",
"R",
"fetchProperties",
"(",
"TQProperty",
"<",
"?",
">",
"...",
"props",
")",
"{",
"(",
"(",
"TQRootBean",
")",
"_root",
")",
".",
"query",
"(",
")",
".",
"fetch",
"(",
"_name",
",",
"properties",
"(",
"props",
")",
")",
";",
"return",
... | Eagerly fetch this association fetching some of the properties. | [
"Eagerly",
"fetch",
"this",
"association",
"fetching",
"some",
"of",
"the",
"properties",
"."
] | 821650cb817c9c0fdcc97f93408dc79170b12423 | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQAssocBean.java#L83-L86 | train |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/TQAssocBean.java | TQAssocBean.properties | protected String properties(TQProperty<?>... props) {
StringBuilder selectProps = new StringBuilder(50);
for (int i = 0; i < props.length; i++) {
if (i > 0) {
selectProps.append(",");
}
selectProps.append(props[i].propertyName());
}
return selectProps.toString();
} | java | protected String properties(TQProperty<?>... props) {
StringBuilder selectProps = new StringBuilder(50);
for (int i = 0; i < props.length; i++) {
if (i > 0) {
selectProps.append(",");
}
selectProps.append(props[i].propertyName());
}
return selectProps.toString();
} | [
"protected",
"String",
"properties",
"(",
"TQProperty",
"<",
"?",
">",
"...",
"props",
")",
"{",
"StringBuilder",
"selectProps",
"=",
"new",
"StringBuilder",
"(",
"50",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"props",
".",
"length",
... | Append the properties as a comma delimited string. | [
"Append",
"the",
"properties",
"as",
"a",
"comma",
"delimited",
"string",
"."
] | 821650cb817c9c0fdcc97f93408dc79170b12423 | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQAssocBean.java#L107-L116 | train |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/TQAssocBean.java | TQAssocBean.filterMany | public R filterMany(ExpressionList<T> filter) {
@SuppressWarnings("unchecked")
ExpressionList<T> expressionList = (ExpressionList<T>) expr().filterMany(_name);
expressionList.addAll(filter);
return _root;
} | java | public R filterMany(ExpressionList<T> filter) {
@SuppressWarnings("unchecked")
ExpressionList<T> expressionList = (ExpressionList<T>) expr().filterMany(_name);
expressionList.addAll(filter);
return _root;
} | [
"public",
"R",
"filterMany",
"(",
"ExpressionList",
"<",
"T",
">",
"filter",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"ExpressionList",
"<",
"T",
">",
"expressionList",
"=",
"(",
"ExpressionList",
"<",
"T",
">",
")",
"expr",
"(",
")",
... | Apply a filter when fetching these beans. | [
"Apply",
"a",
"filter",
"when",
"fetching",
"these",
"beans",
"."
] | 821650cb817c9c0fdcc97f93408dc79170b12423 | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/TQAssocBean.java#L151-L157 | train |
podio/podio-java | src/main/java/com/podio/calendar/CalendarAPI.java | CalendarAPI.getApp | public List<Event> getApp(int appId, LocalDate dateFrom, LocalDate dateTo,
ReferenceType... types) {
return getCalendar("app/" + appId, dateFrom, dateTo, null, types);
} | java | public List<Event> getApp(int appId, LocalDate dateFrom, LocalDate dateTo,
ReferenceType... types) {
return getCalendar("app/" + appId, dateFrom, dateTo, null, types);
} | [
"public",
"List",
"<",
"Event",
">",
"getApp",
"(",
"int",
"appId",
",",
"LocalDate",
"dateFrom",
",",
"LocalDate",
"dateTo",
",",
"ReferenceType",
"...",
"types",
")",
"{",
"return",
"getCalendar",
"(",
"\"app/\"",
"+",
"appId",
",",
"dateFrom",
",",
"dat... | Returns the items and tasks that are related to the given app.
@param appId
The id of the app
@param dateFrom
The from date
@param dateTo
The to date
@param types
The types of events that should be returned. Leave out to get
all types of events.
@return The events in the calendar | [
"Returns",
"the",
"items",
"and",
"tasks",
"that",
"are",
"related",
"to",
"the",
"given",
"app",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/calendar/CalendarAPI.java#L63-L66 | train |
podio/podio-java | src/main/java/com/podio/calendar/CalendarAPI.java | CalendarAPI.getSpace | public List<Event> getSpace(int spaceId, LocalDate dateFrom,
LocalDate dateTo, ReferenceType... types) {
return getCalendar("space/" + spaceId, dateFrom, dateTo, null, types);
} | java | public List<Event> getSpace(int spaceId, LocalDate dateFrom,
LocalDate dateTo, ReferenceType... types) {
return getCalendar("space/" + spaceId, dateFrom, dateTo, null, types);
} | [
"public",
"List",
"<",
"Event",
">",
"getSpace",
"(",
"int",
"spaceId",
",",
"LocalDate",
"dateFrom",
",",
"LocalDate",
"dateTo",
",",
"ReferenceType",
"...",
"types",
")",
"{",
"return",
"getCalendar",
"(",
"\"space/\"",
"+",
"spaceId",
",",
"dateFrom",
","... | Returns all items and tasks that the user have access to in the given
space. Tasks with reference to other spaces are not returned or tasks
with no reference.
@param spaceId
The id of the space
@param dateFrom
The from date
@param dateTo
The to date
@param types
The types of events that should be returned. Leave out t... | [
"Returns",
"all",
"items",
"and",
"tasks",
"that",
"the",
"user",
"have",
"access",
"to",
"in",
"the",
"given",
"space",
".",
"Tasks",
"with",
"reference",
"to",
"other",
"spaces",
"are",
"not",
"returned",
"or",
"tasks",
"with",
"no",
"reference",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/calendar/CalendarAPI.java#L84-L87 | train |
podio/podio-java | src/main/java/com/podio/calendar/CalendarAPI.java | CalendarAPI.getGlobal | public List<Event> getGlobal(LocalDate dateFrom, LocalDate dateTo,
List<Integer> spaceIds, ReferenceType... types) {
return getCalendar("", dateFrom, dateTo, spaceIds, types);
} | java | public List<Event> getGlobal(LocalDate dateFrom, LocalDate dateTo,
List<Integer> spaceIds, ReferenceType... types) {
return getCalendar("", dateFrom, dateTo, spaceIds, types);
} | [
"public",
"List",
"<",
"Event",
">",
"getGlobal",
"(",
"LocalDate",
"dateFrom",
",",
"LocalDate",
"dateTo",
",",
"List",
"<",
"Integer",
">",
"spaceIds",
",",
"ReferenceType",
"...",
"types",
")",
"{",
"return",
"getCalendar",
"(",
"\"\"",
",",
"dateFrom",
... | Returns all items that the user have access to and all tasks that are
assigned to the user. The items and tasks can be filtered by a list of
space ids, but tasks without a reference will always be returned.
@param dateFrom
The from date
@param dateTo
The to date
@param types
The types of events that should be returned... | [
"Returns",
"all",
"items",
"that",
"the",
"user",
"have",
"access",
"to",
"and",
"all",
"tasks",
"that",
"are",
"assigned",
"to",
"the",
"user",
".",
"The",
"items",
"and",
"tasks",
"can",
"be",
"filtered",
"by",
"a",
"list",
"of",
"space",
"ids",
"but... | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/calendar/CalendarAPI.java#L103-L106 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WPasswordFieldRenderer.java | WPasswordFieldRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WPasswordField field = (WPasswordField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = field.isReadOnly();
xml.appendTagOpen(TAG_NAME);
xml.appendAttribute("id", component.... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WPasswordField field = (WPasswordField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = field.isReadOnly();
xml.appendTagOpen(TAG_NAME);
xml.appendAttribute("id", component.... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WPasswordField",
"field",
"=",
"(",
"WPasswordField",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"r... | Paints the given WPasswordField.
@param component the WPasswordField to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WPasswordField",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WPasswordFieldRenderer.java#L30-L75 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SafetyContainer.java | SafetyContainer.handleRequest | @Override
public void handleRequest(final Request request) {
if (!isInitialised()) {
getOrCreateComponentModel().delegate = new SafetyContainerDelegate(UIContextHolder.
getCurrent());
setInitialised(true);
}
try {
UIContext delegate = getComponentModel().delegate;
UIContextHolder.pushContext(de... | java | @Override
public void handleRequest(final Request request) {
if (!isInitialised()) {
getOrCreateComponentModel().delegate = new SafetyContainerDelegate(UIContextHolder.
getCurrent());
setInitialised(true);
}
try {
UIContext delegate = getComponentModel().delegate;
UIContextHolder.pushContext(de... | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"!",
"isInitialised",
"(",
")",
")",
"{",
"getOrCreateComponentModel",
"(",
")",
".",
"delegate",
"=",
"new",
"SafetyContainerDelegate",
"(",
"UIContex... | Override handleRequest in order to safely process the example component, which has been excluded from normal
WComponent processing.
@param request the request being responded to. | [
"Override",
"handleRequest",
"in",
"order",
"to",
"safely",
"process",
"the",
"example",
"component",
"which",
"has",
"been",
"excluded",
"from",
"normal",
"WComponent",
"processing",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SafetyContainer.java#L55-L86 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SafetyContainer.java | SafetyContainer.resetContent | public void resetContent() {
for (int i = 0; i < shim.getChildCount(); i++) {
WComponent child = shim.getChildAt(i);
child.reset();
}
removeAttribute(SafetyContainer.ERROR_KEY);
} | java | public void resetContent() {
for (int i = 0; i < shim.getChildCount(); i++) {
WComponent child = shim.getChildAt(i);
child.reset();
}
removeAttribute(SafetyContainer.ERROR_KEY);
} | [
"public",
"void",
"resetContent",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"shim",
".",
"getChildCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"WComponent",
"child",
"=",
"shim",
".",
"getChildAt",
"(",
"i",
")",
";",
"child"... | Resets the contents. | [
"Resets",
"the",
"contents",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SafetyContainer.java#L170-L177 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRadioButtonRenderer.java | WRadioButtonRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WRadioButton button = (WRadioButton) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = button.isReadOnly();
String value = button.getValue();
xml.appendTagOpen("ui:radiobutton... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WRadioButton button = (WRadioButton) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = button.isReadOnly();
String value = button.getValue();
xml.appendTagOpen("ui:radiobutton... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WRadioButton",
"button",
"=",
"(",
"WRadioButton",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"rend... | Paints the given WRadioButton.
@param component the WRadioButton to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WRadioButton",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRadioButtonRenderer.java#L24-L53 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTabGroupRenderer.java | WTabGroupRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTabGroup group = (WTabGroup) component;
paintChildren(group, renderContext);
} | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTabGroup group = (WTabGroup) component;
paintChildren(group, renderContext);
} | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WTabGroup",
"group",
"=",
"(",
"WTabGroup",
")",
"component",
";",
"paintChildren",
"(",
"group",
",",
"rende... | Paints the given WTabGroup.
@param component the WTabGroup to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WTabGroup",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTabGroupRenderer.java#L23-L27 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DefaultPageShell.java | DefaultPageShell.getApplicationTitle | private String getApplicationTitle(final UIContext uic) {
WComponent root = uic.getUI();
String title = root instanceof WApplication ? ((WApplication) root).getTitle() : null;
Map<String, String> params = uic.getEnvironment().getHiddenParameters();
String target = params.get(WWindow.WWINDOW_REQUEST_PARAM_KEY);... | java | private String getApplicationTitle(final UIContext uic) {
WComponent root = uic.getUI();
String title = root instanceof WApplication ? ((WApplication) root).getTitle() : null;
Map<String, String> params = uic.getEnvironment().getHiddenParameters();
String target = params.get(WWindow.WWINDOW_REQUEST_PARAM_KEY);... | [
"private",
"String",
"getApplicationTitle",
"(",
"final",
"UIContext",
"uic",
")",
"{",
"WComponent",
"root",
"=",
"uic",
".",
"getUI",
"(",
")",
";",
"String",
"title",
"=",
"root",
"instanceof",
"WApplication",
"?",
"(",
"(",
"WApplication",
")",
"root",
... | Retrieves the application title for the given context. This mess is required due to WWindow essentially existing
as a separate UI root. If WWindow is eventually removed, then we can just retrieve the title from the root
WApplication.
@param uic the context to check.
@return the current application title. | [
"Retrieves",
"the",
"application",
"title",
"for",
"the",
"given",
"context",
".",
"This",
"mess",
"is",
"required",
"due",
"to",
"WWindow",
"essentially",
"existing",
"as",
"a",
"separate",
"UI",
"root",
".",
"If",
"WWindow",
"is",
"eventually",
"removed",
... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/DefaultPageShell.java#L70-L91 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRowRendererRenderer.java | WDataTableRowRendererRenderer.getFilterValues | private String getFilterValues(final TableDataModel dataModel, final int rowIndex) {
List<String> filterValues = dataModel.getFilterValues(rowIndex);
if (filterValues == null || filterValues.isEmpty()) {
return null;
}
StringBuffer buf = new StringBuffer(filterValues.get(0));
for (int i = 1; i < filterV... | java | private String getFilterValues(final TableDataModel dataModel, final int rowIndex) {
List<String> filterValues = dataModel.getFilterValues(rowIndex);
if (filterValues == null || filterValues.isEmpty()) {
return null;
}
StringBuffer buf = new StringBuffer(filterValues.get(0));
for (int i = 1; i < filterV... | [
"private",
"String",
"getFilterValues",
"(",
"final",
"TableDataModel",
"dataModel",
",",
"final",
"int",
"rowIndex",
")",
"{",
"List",
"<",
"String",
">",
"filterValues",
"=",
"dataModel",
".",
"getFilterValues",
"(",
"rowIndex",
")",
";",
"if",
"(",
"filterV... | Retrieves the filter values for the given row in the data model, as a comma-separated string.
@param dataModel the data model.
@param rowIndex the row index.
@return the filter values string. | [
"Retrieves",
"the",
"filter",
"values",
"for",
"the",
"given",
"row",
"in",
"the",
"data",
"model",
"as",
"a",
"comma",
"-",
"separated",
"string",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRowRendererRenderer.java#L163-L178 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.getRenderer | public static Renderer getRenderer(final WComponent component, final RenderContext context) {
Class<? extends WComponent> clazz = component.getClass();
Duplet<String, Class<?>> key = new Duplet<String, Class<?>>(context.getRenderPackage(),
clazz);
Renderer renderer = INSTANCE.renderers.get(key);
if (rende... | java | public static Renderer getRenderer(final WComponent component, final RenderContext context) {
Class<? extends WComponent> clazz = component.getClass();
Duplet<String, Class<?>> key = new Duplet<String, Class<?>>(context.getRenderPackage(),
clazz);
Renderer renderer = INSTANCE.renderers.get(key);
if (rende... | [
"public",
"static",
"Renderer",
"getRenderer",
"(",
"final",
"WComponent",
"component",
",",
"final",
"RenderContext",
"context",
")",
"{",
"Class",
"<",
"?",
"extends",
"WComponent",
">",
"clazz",
"=",
"component",
".",
"getClass",
"(",
")",
";",
"Duplet",
... | Retrieves a renderer which can renderer the given component to the context.
@param component the component to retrieve the renderer for.
@param context the render context.
@return an appropriate renderer for the component and context, or null if a suitable renderer could not be found. | [
"Retrieves",
"a",
"renderer",
"which",
"can",
"renderer",
"the",
"given",
"component",
"to",
"the",
"context",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L120-L134 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.getTemplateRenderer | @Deprecated
public static Renderer getTemplateRenderer(final RenderContext context) {
String packageName = context.getRenderPackage();
Renderer renderer = INSTANCE.templateRenderers.get(packageName);
if (renderer == null) {
renderer = INSTANCE.findTemplateRenderer(packageName);
} else if (renderer == NULL_... | java | @Deprecated
public static Renderer getTemplateRenderer(final RenderContext context) {
String packageName = context.getRenderPackage();
Renderer renderer = INSTANCE.templateRenderers.get(packageName);
if (renderer == null) {
renderer = INSTANCE.findTemplateRenderer(packageName);
} else if (renderer == NULL_... | [
"@",
"Deprecated",
"public",
"static",
"Renderer",
"getTemplateRenderer",
"(",
"final",
"RenderContext",
"context",
")",
"{",
"String",
"packageName",
"=",
"context",
".",
"getRenderPackage",
"(",
")",
";",
"Renderer",
"renderer",
"=",
"INSTANCE",
".",
"templateRe... | Retrieves a renderer which can renderer templates for the given context.
@param context the render context.
@return an appropriate renderer for the component and context, or null if a suitable renderer could not be found.
@deprecated Use {@link WTemplate} instead. | [
"Retrieves",
"a",
"renderer",
"which",
"can",
"renderer",
"templates",
"for",
"the",
"given",
"context",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L143-L155 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.findTemplateRenderer | @Deprecated
private synchronized Renderer findTemplateRenderer(final String packageName) {
RendererFactory factory = INSTANCE.findRendererFactory(packageName);
Renderer renderer = factory.getTemplateRenderer();
if (renderer == null) {
templateRenderers.put(packageName, NULL_RENDERER);
} else {
templateR... | java | @Deprecated
private synchronized Renderer findTemplateRenderer(final String packageName) {
RendererFactory factory = INSTANCE.findRendererFactory(packageName);
Renderer renderer = factory.getTemplateRenderer();
if (renderer == null) {
templateRenderers.put(packageName, NULL_RENDERER);
} else {
templateR... | [
"@",
"Deprecated",
"private",
"synchronized",
"Renderer",
"findTemplateRenderer",
"(",
"final",
"String",
"packageName",
")",
"{",
"RendererFactory",
"factory",
"=",
"INSTANCE",
".",
"findRendererFactory",
"(",
"packageName",
")",
";",
"Renderer",
"renderer",
"=",
"... | Retrieves the template renderer for the given package.
@param packageName the package to retrieve the template renderer for.
@return the template renderer for the given package, or null if the package does not contain a template renderer.
@deprecated Use {@link WTemplate} instead. | [
"Retrieves",
"the",
"template",
"renderer",
"for",
"the",
"given",
"package",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L164-L176 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.getDefaultRenderer | @Deprecated
public static Renderer getDefaultRenderer(final WComponent component) {
LOG.warn("The getDefaultRenderer() method is deprecated. Do not obtain renderers directly.");
return getRenderer(component, new WebXmlRenderContext(new PrintWriter(new NullWriter())));
} | java | @Deprecated
public static Renderer getDefaultRenderer(final WComponent component) {
LOG.warn("The getDefaultRenderer() method is deprecated. Do not obtain renderers directly.");
return getRenderer(component, new WebXmlRenderContext(new PrintWriter(new NullWriter())));
} | [
"@",
"Deprecated",
"public",
"static",
"Renderer",
"getDefaultRenderer",
"(",
"final",
"WComponent",
"component",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"The getDefaultRenderer() method is deprecated. Do not obtain renderers directly.\"",
")",
";",
"return",
"getRenderer",
"(... | Retrieves the default LayoutManager for the given component. This method must no longer be used, as it will only
ever return a web-xml renderer.
@param component the component.
@return the LayoutManager for the given component.
@deprecated use {@link #getRenderer(WComponent, RenderContext)}. | [
"Retrieves",
"the",
"default",
"LayoutManager",
"for",
"the",
"given",
"component",
".",
"This",
"method",
"must",
"no",
"longer",
"be",
"used",
"as",
"it",
"will",
"only",
"ever",
"return",
"a",
"web",
"-",
"xml",
"renderer",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L187-L191 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.findRenderer | private synchronized Renderer findRenderer(final WComponent component,
final Duplet<String, Class<?>> key) {
LOG.info("Looking for layout for " + key.getSecond().getName() + " in " + key.getFirst());
Renderer renderer = findConfiguredRenderer(component, key.getFirst());
if (renderer == null) {
renderers.p... | java | private synchronized Renderer findRenderer(final WComponent component,
final Duplet<String, Class<?>> key) {
LOG.info("Looking for layout for " + key.getSecond().getName() + " in " + key.getFirst());
Renderer renderer = findConfiguredRenderer(component, key.getFirst());
if (renderer == null) {
renderers.p... | [
"private",
"synchronized",
"Renderer",
"findRenderer",
"(",
"final",
"WComponent",
"component",
",",
"final",
"Duplet",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"key",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Looking for layout for \"",
"+",
"key",
".",... | Finds the layout for the given theme and component.
@param component the WComponent class to find a manager for.
@param key the component key to use for caching the renderer.
@return the LayoutManager for the component. | [
"Finds",
"the",
"layout",
"for",
"the",
"given",
"theme",
"and",
"component",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L208-L221 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.findRendererFactory | private synchronized RendererFactory findRendererFactory(final String packageName) {
RendererFactory factory = factoriesByPackage.get(packageName);
if (factory == null) {
try {
factory = (RendererFactory) Class.forName(packageName + ".RendererFactoryImpl").
newInstance();
factoriesByPackage.put(pa... | java | private synchronized RendererFactory findRendererFactory(final String packageName) {
RendererFactory factory = factoriesByPackage.get(packageName);
if (factory == null) {
try {
factory = (RendererFactory) Class.forName(packageName + ".RendererFactoryImpl").
newInstance();
factoriesByPackage.put(pa... | [
"private",
"synchronized",
"RendererFactory",
"findRendererFactory",
"(",
"final",
"String",
"packageName",
")",
"{",
"RendererFactory",
"factory",
"=",
"factoriesByPackage",
".",
"get",
"(",
"packageName",
")",
";",
"if",
"(",
"factory",
"==",
"null",
")",
"{",
... | Finds the renderer factory for the given package.
@param packageName the package name to find the renderer factory for.
@return the RendererFactory for the given package, or null if not found. | [
"Finds",
"the",
"renderer",
"factory",
"for",
"the",
"given",
"package",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L229-L244 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.findConfiguredRenderer | private Renderer findConfiguredRenderer(final WComponent component, final String rendererPackage) {
Renderer renderer = null;
// We loop for each WComponent in the class hierarchy, as the
// Renderer may have been specified at a higher level.
for (Class<?> c = component.getClass(); renderer == null && c != nul... | java | private Renderer findConfiguredRenderer(final WComponent component, final String rendererPackage) {
Renderer renderer = null;
// We loop for each WComponent in the class hierarchy, as the
// Renderer may have been specified at a higher level.
for (Class<?> c = component.getClass(); renderer == null && c != nul... | [
"private",
"Renderer",
"findConfiguredRenderer",
"(",
"final",
"WComponent",
"component",
",",
"final",
"String",
"rendererPackage",
")",
"{",
"Renderer",
"renderer",
"=",
"null",
";",
"// We loop for each WComponent in the class hierarchy, as the",
"// Renderer may have been s... | Attempts to find the configured renderer for the given output format and component.
@param component the component to find a manager for.
@param rendererPackage the package containing the renderers.
@return the Renderer for the component, or null if there is no renderer defined. | [
"Attempts",
"to",
"find",
"the",
"configured",
"renderer",
"for",
"the",
"given",
"output",
"format",
"and",
"component",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L253-L280 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.createRenderer | private static Renderer createRenderer(final String rendererName) {
if (rendererName.endsWith(".vm")) {
// This is a velocity template, so use a VelocityLayout
return new VelocityRenderer(rendererName);
}
try {
Class<?> managerClass = Class.forName(rendererName);
Object manager = managerClass.newInst... | java | private static Renderer createRenderer(final String rendererName) {
if (rendererName.endsWith(".vm")) {
// This is a velocity template, so use a VelocityLayout
return new VelocityRenderer(rendererName);
}
try {
Class<?> managerClass = Class.forName(rendererName);
Object manager = managerClass.newInst... | [
"private",
"static",
"Renderer",
"createRenderer",
"(",
"final",
"String",
"rendererName",
")",
"{",
"if",
"(",
"rendererName",
".",
"endsWith",
"(",
"\".vm\"",
")",
")",
"{",
"// This is a velocity template, so use a VelocityLayout",
"return",
"new",
"VelocityRenderer"... | Attempts to create a Renderer with the given name.
@param rendererName the name of the Renderer
@return a Renderer of the given type, or null if the class was not found. | [
"Attempts",
"to",
"create",
"a",
"Renderer",
"with",
"the",
"given",
"name",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L288-L311 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxPollingWButtonExample.java | AjaxPollingWButtonExample.fakeServiceCall | private void fakeServiceCall() {
poller.enablePoll();
Cache.getCache().invalidate(DATA_KEY);
new Thread() {
@Override
public void run() {
try {
Thread.sleep(SERVICE_TIME);
Cache.getCache().put(DATA_KEY, "SUCCESS!");
} catch (InterruptedException e) {
LOG.error("Timed out calling serv... | java | private void fakeServiceCall() {
poller.enablePoll();
Cache.getCache().invalidate(DATA_KEY);
new Thread() {
@Override
public void run() {
try {
Thread.sleep(SERVICE_TIME);
Cache.getCache().put(DATA_KEY, "SUCCESS!");
} catch (InterruptedException e) {
LOG.error("Timed out calling serv... | [
"private",
"void",
"fakeServiceCall",
"(",
")",
"{",
"poller",
".",
"enablePoll",
"(",
")",
";",
"Cache",
".",
"getCache",
"(",
")",
".",
"invalidate",
"(",
"DATA_KEY",
")",
";",
"new",
"Thread",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",... | Fakes a service call, using the WorkManager for threading. | [
"Fakes",
"a",
"service",
"call",
"using",
"the",
"WorkManager",
"for",
"threading",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxPollingWButtonExample.java#L107-L123 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java | UicStats.analyseWC | public void analyseWC(final WComponent comp) {
if (comp == null) {
return;
}
statsByWCTree.put(comp, createWCTreeStats(comp));
} | java | public void analyseWC(final WComponent comp) {
if (comp == null) {
return;
}
statsByWCTree.put(comp, createWCTreeStats(comp));
} | [
"public",
"void",
"analyseWC",
"(",
"final",
"WComponent",
"comp",
")",
"{",
"if",
"(",
"comp",
"==",
"null",
")",
"{",
"return",
";",
"}",
"statsByWCTree",
".",
"put",
"(",
"comp",
",",
"createWCTreeStats",
"(",
"comp",
")",
")",
";",
"}"
] | Creates statistics for the given WComponent within the uicontext being analysed.
@param comp the component to create stats for. | [
"Creates",
"statistics",
"for",
"the",
"given",
"WComponent",
"within",
"the",
"uicontext",
"being",
"analysed",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java#L113-L119 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java | UicStats.addStats | private void addStats(final Map<WComponent, Stat> statsMap, final WComponent comp) {
Stat stat = createStat(comp);
statsMap.put(comp, stat);
if (comp instanceof Container) {
Container container = (Container) comp;
int childCount = container.getChildCount();
for (int i = 0; i < childCount; i++) {
WC... | java | private void addStats(final Map<WComponent, Stat> statsMap, final WComponent comp) {
Stat stat = createStat(comp);
statsMap.put(comp, stat);
if (comp instanceof Container) {
Container container = (Container) comp;
int childCount = container.getChildCount();
for (int i = 0; i < childCount; i++) {
WC... | [
"private",
"void",
"addStats",
"(",
"final",
"Map",
"<",
"WComponent",
",",
"Stat",
">",
"statsMap",
",",
"final",
"WComponent",
"comp",
")",
"{",
"Stat",
"stat",
"=",
"createStat",
"(",
"comp",
")",
";",
"statsMap",
".",
"put",
"(",
"comp",
",",
"stat... | Recursively adds statistics for a component and its children to the stats map.
@param statsMap the stats map to add to.
@param comp the component to analyse. | [
"Recursively",
"adds",
"statistics",
"for",
"a",
"component",
"and",
"its",
"children",
"to",
"the",
"stats",
"map",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java#L147-L160 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java | UicStats.createStat | private Stat createStat(final WComponent comp) {
Stat stat = new Stat();
stat.setClassName(comp.getClass().getName());
stat.setName(comp.getId());
if (stat.getName() == null) {
stat.setName("Unknown");
}
if (comp instanceof AbstractWComponent) {
Object obj = AbstractWComponent.replaceWComponent((Ab... | java | private Stat createStat(final WComponent comp) {
Stat stat = new Stat();
stat.setClassName(comp.getClass().getName());
stat.setName(comp.getId());
if (stat.getName() == null) {
stat.setName("Unknown");
}
if (comp instanceof AbstractWComponent) {
Object obj = AbstractWComponent.replaceWComponent((Ab... | [
"private",
"Stat",
"createStat",
"(",
"final",
"WComponent",
"comp",
")",
"{",
"Stat",
"stat",
"=",
"new",
"Stat",
"(",
")",
";",
"stat",
".",
"setClassName",
"(",
"comp",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"stat",
".",
... | Creates statistics for a component in the given context.
@param comp the component.
@return the stats for the given component in the given context. | [
"Creates",
"statistics",
"for",
"a",
"component",
"in",
"the",
"given",
"context",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java#L168-L199 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java | UicStats.getSerializationSize | private int getSerializationSize(final Object obj) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(obj);
oos.close();
byte[] bytes = bos.toByteArray();
return bytes.length;
} catch (IOException ex) {
// Unab... | java | private int getSerializationSize(final Object obj) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(obj);
oos.close();
byte[] bytes = bos.toByteArray();
return bytes.length;
} catch (IOException ex) {
// Unab... | [
"private",
"int",
"getSerializationSize",
"(",
"final",
"Object",
"obj",
")",
"{",
"try",
"{",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"oos",
"=",
"new",
"ObjectOutputStream",
"(",
"bos",
")",
";"... | Determines the serialized size of an object by serializng it to a byte array.
@param obj the object to find the serialized size of.
@return the serialized size of the given object, or -1 on error. | [
"Determines",
"the",
"serialized",
"size",
"of",
"an",
"object",
"by",
"serializng",
"it",
"to",
"a",
"byte",
"array",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/monitor/UicStats.java#L207-L220 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/DataTableBeanExample.java | DataTableBeanExample.createTable | private WDataTable createTable() {
WDataTable tbl = new WDataTable();
tbl.addColumn(new WTableColumn("First name", new WTextField()));
tbl.addColumn(new WTableColumn("Last name", new WTextField()));
tbl.addColumn(new WTableColumn("DOB", new WDateField()));
return tbl;
} | java | private WDataTable createTable() {
WDataTable tbl = new WDataTable();
tbl.addColumn(new WTableColumn("First name", new WTextField()));
tbl.addColumn(new WTableColumn("Last name", new WTextField()));
tbl.addColumn(new WTableColumn("DOB", new WDateField()));
return tbl;
} | [
"private",
"WDataTable",
"createTable",
"(",
")",
"{",
"WDataTable",
"tbl",
"=",
"new",
"WDataTable",
"(",
")",
";",
"tbl",
".",
"addColumn",
"(",
"new",
"WTableColumn",
"(",
"\"First name\"",
",",
"new",
"WTextField",
"(",
")",
")",
")",
";",
"tbl",
"."... | Creates and configures the table to be used by the example.
@return a new configured table. | [
"Creates",
"and",
"configures",
"the",
"table",
"to",
"be",
"used",
"by",
"the",
"example",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/DataTableBeanExample.java#L104-L110 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/link/RepeaterLinkExample.java | RepeaterLinkExample.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
if (!isInitialised()) {
MyData data = new MyData("Homer");
basic.setData(data);
List<MyData> dataList = new ArrayList<>();
dataList.add(new MyData("Homer"));
dataList.add(new MyData("Marge"));
dataList.add(new MyData("Bart"));... | java | @Override
protected void preparePaintComponent(final Request request) {
if (!isInitialised()) {
MyData data = new MyData("Homer");
basic.setData(data);
List<MyData> dataList = new ArrayList<>();
dataList.add(new MyData("Homer"));
dataList.add(new MyData("Marge"));
dataList.add(new MyData("Bart"));... | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"!",
"isInitialised",
"(",
")",
")",
"{",
"MyData",
"data",
"=",
"new",
"MyData",
"(",
"\"Homer\"",
")",
";",
"basic",
".",
"setData",
... | Override preparePaint to initialise the data the first time through.
@param request the request being responded to. | [
"Override",
"preparePaint",
"to",
"initialise",
"the",
"data",
"the",
"first",
"time",
"through",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/link/RepeaterLinkExample.java#L56-L91 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java | ObjectGraphNode.getSize | private int getSize(final String fieldType, final Object fieldValue) {
Integer fieldSize = SIMPLE_SIZES.get(fieldType);
if (fieldSize != null) {
if (PRIMITIVE_TYPES.contains(fieldType)) {
return fieldSize;
}
return OBJREF_SIZE + fieldSize;
} else if (fieldValue instanceof String) {
return (OBJRE... | java | private int getSize(final String fieldType, final Object fieldValue) {
Integer fieldSize = SIMPLE_SIZES.get(fieldType);
if (fieldSize != null) {
if (PRIMITIVE_TYPES.contains(fieldType)) {
return fieldSize;
}
return OBJREF_SIZE + fieldSize;
} else if (fieldValue instanceof String) {
return (OBJRE... | [
"private",
"int",
"getSize",
"(",
"final",
"String",
"fieldType",
",",
"final",
"Object",
"fieldValue",
")",
"{",
"Integer",
"fieldSize",
"=",
"SIMPLE_SIZES",
".",
"get",
"(",
"fieldType",
")",
";",
"if",
"(",
"fieldSize",
"!=",
"null",
")",
"{",
"if",
"... | Calculates the size of a field value obtained using the reflection API.
@param fieldType the Field's type (class), needed to return the correct values for primitives.
@param fieldValue the field's value (primitives are boxed).
@return an approximation of amount of memory the field occupies, in bytes. | [
"Calculates",
"the",
"size",
"of",
"a",
"field",
"value",
"obtained",
"using",
"the",
"reflection",
"API",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java#L177-L195 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java | ObjectGraphNode.toFlatSummary | private void toFlatSummary(final String indent, final StringBuffer buffer) {
buffer.append(indent);
ObjectGraphNode root = (ObjectGraphNode) getRoot();
double pct = 100.0 * getSize() / root.getSize();
buffer.append(getSize()).append(" (");
buffer.append(new DecimalFormat("0.0").format(pct));
buffer.append... | java | private void toFlatSummary(final String indent, final StringBuffer buffer) {
buffer.append(indent);
ObjectGraphNode root = (ObjectGraphNode) getRoot();
double pct = 100.0 * getSize() / root.getSize();
buffer.append(getSize()).append(" (");
buffer.append(new DecimalFormat("0.0").format(pct));
buffer.append... | [
"private",
"void",
"toFlatSummary",
"(",
"final",
"String",
"indent",
",",
"final",
"StringBuffer",
"buffer",
")",
"{",
"buffer",
".",
"append",
"(",
"indent",
")",
";",
"ObjectGraphNode",
"root",
"=",
"(",
"ObjectGraphNode",
")",
"getRoot",
"(",
")",
";",
... | Generates a flat format summary XML representation of this ObjectGraphNode.
@param indent the indent, for formatting.
@param buffer the StringBuffer to append the summary to. | [
"Generates",
"a",
"flat",
"format",
"summary",
"XML",
"representation",
"of",
"this",
"ObjectGraphNode",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java#L273-L298 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java | ObjectGraphNode.toXml | private void toXml(final String indent, final StringBuffer xml) {
String primitiveString = formatSimpleValue();
xml.append(indent);
xml.append(isPrimitive() ? "<primitive" : "<object");
if (refNode == null) {
xml.append(" id=\"").append(id).append('"');
if (fieldName != null) {
xml.append(" field=\... | java | private void toXml(final String indent, final StringBuffer xml) {
String primitiveString = formatSimpleValue();
xml.append(indent);
xml.append(isPrimitive() ? "<primitive" : "<object");
if (refNode == null) {
xml.append(" id=\"").append(id).append('"');
if (fieldName != null) {
xml.append(" field=\... | [
"private",
"void",
"toXml",
"(",
"final",
"String",
"indent",
",",
"final",
"StringBuffer",
"xml",
")",
"{",
"String",
"primitiveString",
"=",
"formatSimpleValue",
"(",
")",
";",
"xml",
".",
"append",
"(",
"indent",
")",
";",
"xml",
".",
"append",
"(",
"... | Emits an XML representation of this ObjectGraphNode.
@param indent the indent, for formatting.
@param xml the buffer to write XML output to. | [
"Emits",
"an",
"XML",
"representation",
"of",
"this",
"ObjectGraphNode",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphNode.java#L316-L371 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java | WButtonExample.addClientOnlyExamples | private void addClientOnlyExamples() {
// client command button
add(new WHeading(HeadingLevel.H2, "Client command buttons"));
add(new ExplanatoryText("These examples show buttons which do not submit the form"));
//client command buttons witho a command
WButton nothingButton = new WButton("Do nothing");
ad... | java | private void addClientOnlyExamples() {
// client command button
add(new WHeading(HeadingLevel.H2, "Client command buttons"));
add(new ExplanatoryText("These examples show buttons which do not submit the form"));
//client command buttons witho a command
WButton nothingButton = new WButton("Do nothing");
ad... | [
"private",
"void",
"addClientOnlyExamples",
"(",
")",
"{",
"// client command button",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"\"Client command buttons\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"These examples show ... | Examples showing use of client only buttons. | [
"Examples",
"showing",
"use",
"of",
"client",
"only",
"buttons",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java#L208-L229 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java | WButtonExample.addDefaultSubmitButtonExample | private void addDefaultSubmitButtonExample() {
add(new WHeading(HeadingLevel.H3, "Default submit button"));
add(new ExplanatoryText(
"This example shows how to use an image as the only content of a WButton. "
+ "In addition this text field submits the entire screen using the image button to the right of th... | java | private void addDefaultSubmitButtonExample() {
add(new WHeading(HeadingLevel.H3, "Default submit button"));
add(new ExplanatoryText(
"This example shows how to use an image as the only content of a WButton. "
+ "In addition this text field submits the entire screen using the image button to the right of th... | [
"private",
"void",
"addDefaultSubmitButtonExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"Default submit button\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"This example shows how to use an image as t... | Examples showing how to set a WButton as the default submit button for an input control. | [
"Examples",
"showing",
"how",
"to",
"set",
"a",
"WButton",
"as",
"the",
"default",
"submit",
"button",
"for",
"an",
"input",
"control",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java#L280-L311 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java | WButtonExample.addDisabledExamples | private void addDisabledExamples() {
add(new WHeading(HeadingLevel.H2, "Examples of disabled buttons"));
WPanel disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
FlowLayout.ContentAlignment.BASELINE));
add(disabledButtonLayout... | java | private void addDisabledExamples() {
add(new WHeading(HeadingLevel.H2, "Examples of disabled buttons"));
WPanel disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
FlowLayout.ContentAlignment.BASELINE));
add(disabledButtonLayout... | [
"private",
"void",
"addDisabledExamples",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"\"Examples of disabled buttons\"",
")",
")",
";",
"WPanel",
"disabledButtonLayoutPanel",
"=",
"new",
"WPanel",
"(",
"WPanel",
".",
"Type... | Examples of disabled buttons in various guises. | [
"Examples",
"of",
"disabled",
"buttons",
"in",
"various",
"guises",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java#L316-L370 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java | WButtonExample.addAntiPatternExamples | private void addAntiPatternExamples() {
add(new WHeading(HeadingLevel.H2, "WButton 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 WHeading(HeadingLeve... | java | private void addAntiPatternExamples() {
add(new WHeading(HeadingLevel.H2, "WButton 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 WHeading(HeadingLeve... | [
"private",
"void",
"addAntiPatternExamples",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"\"WButton anti-pattern examples\"",
")",
")",
";",
"add",
"(",
"new",
"WMessageBox",
"(",
"WMessageBox",
".",
"WARN",
",",
"\"These... | Examples of what not to do when using WButton. | [
"Examples",
"of",
"what",
"not",
"to",
"do",
"when",
"using",
"WButton",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java#L375-L391 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java | WButtonExample.handleRequest | @Override
public void handleRequest(final Request request) {
if (plainBtn.isPressed()) {
WMessages.getInstance(this).info("Plain button pressed.");
}
if (linkBtn.isPressed()) {
WMessages.getInstance(this).info("Link button pressed.");
}
} | java | @Override
public void handleRequest(final Request request) {
if (plainBtn.isPressed()) {
WMessages.getInstance(this).info("Plain button pressed.");
}
if (linkBtn.isPressed()) {
WMessages.getInstance(this).info("Link button pressed.");
}
} | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"plainBtn",
".",
"isPressed",
"(",
")",
")",
"{",
"WMessages",
".",
"getInstance",
"(",
"this",
")",
".",
"info",
"(",
"\"Plain button pressed.\"",
... | Override handleRequest in order to perform processing specific to this example. Normally, you would attach
actions to a button rather than calling "isPressed" on each button.
@param request the request being responded to. | [
"Override",
"handleRequest",
"in",
"order",
"to",
"perform",
"processing",
"specific",
"to",
"this",
"example",
".",
"Normally",
"you",
"would",
"attach",
"actions",
"to",
"a",
"button",
"rather",
"than",
"calling",
"isPressed",
"on",
"each",
"button",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WButtonExample.java#L407-L416 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java | SelectListUtil.containsOption | public static boolean containsOption(final List<?> options, final Object findOption) {
if (options != null) {
for (Object option : options) {
if (option instanceof OptionGroup) {
List<?> groupOptions = ((OptionGroup) option).getOptions();
if (groupOptions != null) {
for (Object nestedOption : g... | java | public static boolean containsOption(final List<?> options, final Object findOption) {
if (options != null) {
for (Object option : options) {
if (option instanceof OptionGroup) {
List<?> groupOptions = ((OptionGroup) option).getOptions();
if (groupOptions != null) {
for (Object nestedOption : g... | [
"public",
"static",
"boolean",
"containsOption",
"(",
"final",
"List",
"<",
"?",
">",
"options",
",",
"final",
"Object",
"findOption",
")",
"{",
"if",
"(",
"options",
"!=",
"null",
")",
"{",
"for",
"(",
"Object",
"option",
":",
"options",
")",
"{",
"if... | Iterate through the options to determine if an option exists.
@param options the list of options
@param findOption the option to search for
@return true if the list of options contains the option | [
"Iterate",
"through",
"the",
"options",
"to",
"determine",
"if",
"an",
"option",
"exists",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java#L28-L46 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java | SelectListUtil.getFirstOption | public static Object getFirstOption(final List<?> options) {
if (options != null) {
for (Object option : options) {
if (option instanceof OptionGroup) {
List<?> groupOptions = ((OptionGroup) option).getOptions();
if (groupOptions != null && !groupOptions.isEmpty()) {
return groupOptions.get(0);... | java | public static Object getFirstOption(final List<?> options) {
if (options != null) {
for (Object option : options) {
if (option instanceof OptionGroup) {
List<?> groupOptions = ((OptionGroup) option).getOptions();
if (groupOptions != null && !groupOptions.isEmpty()) {
return groupOptions.get(0);... | [
"public",
"static",
"Object",
"getFirstOption",
"(",
"final",
"List",
"<",
"?",
">",
"options",
")",
"{",
"if",
"(",
"options",
"!=",
"null",
")",
"{",
"for",
"(",
"Object",
"option",
":",
"options",
")",
"{",
"if",
"(",
"option",
"instanceof",
"Option... | Retrieve the first option. The first option maybe within an option group.
@param options the list of options
@return true the first option | [
"Retrieve",
"the",
"first",
"option",
".",
"The",
"first",
"option",
"maybe",
"within",
"an",
"option",
"group",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java#L139-L153 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java | SelectListUtil.isLegacyMatch | @Deprecated
private static boolean isLegacyMatch(final Object option, final Object data) {
// Support legacy matching, which supported setSelected using String representations...
String optionAsString = String.valueOf(option);
String matchAsString = String.valueOf(data);
boolean equal = Util.equals(optionAsStr... | java | @Deprecated
private static boolean isLegacyMatch(final Object option, final Object data) {
// Support legacy matching, which supported setSelected using String representations...
String optionAsString = String.valueOf(option);
String matchAsString = String.valueOf(data);
boolean equal = Util.equals(optionAsStr... | [
"@",
"Deprecated",
"private",
"static",
"boolean",
"isLegacyMatch",
"(",
"final",
"Object",
"option",
",",
"final",
"Object",
"data",
")",
"{",
"// Support legacy matching, which supported setSelected using String representations...",
"String",
"optionAsString",
"=",
"String"... | Check for legacy matching, which supported setSelected using String representations.
@param option the option to test for a match
@param data the test data value
@return true if the option is a legacy match
@deprecated Support for legacy matching will be removed | [
"Check",
"for",
"legacy",
"matching",
"which",
"supported",
"setSelected",
"using",
"String",
"representations",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java#L175-L182 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTemplateRenderer.java | WTemplateRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTemplate template = (WTemplate) component;
// Setup the context
Map<String, Object> context = new HashMap<>();
// Make the component available under the "wc" key.
context.put("wc", template);
// Load the... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTemplate template = (WTemplate) component;
// Setup the context
Map<String, Object> context = new HashMap<>();
// Make the component available under the "wc" key.
context.put("wc", template);
// Load the... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WTemplate",
"template",
"=",
"(",
"WTemplate",
")",
"component",
";",
"// Setup the context",
"Map",
"<",
"Stri... | Paints the given WTemplate.
@param component the WTemplate to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WTemplate",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTemplateRenderer.java#L28-L56 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/link/DisplayComponent.java | DisplayComponent.updateComponent | @Override
public void updateComponent(final Object data) {
MyData myData = (MyData) data;
name.setText("<B>" + myData.getName() + "</B>");
count.setText(String.valueOf(myData.getCount()));
} | java | @Override
public void updateComponent(final Object data) {
MyData myData = (MyData) data;
name.setText("<B>" + myData.getName() + "</B>");
count.setText(String.valueOf(myData.getCount()));
} | [
"@",
"Override",
"public",
"void",
"updateComponent",
"(",
"final",
"Object",
"data",
")",
"{",
"MyData",
"myData",
"=",
"(",
"MyData",
")",
"data",
";",
"name",
".",
"setText",
"(",
"\"<B>\"",
"+",
"myData",
".",
"getName",
"(",
")",
"+",
"\"</B>\"",
... | Copies data from the Model into the View.
@param data the MyData bean to set on the component. | [
"Copies",
"data",
"from",
"the",
"Model",
"into",
"the",
"View",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/repeater/link/DisplayComponent.java#L45-L50 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java | TransformXMLInterceptor.paint | @Override
public void paint(final RenderContext renderContext) {
if (!doTransform) {
super.paint(renderContext);
return;
}
if (!(renderContext instanceof WebXmlRenderContext)) {
LOG.warn("Unable to transform a " + renderContext);
super.paint(renderContext);
return;
}
LOG.debug("Transform XML... | java | @Override
public void paint(final RenderContext renderContext) {
if (!doTransform) {
super.paint(renderContext);
return;
}
if (!(renderContext instanceof WebXmlRenderContext)) {
LOG.warn("Unable to transform a " + renderContext);
super.paint(renderContext);
return;
}
LOG.debug("Transform XML... | [
"@",
"Override",
"public",
"void",
"paint",
"(",
"final",
"RenderContext",
"renderContext",
")",
"{",
"if",
"(",
"!",
"doTransform",
")",
"{",
"super",
".",
"paint",
"(",
"renderContext",
")",
";",
"return",
";",
"}",
"if",
"(",
"!",
"(",
"renderContext"... | Override paint to perform XML to HTML transformation.
@param renderContext the renderContext to send the output to. | [
"Override",
"paint",
"to",
"perform",
"XML",
"to",
"HTML",
"transformation",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java#L115-L172 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java | TransformXMLInterceptor.transform | private void transform(final String xml, final UIContext uic, final PrintWriter writer) {
Transformer transformer = newTransformer();
Source inputXml;
try {
inputXml = new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8")));
StreamResult result = new StreamResult(writer);
if (debugRequested) {... | java | private void transform(final String xml, final UIContext uic, final PrintWriter writer) {
Transformer transformer = newTransformer();
Source inputXml;
try {
inputXml = new StreamSource(new ByteArrayInputStream(xml.getBytes("utf-8")));
StreamResult result = new StreamResult(writer);
if (debugRequested) {... | [
"private",
"void",
"transform",
"(",
"final",
"String",
"xml",
",",
"final",
"UIContext",
"uic",
",",
"final",
"PrintWriter",
"writer",
")",
"{",
"Transformer",
"transformer",
"=",
"newTransformer",
"(",
")",
";",
"Source",
"inputXml",
";",
"try",
"{",
"inpu... | Transform the UI XML to HTML using the correct XSLT from the classpath.
@param xml The XML to transform.
@param uic The UIContext used to determine variables such as locale.
@param writer The result of the transformation will be written to this writer. | [
"Transform",
"the",
"UI",
"XML",
"to",
"HTML",
"using",
"the",
"correct",
"XSLT",
"from",
"the",
"classpath",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java#L181-L195 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java | TransformXMLInterceptor.initTemplates | private static Templates initTemplates() {
try {
URL xsltURL = ThemeUtil.class.getResource(RESOURCE_NAME);
if (xsltURL != null) {
Source xsltSource = new StreamSource(xsltURL.openStream(), xsltURL.toExternalForm());
TransformerFactory factory = new net.sf.saxon.TransformerFactoryImpl();
Templates te... | java | private static Templates initTemplates() {
try {
URL xsltURL = ThemeUtil.class.getResource(RESOURCE_NAME);
if (xsltURL != null) {
Source xsltSource = new StreamSource(xsltURL.openStream(), xsltURL.toExternalForm());
TransformerFactory factory = new net.sf.saxon.TransformerFactoryImpl();
Templates te... | [
"private",
"static",
"Templates",
"initTemplates",
"(",
")",
"{",
"try",
"{",
"URL",
"xsltURL",
"=",
"ThemeUtil",
".",
"class",
".",
"getResource",
"(",
"RESOURCE_NAME",
")",
";",
"if",
"(",
"xsltURL",
"!=",
"null",
")",
"{",
"Source",
"xsltSource",
"=",
... | Statically initialize the XSLT templates that are cached for all future transforms.
@return the XSLT Templates. | [
"Statically",
"initialize",
"the",
"XSLT",
"templates",
"that",
"are",
"cached",
"for",
"all",
"future",
"transforms",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java#L221-L237 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java | TransformXMLInterceptor.removeCorruptCharacters | private static String removeCorruptCharacters(final String input) {
if (Util.empty(input)) {
return input;
}
return ESCAPE_BAD_XML10.translate(input);
} | java | private static String removeCorruptCharacters(final String input) {
if (Util.empty(input)) {
return input;
}
return ESCAPE_BAD_XML10.translate(input);
} | [
"private",
"static",
"String",
"removeCorruptCharacters",
"(",
"final",
"String",
"input",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"input",
")",
")",
"{",
"return",
"input",
";",
"}",
"return",
"ESCAPE_BAD_XML10",
".",
"translate",
"(",
"input",
")... | Remove bad characters in XML.
@param input The String to escape.
@return the clean string | [
"Remove",
"bad",
"characters",
"in",
"XML",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor.java#L252-L257 | train |
podio/podio-java | src/main/java/com/podio/hook/HookAPI.java | HookAPI.create | public int create(Reference object, HookCreate create) {
return getResourceFactory()
.getApiResource(
"/hook/" + object.getType() + "/" + object.getId()
+ "/")
.entity(create, MediaType.APPLICATION_JSON)
.post(HookCreateResponse.class).getId();
} | java | public int create(Reference object, HookCreate create) {
return getResourceFactory()
.getApiResource(
"/hook/" + object.getType() + "/" + object.getId()
+ "/")
.entity(create, MediaType.APPLICATION_JSON)
.post(HookCreateResponse.class).getId();
} | [
"public",
"int",
"create",
"(",
"Reference",
"object",
",",
"HookCreate",
"create",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/hook/\"",
"+",
"object",
".",
"getType",
"(",
")",
"+",
"\"/\"",
"+",
"object",
".",
"ge... | Create a new hook on the given object.
@param object
The reference to the object the hook should be created on
@param create
The details for the new hook
@return The id of the newly created hook | [
"Create",
"a",
"new",
"hook",
"on",
"the",
"given",
"object",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/hook/HookAPI.java#L28-L35 | train |
podio/podio-java | src/main/java/com/podio/hook/HookAPI.java | HookAPI.get | public List<Hook> get(Reference object) {
return getResourceFactory().getApiResource(
"/hook/" + object.getType() + "/" + object.getId() + "/").get(
new GenericType<List<Hook>>() {
});
} | java | public List<Hook> get(Reference object) {
return getResourceFactory().getApiResource(
"/hook/" + object.getType() + "/" + object.getId() + "/").get(
new GenericType<List<Hook>>() {
});
} | [
"public",
"List",
"<",
"Hook",
">",
"get",
"(",
"Reference",
"object",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/hook/\"",
"+",
"object",
".",
"getType",
"(",
")",
"+",
"\"/\"",
"+",
"object",
".",
"getId",
"(",
... | Returns the hooks on the object.
@param object
The reference to the object to get hooks for
@return The list of hooks on the object | [
"Returns",
"the",
"hooks",
"on",
"the",
"object",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/hook/HookAPI.java#L55-L60 | train |
podio/podio-java | src/main/java/com/podio/hook/HookAPI.java | HookAPI.requestVerification | public void requestVerification(int id) {
getResourceFactory().getApiResource("/hook/" + id + "/verify/request")
.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
} | java | public void requestVerification(int id) {
getResourceFactory().getApiResource("/hook/" + id + "/verify/request")
.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
} | [
"public",
"void",
"requestVerification",
"(",
"int",
"id",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/hook/\"",
"+",
"id",
"+",
"\"/verify/request\"",
")",
".",
"entity",
"(",
"new",
"Empty",
"(",
")",
",",
"MediaType",
".",
... | Request the hook to be validated. This will cause the hook to send a
request to the URL with the parameter "type" set to "hook.verify" and
"code" set to the verification code. The endpoint must then call the
validate method with the code to complete the verification.
@param id
The id of the hook to be verified | [
"Request",
"the",
"hook",
"to",
"be",
"validated",
".",
"This",
"will",
"cause",
"the",
"hook",
"to",
"send",
"a",
"request",
"to",
"the",
"URL",
"with",
"the",
"parameter",
"type",
"set",
"to",
"hook",
".",
"verify",
"and",
"code",
"set",
"to",
"the",... | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/hook/HookAPI.java#L71-L74 | train |
podio/podio-java | src/main/java/com/podio/hook/HookAPI.java | HookAPI.validateVerification | public void validateVerification(int id, String code) {
getResourceFactory().getApiResource("/hook/" + id + "/verify/validate")
.entity(new HookValidate(code), MediaType.APPLICATION_JSON)
.post();
} | java | public void validateVerification(int id, String code) {
getResourceFactory().getApiResource("/hook/" + id + "/verify/validate")
.entity(new HookValidate(code), MediaType.APPLICATION_JSON)
.post();
} | [
"public",
"void",
"validateVerification",
"(",
"int",
"id",
",",
"String",
"code",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/hook/\"",
"+",
"id",
"+",
"\"/verify/validate\"",
")",
".",
"entity",
"(",
"new",
"HookValidate",
"(",
... | Validates the hook using the code received from the verify call. On
successful validation the hook will become active.
@param id
The id of the hook to be verified
@param code
The code received from the call to the endpoint | [
"Validates",
"the",
"hook",
"using",
"the",
"code",
"received",
"from",
"the",
"verify",
"call",
".",
"On",
"successful",
"validation",
"the",
"hook",
"will",
"become",
"active",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/hook/HookAPI.java#L85-L89 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WRadioButton.java | WRadioButton.handleRequest | @Override
public void handleRequest(final Request request) {
// Protect against client-side tampering of disabled/read-only fields.
if (isDisabled() || isReadOnly()) {
return;
}
RadioButtonGroup currentGroup = getGroup();
// Check if the group is not on the request (do nothing)
if (!currentGroup.isPre... | java | @Override
public void handleRequest(final Request request) {
// Protect against client-side tampering of disabled/read-only fields.
if (isDisabled() || isReadOnly()) {
return;
}
RadioButtonGroup currentGroup = getGroup();
// Check if the group is not on the request (do nothing)
if (!currentGroup.isPre... | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"// Protect against client-side tampering of disabled/read-only fields.",
"if",
"(",
"isDisabled",
"(",
")",
"||",
"isReadOnly",
"(",
")",
")",
"{",
"return",
";",
"}",... | This method will only process the request if the value for the group matches the button's value.
@param request the request being processed. | [
"This",
"method",
"will",
"only",
"process",
"the",
"request",
"if",
"the",
"value",
"for",
"the",
"group",
"matches",
"the",
"button",
"s",
"value",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WRadioButton.java#L68-L100 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WRadioButton.java | WRadioButton.setSelected | public void setSelected(final boolean selected) {
if (selected) {
if (isDisabled()) {
throw new IllegalStateException("Cannot select a disabled radio button");
}
getGroup().setSelectedValue(getValue());
} else if (isSelected()) {
// Clear selection
getGroup().setData(null);
}
} | java | public void setSelected(final boolean selected) {
if (selected) {
if (isDisabled()) {
throw new IllegalStateException("Cannot select a disabled radio button");
}
getGroup().setSelectedValue(getValue());
} else if (isSelected()) {
// Clear selection
getGroup().setData(null);
}
} | [
"public",
"void",
"setSelected",
"(",
"final",
"boolean",
"selected",
")",
"{",
"if",
"(",
"selected",
")",
"{",
"if",
"(",
"isDisabled",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot select a disabled radio button\"",
")",
";",
"... | Sets whether the radio button is selected.
@param selected true if the button should be selected, false if not | [
"Sets",
"whether",
"the",
"radio",
"button",
"is",
"selected",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WRadioButton.java#L126-L136 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.addJsUrl | public ApplicationResource addJsUrl(final String url) {
if (Util.empty(url)) {
throw new IllegalArgumentException("A URL must be provided.");
}
ApplicationResource res = new ApplicationResource(url);
addJsResource(res);
return res;
} | java | public ApplicationResource addJsUrl(final String url) {
if (Util.empty(url)) {
throw new IllegalArgumentException("A URL must be provided.");
}
ApplicationResource res = new ApplicationResource(url);
addJsResource(res);
return res;
} | [
"public",
"ApplicationResource",
"addJsUrl",
"(",
"final",
"String",
"url",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"url",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A URL must be provided.\"",
")",
";",
"}",
"ApplicationResource"... | Add custom javaScript located at the specified URL to be used by the Application.
@param url URL to a javaScript resource
@return the application resource in which the URL details are held | [
"Add",
"custom",
"javaScript",
"located",
"at",
"the",
"specified",
"URL",
"to",
"be",
"used",
"by",
"the",
"Application",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L168-L175 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.addJsFile | public ApplicationResource addJsFile(final String fileName) {
if (Util.empty(fileName)) {
throw new IllegalArgumentException("A file name must be provided.");
}
InternalResource resource = new InternalResource(fileName, fileName);
ApplicationResource res = new ApplicationResource(resource);
addJsResource(r... | java | public ApplicationResource addJsFile(final String fileName) {
if (Util.empty(fileName)) {
throw new IllegalArgumentException("A file name must be provided.");
}
InternalResource resource = new InternalResource(fileName, fileName);
ApplicationResource res = new ApplicationResource(resource);
addJsResource(r... | [
"public",
"ApplicationResource",
"addJsFile",
"(",
"final",
"String",
"fileName",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"fileName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A file name must be provided.\"",
")",
";",
"}",
"Int... | Add custom JavaScript held as an internal resource to be used by the application.
@param fileName the JavaScript file name
@return the application resource in which the resource details are held | [
"Add",
"custom",
"JavaScript",
"held",
"as",
"an",
"internal",
"resource",
"to",
"be",
"used",
"by",
"the",
"application",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L183-L191 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.addJsResource | public void addJsResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.jsResources == null) {
model.jsResources = new ArrayList<>();
} else if (model.jsResources.contains(resource)) {
return;
}
model.jsResources.add(resource);
MemoryUtil.checkS... | java | public void addJsResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.jsResources == null) {
model.jsResources = new ArrayList<>();
} else if (model.jsResources.contains(resource)) {
return;
}
model.jsResources.add(resource);
MemoryUtil.checkS... | [
"public",
"void",
"addJsResource",
"(",
"final",
"ApplicationResource",
"resource",
")",
"{",
"WApplicationModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"if",
"(",
"model",
".",
"jsResources",
"==",
"null",
")",
"{",
"model",
".",
"jsResource... | Add a custom javaScript resource that is to be loaded and used by the application.
@param resource the JavaScript resource | [
"Add",
"a",
"custom",
"javaScript",
"resource",
"that",
"is",
"to",
"be",
"loaded",
"and",
"used",
"by",
"the",
"application",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L198-L207 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.removeJsResource | public void removeJsResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.jsResources != null) {
model.jsResources.remove(resource);
}
} | java | public void removeJsResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.jsResources != null) {
model.jsResources.remove(resource);
}
} | [
"public",
"void",
"removeJsResource",
"(",
"final",
"ApplicationResource",
"resource",
")",
"{",
"WApplicationModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"if",
"(",
"model",
".",
"jsResources",
"!=",
"null",
")",
"{",
"model",
".",
"jsResou... | Remove a custom JavaScript resource.
@param resource the javaScript resource to remove | [
"Remove",
"a",
"custom",
"JavaScript",
"resource",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L221-L226 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.addCssUrl | public ApplicationResource addCssUrl(final String url) {
if (Util.empty(url)) {
throw new IllegalArgumentException("A URL must be provided.");
}
ApplicationResource res = new ApplicationResource(url);
addCssResource(res);
return res;
} | java | public ApplicationResource addCssUrl(final String url) {
if (Util.empty(url)) {
throw new IllegalArgumentException("A URL must be provided.");
}
ApplicationResource res = new ApplicationResource(url);
addCssResource(res);
return res;
} | [
"public",
"ApplicationResource",
"addCssUrl",
"(",
"final",
"String",
"url",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"url",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A URL must be provided.\"",
")",
";",
"}",
"ApplicationResource... | Add custom CSS located at the specified URL to be used by the Application.
@param url URL to a CSS resource
@return the application resource in which the URL details are held | [
"Add",
"custom",
"CSS",
"located",
"at",
"the",
"specified",
"URL",
"to",
"be",
"used",
"by",
"the",
"Application",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L245-L252 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.addCssFile | public ApplicationResource addCssFile(final String fileName) {
if (Util.empty(fileName)) {
throw new IllegalArgumentException("A file name must be provided.");
}
InternalResource resource = new InternalResource(fileName, fileName);
ApplicationResource res = new ApplicationResource(resource);
addCssResource... | java | public ApplicationResource addCssFile(final String fileName) {
if (Util.empty(fileName)) {
throw new IllegalArgumentException("A file name must be provided.");
}
InternalResource resource = new InternalResource(fileName, fileName);
ApplicationResource res = new ApplicationResource(resource);
addCssResource... | [
"public",
"ApplicationResource",
"addCssFile",
"(",
"final",
"String",
"fileName",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"fileName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A file name must be provided.\"",
")",
";",
"}",
"In... | Add custom CSS held as an internal resource to be used by the Application.
@param fileName the CSS file name
@return the application resource in which the resource details are held | [
"Add",
"custom",
"CSS",
"held",
"as",
"an",
"internal",
"resource",
"to",
"be",
"used",
"by",
"the",
"Application",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L260-L268 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.addCssResource | public void addCssResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.cssResources == null) {
model.cssResources = new ArrayList<>();
} else if (model.cssResources.contains(resource)) {
return;
}
model.cssResources.add(resource);
MemoryUtil.c... | java | public void addCssResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.cssResources == null) {
model.cssResources = new ArrayList<>();
} else if (model.cssResources.contains(resource)) {
return;
}
model.cssResources.add(resource);
MemoryUtil.c... | [
"public",
"void",
"addCssResource",
"(",
"final",
"ApplicationResource",
"resource",
")",
"{",
"WApplicationModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"if",
"(",
"model",
".",
"cssResources",
"==",
"null",
")",
"{",
"model",
".",
"cssResou... | Add a custom CSS resource that will be loaded and used by this application.
@param resource the CSS resource | [
"Add",
"a",
"custom",
"CSS",
"resource",
"that",
"will",
"be",
"loaded",
"and",
"used",
"by",
"this",
"application",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L275-L284 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java | WApplication.removeCssResource | public void removeCssResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.cssResources != null) {
model.cssResources.remove(resource);
}
} | java | public void removeCssResource(final ApplicationResource resource) {
WApplicationModel model = getOrCreateComponentModel();
if (model.cssResources != null) {
model.cssResources.remove(resource);
}
} | [
"public",
"void",
"removeCssResource",
"(",
"final",
"ApplicationResource",
"resource",
")",
"{",
"WApplicationModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"if",
"(",
"model",
".",
"cssResources",
"!=",
"null",
")",
"{",
"model",
".",
"cssRe... | Remove a custom CSS resource.
@param resource the CSS resource to remove | [
"Remove",
"a",
"custom",
"CSS",
"resource",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WApplication.java#L298-L303 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java | AbstractInput.validateComponent | @Override
protected void validateComponent(final List<Diagnostic> diags) {
// Mandatory validation
if (isMandatory() && isEmpty()) {
diags.add(createMandatoryDiagnostic());
}
// Other validations
List<FieldValidator> validators = getComponentModel().validators;
if (validators != null) {
for (FieldV... | java | @Override
protected void validateComponent(final List<Diagnostic> diags) {
// Mandatory validation
if (isMandatory() && isEmpty()) {
diags.add(createMandatoryDiagnostic());
}
// Other validations
List<FieldValidator> validators = getComponentModel().validators;
if (validators != null) {
for (FieldV... | [
"@",
"Override",
"protected",
"void",
"validateComponent",
"(",
"final",
"List",
"<",
"Diagnostic",
">",
"diags",
")",
"{",
"// Mandatory validation",
"if",
"(",
"isMandatory",
"(",
")",
"&&",
"isEmpty",
"(",
")",
")",
"{",
"diags",
".",
"add",
"(",
"creat... | Override WComponent's validatorComponent in order to use the validators which have been added to this input
field. Subclasses may still override this method, but it is suggested to call super.validateComponent to ensure
that the validators are still used.
@param diags the list into which any validation diagnostics are... | [
"Override",
"WComponent",
"s",
"validatorComponent",
"in",
"order",
"to",
"use",
"the",
"validators",
"which",
"have",
"been",
"added",
"to",
"this",
"input",
"field",
".",
"Subclasses",
"may",
"still",
"override",
"this",
"method",
"but",
"it",
"is",
"suggest... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java#L67-L82 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java | AbstractInput.setChangedInLastRequest | protected void setChangedInLastRequest(final boolean changed) {
if (isChangedInLastRequest() != changed) {
InputModel model = getOrCreateComponentModel();
model.changedInLastRequest = changed;
}
} | java | protected void setChangedInLastRequest(final boolean changed) {
if (isChangedInLastRequest() != changed) {
InputModel model = getOrCreateComponentModel();
model.changedInLastRequest = changed;
}
} | [
"protected",
"void",
"setChangedInLastRequest",
"(",
"final",
"boolean",
"changed",
")",
"{",
"if",
"(",
"isChangedInLastRequest",
"(",
")",
"!=",
"changed",
")",
"{",
"InputModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"model",
".",
"changed... | Set the changed flag to indicate if the component changed in the last request.
@param changed true if the value changed in the request | [
"Set",
"the",
"changed",
"flag",
"to",
"indicate",
"if",
"the",
"component",
"changed",
"in",
"the",
"last",
"request",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java#L373-L378 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WHiddenCommentRenderer.java | WHiddenCommentRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WHiddenComment hiddenComponent = (WHiddenComment) component;
XmlStringBuilder xml = renderContext.getWriter();
String hiddenText = hiddenComponent.getText();
if (!Util.empty(hiddenText)) {
xml.appendTag("... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WHiddenComment hiddenComponent = (WHiddenComment) component;
XmlStringBuilder xml = renderContext.getWriter();
String hiddenText = hiddenComponent.getText();
if (!Util.empty(hiddenText)) {
xml.appendTag("... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WHiddenComment",
"hiddenComponent",
"=",
"(",
"WHiddenComment",
")",
"component",
";",
"XmlStringBuilder",
"xml",
... | Paints the given WHiddenComment.
@param component the WHiddenComment to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WHiddenComment",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WHiddenCommentRenderer.java#L24-L36 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SimpleTableModel.java | SimpleTableModel.setComparator | public void setComparator(final int col, final Comparator comparator) {
synchronized (this) {
if (comparators == null) {
comparators = new HashMap<>();
}
}
if (comparator == null) {
comparators.remove(col);
} else {
comparators.put(col, comparator);
}
} | java | public void setComparator(final int col, final Comparator comparator) {
synchronized (this) {
if (comparators == null) {
comparators = new HashMap<>();
}
}
if (comparator == null) {
comparators.remove(col);
} else {
comparators.put(col, comparator);
}
} | [
"public",
"void",
"setComparator",
"(",
"final",
"int",
"col",
",",
"final",
"Comparator",
"comparator",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"comparators",
"==",
"null",
")",
"{",
"comparators",
"=",
"new",
"HashMap",
"<>",
"(",
"... | Sets the comparator for the given column, to enable sorting.
@param col the column to set the comparator on.
@param comparator the comparator to set. | [
"Sets",
"the",
"comparator",
"for",
"the",
"given",
"column",
"to",
"enable",
"sorting",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SimpleTableModel.java#L86-L98 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.