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/WTabSet.java | WTabSet.getTabIndex | public int getTabIndex(final WComponent content) {
List<WTab> tabs = getTabs();
final int count = tabs.size();
for (int i = 0; i < count; i++) {
WTab tab = tabs.get(i);
if (content == tab.getContent()) {
return i;
}
}
return -1;
} | java | public int getTabIndex(final WComponent content) {
List<WTab> tabs = getTabs();
final int count = tabs.size();
for (int i = 0; i < count; i++) {
WTab tab = tabs.get(i);
if (content == tab.getContent()) {
return i;
}
}
return -1;
} | [
"public",
"int",
"getTabIndex",
"(",
"final",
"WComponent",
"content",
")",
"{",
"List",
"<",
"WTab",
">",
"tabs",
"=",
"getTabs",
"(",
")",
";",
"final",
"int",
"count",
"=",
"tabs",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Retrieves the tab index for the given tab content.
@param content the tab content
@return the tab index, or -1 if the content is not in a tab in this tab set. | [
"Retrieves",
"the",
"tab",
"index",
"for",
"the",
"given",
"tab",
"content",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java#L566-L579 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java | WTabSet.clientIndexToTabIndex | private int clientIndexToTabIndex(final int clientIndex) {
int childCount = getTotalTabs();
int serverIndex = clientIndex;
for (int i = 0; i <= serverIndex && i < childCount; i++) {
if (!isTabVisible(i)) {
serverIndex++;
}
}
return serverIndex;
} | java | private int clientIndexToTabIndex(final int clientIndex) {
int childCount = getTotalTabs();
int serverIndex = clientIndex;
for (int i = 0; i <= serverIndex && i < childCount; i++) {
if (!isTabVisible(i)) {
serverIndex++;
}
}
return serverIndex;
} | [
"private",
"int",
"clientIndexToTabIndex",
"(",
"final",
"int",
"clientIndex",
")",
"{",
"int",
"childCount",
"=",
"getTotalTabs",
"(",
")",
";",
"int",
"serverIndex",
"=",
"clientIndex",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<=",
"serverIndex"... | The client-side tab indices will differ from the WTabSet's indices when one or more tabs are invisible.
@param clientIndex the client-side index
@return the WTabSet index corresponding to the given client index | [
"The",
"client",
"-",
"side",
"tab",
"indices",
"will",
"differ",
"from",
"the",
"WTabSet",
"s",
"indices",
"when",
"one",
"or",
"more",
"tabs",
"are",
"invisible",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java#L698-L709 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java | WTabSet.getGroupName | public String getGroupName() {
if (TabSetType.ACCORDION.equals(getType())) {
CollapsibleGroup group = getComponentModel().group;
return (group == null ? null : group.getGroupName());
}
return null;
} | java | public String getGroupName() {
if (TabSetType.ACCORDION.equals(getType())) {
CollapsibleGroup group = getComponentModel().group;
return (group == null ? null : group.getGroupName());
}
return null;
} | [
"public",
"String",
"getGroupName",
"(",
")",
"{",
"if",
"(",
"TabSetType",
".",
"ACCORDION",
".",
"equals",
"(",
"getType",
"(",
")",
")",
")",
"{",
"CollapsibleGroup",
"group",
"=",
"getComponentModel",
"(",
")",
".",
"group",
";",
"return",
"(",
"grou... | The "collapsible" group name that this tabset belongs to.
@return the collapsible group name | [
"The",
"collapsible",
"group",
"name",
"that",
"this",
"tabset",
"belongs",
"to",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTabSet.java#L820-L826 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java | ColumnMenuExample.buildColumnMenu | private WMenu buildColumnMenu(final WText selectedMenuText) {
WMenu menu = new WMenu(WMenu.MenuType.COLUMN);
menu.setSelectMode(SelectMode.SINGLE);
menu.setRows(8);
StringTreeNode root = getOrgHierarchyTree();
mapColumnHierarchy(menu, root, selectedMenuText);
// Demonstrate different menu modes
getSubMe... | java | private WMenu buildColumnMenu(final WText selectedMenuText) {
WMenu menu = new WMenu(WMenu.MenuType.COLUMN);
menu.setSelectMode(SelectMode.SINGLE);
menu.setRows(8);
StringTreeNode root = getOrgHierarchyTree();
mapColumnHierarchy(menu, root, selectedMenuText);
// Demonstrate different menu modes
getSubMe... | [
"private",
"WMenu",
"buildColumnMenu",
"(",
"final",
"WText",
"selectedMenuText",
")",
"{",
"WMenu",
"menu",
"=",
"new",
"WMenu",
"(",
"WMenu",
".",
"MenuType",
".",
"COLUMN",
")",
";",
"menu",
".",
"setSelectMode",
"(",
"SelectMode",
".",
"SINGLE",
")",
"... | Builds up a column menu for inclusion in the example.
@param selectedMenuText the WText to display the selected menu.
@return a column menu for the example. | [
"Builds",
"up",
"a",
"column",
"menu",
"for",
"inclusion",
"in",
"the",
"example",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java#L53-L77 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java | ColumnMenuExample.getOrgHierarchyTree | private StringTreeNode getOrgHierarchyTree() {
// Hierarchical data in a flat format.
// If an Object array contains 1 String element, it is a leaf node.
// Else an Object array contains 1 String element + object arrays and is a branch node.
Object[] data = new Object[]{
"Australia",
new Object[]{"ACT"},
... | java | private StringTreeNode getOrgHierarchyTree() {
// Hierarchical data in a flat format.
// If an Object array contains 1 String element, it is a leaf node.
// Else an Object array contains 1 String element + object arrays and is a branch node.
Object[] data = new Object[]{
"Australia",
new Object[]{"ACT"},
... | [
"private",
"StringTreeNode",
"getOrgHierarchyTree",
"(",
")",
"{",
"// Hierarchical data in a flat format.",
"// If an Object array contains 1 String element, it is a leaf node.",
"// Else an Object array contains 1 String element + object arrays and is a branch node.",
"Object",
"[",
"]",
"... | Builds an organisation hierarchy tree for the column menu example.
@return an organisation hierarchy tree. | [
"Builds",
"an",
"organisation",
"hierarchy",
"tree",
"for",
"the",
"column",
"menu",
"example",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java#L128-L206 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java | ColumnMenuExample.buildOrgHierarchyTree | private StringTreeNode buildOrgHierarchyTree(final Object[] data) {
StringTreeNode childNode = new StringTreeNode((String) data[0]);
if (data.length > 1) {
for (int i = 1; i < data.length; i++) {
childNode.add(buildOrgHierarchyTree((Object[]) data[i]));
}
}
return childNode;
} | java | private StringTreeNode buildOrgHierarchyTree(final Object[] data) {
StringTreeNode childNode = new StringTreeNode((String) data[0]);
if (data.length > 1) {
for (int i = 1; i < data.length; i++) {
childNode.add(buildOrgHierarchyTree((Object[]) data[i]));
}
}
return childNode;
} | [
"private",
"StringTreeNode",
"buildOrgHierarchyTree",
"(",
"final",
"Object",
"[",
"]",
"data",
")",
"{",
"StringTreeNode",
"childNode",
"=",
"new",
"StringTreeNode",
"(",
"(",
"String",
")",
"data",
"[",
"0",
"]",
")",
";",
"if",
"(",
"data",
".",
"length... | Builds one level of the org hierarchy tree.
The data parameter should either contain a single String, or a String plus data arrays for child nodes.
@param data the node data.
@return the tree node created from the data. | [
"Builds",
"one",
"level",
"of",
"the",
"org",
"hierarchy",
"tree",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java#L216-L226 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java | ColumnMenuExample.getSubMenuByText | private WSubMenu getSubMenuByText(final String text, final WComponent node) {
if (node instanceof WSubMenu) {
WSubMenu subMenu = (WSubMenu) node;
if (text.equals(subMenu.getText())) {
return subMenu;
}
for (MenuItem item : subMenu.getMenuItems()) {
WSubMenu result = getSubMenuByText(text, item);
... | java | private WSubMenu getSubMenuByText(final String text, final WComponent node) {
if (node instanceof WSubMenu) {
WSubMenu subMenu = (WSubMenu) node;
if (text.equals(subMenu.getText())) {
return subMenu;
}
for (MenuItem item : subMenu.getMenuItems()) {
WSubMenu result = getSubMenuByText(text, item);
... | [
"private",
"WSubMenu",
"getSubMenuByText",
"(",
"final",
"String",
"text",
",",
"final",
"WComponent",
"node",
")",
"{",
"if",
"(",
"node",
"instanceof",
"WSubMenu",
")",
"{",
"WSubMenu",
"subMenu",
"=",
"(",
"WSubMenu",
")",
"node",
";",
"if",
"(",
"text"... | Retrieves a sub menu by its text.
@param text the text to search for.
@param node the current node in the WComponent tree.
@return the sub menu with the given text, or null if not found. | [
"Retrieves",
"a",
"sub",
"menu",
"by",
"its",
"text",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/ColumnMenuExample.java#L235-L259 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/SpaceUtil.java | SpaceUtil.intToSize | @Deprecated
public static Size intToSize(final int convert) {
// NOTE: no zero size margin in the old versions.
if (convert <= 0) {
return null;
}
if (convert <= MAX_SMALL) {
return Size.SMALL;
}
if (convert <= MAX_MED) {
return Size.MEDIUM;
}
if (convert <= MAX_LARGE) {
return Size.LARGE;
... | java | @Deprecated
public static Size intToSize(final int convert) {
// NOTE: no zero size margin in the old versions.
if (convert <= 0) {
return null;
}
if (convert <= MAX_SMALL) {
return Size.SMALL;
}
if (convert <= MAX_MED) {
return Size.MEDIUM;
}
if (convert <= MAX_LARGE) {
return Size.LARGE;
... | [
"@",
"Deprecated",
"public",
"static",
"Size",
"intToSize",
"(",
"final",
"int",
"convert",
")",
"{",
"// NOTE: no zero size margin in the old versions.",
"if",
"(",
"convert",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"convert",
"<=",
"MAX_S... | Convert an int space to a Size. For backwards compatibility during conversion of int spaces to Size spaces.
@param convert the int size to convert
@return a Size appropriate to the int | [
"Convert",
"an",
"int",
"space",
"to",
"a",
"Size",
".",
"For",
"backwards",
"compatibility",
"during",
"conversion",
"of",
"int",
"spaces",
"to",
"Size",
"spaces",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/SpaceUtil.java#L49-L65 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/SpaceUtil.java | SpaceUtil.sizeToInt | @Deprecated
public static int sizeToInt(final Size size) {
if (size == null) {
return -1;
}
switch (size) {
case ZERO:
return 0;
case SMALL:
return MAX_SMALL;
case MEDIUM:
return MAX_MED;
case LARGE:
return MAX_LARGE;
default:
return COMMON_XL;
}
} | java | @Deprecated
public static int sizeToInt(final Size size) {
if (size == null) {
return -1;
}
switch (size) {
case ZERO:
return 0;
case SMALL:
return MAX_SMALL;
case MEDIUM:
return MAX_MED;
case LARGE:
return MAX_LARGE;
default:
return COMMON_XL;
}
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"sizeToInt",
"(",
"final",
"Size",
"size",
")",
"{",
"if",
"(",
"size",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"switch",
"(",
"size",
")",
"{",
"case",
"ZERO",
":",
"return",
"0",
";",
... | Convert a size back to a representative int. For testing only during conversion of int spaces to Size spaces.
@param size the Size to convert
@return an int representative of the Size | [
"Convert",
"a",
"size",
"back",
"to",
"a",
"representative",
"int",
".",
"For",
"testing",
"only",
"during",
"conversion",
"of",
"int",
"spaces",
"to",
"Size",
"spaces",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/SpaceUtil.java#L72-L89 | train |
podio/podio-java | src/main/java/com/podio/tag/TagAPI.java | TagAPI.removeTag | public void removeTag(Reference reference, String tag) {
getResourceFactory()
.getApiResource("/tag/" + reference.toURLFragment())
.queryParam("text", tag).delete();
} | java | public void removeTag(Reference reference, String tag) {
getResourceFactory()
.getApiResource("/tag/" + reference.toURLFragment())
.queryParam("text", tag).delete();
} | [
"public",
"void",
"removeTag",
"(",
"Reference",
"reference",
",",
"String",
"tag",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/tag/\"",
"+",
"reference",
".",
"toURLFragment",
"(",
")",
")",
".",
"queryParam",
"(",
"\"text\"",
... | Removes a single tag from an object.
@param reference
The object the tag should be removed from
@param tag
The tag to remove | [
"Removes",
"a",
"single",
"tag",
"from",
"an",
"object",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/tag/TagAPI.java#L91-L95 | train |
podio/podio-java | src/main/java/com/podio/tag/TagAPI.java | TagAPI.getTagsOnAppWithText | public List<TagReference> getTagsOnAppWithText(int appId, String text) {
return getResourceFactory()
.getApiResource("/tag/app/" + appId + "/search/")
.queryParam("text", text)
.get(new GenericType<List<TagReference>>() {
});
} | java | public List<TagReference> getTagsOnAppWithText(int appId, String text) {
return getResourceFactory()
.getApiResource("/tag/app/" + appId + "/search/")
.queryParam("text", text)
.get(new GenericType<List<TagReference>>() {
});
} | [
"public",
"List",
"<",
"TagReference",
">",
"getTagsOnAppWithText",
"(",
"int",
"appId",
",",
"String",
"text",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/tag/app/\"",
"+",
"appId",
"+",
"\"/search/\"",
")",
".",
"query... | Returns the objects that are tagged with the given text on the app. The
objects are returned sorted descending by the time the tag was added.
@param appId
The id of the app to search within
@param text
The tag to search for
@return The list of objects in the app that have the given tag | [
"Returns",
"the",
"objects",
"that",
"are",
"tagged",
"with",
"the",
"given",
"text",
"on",
"the",
"app",
".",
"The",
"objects",
"are",
"returned",
"sorted",
"descending",
"by",
"the",
"time",
"the",
"tag",
"was",
"added",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/tag/TagAPI.java#L274-L280 | train |
podio/podio-java | src/main/java/com/podio/tag/TagAPI.java | TagAPI.getTagsOnOrgWithText | public List<TagReference> getTagsOnOrgWithText(int orgId, String text) {
return getResourceFactory()
.getApiResource("/tag/org/" + orgId + "/search/")
.queryParam("text", text)
.get(new GenericType<List<TagReference>>() {
});
} | java | public List<TagReference> getTagsOnOrgWithText(int orgId, String text) {
return getResourceFactory()
.getApiResource("/tag/org/" + orgId + "/search/")
.queryParam("text", text)
.get(new GenericType<List<TagReference>>() {
});
} | [
"public",
"List",
"<",
"TagReference",
">",
"getTagsOnOrgWithText",
"(",
"int",
"orgId",
",",
"String",
"text",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/tag/org/\"",
"+",
"orgId",
"+",
"\"/search/\"",
")",
".",
"query... | Returns the objects that are tagged with the given text on the org. The
objects are returned sorted descending by the time the tag was added.
@param orgId
The id of the org to search within
@param text
The tag to search for
@return The list of objects in the org that have the given tag | [
"Returns",
"the",
"objects",
"that",
"are",
"tagged",
"with",
"the",
"given",
"text",
"on",
"the",
"org",
".",
"The",
"objects",
"are",
"returned",
"sorted",
"descending",
"by",
"the",
"time",
"the",
"tag",
"was",
"added",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/tag/TagAPI.java#L292-L298 | train |
podio/podio-java | src/main/java/com/podio/tag/TagAPI.java | TagAPI.getTagsOnSpaceWithText | public List<TagReference> getTagsOnSpaceWithText(int spaceId, String text) {
return getResourceFactory()
.getApiResource("/tag/space/" + spaceId + "/search/")
.queryParam("text", text)
.get(new GenericType<List<TagReference>>() {
});
} | java | public List<TagReference> getTagsOnSpaceWithText(int spaceId, String text) {
return getResourceFactory()
.getApiResource("/tag/space/" + spaceId + "/search/")
.queryParam("text", text)
.get(new GenericType<List<TagReference>>() {
});
} | [
"public",
"List",
"<",
"TagReference",
">",
"getTagsOnSpaceWithText",
"(",
"int",
"spaceId",
",",
"String",
"text",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/tag/space/\"",
"+",
"spaceId",
"+",
"\"/search/\"",
")",
".",
... | Returns the objects that are tagged with the given text on the space. The
objects are returned sorted descending by the time the tag was added.
@param spaceId
The id of the space to search within
@param text
The tag to search for
@return The list of objects in the space that have the given tag | [
"Returns",
"the",
"objects",
"that",
"are",
"tagged",
"with",
"the",
"given",
"text",
"on",
"the",
"space",
".",
"The",
"objects",
"are",
"returned",
"sorted",
"descending",
"by",
"the",
"time",
"the",
"tag",
"was",
"added",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/tag/TagAPI.java#L310-L316 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/SimpleTabs.java | SimpleTabs.addTab | public void addTab(final WComponent card, final String name) {
WContainer titledCard = new WContainer();
WText title = new WText("<b>[" + name + "]:</b><br/>");
title.setEncodeText(false);
titledCard.add(title);
titledCard.add(card);
deck.add(titledCard);
final TabButton button = new TabButton(name, tit... | java | public void addTab(final WComponent card, final String name) {
WContainer titledCard = new WContainer();
WText title = new WText("<b>[" + name + "]:</b><br/>");
title.setEncodeText(false);
titledCard.add(title);
titledCard.add(card);
deck.add(titledCard);
final TabButton button = new TabButton(name, tit... | [
"public",
"void",
"addTab",
"(",
"final",
"WComponent",
"card",
",",
"final",
"String",
"name",
")",
"{",
"WContainer",
"titledCard",
"=",
"new",
"WContainer",
"(",
")",
";",
"WText",
"title",
"=",
"new",
"WText",
"(",
"\"<b>[\"",
"+",
"name",
"+",
"\"]:... | Adds a tab.
@param card the tab content.
@param name the tab name. | [
"Adds",
"a",
"tab",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/SimpleTabs.java#L46-L65 | train |
BorderTech/wcomponents | wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/StandaloneLauncher.java | StandaloneLauncher.main | public static void main(final String[] args) throws Exception {
// Set the logger to use the text area logger
System.setProperty("org.apache.commons.logging.Log",
"com.github.bordertech.wcomponents.lde.StandaloneLauncher$TextAreaLogger");
// Set the port number to a random port
Configuration internalWCompo... | java | public static void main(final String[] args) throws Exception {
// Set the logger to use the text area logger
System.setProperty("org.apache.commons.logging.Log",
"com.github.bordertech.wcomponents.lde.StandaloneLauncher$TextAreaLogger");
// Set the port number to a random port
Configuration internalWCompo... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"// Set the logger to use the text area logger",
"System",
".",
"setProperty",
"(",
"\"org.apache.commons.logging.Log\"",
",",
"\"com.github.bordertech.wcomponents... | The entry point when the launcher is run as a java application.
@param args command-line arguments, ignored.
@throws Exception on error | [
"The",
"entry",
"point",
"when",
"the",
"launcher",
"is",
"run",
"as",
"a",
"java",
"application",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/StandaloneLauncher.java#L163-L178 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextFieldExample.java | TextFieldExample.readFields | private void readFields() {
plain.setText(tf1.getText());
mandatory.setText(tf2.getText());
readOnly.setText(tf3.getText());
disabled.setText(tf4.getText());
width.setText(tf5.getText());
} | java | private void readFields() {
plain.setText(tf1.getText());
mandatory.setText(tf2.getText());
readOnly.setText(tf3.getText());
disabled.setText(tf4.getText());
width.setText(tf5.getText());
} | [
"private",
"void",
"readFields",
"(",
")",
"{",
"plain",
".",
"setText",
"(",
"tf1",
".",
"getText",
"(",
")",
")",
";",
"mandatory",
".",
"setText",
"(",
"tf2",
".",
"getText",
"(",
")",
")",
";",
"readOnly",
".",
"setText",
"(",
"tf3",
".",
"getT... | Read fields is a simple method to read all the fields and populate the encoded text fields. | [
"Read",
"fields",
"is",
"a",
"simple",
"method",
"to",
"read",
"all",
"the",
"fields",
"and",
"populate",
"the",
"encoded",
"text",
"fields",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextFieldExample.java#L170-L176 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SourcePanel.java | SourcePanel.setSource | public void setSource(final String sourceText) {
String formattedSource;
if (sourceText == null) {
formattedSource = "";
} else {
formattedSource = WebUtilities.encode(sourceText); // XML escape content
}
source.setText(formattedSource);
} | java | public void setSource(final String sourceText) {
String formattedSource;
if (sourceText == null) {
formattedSource = "";
} else {
formattedSource = WebUtilities.encode(sourceText); // XML escape content
}
source.setText(formattedSource);
} | [
"public",
"void",
"setSource",
"(",
"final",
"String",
"sourceText",
")",
"{",
"String",
"formattedSource",
";",
"if",
"(",
"sourceText",
"==",
"null",
")",
"{",
"formattedSource",
"=",
"\"\"",
";",
"}",
"else",
"{",
"formattedSource",
"=",
"WebUtilities",
"... | Sets the source code to be displayed in the panel.
@param sourceText the source code to display. | [
"Sets",
"the",
"source",
"code",
"to",
"be",
"displayed",
"in",
"the",
"panel",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/SourcePanel.java#L74-L84 | train |
BorderTech/wcomponents | wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/examples/HelloWServlet.java | HelloWServlet.main | public static void main(final String[] args)
throws Exception {
// Use jetty to run the servlet.
Server server = new Server();
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(0);
connector.setPort(8080);
server.addConnector(connector);
WebAppContext context = new WebAppCon... | java | public static void main(final String[] args)
throws Exception {
// Use jetty to run the servlet.
Server server = new Server();
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(0);
connector.setPort(8080);
server.addConnector(connector);
WebAppContext context = new WebAppCon... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"// Use jetty to run the servlet.",
"Server",
"server",
"=",
"new",
"Server",
"(",
")",
";",
"SocketConnector",
"connector",
"=",
"new",
"SocketConnect... | This main method exists to make it easy to run this servlet without having to create a web.xml file, build a war
and deploy it.
@param args command-line arguments, ignored.
@throws Exception Thrown if a problem occurs. | [
"This",
"main",
"method",
"exists",
"to",
"make",
"it",
"easy",
"to",
"run",
"this",
"servlet",
"without",
"having",
"to",
"create",
"a",
"web",
".",
"xml",
"file",
"build",
"a",
"war",
"and",
"deploy",
"it",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-lde/src/main/java/com/github/bordertech/wcomponents/lde/examples/HelloWServlet.java#L42-L60 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WSubMenu.java | WSubMenu.isDisabled | @Override
public boolean isDisabled() {
if (isFlagSet(ComponentModel.DISABLED_FLAG)) {
return true;
}
MenuContainer container = WebUtilities.getAncestorOfClass(MenuContainer.class, this);
if (container instanceof Disableable && ((Disableable) container).isDisabled()) {
return true;
}
return false;
... | java | @Override
public boolean isDisabled() {
if (isFlagSet(ComponentModel.DISABLED_FLAG)) {
return true;
}
MenuContainer container = WebUtilities.getAncestorOfClass(MenuContainer.class, this);
if (container instanceof Disableable && ((Disableable) container).isDisabled()) {
return true;
}
return false;
... | [
"@",
"Override",
"public",
"boolean",
"isDisabled",
"(",
")",
"{",
"if",
"(",
"isFlagSet",
"(",
"ComponentModel",
".",
"DISABLED_FLAG",
")",
")",
"{",
"return",
"true",
";",
"}",
"MenuContainer",
"container",
"=",
"WebUtilities",
".",
"getAncestorOfClass",
"("... | Indicates whether this sub menu is disabled in the given context.
@return true if this sub menu is disabled. | [
"Indicates",
"whether",
"this",
"sub",
"menu",
"is",
"disabled",
"in",
"the",
"given",
"context",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WSubMenu.java#L229-L241 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WSubMenu.java | WSubMenu.handleRequest | @Override
public void handleRequest(final Request request) {
if (isDisabled()) {
// Protect against client-side tampering of disabled/read-only fields.
return;
}
if (isMenuPresent(request)) {
// If current ajax trigger, process menu for current selections
if (AjaxHelper.isCurrentAjaxTrigger(this)) {... | java | @Override
public void handleRequest(final Request request) {
if (isDisabled()) {
// Protect against client-side tampering of disabled/read-only fields.
return;
}
if (isMenuPresent(request)) {
// If current ajax trigger, process menu for current selections
if (AjaxHelper.isCurrentAjaxTrigger(this)) {... | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"isDisabled",
"(",
")",
")",
"{",
"// Protect against client-side tampering of disabled/read-only fields.",
"return",
";",
"}",
"if",
"(",
"isMenuPresent",
"... | Override handleRequest in order to perform processing for this component. This implementation checks for submenu
selection and executes the associated action if it has been set.
@param request the request being responded to. | [
"Override",
"handleRequest",
"in",
"order",
"to",
"perform",
"processing",
"for",
"this",
"component",
".",
"This",
"implementation",
"checks",
"for",
"submenu",
"selection",
"and",
"executes",
"the",
"associated",
"action",
"if",
"it",
"has",
"been",
"set",
"."... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WSubMenu.java#L519-L553 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WSubMenu.java | WSubMenu.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
String targetId = getContent().getId();
String contentId = getId() + "-content";
switch (getComponentModel().mode) {
case LAZY: {
getContent().setVisible(isOpen());
AjaxHelper.registerCont... | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
String targetId = getContent().getId();
String contentId = getId() + "-content";
switch (getComponentModel().mode) {
case LAZY: {
getContent().setVisible(isOpen());
AjaxHelper.registerCont... | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"String",
"targetId",
"=",
"getContent",
"(",
")",
".",
"getId",
"(",
")",
";",
"Str... | Override preparePaintComponent in order to correct the visibility of the sub-menu's children before they are
rendered.
@param request the request being responded to. | [
"Override",
"preparePaintComponent",
"in",
"order",
"to",
"correct",
"the",
"visibility",
"of",
"the",
"sub",
"-",
"menu",
"s",
"children",
"before",
"they",
"are",
"rendered",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WSubMenu.java#L572-L610 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMultiTextField.java | WMultiTextField.getValueAsString | @Override
public String getValueAsString() {
String result = null;
String[] inputs = getValue();
if (inputs != null && inputs.length > 0) {
StringBuffer stringValues = new StringBuffer();
for (int i = 0; i < inputs.length; i++) {
if (i > 0) {
stringValues.append(", ");
}
stringValues.a... | java | @Override
public String getValueAsString() {
String result = null;
String[] inputs = getValue();
if (inputs != null && inputs.length > 0) {
StringBuffer stringValues = new StringBuffer();
for (int i = 0; i < inputs.length; i++) {
if (i > 0) {
stringValues.append(", ");
}
stringValues.a... | [
"@",
"Override",
"public",
"String",
"getValueAsString",
"(",
")",
"{",
"String",
"result",
"=",
"null",
";",
"String",
"[",
"]",
"inputs",
"=",
"getValue",
"(",
")",
";",
"if",
"(",
"inputs",
"!=",
"null",
"&&",
"inputs",
".",
"length",
">",
"0",
")... | The string is a comma seperated list of the string inputs.
@return A string concatenation of the string inputs. | [
"The",
"string",
"is",
"a",
"comma",
"seperated",
"list",
"of",
"the",
"string",
"inputs",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMultiTextField.java#L243-L265 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java | WWindowInterceptor.serviceRequest | @Override
public void serviceRequest(final Request request) {
// Get window id off the request
windowId = request.getParameter(WWindow.WWINDOW_REQUEST_PARAM_KEY);
if (windowId == null) {
super.serviceRequest(request);
} else {
// Get the window component
ComponentWithContext target = WebUtilities.get... | java | @Override
public void serviceRequest(final Request request) {
// Get window id off the request
windowId = request.getParameter(WWindow.WWINDOW_REQUEST_PARAM_KEY);
if (windowId == null) {
super.serviceRequest(request);
} else {
// Get the window component
ComponentWithContext target = WebUtilities.get... | [
"@",
"Override",
"public",
"void",
"serviceRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"// Get window id off the request",
"windowId",
"=",
"request",
".",
"getParameter",
"(",
"WWindow",
".",
"WWINDOW_REQUEST_PARAM_KEY",
")",
";",
"if",
"(",
"windowId",... | Temporarily replaces the environment while the request is being handled.
@param request the request being responded to. | [
"Temporarily",
"replaces",
"the",
"environment",
"while",
"the",
"request",
"is",
"being",
"handled",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java#L53-L83 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java | WWindowInterceptor.preparePaint | @Override
public void preparePaint(final Request request) {
if (windowId == null) {
super.preparePaint(request);
} else {
// Get the window component
ComponentWithContext target = WebUtilities.getComponentById(windowId, true);
if (target == null) {
throw new SystemException("No window component for... | java | @Override
public void preparePaint(final Request request) {
if (windowId == null) {
super.preparePaint(request);
} else {
// Get the window component
ComponentWithContext target = WebUtilities.getComponentById(windowId, true);
if (target == null) {
throw new SystemException("No window component for... | [
"@",
"Override",
"public",
"void",
"preparePaint",
"(",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"windowId",
"==",
"null",
")",
"{",
"super",
".",
"preparePaint",
"(",
"request",
")",
";",
"}",
"else",
"{",
"// Get the window component",
"Componen... | Temporarily replaces the environment while the UI prepares to render.
@param request the request being responded to. | [
"Temporarily",
"replaces",
"the",
"environment",
"while",
"the",
"UI",
"prepares",
"to",
"render",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java#L90-L113 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java | WWindowInterceptor.paint | @Override
public void paint(final RenderContext renderContext) {
if (windowId == null) {
super.paint(renderContext);
} else {
// Get the window component
ComponentWithContext target = WebUtilities.getComponentById(windowId, true);
if (target == null) {
throw new SystemException("No window component... | java | @Override
public void paint(final RenderContext renderContext) {
if (windowId == null) {
super.paint(renderContext);
} else {
// Get the window component
ComponentWithContext target = WebUtilities.getComponentById(windowId, true);
if (target == null) {
throw new SystemException("No window component... | [
"@",
"Override",
"public",
"void",
"paint",
"(",
"final",
"RenderContext",
"renderContext",
")",
"{",
"if",
"(",
"windowId",
"==",
"null",
")",
"{",
"super",
".",
"paint",
"(",
"renderContext",
")",
";",
"}",
"else",
"{",
"// Get the window component",
"Comp... | Temporarily replaces the environment while the UI is being rendered.
@param renderContext the context to render to. | [
"Temporarily",
"replaces",
"the",
"environment",
"while",
"the",
"UI",
"is",
"being",
"rendered",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/WWindowInterceptor.java#L120-L143 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java | WTableRenderer.paintPaginationDetails | private void paintPaginationDetails(final WTable table, final XmlStringBuilder xml) {
TableModel model = table.getTableModel();
xml.appendTagOpen("ui:pagination");
xml.appendAttribute("rows", model.getRowCount());
xml.appendOptionalAttribute("rowsPerPage", table.getRowsPerPage() > 0, table.
getRowsPerPage... | java | private void paintPaginationDetails(final WTable table, final XmlStringBuilder xml) {
TableModel model = table.getTableModel();
xml.appendTagOpen("ui:pagination");
xml.appendAttribute("rows", model.getRowCount());
xml.appendOptionalAttribute("rowsPerPage", table.getRowsPerPage() > 0, table.
getRowsPerPage... | [
"private",
"void",
"paintPaginationDetails",
"(",
"final",
"WTable",
"table",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"TableModel",
"model",
"=",
"table",
".",
"getTableModel",
"(",
")",
";",
"xml",
".",
"appendTagOpen",
"(",
"\"ui:pagination\"",
")",... | Paint the pagination aspects of the table.
@param table the WDataTable being rendered
@param xml the string builder in use | [
"Paint",
"the",
"pagination",
"aspects",
"of",
"the",
"table",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java#L126-L178 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java | WTableRenderer.paintSortDetails | private void paintSortDetails(final WTable table, final XmlStringBuilder xml) {
int col = table.getSortColumnIndex();
boolean ascending = table.isSortAscending();
xml.appendTagOpen("ui:sort");
if (col >= 0) {
// Allow for column order
int[] cols = table.getColumnOrder();
if (cols != null) {
for (... | java | private void paintSortDetails(final WTable table, final XmlStringBuilder xml) {
int col = table.getSortColumnIndex();
boolean ascending = table.isSortAscending();
xml.appendTagOpen("ui:sort");
if (col >= 0) {
// Allow for column order
int[] cols = table.getColumnOrder();
if (cols != null) {
for (... | [
"private",
"void",
"paintSortDetails",
"(",
"final",
"WTable",
"table",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"int",
"col",
"=",
"table",
".",
"getSortColumnIndex",
"(",
")",
";",
"boolean",
"ascending",
"=",
"table",
".",
"isSortAscending",
"(",
... | Paints the sort details.
@param table the table being rendered
@param xml the string builder in use | [
"Paints",
"the",
"sort",
"details",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java#L245-L275 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java | WTableRenderer.paintTableActions | private void paintTableActions(final WTable table, final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
List<WButton> tableActions = table.getActions();
if (!tableActions.isEmpty()) {
boolean hasActions = false;
for (WButton button : tableActions) {
if (!button.... | java | private void paintTableActions(final WTable table, final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
List<WButton> tableActions = table.getActions();
if (!tableActions.isEmpty()) {
boolean hasActions = false;
for (WButton button : tableActions) {
if (!button.... | [
"private",
"void",
"paintTableActions",
"(",
"final",
"WTable",
"table",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".",
"getWriter",
"(",
")",
";",
"List",
"<",
"WButton",
">",
"tableActions",
... | Paints the table actions of the table.
@param table the table to paint the table actions for.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"table",
"actions",
"of",
"the",
"table",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java#L283-L330 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java | WTableRenderer.paintColumnHeading | private void paintColumnHeading(final WTableColumn col, final boolean sortable,
final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
int width = col.getWidth();
Alignment align = col.getAlign();
xml.appendTagOpen("ui:th");
xml.appendOptionalAttribute("width", width ... | java | private void paintColumnHeading(final WTableColumn col, final boolean sortable,
final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
int width = col.getWidth();
Alignment align = col.getAlign();
xml.appendTagOpen("ui:th");
xml.appendOptionalAttribute("width", width ... | [
"private",
"void",
"paintColumnHeading",
"(",
"final",
"WTableColumn",
"col",
",",
"final",
"boolean",
"sortable",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".",
"getWriter",
"(",
")",
";",
"in... | Paints a single column heading.
@param col the column to paint.
@param sortable true if the column is sortable, false otherwise
@param renderContext the RenderContext to paint to. | [
"Paints",
"a",
"single",
"column",
"heading",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java#L447-L468 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java | WPanelTypeExample.updateUI | public void updateUI() {
if (!Util.empty(panelContent.getText())) {
panelContentRO.setData(panelContent.getData());
} else {
panelContentRO.setText(SAMPLE_CONTENT);
}
panel.setType((WPanel.Type) panelType.getSelected());
String headingText = tfHeading.getText();
if (!Util.empty(tfHeading.getText()))... | java | public void updateUI() {
if (!Util.empty(panelContent.getText())) {
panelContentRO.setData(panelContent.getData());
} else {
panelContentRO.setText(SAMPLE_CONTENT);
}
panel.setType((WPanel.Type) panelType.getSelected());
String headingText = tfHeading.getText();
if (!Util.empty(tfHeading.getText()))... | [
"public",
"void",
"updateUI",
"(",
")",
"{",
"if",
"(",
"!",
"Util",
".",
"empty",
"(",
"panelContent",
".",
"getText",
"(",
")",
")",
")",
"{",
"panelContentRO",
".",
"setData",
"(",
"panelContent",
".",
"getData",
"(",
")",
")",
";",
"}",
"else",
... | Set up the WPanel so that the appropriate items are visible based on configuration settings. | [
"Set",
"up",
"the",
"WPanel",
"so",
"that",
"the",
"appropriate",
"items",
"are",
"visible",
"based",
"on",
"configuration",
"settings",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java#L181-L198 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java | WPanelTypeExample.buildUI | private void buildUI() {
buildTargetPanel();
buildConfigOptions();
add(new WHorizontalRule());
add(panel);
add(new WHorizontalRule());
// We need this reflection of the selected menu item just so we can reuse the menu from the
// MenuBarExample. It serves no purpose in this example so I am going to hide ... | java | private void buildUI() {
buildTargetPanel();
buildConfigOptions();
add(new WHorizontalRule());
add(panel);
add(new WHorizontalRule());
// We need this reflection of the selected menu item just so we can reuse the menu from the
// MenuBarExample. It serves no purpose in this example so I am going to hide ... | [
"private",
"void",
"buildUI",
"(",
")",
"{",
"buildTargetPanel",
"(",
")",
";",
"buildConfigOptions",
"(",
")",
";",
"add",
"(",
"new",
"WHorizontalRule",
"(",
")",
")",
";",
"add",
"(",
"panel",
")",
";",
"add",
"(",
"new",
"WHorizontalRule",
"(",
")"... | Add the components in the required order. | [
"Add",
"the",
"components",
"in",
"the",
"required",
"order",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java#L213-L232 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java | WPanelTypeExample.buildConfigOptions | private void buildConfigOptions() {
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
layout.addField("Select a WPanel Type", panelType);
contentField = layout.addField("Panel content", panelContent);
headingField = layout.addField... | java | private void buildConfigOptions() {
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
layout.addField("Select a WPanel Type", panelType);
contentField = layout.addField("Panel content", panelContent);
headingField = layout.addField... | [
"private",
"void",
"buildConfigOptions",
"(",
")",
"{",
"WFieldLayout",
"layout",
"=",
"new",
"WFieldLayout",
"(",
"WFieldLayout",
".",
"LAYOUT_STACKED",
")",
";",
"layout",
".",
"setMargin",
"(",
"new",
"Margin",
"(",
"null",
",",
"null",
",",
"Size",
".",
... | Set up the UI for the configuration options. | [
"Set",
"up",
"the",
"UI",
"for",
"the",
"configuration",
"options",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java#L237-L247 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java | WPanelTypeExample.buildTargetPanel | private void buildTargetPanel() {
setUpUtilBar();
panel.add(utilBar);
panel.add(heading);
panel.add(panelContentRO);
panel.add(menu);
} | java | private void buildTargetPanel() {
setUpUtilBar();
panel.add(utilBar);
panel.add(heading);
panel.add(panelContentRO);
panel.add(menu);
} | [
"private",
"void",
"buildTargetPanel",
"(",
")",
"{",
"setUpUtilBar",
"(",
")",
";",
"panel",
".",
"add",
"(",
"utilBar",
")",
";",
"panel",
".",
"add",
"(",
"heading",
")",
";",
"panel",
".",
"add",
"(",
"panelContentRO",
")",
";",
"panel",
".",
"ad... | Set up the target panel contents. | [
"Set",
"up",
"the",
"target",
"panel",
"contents",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java#L252-L258 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java | WPanelTypeExample.setUpUtilBar | private void setUpUtilBar() {
utilBar.setLayout(new ListLayout(ListLayout.Type.FLAT, ListLayout.Alignment.RIGHT, ListLayout.Separator.NONE, false));
WTextField selectOther = new WTextField();
selectOther.setToolTip("Enter text.");
utilBar.add(selectOther);
utilBar.add(new WButton("Go"));
utilBar.add(new WBu... | java | private void setUpUtilBar() {
utilBar.setLayout(new ListLayout(ListLayout.Type.FLAT, ListLayout.Alignment.RIGHT, ListLayout.Separator.NONE, false));
WTextField selectOther = new WTextField();
selectOther.setToolTip("Enter text.");
utilBar.add(selectOther);
utilBar.add(new WButton("Go"));
utilBar.add(new WBu... | [
"private",
"void",
"setUpUtilBar",
"(",
")",
"{",
"utilBar",
".",
"setLayout",
"(",
"new",
"ListLayout",
"(",
"ListLayout",
".",
"Type",
".",
"FLAT",
",",
"ListLayout",
".",
"Alignment",
".",
"RIGHT",
",",
"ListLayout",
".",
"Separator",
".",
"NONE",
",",
... | Add some UI to a "utility bar" type structure. | [
"Add",
"some",
"UI",
"to",
"a",
"utility",
"bar",
"type",
"structure",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java#L290-L300 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AjaxSetupInterceptor.java | AjaxSetupInterceptor.serviceRequest | @Override
public void serviceRequest(final Request request) {
// Get trigger id
String triggerId = request.getParameter(WServlet.AJAX_TRIGGER_PARAM_NAME);
if (triggerId == null) {
throw new SystemException("No AJAX trigger id to on request");
}
// Find the Component for this trigger
ComponentWithConte... | java | @Override
public void serviceRequest(final Request request) {
// Get trigger id
String triggerId = request.getParameter(WServlet.AJAX_TRIGGER_PARAM_NAME);
if (triggerId == null) {
throw new SystemException("No AJAX trigger id to on request");
}
// Find the Component for this trigger
ComponentWithConte... | [
"@",
"Override",
"public",
"void",
"serviceRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"// Get trigger id",
"String",
"triggerId",
"=",
"request",
".",
"getParameter",
"(",
"WServlet",
".",
"AJAX_TRIGGER_PARAM_NAME",
")",
";",
"if",
"(",
"triggerId",
... | Setup the AJAX operation details.
@param request the request being serviced. | [
"Setup",
"the",
"AJAX",
"operation",
"details",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/AjaxSetupInterceptor.java#L27-L82 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDecoratedLabelRenderer.java | WDecoratedLabelRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDecoratedLabel label = (WDecoratedLabel) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent head = label.getHead();
WComponent body = label.getBody();
WComponent tail = label.getTail();... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDecoratedLabel label = (WDecoratedLabel) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent head = label.getHead();
WComponent body = label.getBody();
WComponent tail = label.getTail();... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WDecoratedLabel",
"label",
"=",
"(",
"WDecoratedLabel",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
... | Paints the given WDecoratedLabel.
@param component the WDecoratedLabel to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WDecoratedLabel",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDecoratedLabelRenderer.java#L23-L61 | train |
podio/podio-java | src/main/java/com/podio/comment/CommentAPI.java | CommentAPI.getComments | public List<Comment> getComments(Reference reference) {
return getResourceFactory().getApiResource(
"/comment/" + reference.getType() + "/" + reference.getId())
.get(new GenericType<List<Comment>>() {
});
} | java | public List<Comment> getComments(Reference reference) {
return getResourceFactory().getApiResource(
"/comment/" + reference.getType() + "/" + reference.getId())
.get(new GenericType<List<Comment>>() {
});
} | [
"public",
"List",
"<",
"Comment",
">",
"getComments",
"(",
"Reference",
"reference",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/comment/\"",
"+",
"reference",
".",
"getType",
"(",
")",
"+",
"\"/\"",
"+",
"reference",
... | Used to retrieve all the comments that have been made on an object of the
given type and with the given id. It returns a list of all the comments
sorted in ascending order by time created.
@param reference
The reference to the object from which the comments should be
retrieved
@return The comments on the object | [
"Used",
"to",
"retrieve",
"all",
"the",
"comments",
"that",
"have",
"been",
"made",
"on",
"an",
"object",
"of",
"the",
"given",
"type",
"and",
"with",
"the",
"given",
"id",
".",
"It",
"returns",
"a",
"list",
"of",
"all",
"the",
"comments",
"sorted",
"i... | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/comment/CommentAPI.java#L35-L40 | train |
podio/podio-java | src/main/java/com/podio/comment/CommentAPI.java | CommentAPI.addComment | public int addComment(Reference reference, CommentCreate comment,
boolean silent, boolean hook) {
return getResourceFactory()
.getApiResource(
"/comment/" + reference.getType() + "/"
+ reference.getId())
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.... | java | public int addComment(Reference reference, CommentCreate comment,
boolean silent, boolean hook) {
return getResourceFactory()
.getApiResource(
"/comment/" + reference.getType() + "/"
+ reference.getId())
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.... | [
"public",
"int",
"addComment",
"(",
"Reference",
"reference",
",",
"CommentCreate",
"comment",
",",
"boolean",
"silent",
",",
"boolean",
"hook",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/comment/\"",
"+",
"reference",
".... | Adds a new comment to the object of the given type and id, f.ex. item 1.
@param reference
The reference to the object the comment should be added to
@param comment
The comment that should be added
@param silent
True if the update should be silent, false otherwise | [
"Adds",
"a",
"new",
"comment",
"to",
"the",
"object",
"of",
"the",
"given",
"type",
"and",
"id",
"f",
".",
"ex",
".",
"item",
"1",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/comment/CommentAPI.java#L65-L75 | train |
podio/podio-java | src/main/java/com/podio/comment/CommentAPI.java | CommentAPI.updateComment | public void updateComment(int commentId, CommentUpdate comment) {
getResourceFactory().getApiResource("/comment/" + commentId)
.entity(comment, MediaType.APPLICATION_JSON_TYPE).put();
} | java | public void updateComment(int commentId, CommentUpdate comment) {
getResourceFactory().getApiResource("/comment/" + commentId)
.entity(comment, MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateComment",
"(",
"int",
"commentId",
",",
"CommentUpdate",
"comment",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/comment/\"",
"+",
"commentId",
")",
".",
"entity",
"(",
"comment",
",",
"MediaType",
".",
"AP... | Updates an already created comment. This should only be used to correct
spelling and grammatical mistakes in the comment.
@param commentId
The id of the comment
@param comment
The updated comment definition | [
"Updates",
"an",
"already",
"created",
"comment",
".",
"This",
"should",
"only",
"be",
"used",
"to",
"correct",
"spelling",
"and",
"grammatical",
"mistakes",
"in",
"the",
"comment",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/comment/CommentAPI.java#L86-L89 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java | VelocityRenderer.render | @Override
public void render(final WComponent component, final RenderContext context) {
PrintWriter out = ((WebXmlRenderContext) context).getWriter();
// If we are debugging the layout, write markers so that the html
// designer can see where templates start and end.
boolean debugLayout = ConfigurationPropert... | java | @Override
public void render(final WComponent component, final RenderContext context) {
PrintWriter out = ((WebXmlRenderContext) context).getWriter();
// If we are debugging the layout, write markers so that the html
// designer can see where templates start and end.
boolean debugLayout = ConfigurationPropert... | [
"@",
"Override",
"public",
"void",
"render",
"(",
"final",
"WComponent",
"component",
",",
"final",
"RenderContext",
"context",
")",
"{",
"PrintWriter",
"out",
"=",
"(",
"(",
"WebXmlRenderContext",
")",
"context",
")",
".",
"getWriter",
"(",
")",
";",
"// If... | Paints the component in HTML using the Velocity Template.
@param component the component to paint.
@param context the context to send the XML output to. | [
"Paints",
"the",
"component",
"in",
"HTML",
"using",
"the",
"Velocity",
"Template",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java#L122-L143 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java | VelocityRenderer.paintXml | public void paintXml(final WComponent component, final Writer writer) {
if (LOG.isDebugEnabled()) {
LOG.debug("paintXml called for component class " + component.getClass());
}
String templateText = null;
if (component instanceof AbstractWComponent) {
AbstractWComponent abstractComp = ((AbstractWComponen... | java | public void paintXml(final WComponent component, final Writer writer) {
if (LOG.isDebugEnabled()) {
LOG.debug("paintXml called for component class " + component.getClass());
}
String templateText = null;
if (component instanceof AbstractWComponent) {
AbstractWComponent abstractComp = ((AbstractWComponen... | [
"public",
"void",
"paintXml",
"(",
"final",
"WComponent",
"component",
",",
"final",
"Writer",
"writer",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"paintXml called for component class \"",
"+",
"componen... | Paints the component in XML using the Velocity Template.
@param component the component to paint.
@param writer the writer to send the HTML output to. | [
"Paints",
"the",
"component",
"in",
"XML",
"using",
"the",
"Velocity",
"Template",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java#L151-L211 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java | VelocityRenderer.fillContext | private void fillContext(final WComponent component,
final VelocityContext context, final Map<String, WComponent> componentsByKey) {
// Also make the component available under the "this" key.
context.put("this", component);
// Make the UIContext available under the "uicontext" key.
UIContext uic = UIContext... | java | private void fillContext(final WComponent component,
final VelocityContext context, final Map<String, WComponent> componentsByKey) {
// Also make the component available under the "this" key.
context.put("this", component);
// Make the UIContext available under the "uicontext" key.
UIContext uic = UIContext... | [
"private",
"void",
"fillContext",
"(",
"final",
"WComponent",
"component",
",",
"final",
"VelocityContext",
"context",
",",
"final",
"Map",
"<",
"String",
",",
"WComponent",
">",
"componentsByKey",
")",
"{",
"// Also make the component available under the \"this\" key.",
... | Fills the given velocity context with data from the component which is being rendered. A map of components is
also built up, in order to support deferred rendering.
@param component the current component being rendered.
@param context the velocity context to modify.
@param componentsByKey a map to store components for... | [
"Fills",
"the",
"given",
"velocity",
"context",
"with",
"data",
"from",
"the",
"component",
"which",
"is",
"being",
"rendered",
".",
"A",
"map",
"of",
"components",
"is",
"also",
"built",
"up",
"in",
"order",
"to",
"support",
"deferred",
"rendering",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java#L221-L280 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java | VelocityRenderer.noTemplatePaintHtml | @Deprecated
protected void noTemplatePaintHtml(final WComponent component, final Writer writer) {
try {
writer.write("<!-- Start " + url + " not found -->\n");
new VelocityRenderer(NO_TEMPLATE_LAYOUT).paintXml(component, writer);
writer.write("<!-- End " + url + " (template not found) -->\n");
} catch (IO... | java | @Deprecated
protected void noTemplatePaintHtml(final WComponent component, final Writer writer) {
try {
writer.write("<!-- Start " + url + " not found -->\n");
new VelocityRenderer(NO_TEMPLATE_LAYOUT).paintXml(component, writer);
writer.write("<!-- End " + url + " (template not found) -->\n");
} catch (IO... | [
"@",
"Deprecated",
"protected",
"void",
"noTemplatePaintHtml",
"(",
"final",
"WComponent",
"component",
",",
"final",
"Writer",
"writer",
")",
"{",
"try",
"{",
"writer",
".",
"write",
"(",
"\"<!-- Start \"",
"+",
"url",
"+",
"\" not found -->\\n\"",
")",
";",
... | Paints the component in HTML using the NoTemplateLayout.
@param component the component to paint.
@param writer the writer to send the HTML output to.
@deprecated Unused. Will be removed in the next major release. | [
"Paints",
"the",
"component",
"in",
"HTML",
"using",
"the",
"NoTemplateLayout",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java#L319-L328 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java | VelocityRenderer.getTemplate | private Template getTemplate(final WComponent component) {
String templateUrl = url;
if (templateUrl == null && component instanceof AbstractWComponent) {
templateUrl = ((AbstractWComponent) component).getTemplate();
}
if (templateUrl != null) {
try {
return VelocityEngineFactory.getVelocityEngine()... | java | private Template getTemplate(final WComponent component) {
String templateUrl = url;
if (templateUrl == null && component instanceof AbstractWComponent) {
templateUrl = ((AbstractWComponent) component).getTemplate();
}
if (templateUrl != null) {
try {
return VelocityEngineFactory.getVelocityEngine()... | [
"private",
"Template",
"getTemplate",
"(",
"final",
"WComponent",
"component",
")",
"{",
"String",
"templateUrl",
"=",
"url",
";",
"if",
"(",
"templateUrl",
"==",
"null",
"&&",
"component",
"instanceof",
"AbstractWComponent",
")",
"{",
"templateUrl",
"=",
"(",
... | Retrieves the Velocity template for the given component.
@param component the component to retrieve the template for.
@return the template for the given component, or null if there is no template. | [
"Retrieves",
"the",
"Velocity",
"template",
"for",
"the",
"given",
"component",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/VelocityRenderer.java#L344-L369 | train |
podio/podio-java | src/main/java/com/podio/stream/StreamAPI.java | StreamAPI.getGlobalStream | public List<StreamObject> getGlobalStream(Integer limit, Integer offset,
DateTime dateFrom, DateTime dateTo) {
return getStream("/stream/", limit, offset, dateFrom, dateTo);
} | java | public List<StreamObject> getGlobalStream(Integer limit, Integer offset,
DateTime dateFrom, DateTime dateTo) {
return getStream("/stream/", limit, offset, dateFrom, dateTo);
} | [
"public",
"List",
"<",
"StreamObject",
">",
"getGlobalStream",
"(",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"DateTime",
"dateFrom",
",",
"DateTime",
"dateTo",
")",
"{",
"return",
"getStream",
"(",
"\"/stream/\"",
",",
"limit",
",",
"offset",
",",
... | Returns the global stream. This includes items and statuses with
comments, ratings, files and edits.
@param limit
How many objects should be returned, defaults to 10
@param offset
How far should the objects be offset, defaults to 0
@param dateFrom
The date and time that all events should be after, defaults to
no limit... | [
"Returns",
"the",
"global",
"stream",
".",
"This",
"includes",
"items",
"and",
"statuses",
"with",
"comments",
"ratings",
"files",
"and",
"edits",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/stream/StreamAPI.java#L70-L73 | train |
podio/podio-java | src/main/java/com/podio/stream/StreamAPI.java | StreamAPI.getGlobalStreamV2 | public List<StreamObjectV2> getGlobalStreamV2(Integer limit,
Integer offset, DateTime dateFrom, DateTime dateTo) {
return getStreamV2("/stream/v2/", limit, offset, dateFrom, dateTo);
} | java | public List<StreamObjectV2> getGlobalStreamV2(Integer limit,
Integer offset, DateTime dateFrom, DateTime dateTo) {
return getStreamV2("/stream/v2/", limit, offset, dateFrom, dateTo);
} | [
"public",
"List",
"<",
"StreamObjectV2",
">",
"getGlobalStreamV2",
"(",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"DateTime",
"dateFrom",
",",
"DateTime",
"dateTo",
")",
"{",
"return",
"getStreamV2",
"(",
"\"/stream/v2/\"",
",",
"limit",
",",
"offset",
... | Returns the global stream. The types of objects in the stream can be
either "item", "status" or "task".
@param limit
How many objects should be returned, defaults to 10
@param offset
How far should the objects be offset, defaults to 0
@param dateFrom
The date and time that all events should be after, defaults to
no li... | [
"Returns",
"the",
"global",
"stream",
".",
"The",
"types",
"of",
"objects",
"in",
"the",
"stream",
"can",
"be",
"either",
"item",
"status",
"or",
"task",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/stream/StreamAPI.java#L91-L94 | train |
podio/podio-java | src/main/java/com/podio/stream/StreamAPI.java | StreamAPI.getAppStream | public List<StreamObjectV2> getAppStream(int appId, Integer limit,
Integer offset) {
return getStreamV2("/stream/app/" + appId + "/", limit, offset, null,
null);
} | java | public List<StreamObjectV2> getAppStream(int appId, Integer limit,
Integer offset) {
return getStreamV2("/stream/app/" + appId + "/", limit, offset, null,
null);
} | [
"public",
"List",
"<",
"StreamObjectV2",
">",
"getAppStream",
"(",
"int",
"appId",
",",
"Integer",
"limit",
",",
"Integer",
"offset",
")",
"{",
"return",
"getStreamV2",
"(",
"\"/stream/app/\"",
"+",
"appId",
"+",
"\"/\"",
",",
"limit",
",",
"offset",
",",
... | Returns the stream for the app. Is identical to the global stream, but
only returns objects in the app.
@param limit
How many objects should be returned, defaults to 10
@param offset
How far should the objects be offset, defaults to 0
@param dateFrom
The date and time that all events should be after, defaults to
no li... | [
"Returns",
"the",
"stream",
"for",
"the",
"app",
".",
"Is",
"identical",
"to",
"the",
"global",
"stream",
"but",
"only",
"returns",
"objects",
"in",
"the",
"app",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/stream/StreamAPI.java#L200-L204 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WVideoExample.java | WVideoExample.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request); //To change body of generated methods, choose Tools | Templates.
if (!isInitialised()) {
setInitialised(true);
setupVideo();
}
} | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request); //To change body of generated methods, choose Tools | Templates.
if (!isInitialised()) {
setInitialised(true);
setupVideo();
}
} | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"//To change body of generated methods, choose Tools | Templates.",
"if",
"(",
"!",
"isInitialised... | Set up the initial state of the video component.
@param request The http request being processed. | [
"Set",
"up",
"the",
"initial",
"state",
"of",
"the",
"video",
"component",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WVideoExample.java#L133-L140 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WVideoExample.java | WVideoExample.setupVideo | private void setupVideo() {
video.setAutoplay(cbAutoPlay.isSelected());
video.setLoop(cbLoop.isSelected());
video.setMuted(!cbMute.isDisabled() && cbMute.isSelected());
video.setControls(cbControls.isSelected() ? WVideo.Controls.PLAY_PAUSE : WVideo.Controls.NATIVE);
video.setDisabled(cbControls.isSelected() &... | java | private void setupVideo() {
video.setAutoplay(cbAutoPlay.isSelected());
video.setLoop(cbLoop.isSelected());
video.setMuted(!cbMute.isDisabled() && cbMute.isSelected());
video.setControls(cbControls.isSelected() ? WVideo.Controls.PLAY_PAUSE : WVideo.Controls.NATIVE);
video.setDisabled(cbControls.isSelected() &... | [
"private",
"void",
"setupVideo",
"(",
")",
"{",
"video",
".",
"setAutoplay",
"(",
"cbAutoPlay",
".",
"isSelected",
"(",
")",
")",
";",
"video",
".",
"setLoop",
"(",
"cbLoop",
".",
"isSelected",
"(",
")",
")",
";",
"video",
".",
"setMuted",
"(",
"!",
... | Set the video configuration options. | [
"Set",
"the",
"video",
"configuration",
"options",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WVideoExample.java#L146-L152 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/HeadersImpl.java | HeadersImpl.getHeadLines | @Override
public List<String> getHeadLines(final String type) {
ArrayList<String> lines = headers.get(type);
return lines == null ? null : Collections.unmodifiableList(lines);
} | java | @Override
public List<String> getHeadLines(final String type) {
ArrayList<String> lines = headers.get(type);
return lines == null ? null : Collections.unmodifiableList(lines);
} | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"getHeadLines",
"(",
"final",
"String",
"type",
")",
"{",
"ArrayList",
"<",
"String",
">",
"lines",
"=",
"headers",
".",
"get",
"(",
"type",
")",
";",
"return",
"lines",
"==",
"null",
"?",
"null",
... | Gets the head lines, of a specified type.
@param type the type of lines to retrieve.
@return a list of headlines, or null if there are no headlines of the given type. | [
"Gets",
"the",
"head",
"lines",
"of",
"a",
"specified",
"type",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/HeadersImpl.java#L109-L113 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java | XmlStringBuilder.append | public void append(final Object text) {
if (text instanceof Message) {
append(translate(text), true);
} else if (text != null) {
append(text.toString(), true);
}
} | java | public void append(final Object text) {
if (text instanceof Message) {
append(translate(text), true);
} else if (text != null) {
append(text.toString(), true);
}
} | [
"public",
"void",
"append",
"(",
"final",
"Object",
"text",
")",
"{",
"if",
"(",
"text",
"instanceof",
"Message",
")",
"{",
"append",
"(",
"translate",
"(",
"text",
")",
",",
"true",
")",
";",
"}",
"else",
"if",
"(",
"text",
"!=",
"null",
")",
"{",... | Appends the given text to this XmlStringBuilder. XML values are escaped.
@param text the message to append. | [
"Appends",
"the",
"given",
"text",
"to",
"this",
"XmlStringBuilder",
".",
"XML",
"values",
"are",
"escaped",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java#L298-L304 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java | XmlStringBuilder.append | public void append(final String string, final boolean encode) {
if (encode) {
appendOptional(WebUtilities.encode(string));
} else {
// unescaped content still has to be XML compliant.
write(HtmlToXMLUtil.unescapeToXML(string));
}
} | java | public void append(final String string, final boolean encode) {
if (encode) {
appendOptional(WebUtilities.encode(string));
} else {
// unescaped content still has to be XML compliant.
write(HtmlToXMLUtil.unescapeToXML(string));
}
} | [
"public",
"void",
"append",
"(",
"final",
"String",
"string",
",",
"final",
"boolean",
"encode",
")",
"{",
"if",
"(",
"encode",
")",
"{",
"appendOptional",
"(",
"WebUtilities",
".",
"encode",
"(",
"string",
")",
")",
";",
"}",
"else",
"{",
"// unescaped ... | Appends the string to this XmlStringBuilder. XML values are not escaped.
@param string the String to append.
@param encode true to encode the string before output, false to output as is | [
"Appends",
"the",
"string",
"to",
"this",
"XmlStringBuilder",
".",
"XML",
"values",
"are",
"not",
"escaped",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java#L312-L319 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java | XmlStringBuilder.translate | private String translate(final Object messageObject) {
if (messageObject instanceof Message) {
Message message = (Message) messageObject;
return I18nUtilities.format(locale, message.getMessage(), (Object[]) message.getArgs());
} else if (messageObject != null) {
return I18nUtilities.format(locale, messageO... | java | private String translate(final Object messageObject) {
if (messageObject instanceof Message) {
Message message = (Message) messageObject;
return I18nUtilities.format(locale, message.getMessage(), (Object[]) message.getArgs());
} else if (messageObject != null) {
return I18nUtilities.format(locale, messageO... | [
"private",
"String",
"translate",
"(",
"final",
"Object",
"messageObject",
")",
"{",
"if",
"(",
"messageObject",
"instanceof",
"Message",
")",
"{",
"Message",
"message",
"=",
"(",
"Message",
")",
"messageObject",
";",
"return",
"I18nUtilities",
".",
"format",
... | Translates the given message into the appropriate user text. This takes the current locale into consideration, if
set.
@param messageObject the message to translate.
@return the translated message. | [
"Translates",
"the",
"given",
"message",
"into",
"the",
"appropriate",
"user",
"text",
".",
"This",
"takes",
"the",
"current",
"locale",
"into",
"consideration",
"if",
"set",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java#L359-L368 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/RequestUtil.java | RequestUtil.addFileItem | public static void addFileItem(final Map<String, FileItem[]> files, final String name, final FileItem item) {
if (files.containsKey(name)) {
// This field contains multiple values, append the new value to the existing values.
FileItem[] oldValues = files.get(name);
FileItem[] newValues = new FileItem[oldValu... | java | public static void addFileItem(final Map<String, FileItem[]> files, final String name, final FileItem item) {
if (files.containsKey(name)) {
// This field contains multiple values, append the new value to the existing values.
FileItem[] oldValues = files.get(name);
FileItem[] newValues = new FileItem[oldValu... | [
"public",
"static",
"void",
"addFileItem",
"(",
"final",
"Map",
"<",
"String",
",",
"FileItem",
"[",
"]",
">",
"files",
",",
"final",
"String",
"name",
",",
"final",
"FileItem",
"item",
")",
"{",
"if",
"(",
"files",
".",
"containsKey",
"(",
"name",
")"... | Add the file data to the files collection. If a file already exists with the given name then the value for this
name will be an array of all registered files.
@param files the map in which to store file data.
@param name the name of the file, i.e. the key to store the file against.
@param item the file data. | [
"Add",
"the",
"file",
"data",
"to",
"the",
"files",
"collection",
".",
"If",
"a",
"file",
"already",
"exists",
"with",
"the",
"given",
"name",
"then",
"the",
"value",
"for",
"this",
"name",
"will",
"be",
"an",
"array",
"of",
"all",
"registered",
"files",... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/RequestUtil.java#L28-L39 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/RequestUtil.java | RequestUtil.addParameter | public static void addParameter(final Map<String, String[]> parameters, final String name, final String value) {
if (parameters.containsKey(name)) {
// This field contains multiple values, append the new value to the existing values.
String[] oldValues = parameters.get(name);
String[] newValues = new String[... | java | public static void addParameter(final Map<String, String[]> parameters, final String name, final String value) {
if (parameters.containsKey(name)) {
// This field contains multiple values, append the new value to the existing values.
String[] oldValues = parameters.get(name);
String[] newValues = new String[... | [
"public",
"static",
"void",
"addParameter",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameters",
",",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"parameters",
".",
"containsKey",
"(",
"name... | Add the request parameter to the parameters collection. If a parameter already exists with the given name then
the Map will contain an array of all registered values.
@param parameters the map to store non-file request parameters in.
@param name the name of the parameter.
@param value the parameter value. | [
"Add",
"the",
"request",
"parameter",
"to",
"the",
"parameters",
"collection",
".",
"If",
"a",
"parameter",
"already",
"exists",
"with",
"the",
"given",
"name",
"then",
"the",
"Map",
"will",
"contain",
"an",
"array",
"of",
"all",
"registered",
"values",
"."
... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/RequestUtil.java#L49-L60 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageRenderer.java | WImageRenderer.renderTagOpen | protected static void renderTagOpen(final WImage imageComponent, final XmlStringBuilder xml) {
// Check for alternative text on the image
String alternativeText = imageComponent.getAlternativeText();
if (alternativeText == null) {
alternativeText = "";
} else {
alternativeText = I18nUtilities.format(null... | java | protected static void renderTagOpen(final WImage imageComponent, final XmlStringBuilder xml) {
// Check for alternative text on the image
String alternativeText = imageComponent.getAlternativeText();
if (alternativeText == null) {
alternativeText = "";
} else {
alternativeText = I18nUtilities.format(null... | [
"protected",
"static",
"void",
"renderTagOpen",
"(",
"final",
"WImage",
"imageComponent",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"// Check for alternative text on the image",
"String",
"alternativeText",
"=",
"imageComponent",
".",
"getAlternativeText",
"(",
"... | Builds the "open tag" part of the XML, that is the tagname and attributes.
E.g. <ui:image src="example.png" alt="some alt txt"
The caller may then append any additional attributes and then close the XML tag.
@param imageComponent The WImage to render.
@param xml The buffer to render the XML into. | [
"Builds",
"the",
"open",
"tag",
"part",
"of",
"the",
"XML",
"that",
"is",
"the",
"tagname",
"and",
"attributes",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageRenderer.java#L28-L57 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/Integrity.java | Integrity.issue | public static void issue(final WComponent comp, final String message) {
String debugMessage = message + ' ' + comp;
if (ConfigurationProperties.getIntegrityErrorMode()) {
throw new IntegrityException(debugMessage);
} else {
LogFactory.getLog(Integrity.class).warn(debugMessage);
}
} | java | public static void issue(final WComponent comp, final String message) {
String debugMessage = message + ' ' + comp;
if (ConfigurationProperties.getIntegrityErrorMode()) {
throw new IntegrityException(debugMessage);
} else {
LogFactory.getLog(Integrity.class).warn(debugMessage);
}
} | [
"public",
"static",
"void",
"issue",
"(",
"final",
"WComponent",
"comp",
",",
"final",
"String",
"message",
")",
"{",
"String",
"debugMessage",
"=",
"message",
"+",
"'",
"'",
"+",
"comp",
";",
"if",
"(",
"ConfigurationProperties",
".",
"getIntegrityErrorMode",... | Raises an integrity issue.
@param comp the component to issue the exception for.
@param message the integrity message to issue. | [
"Raises",
"an",
"integrity",
"issue",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/Integrity.java#L32-L40 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/AbstractWFieldIndicatorRenderer.java | AbstractWFieldIndicatorRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
AbstractWFieldIndicator fieldIndicator = (AbstractWFieldIndicator) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent validationTarget = fieldIndicator.getTargetComponent();
// no need t... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
AbstractWFieldIndicator fieldIndicator = (AbstractWFieldIndicator) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent validationTarget = fieldIndicator.getTargetComponent();
// no need t... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"AbstractWFieldIndicator",
"fieldIndicator",
"=",
"(",
"AbstractWFieldIndicator",
")",
"component",
";",
"XmlStringBui... | Paints the given AbstractWFieldIndicator.
@param component the WFieldErrorIndicator to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"AbstractWFieldIndicator",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/AbstractWFieldIndicatorRenderer.java#L28-L81 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePicker.java | ExamplePicker.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
// Check project versions for Wcomponents-examples and WComponents match
String egVersion = Config.getInstance().getString("wcomponents-examples.version");
String wcVersio... | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
// Check project versions for Wcomponents-examples and WComponents match
String egVersion = Config.getInstance().getString("wcomponents-examples.version");
String wcVersio... | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"if",
"(",
"!",
"isInitialised",
"(",
")",
")",
"{",
"// Check project versions for Wcompo... | Override preparePaint in order to set up the resources on first access by a user.
@param request the request being responded to. | [
"Override",
"preparePaint",
"in",
"order",
"to",
"set",
"up",
"the",
"resources",
"on",
"first",
"access",
"by",
"a",
"user",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePicker.java#L79-L99 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WField.java | WField.setInputWidth | public void setInputWidth(final int inputWidth) {
if (inputWidth > 100) {
throw new IllegalArgumentException(
"inputWidth (" + inputWidth + ") cannot be greater than 100 percent.");
}
getOrCreateComponentModel().inputWidth = Math.max(0, inputWidth);
} | java | public void setInputWidth(final int inputWidth) {
if (inputWidth > 100) {
throw new IllegalArgumentException(
"inputWidth (" + inputWidth + ") cannot be greater than 100 percent.");
}
getOrCreateComponentModel().inputWidth = Math.max(0, inputWidth);
} | [
"public",
"void",
"setInputWidth",
"(",
"final",
"int",
"inputWidth",
")",
"{",
"if",
"(",
"inputWidth",
">",
"100",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"inputWidth (\"",
"+",
"inputWidth",
"+",
"\") cannot be greater than 100 percent.\"",
"... | Sets the desired width of the input field, as a percentage of the available space.
@param inputWidth the percentage width, or <= 0 to use the default field width. | [
"Sets",
"the",
"desired",
"width",
"of",
"the",
"input",
"field",
"as",
"a",
"percentage",
"of",
"the",
"available",
"space",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WField.java#L260-L266 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java | ExamplePickerTree.setUp | private void setUp() {
addExamples("AJAX", ExampleData.AJAX_EXAMPLES);
addExamples("Form controls", ExampleData.FORM_CONTROLS);
addExamples("Feedback and indicators", ExampleData.FEEDBACK_AND_INDICATORS);
addExamples("Layout", ExampleData.LAYOUT_EXAMPLES);
addExamples("Menus", ExampleData.MENU_EXAMPLES);
ad... | java | private void setUp() {
addExamples("AJAX", ExampleData.AJAX_EXAMPLES);
addExamples("Form controls", ExampleData.FORM_CONTROLS);
addExamples("Feedback and indicators", ExampleData.FEEDBACK_AND_INDICATORS);
addExamples("Layout", ExampleData.LAYOUT_EXAMPLES);
addExamples("Menus", ExampleData.MENU_EXAMPLES);
ad... | [
"private",
"void",
"setUp",
"(",
")",
"{",
"addExamples",
"(",
"\"AJAX\"",
",",
"ExampleData",
".",
"AJAX_EXAMPLES",
")",
";",
"addExamples",
"(",
"\"Form controls\"",
",",
"ExampleData",
".",
"FORM_CONTROLS",
")",
";",
"addExamples",
"(",
"\"Feedback and indicato... | Add the examples as data in the tree. | [
"Add",
"the",
"examples",
"as",
"data",
"in",
"the",
"tree",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java#L37-L51 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java | ExamplePickerTree.addExamples | public void addExamples(final String groupName, final ExampleData[] entries) {
data.add(new ExampleMenuList(groupName, entries));
} | java | public void addExamples(final String groupName, final ExampleData[] entries) {
data.add(new ExampleMenuList(groupName, entries));
} | [
"public",
"void",
"addExamples",
"(",
"final",
"String",
"groupName",
",",
"final",
"ExampleData",
"[",
"]",
"entries",
")",
"{",
"data",
".",
"add",
"(",
"new",
"ExampleMenuList",
"(",
"groupName",
",",
"entries",
")",
")",
";",
"}"
] | Add a set of examples to the WTree.
@param groupName The name of the example group.
@param entries An array of examples in this group. | [
"Add",
"a",
"set",
"of",
"examples",
"to",
"the",
"WTree",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java#L67-L69 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java | ExamplePickerTree.getSelectedExampleData | public final ExampleData getSelectedExampleData() {
Set<String> allSelectedItems = getSelectedRows();
if (allSelectedItems == null || allSelectedItems.isEmpty()) {
return null;
}
for (String selectedItem : allSelectedItems) {
// Only interested in the first selected item as it is a single select list.
... | java | public final ExampleData getSelectedExampleData() {
Set<String> allSelectedItems = getSelectedRows();
if (allSelectedItems == null || allSelectedItems.isEmpty()) {
return null;
}
for (String selectedItem : allSelectedItems) {
// Only interested in the first selected item as it is a single select list.
... | [
"public",
"final",
"ExampleData",
"getSelectedExampleData",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"allSelectedItems",
"=",
"getSelectedRows",
"(",
")",
";",
"if",
"(",
"allSelectedItems",
"==",
"null",
"||",
"allSelectedItems",
".",
"isEmpty",
"(",
")",
")... | Get the example which is selected in the tree.
@return an example data object. | [
"Get",
"the",
"example",
"which",
"is",
"selected",
"in",
"the",
"tree",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java#L76-L87 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java | ExamplePickerTree.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
setInitialised(true);
setTreeModel(new MenuTreeModel(data));
}
} | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
setInitialised(true);
setTreeModel(new MenuTreeModel(data));
}
} | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"if",
"(",
"!",
"isInitialised",
"(",
")",
")",
"{",
"setInitialised",
"(",
"true",
... | Set the tree model on first use.
@param request The request. | [
"Set",
"the",
"tree",
"model",
"on",
"first",
"use",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java#L94-L101 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/BorderLayoutExample.java | BorderLayoutExample.createPanelWithText | private WPanel createPanelWithText(final String title, final String text) {
WPanel panel = new WPanel(WPanel.Type.CHROME);
panel.setTitleText(title);
WText textComponent = new WText(text);
textComponent.setEncodeText(false);
panel.add(textComponent);
return panel;
} | java | private WPanel createPanelWithText(final String title, final String text) {
WPanel panel = new WPanel(WPanel.Type.CHROME);
panel.setTitleText(title);
WText textComponent = new WText(text);
textComponent.setEncodeText(false);
panel.add(textComponent);
return panel;
} | [
"private",
"WPanel",
"createPanelWithText",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"text",
")",
"{",
"WPanel",
"panel",
"=",
"new",
"WPanel",
"(",
"WPanel",
".",
"Type",
".",
"CHROME",
")",
";",
"panel",
".",
"setTitleText",
"(",
"title",... | Convenience method to create a WPanel with the given title and text.
@param title the panel title.
@param text the panel text.
@return a new WPanel with the given title and text. | [
"Convenience",
"method",
"to",
"create",
"a",
"WPanel",
"with",
"the",
"given",
"title",
"and",
"text",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/BorderLayoutExample.java#L148-L156 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/WValidationErrors.java | WValidationErrors.setErrors | public void setErrors(final List<Diagnostic> errors) {
if (errors != null) {
ValidationErrorsModel model = getOrCreateComponentModel();
for (Diagnostic error : errors) {
if (error.getSeverity() == Diagnostic.ERROR) {
model.errors.add(error);
}
}
}
} | java | public void setErrors(final List<Diagnostic> errors) {
if (errors != null) {
ValidationErrorsModel model = getOrCreateComponentModel();
for (Diagnostic error : errors) {
if (error.getSeverity() == Diagnostic.ERROR) {
model.errors.add(error);
}
}
}
} | [
"public",
"void",
"setErrors",
"(",
"final",
"List",
"<",
"Diagnostic",
">",
"errors",
")",
"{",
"if",
"(",
"errors",
"!=",
"null",
")",
"{",
"ValidationErrorsModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"for",
"(",
"Diagnostic",
"error"... | Sets the errors for a given user.
@param errors the errors to set. | [
"Sets",
"the",
"errors",
"for",
"a",
"given",
"user",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/WValidationErrors.java#L46-L56 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/WValidationErrors.java | WValidationErrors.getGroupedErrors | public List<GroupedDiagnositcs> getGroupedErrors() {
List<GroupedDiagnositcs> grouped = new ArrayList<>();
Diagnostic previousError = null;
GroupedDiagnositcs group = null;
for (Diagnostic theError : getErrors()) {
boolean isNewField = ((previousError == null) || (previousError.getContext() != theError.
... | java | public List<GroupedDiagnositcs> getGroupedErrors() {
List<GroupedDiagnositcs> grouped = new ArrayList<>();
Diagnostic previousError = null;
GroupedDiagnositcs group = null;
for (Diagnostic theError : getErrors()) {
boolean isNewField = ((previousError == null) || (previousError.getContext() != theError.
... | [
"public",
"List",
"<",
"GroupedDiagnositcs",
">",
"getGroupedErrors",
"(",
")",
"{",
"List",
"<",
"GroupedDiagnositcs",
">",
"grouped",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Diagnostic",
"previousError",
"=",
"null",
";",
"GroupedDiagnositcs",
"group",
... | Groups the errors by their source field.
@return a list of grouped errors. | [
"Groups",
"the",
"errors",
"by",
"their",
"source",
"field",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/validation/WValidationErrors.java#L82-L103 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDateFieldRenderer.java | WDateFieldRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDateField dateField = (WDateField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = dateField.isReadOnly();
Date date = dateField.getDate();
xml.appendTagOpen("ui:datefield"... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDateField dateField = (WDateField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = dateField.isReadOnly();
Date date = dateField.getDate();
xml.appendTagOpen("ui:datefield"... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WDateField",
"dateField",
"=",
"(",
"WDateField",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"rende... | Paints the given WDateField.
@param component the WDateField to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WDateField",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDateFieldRenderer.java#L31-L84 | train |
podio/podio-java | src/main/java/com/podio/user/UserAPI.java | UserAPI.updateUser | public void updateUser(UserUpdate update) {
getResourceFactory().getApiResource("/user/")
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
} | java | public void updateUser(UserUpdate update) {
getResourceFactory().getApiResource("/user/")
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateUser",
"(",
"UserUpdate",
"update",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/user/\"",
")",
".",
"entity",
"(",
"update",
",",
"MediaType",
".",
"APPLICATION_JSON_TYPE",
")",
".",
"put",
"(",
")",
";"... | Updates the active user. The old and new password can be left out, in
which case the password will not be changed. If the mail is changed, the
old password has to be supplied as well. | [
"Updates",
"the",
"active",
"user",
".",
"The",
"old",
"and",
"new",
"password",
"can",
"be",
"left",
"out",
"in",
"which",
"case",
"the",
"password",
"will",
"not",
"be",
"changed",
".",
"If",
"the",
"mail",
"is",
"changed",
"the",
"old",
"password",
... | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/user/UserAPI.java#L31-L34 | train |
podio/podio-java | src/main/java/com/podio/user/UserAPI.java | UserAPI.getProfileField | public <T, R> List<T> getProfileField(ProfileField<T, R> field) {
List<R> values = getResourceFactory().getApiResource(
"/user/profile/" + field.getName()).get(
new GenericType<List<R>>() {
});
List<T> formatted = new ArrayList<T>();
for (R value : values) {
formatted.add(field.parse(value));
}
... | java | public <T, R> List<T> getProfileField(ProfileField<T, R> field) {
List<R> values = getResourceFactory().getApiResource(
"/user/profile/" + field.getName()).get(
new GenericType<List<R>>() {
});
List<T> formatted = new ArrayList<T>();
for (R value : values) {
formatted.add(field.parse(value));
}
... | [
"public",
"<",
"T",
",",
"R",
">",
"List",
"<",
"T",
">",
"getProfileField",
"(",
"ProfileField",
"<",
"T",
",",
"R",
">",
"field",
")",
"{",
"List",
"<",
"R",
">",
"values",
"=",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/user/p... | Returns the field of the profile for the given key from the active user.
@param field
The field to return the values for
@return The values for the given field | [
"Returns",
"the",
"field",
"of",
"the",
"profile",
"for",
"the",
"given",
"key",
"from",
"the",
"active",
"user",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/user/UserAPI.java#L64-L76 | train |
podio/podio-java | src/main/java/com/podio/user/UserAPI.java | UserAPI.updateProfile | public void updateProfile(ProfileUpdate profile) {
getResourceFactory().getApiResource("/user/profile/")
.entity(profile, MediaType.APPLICATION_JSON_TYPE).put();
} | java | public void updateProfile(ProfileUpdate profile) {
getResourceFactory().getApiResource("/user/profile/")
.entity(profile, MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateProfile",
"(",
"ProfileUpdate",
"profile",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/user/profile/\"",
")",
".",
"entity",
"(",
"profile",
",",
"MediaType",
".",
"APPLICATION_JSON_TYPE",
")",
".",
"put",
"... | Updates the fields of an existing profile. All fields must be filled out,
as any fields not included will not be part of the new revision.
@param profile
The updated profile | [
"Updates",
"the",
"fields",
"of",
"an",
"existing",
"profile",
".",
"All",
"fields",
"must",
"be",
"filled",
"out",
"as",
"any",
"fields",
"not",
"included",
"will",
"not",
"be",
"part",
"of",
"the",
"new",
"revision",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/user/UserAPI.java#L85-L88 | train |
podio/podio-java | src/main/java/com/podio/user/UserAPI.java | UserAPI.updateProfile | public void updateProfile(ProfileFieldValues values) {
getResourceFactory().getApiResource("/user/profile/")
.entity(values, MediaType.APPLICATION_JSON_TYPE).put();
} | java | public void updateProfile(ProfileFieldValues values) {
getResourceFactory().getApiResource("/user/profile/")
.entity(values, MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateProfile",
"(",
"ProfileFieldValues",
"values",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/user/profile/\"",
")",
".",
"entity",
"(",
"values",
",",
"MediaType",
".",
"APPLICATION_JSON_TYPE",
")",
".",
"put",
... | Updates the fields of an existing profile. Will only update the fields in
the values.
@param values
The updated values for the profile | [
"Updates",
"the",
"fields",
"of",
"an",
"existing",
"profile",
".",
"Will",
"only",
"update",
"the",
"fields",
"in",
"the",
"values",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/user/UserAPI.java#L151-L154 | train |
podio/podio-java | src/main/java/com/podio/user/UserAPI.java | UserAPI.setProperty | public void setProperty(String key, boolean value) {
getResourceFactory()
.getApiResource("/user/property/" + key)
.entity(new PropertyValue(value),
MediaType.APPLICATION_JSON_TYPE).put();
} | java | public void setProperty(String key, boolean value) {
getResourceFactory()
.getApiResource("/user/property/" + key)
.entity(new PropertyValue(value),
MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"setProperty",
"(",
"String",
"key",
",",
"boolean",
"value",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/user/property/\"",
"+",
"key",
")",
".",
"entity",
"(",
"new",
"PropertyValue",
"(",
"value",
")",
",",
... | Sets the value of the property for the active user with the given name.
The property is specific to the auth client used.
@param key
The key of the property
@param value
The value of the property | [
"Sets",
"the",
"value",
"of",
"the",
"property",
"for",
"the",
"active",
"user",
"with",
"the",
"given",
"name",
".",
"The",
"property",
"is",
"specific",
"to",
"the",
"auth",
"client",
"used",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/user/UserAPI.java#L186-L191 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractTreeTableDataModel.java | AbstractTreeTableDataModel.getNodeAtLine | @Override
public final TableTreeNode getNodeAtLine(final int row) {
TableTreeNode node = root.next(); // the root node is never used
for (int index = 0; node != null && index < row; index++) {
node = node.next();
}
return node;
} | java | @Override
public final TableTreeNode getNodeAtLine(final int row) {
TableTreeNode node = root.next(); // the root node is never used
for (int index = 0; node != null && index < row; index++) {
node = node.next();
}
return node;
} | [
"@",
"Override",
"public",
"final",
"TableTreeNode",
"getNodeAtLine",
"(",
"final",
"int",
"row",
")",
"{",
"TableTreeNode",
"node",
"=",
"root",
".",
"next",
"(",
")",
";",
"// the root node is never used",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"node",... | Returns the node at the given line.
@param row the row index.
@return the node at the given line, or null if the index is out of bounds. | [
"Returns",
"the",
"node",
"at",
"the",
"given",
"line",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractTreeTableDataModel.java#L42-L51 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java | WMenu.handleRequest | @Override
public void handleRequest(final Request request) {
if (isDisabled()) {
// Protect against client-side tampering of disabled/read-only fields.
return;
}
if (isPresent(request)) {
List<MenuItemSelectable> selectedItems = new ArrayList<>();
// Unfortunately, we need to recurse through all the... | java | @Override
public void handleRequest(final Request request) {
if (isDisabled()) {
// Protect against client-side tampering of disabled/read-only fields.
return;
}
if (isPresent(request)) {
List<MenuItemSelectable> selectedItems = new ArrayList<>();
// Unfortunately, we need to recurse through all the... | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"isDisabled",
"(",
")",
")",
"{",
"// Protect against client-side tampering of disabled/read-only fields.",
"return",
";",
"}",
"if",
"(",
"isPresent",
"(",
... | Override handleRequest in order to perform processing specific to WMenu.
@param request the request being handled. | [
"Override",
"handleRequest",
"in",
"order",
"to",
"perform",
"processing",
"specific",
"to",
"WMenu",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java#L448-L461 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java | WMenu.findSelections | private void findSelections(final Request request, final MenuSelectContainer selectContainer,
final List<MenuItemSelectable> selections) {
// Don't bother checking disabled or invisible containers
if (!selectContainer.isVisible()
|| (selectContainer instanceof Disableable && ((Disableable) selectContainer).... | java | private void findSelections(final Request request, final MenuSelectContainer selectContainer,
final List<MenuItemSelectable> selections) {
// Don't bother checking disabled or invisible containers
if (!selectContainer.isVisible()
|| (selectContainer instanceof Disableable && ((Disableable) selectContainer).... | [
"private",
"void",
"findSelections",
"(",
"final",
"Request",
"request",
",",
"final",
"MenuSelectContainer",
"selectContainer",
",",
"final",
"List",
"<",
"MenuItemSelectable",
">",
"selections",
")",
"{",
"// Don't bother checking disabled or invisible containers",
"if",
... | Finds the selected items in a menu for a request.
@param request the request being handled
@param selectContainer the menu or sub-menu
@param selections the current set of selections | [
"Finds",
"the",
"selected",
"items",
"in",
"a",
"menu",
"for",
"a",
"request",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java#L496-L533 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java | WMenu.getSelectableItems | private List<MenuItemSelectable> getSelectableItems(final MenuSelectContainer selectContainer) {
List<MenuItemSelectable> result = new ArrayList<>(selectContainer.getMenuItems().size());
SelectionMode selectionMode = selectContainer.getSelectionMode();
for (MenuItem item : selectContainer.getMenuItems()) {
i... | java | private List<MenuItemSelectable> getSelectableItems(final MenuSelectContainer selectContainer) {
List<MenuItemSelectable> result = new ArrayList<>(selectContainer.getMenuItems().size());
SelectionMode selectionMode = selectContainer.getSelectionMode();
for (MenuItem item : selectContainer.getMenuItems()) {
i... | [
"private",
"List",
"<",
"MenuItemSelectable",
">",
"getSelectableItems",
"(",
"final",
"MenuSelectContainer",
"selectContainer",
")",
"{",
"List",
"<",
"MenuItemSelectable",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"selectContainer",
".",
"getMenuItems",
"... | Retrieves the selectable items for the given container.
@param selectContainer the component to search within.
@return the list of selectable items for the given component. May be empty. | [
"Retrieves",
"the",
"selectable",
"items",
"for",
"the",
"given",
"container",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java#L541-L559 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java | WMenu.isSelectable | private boolean isSelectable(final MenuItem item, final SelectionMode selectionMode) {
if (!(item instanceof MenuItemSelectable) || !item.isVisible()
|| (item instanceof Disableable && ((Disableable) item).isDisabled())) {
return false;
}
// SubMenus are only selectable in a column menu type
if (item i... | java | private boolean isSelectable(final MenuItem item, final SelectionMode selectionMode) {
if (!(item instanceof MenuItemSelectable) || !item.isVisible()
|| (item instanceof Disableable && ((Disableable) item).isDisabled())) {
return false;
}
// SubMenus are only selectable in a column menu type
if (item i... | [
"private",
"boolean",
"isSelectable",
"(",
"final",
"MenuItem",
"item",
",",
"final",
"SelectionMode",
"selectionMode",
")",
"{",
"if",
"(",
"!",
"(",
"item",
"instanceof",
"MenuItemSelectable",
")",
"||",
"!",
"item",
".",
"isVisible",
"(",
")",
"||",
"(",
... | Indicates whether the given menu item is selectable.
@param item the menu item to check.
@param selectionMode the select mode of the current menu/sub-menu
@return true if the meu item is selectable, false otherwise. | [
"Indicates",
"whether",
"the",
"given",
"menu",
"item",
"is",
"selectable",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java#L568-L589 | train |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/PBaseValueEqual.java | PBaseValueEqual.in | @SafeVarargs
public final R in(T... values) {
expr().in(_name, (Object[]) values);
return _root;
} | java | @SafeVarargs
public final R in(T... values) {
expr().in(_name, (Object[]) values);
return _root;
} | [
"@",
"SafeVarargs",
"public",
"final",
"R",
"in",
"(",
"T",
"...",
"values",
")",
"{",
"expr",
"(",
")",
".",
"in",
"(",
"_name",
",",
"(",
"Object",
"[",
"]",
")",
"values",
")",
";",
"return",
"_root",
";",
"}"
] | Is in a list of values.
@param values the list of values for the predicate
@return the root query bean instance | [
"Is",
"in",
"a",
"list",
"of",
"values",
"."
] | 821650cb817c9c0fdcc97f93408dc79170b12423 | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/PBaseValueEqual.java#L111-L115 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/AbstractSearchReplaceWriter.java | AbstractSearchReplaceWriter.write | @Override
public void write(final char[] cbuf, final int off, final int len) throws IOException {
if (buffer == null) {
// Nothing to replace, just pass the data through
backing.write(cbuf, off, len);
} else {
for (int i = off; i < off + len; i++) {
buffer[bufferLen++] = cbuf[i];
if (bufferLen ==... | java | @Override
public void write(final char[] cbuf, final int off, final int len) throws IOException {
if (buffer == null) {
// Nothing to replace, just pass the data through
backing.write(cbuf, off, len);
} else {
for (int i = off; i < off + len; i++) {
buffer[bufferLen++] = cbuf[i];
if (bufferLen ==... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"final",
"char",
"[",
"]",
"cbuf",
",",
"final",
"int",
"off",
",",
"final",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",
"// Nothing to replace, just pass th... | Implementation of Writer's write method.
@param cbuf the character buffer to write.
@param off the start position in the array to write from.
@param len the amount of character data to write.
@throws IOException if there is an error writing to the underlying buffer. | [
"Implementation",
"of",
"Writer",
"s",
"write",
"method",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/AbstractSearchReplaceWriter.java#L111-L125 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/AbstractSearchReplaceWriter.java | AbstractSearchReplaceWriter.writeBuf | private void writeBuf(final int endPos) throws IOException {
// If the stream is not closed, we only process half the buffer at once.
String searchTerm;
int pos = 0;
int lastWritePos = 0;
while (pos < endPos) {
searchTerm = findSearchStrings(pos);
if (searchTerm != null) {
if (lastWritePos != pos)... | java | private void writeBuf(final int endPos) throws IOException {
// If the stream is not closed, we only process half the buffer at once.
String searchTerm;
int pos = 0;
int lastWritePos = 0;
while (pos < endPos) {
searchTerm = findSearchStrings(pos);
if (searchTerm != null) {
if (lastWritePos != pos)... | [
"private",
"void",
"writeBuf",
"(",
"final",
"int",
"endPos",
")",
"throws",
"IOException",
"{",
"// If the stream is not closed, we only process half the buffer at once.",
"String",
"searchTerm",
";",
"int",
"pos",
"=",
"0",
";",
"int",
"lastWritePos",
"=",
"0",
";",... | Writes the current contents of the buffer, up to the given position. More data may be written from the buffer
when there is a search string that crosses over endPos.
@param endPos the end position to stop writing
@throws IOException if there is an error writing to the underlying writer. | [
"Writes",
"the",
"current",
"contents",
"of",
"the",
"buffer",
"up",
"to",
"the",
"given",
"position",
".",
"More",
"data",
"may",
"be",
"written",
"from",
"the",
"buffer",
"when",
"there",
"is",
"a",
"search",
"string",
"that",
"crosses",
"over",
"endPos"... | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/AbstractSearchReplaceWriter.java#L134-L164 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/AbstractSearchReplaceWriter.java | AbstractSearchReplaceWriter.findSearchStrings | private String findSearchStrings(final int start) {
String longestMatch = null;
// Loop for each string
for (int i = 0; i < search.length; i++) {
// No point checking a String that's too long
if (start + search[i].length() > bufferLen) {
continue;
}
boolean found = true;
// Loop for each cha... | java | private String findSearchStrings(final int start) {
String longestMatch = null;
// Loop for each string
for (int i = 0; i < search.length; i++) {
// No point checking a String that's too long
if (start + search[i].length() > bufferLen) {
continue;
}
boolean found = true;
// Loop for each cha... | [
"private",
"String",
"findSearchStrings",
"(",
"final",
"int",
"start",
")",
"{",
"String",
"longestMatch",
"=",
"null",
";",
"// Loop for each string",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"search",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Searches for any search strings in the buffer that start between the specified offsets.
@param start the start search offset
@return the first search String found, or null if none were found. | [
"Searches",
"for",
"any",
"search",
"strings",
"in",
"the",
"buffer",
"that",
"start",
"between",
"the",
"specified",
"offsets",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/AbstractSearchReplaceWriter.java#L173-L206 | train |
podio/podio-java | src/main/java/com/podio/status/StatusAPI.java | StatusAPI.createStatus | public int createStatus(int spaceId, StatusCreate status) {
return getResourceFactory()
.getApiResource("/status/space/" + spaceId + "/")
.entity(status, MediaType.APPLICATION_JSON_TYPE)
.post(StatusCreateResponse.class).getId();
} | java | public int createStatus(int spaceId, StatusCreate status) {
return getResourceFactory()
.getApiResource("/status/space/" + spaceId + "/")
.entity(status, MediaType.APPLICATION_JSON_TYPE)
.post(StatusCreateResponse.class).getId();
} | [
"public",
"int",
"createStatus",
"(",
"int",
"spaceId",
",",
"StatusCreate",
"status",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/status/space/\"",
"+",
"spaceId",
"+",
"\"/\"",
")",
".",
"entity",
"(",
"status",
",",
... | Creates a new status message for a user on a specific space. A status
update is simply a short text message that the user wishes to share with
the rest of the space.
@param status
The data for the new status message
@return The id of the newly created status message | [
"Creates",
"a",
"new",
"status",
"message",
"for",
"a",
"user",
"on",
"a",
"specific",
"space",
".",
"A",
"status",
"update",
"is",
"simply",
"a",
"short",
"text",
"message",
"that",
"the",
"user",
"wishes",
"to",
"share",
"with",
"the",
"rest",
"of",
... | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/status/StatusAPI.java#L32-L37 | train |
podio/podio-java | src/main/java/com/podio/status/StatusAPI.java | StatusAPI.updateStatus | public void updateStatus(int statusId, StatusUpdate update) {
getResourceFactory().getApiResource("/status/" + statusId)
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
} | java | public void updateStatus(int statusId, StatusUpdate update) {
getResourceFactory().getApiResource("/status/" + statusId)
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateStatus",
"(",
"int",
"statusId",
",",
"StatusUpdate",
"update",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/status/\"",
"+",
"statusId",
")",
".",
"entity",
"(",
"update",
",",
"MediaType",
".",
"APPLICATI... | This will update an existing status message. This will normally only be
used to correct spelling and grammatical mistakes.
@param statusId
The id of the status to be updated
@param update
The new data for the status | [
"This",
"will",
"update",
"an",
"existing",
"status",
"message",
".",
"This",
"will",
"normally",
"only",
"be",
"used",
"to",
"correct",
"spelling",
"and",
"grammatical",
"mistakes",
"."
] | a520b23bac118c957ce02cdd8ff42a6c7d17b49a | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/status/StatusAPI.java#L73-L76 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/registry/UIRegistryClassLoaderImpl.java | UIRegistryClassLoaderImpl.register | @Override
public synchronized void register(final String key, final WComponent ui) {
if (isRegistered(key)) {
throw new SystemException("Cannot re-register a component. Key = " + key);
}
registry.put(key, ui);
} | java | @Override
public synchronized void register(final String key, final WComponent ui) {
if (isRegistered(key)) {
throw new SystemException("Cannot re-register a component. Key = " + key);
}
registry.put(key, ui);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"register",
"(",
"final",
"String",
"key",
",",
"final",
"WComponent",
"ui",
")",
"{",
"if",
"(",
"isRegistered",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"SystemException",
"(",
"\"Cannot re-register a comp... | Registers the given user interface with the given key.
@param key the registration key.
@param ui the user interface to register. | [
"Registers",
"the",
"given",
"user",
"interface",
"with",
"the",
"given",
"key",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/registry/UIRegistryClassLoaderImpl.java#L34-L41 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/registry/UIRegistryClassLoaderImpl.java | UIRegistryClassLoaderImpl.loadUI | private static Object loadUI(final String key) {
String classname = key.trim();
try {
Class<?> clas = Class.forName(classname);
if (WComponent.class.isAssignableFrom(clas)) {
Object instance = clas.newInstance();
LOG.debug("WComponent successfully loaded with class name \"" + classname + "\".");
... | java | private static Object loadUI(final String key) {
String classname = key.trim();
try {
Class<?> clas = Class.forName(classname);
if (WComponent.class.isAssignableFrom(clas)) {
Object instance = clas.newInstance();
LOG.debug("WComponent successfully loaded with class name \"" + classname + "\".");
... | [
"private",
"static",
"Object",
"loadUI",
"(",
"final",
"String",
"key",
")",
"{",
"String",
"classname",
"=",
"key",
".",
"trim",
"(",
")",
";",
"try",
"{",
"Class",
"<",
"?",
">",
"clas",
"=",
"Class",
".",
"forName",
"(",
"classname",
")",
";",
"... | Attemps to load a ui using the key as a class name.
@param key the registration key
@return A WComponent if one could be loaded from the classpath, else it returns Boolean.FALSE. | [
"Attemps",
"to",
"load",
"a",
"ui",
"using",
"the",
"key",
"as",
"a",
"class",
"name",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/registry/UIRegistryClassLoaderImpl.java#L92-L111 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WComponentGroupRenderer.java | WComponentGroupRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WComponentGroup group = (WComponentGroup) component;
XmlStringBuilder xml = renderContext.getWriter();
List<WComponent> components = group.getComponents();
if (components != null && !components.isEmpty()) {
... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WComponentGroup group = (WComponentGroup) component;
XmlStringBuilder xml = renderContext.getWriter();
List<WComponent> components = group.getComponents();
if (components != null && !components.isEmpty()) {
... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WComponentGroup",
"group",
"=",
"(",
"WComponentGroup",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
... | Paints the given WComponentGroup.
@param component the WComponentGroup to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WComponentGroup",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WComponentGroupRenderer.java#L23-L43 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WSectionRenderer.java | WSectionRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSection section = (WSection) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean renderChildren = isRenderContent(section);
xml.appendTagOpen("ui:section");
xml.appendAttribute("id", comp... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSection section = (WSection) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean renderChildren = isRenderContent(section);
xml.appendTagOpen("ui:section");
xml.appendAttribute("id", comp... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WSection",
"section",
"=",
"(",
"WSection",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderConte... | Paints the given WSection.
@param component the WSection to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WSection",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WSectionRenderer.java#L25-L69 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPanel.java | WPanel.remove | @Override
public void remove(final WComponent aChild) {
super.remove(aChild);
PanelModel model = getOrCreateComponentModel();
if (model.layoutConstraints == null) {
Map<WComponent, Serializable> defaultConstraints = ((PanelModel) getDefaultModel()).layoutConstraints;
if (defaultConstraints != null) {
... | java | @Override
public void remove(final WComponent aChild) {
super.remove(aChild);
PanelModel model = getOrCreateComponentModel();
if (model.layoutConstraints == null) {
Map<WComponent, Serializable> defaultConstraints = ((PanelModel) getDefaultModel()).layoutConstraints;
if (defaultConstraints != null) {
... | [
"@",
"Override",
"public",
"void",
"remove",
"(",
"final",
"WComponent",
"aChild",
")",
"{",
"super",
".",
"remove",
"(",
"aChild",
")",
";",
"PanelModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"if",
"(",
"model",
".",
"layoutConstraints"... | Removes the given component from this component's list of children. This method has been overriden to remove any
associated layout constraints.
@param aChild the child component to remove | [
"Removes",
"the",
"given",
"component",
"from",
"this",
"component",
"s",
"list",
"of",
"children",
".",
"This",
"method",
"has",
"been",
"overriden",
"to",
"remove",
"any",
"associated",
"layout",
"constraints",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPanel.java#L282-L303 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPanel.java | WPanel.getLayoutConstraints | public Serializable getLayoutConstraints(final WComponent child) {
PanelModel model = getComponentModel();
if (model.layoutConstraints != null) {
return model.layoutConstraints.get(child);
}
return null;
} | java | public Serializable getLayoutConstraints(final WComponent child) {
PanelModel model = getComponentModel();
if (model.layoutConstraints != null) {
return model.layoutConstraints.get(child);
}
return null;
} | [
"public",
"Serializable",
"getLayoutConstraints",
"(",
"final",
"WComponent",
"child",
")",
"{",
"PanelModel",
"model",
"=",
"getComponentModel",
"(",
")",
";",
"if",
"(",
"model",
".",
"layoutConstraints",
"!=",
"null",
")",
"{",
"return",
"model",
".",
"layo... | Retrieves the layout constraints for the given component, if they have been set.
@param child the child component to retrieve the constraints for.
@return the layout constraints for the given child, if set. | [
"Retrieves",
"the",
"layout",
"constraints",
"for",
"the",
"given",
"component",
"if",
"they",
"have",
"been",
"set",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WPanel.java#L320-L328 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDefinitionListRenderer.java | WDefinitionListRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDefinitionList list = (WDefinitionList) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:definitionlist");
xml.appendAttribute("id", component.getId());
xml.appendOptional... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDefinitionList list = (WDefinitionList) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:definitionlist");
xml.appendAttribute("id", component.getId());
xml.appendOptional... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WDefinitionList",
"list",
"=",
"(",
"WDefinitionList",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"... | Paints the given definition list.
@param component the list to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"definition",
"list",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDefinitionListRenderer.java#L27-L77 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java | WRowExample.addAlignedExample | private void addAlignedExample() {
add(new WHeading(HeadingLevel.H2, "WRow / WCol with column alignment"));
WRow alignedColsRow = new WRow();
add(alignedColsRow);
WColumn alignedCol = new WColumn();
alignedCol.setAlignment(WColumn.Alignment.LEFT);
alignedCol.setWidth(25);
alignedColsRow.add(alignedCol);
... | java | private void addAlignedExample() {
add(new WHeading(HeadingLevel.H2, "WRow / WCol with column alignment"));
WRow alignedColsRow = new WRow();
add(alignedColsRow);
WColumn alignedCol = new WColumn();
alignedCol.setAlignment(WColumn.Alignment.LEFT);
alignedCol.setWidth(25);
alignedColsRow.add(alignedCol);
... | [
"private",
"void",
"addAlignedExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"\"WRow / WCol with column alignment\"",
")",
")",
";",
"WRow",
"alignedColsRow",
"=",
"new",
"WRow",
"(",
")",
";",
"add",
"(",
"align... | Add an example showing column alignment. | [
"Add",
"an",
"example",
"showing",
"column",
"alignment",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java#L81-L112 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java | WRowExample.createRow | private WRow createRow(final int hgap, final int[] colWidths) {
WRow row = new WRow(hgap);
for (int i = 0; i < colWidths.length; i++) {
WColumn col = new WColumn(colWidths[i]);
WPanel box = new WPanel(WPanel.Type.BOX);
box.add(new WText(colWidths[i] + "%"));
col.add(box);
row.add(col);
}
return... | java | private WRow createRow(final int hgap, final int[] colWidths) {
WRow row = new WRow(hgap);
for (int i = 0; i < colWidths.length; i++) {
WColumn col = new WColumn(colWidths[i]);
WPanel box = new WPanel(WPanel.Type.BOX);
box.add(new WText(colWidths[i] + "%"));
col.add(box);
row.add(col);
}
return... | [
"private",
"WRow",
"createRow",
"(",
"final",
"int",
"hgap",
",",
"final",
"int",
"[",
"]",
"colWidths",
")",
"{",
"WRow",
"row",
"=",
"new",
"WRow",
"(",
"hgap",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"colWidths",
".",
"lengt... | Creates a row containing columns with the given widths.
@param hgap the horizontal gap between columns, in pixels.
@param colWidths the percentage widths for each column.
@return a WRow containing columns with the given widths. | [
"Creates",
"a",
"row",
"containing",
"columns",
"with",
"the",
"given",
"widths",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java#L121-L133 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTextFieldRenderer.java | WTextFieldRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTextField textField = (WTextField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = textField.isReadOnly();
xml.appendTagOpen("ui:textfield");
xml.appendAttribute("id", compo... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTextField textField = (WTextField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = textField.isReadOnly();
xml.appendTagOpen("ui:textfield");
xml.appendAttribute("id", compo... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WTextField",
"textField",
"=",
"(",
"WTextField",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"rende... | Paints the given WTextField.
@param component the WTextField to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WTextField",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTextFieldRenderer.java#L25-L73 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/BorderLayoutRenderer.java | BorderLayoutRenderer.getTag | private String getTag(final BorderLayoutConstraint constraint) {
switch (constraint) {
case EAST:
return "ui:east";
case NORTH:
return "ui:north";
case SOUTH:
return "ui:south";
case WEST:
return "ui:west";
case CENTER:
default:
return "ui:center";
}
} | java | private String getTag(final BorderLayoutConstraint constraint) {
switch (constraint) {
case EAST:
return "ui:east";
case NORTH:
return "ui:north";
case SOUTH:
return "ui:south";
case WEST:
return "ui:west";
case CENTER:
default:
return "ui:center";
}
} | [
"private",
"String",
"getTag",
"(",
"final",
"BorderLayoutConstraint",
"constraint",
")",
"{",
"switch",
"(",
"constraint",
")",
"{",
"case",
"EAST",
":",
"return",
"\"ui:east\"",
";",
"case",
"NORTH",
":",
"return",
"\"ui:north\"",
";",
"case",
"SOUTH",
":",
... | Retrieves the name of the element that will contain components with the given constraint.
@param constraint the constraint to retrieve the tag for.
@return the tag for the given constraint. | [
"Retrieves",
"the",
"name",
"of",
"the",
"element",
"that",
"will",
"contain",
"components",
"with",
"the",
"given",
"constraint",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/BorderLayoutRenderer.java#L72-L87 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/BorderLayoutRenderer.java | BorderLayoutRenderer.paintChildrenWithConstraint | private void paintChildrenWithConstraint(
final List<Duplet<WComponent, BorderLayoutConstraint>> children,
final WebXmlRenderContext renderContext, final BorderLayoutConstraint constraint) {
String containingTag = null;
XmlStringBuilder xml = renderContext.getWriter();
final int size = children.size();
... | java | private void paintChildrenWithConstraint(
final List<Duplet<WComponent, BorderLayoutConstraint>> children,
final WebXmlRenderContext renderContext, final BorderLayoutConstraint constraint) {
String containingTag = null;
XmlStringBuilder xml = renderContext.getWriter();
final int size = children.size();
... | [
"private",
"void",
"paintChildrenWithConstraint",
"(",
"final",
"List",
"<",
"Duplet",
"<",
"WComponent",
",",
"BorderLayoutConstraint",
">",
">",
"children",
",",
"final",
"WebXmlRenderContext",
"renderContext",
",",
"final",
"BorderLayoutConstraint",
"constraint",
")"... | Paints all the child components with the given constraint.
@param children the list of potential children to paint.
@param renderContext the RenderContext to paint to.
@param constraint the target constraint. | [
"Paints",
"all",
"the",
"child",
"components",
"with",
"the",
"given",
"constraint",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/BorderLayoutRenderer.java#L96-L120 | train |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTextAreaRenderer.java | WTextAreaRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTextArea textArea = (WTextArea) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = textArea.isReadOnly();
xml.appendTagOpen("ui:textarea");
xml.appendAttribute("id", component.g... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTextArea textArea = (WTextArea) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = textArea.isReadOnly();
xml.appendTagOpen("ui:textarea");
xml.appendAttribute("id", component.g... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WTextArea",
"textArea",
"=",
"(",
"WTextArea",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderCo... | Paints the given WTextArea.
@param component the WTextArea to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WTextArea",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTextAreaRenderer.java#L25-L86 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/JavaDocText.java | JavaDocText.extractJavaDoc | private StringBuilder extractJavaDoc(final String source) {
int docStart = source.indexOf("/**");
int docEnd = source.indexOf("*/", docStart);
int classStart = source.indexOf("public class");
int author = source.indexOf("@author");
int since = source.indexOf("@since");
if (classStart == -1) {
classStart... | java | private StringBuilder extractJavaDoc(final String source) {
int docStart = source.indexOf("/**");
int docEnd = source.indexOf("*/", docStart);
int classStart = source.indexOf("public class");
int author = source.indexOf("@author");
int since = source.indexOf("@since");
if (classStart == -1) {
classStart... | [
"private",
"StringBuilder",
"extractJavaDoc",
"(",
"final",
"String",
"source",
")",
"{",
"int",
"docStart",
"=",
"source",
".",
"indexOf",
"(",
"\"/**\"",
")",
";",
"int",
"docEnd",
"=",
"source",
".",
"indexOf",
"(",
"\"*/\"",
",",
"docStart",
")",
";",
... | extracts the javadoc. It assumes that the java doc for the class is the first javadoc in the file.
@param source string representing the java class.
@return a String builder containing the javadoc. | [
"extracts",
"the",
"javadoc",
".",
"It",
"assumes",
"that",
"the",
"java",
"doc",
"for",
"the",
"class",
"is",
"the",
"first",
"javadoc",
"in",
"the",
"file",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/JavaDocText.java#L49-L71 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/JavaDocText.java | JavaDocText.stripAsterisk | private void stripAsterisk(final StringBuilder javaDoc) {
int index = javaDoc.indexOf("*");
while (index != -1) {
javaDoc.replace(index, index + 1, "");
index = javaDoc.indexOf("*");
}
} | java | private void stripAsterisk(final StringBuilder javaDoc) {
int index = javaDoc.indexOf("*");
while (index != -1) {
javaDoc.replace(index, index + 1, "");
index = javaDoc.indexOf("*");
}
} | [
"private",
"void",
"stripAsterisk",
"(",
"final",
"StringBuilder",
"javaDoc",
")",
"{",
"int",
"index",
"=",
"javaDoc",
".",
"indexOf",
"(",
"\"*\"",
")",
";",
"while",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"javaDoc",
".",
"replace",
"(",
"index",
",... | This method removes the additional astrisks from the java doc.
@param javaDoc the string builder containing the javadoc. | [
"This",
"method",
"removes",
"the",
"additional",
"astrisks",
"from",
"the",
"java",
"doc",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/JavaDocText.java#L78-L84 | train |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/JavaDocText.java | JavaDocText.parseLink | private String parseLink(final String link) {
String[] tokens = link.substring(7, link.length() - 1).split("\\s");
if (tokens.length == 1) {
return tokens[0];
}
StringBuilder result = new StringBuilder();
boolean parametersSeen = false;
boolean inParameters = false;
for (int index = 0; index < tokens... | java | private String parseLink(final String link) {
String[] tokens = link.substring(7, link.length() - 1).split("\\s");
if (tokens.length == 1) {
return tokens[0];
}
StringBuilder result = new StringBuilder();
boolean parametersSeen = false;
boolean inParameters = false;
for (int index = 0; index < tokens... | [
"private",
"String",
"parseLink",
"(",
"final",
"String",
"link",
")",
"{",
"String",
"[",
"]",
"tokens",
"=",
"link",
".",
"substring",
"(",
"7",
",",
"link",
".",
"length",
"(",
")",
"-",
"1",
")",
".",
"split",
"(",
"\"\\\\s\"",
")",
";",
"if",
... | a helper method to process the links as they are found.
@param link the string representing the original link.
@return a new string to replace the old link. | [
"a",
"helper",
"method",
"to",
"process",
"the",
"links",
"as",
"they",
"are",
"found",
"."
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/JavaDocText.java#L108-L137 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.