code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private WButton newVisibilityToggleForTab(final int idx) {
WButton toggleButton = new WButton("Toggle visibility of tab " + (idx + 1));
toggleButton.setAction(new Action() {
@Override
public void execute(final ActionEvent event) {
boolean tabVisible = tabset.isTabVisible(idx);
tabset.setTabVisible(id... | java |
private <T extends Enum<T>> EnumerationRadioButtonSelect<T> createRadioButtonGroup(
final T[] options) {
EnumerationRadioButtonSelect<T> rbSelect = new EnumerationRadioButtonSelect<>(options);
rbSelect.setButtonLayout(EnumerationRadioButtonSelect.Layout.FLAT);
rbSelect.setFrameless(true);
return rbSelect;
} | java |
private void displaySelected() {
copySelection(table1, selected1);
copySelection(table2, selected2);
copySelection(table3, selected3);
} | java |
private BigDecimal convertValue(final Object value) {
if (value == null) {
return null;
} else if (value instanceof BigDecimal) {
return (BigDecimal) value;
}
// Try and convert "String" value
String dataString = value.toString();
if (Util.empty(dataString)) {
return null;
}
try {
return n... | java |
public void setMinValue(final BigDecimal minValue) {
BigDecimal currMin = getMinValue();
if (!Objects.equals(minValue, currMin)) {
getOrCreateComponentModel().minValue = minValue;
}
} | java |
public void setMaxValue(final BigDecimal maxValue) {
BigDecimal currMax = getMaxValue();
if (!Objects.equals(maxValue, currMax)) {
getOrCreateComponentModel().maxValue = maxValue;
}
} | java |
@Override
protected void validateComponent(final List<Diagnostic> diags) {
if (isValidNumber()) {
super.validateComponent(diags);
validateNumber(diags);
} else {
diags.add(createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_INVALID, this));
}
} | java |
private static boolean containsError(final List<Diagnostic> diags) {
if (diags == null || diags.isEmpty()) {
return false;
}
for (Diagnostic diag : diags) {
if (diag.getSeverity() == Diagnostic.ERROR) {
return true;
}
}
return false;
} | java |
@Override
protected boolean doHandleRequest(final Request request) {
String value = getRequestValue(request);
String current = getValue();
boolean changed = !Util.equals(value, current);
if (changed) {
setData(value);
}
return changed;
} | java |
@Override
public void preparePaint(final Request request) {
UIContext uic = UIContextHolder.getCurrent();
Headers headers = uic.getUI().getHeaders();
headers.reset();
headers.setContentType(WebUtilities.CONTENT_TYPE_XML);
super.preparePaint(request);
} | java |
@Override
public void paint(final RenderContext renderContext) {
WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
XmlStringBuilder xml = webRenderContext.getWriter();
AjaxOperation operation = AjaxHelper.getCurrentOperation();
if (operation == null) {
// the request attribute tha... | java |
@Deprecated
@Override
public void add(final WComponent component, final String tag) {
super.add(component, tag);
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WAudio audioComponent = (WAudio) component;
XmlStringBuilder xml = renderContext.getWriter();
Audio[] audio = audioComponent.getAudio();
if (audio == null || audio.length == 0) {
return;
}
WAudio.Cont... | java |
private void addResponsiveExample() {
add(new WHeading(HeadingLevel.H2, "Default responsive design"));
add(new ExplanatoryText("This example applies the theme's default responsive design rules for ColumnLayout.\n "
+ "The columns have width and alignment and there is also a hgap and a vgap."));
WPanel panel... | java |
private static String getTitle(final int[] widths) {
StringBuffer buf = new StringBuffer("Column widths: ");
for (int i = 0; i < widths.length; i++) {
if (i > 0) {
buf.append(", ");
}
buf.append(widths[i]);
}
return buf.toString();
} | java |
private void addHgapVGapExample(final Size hgap, final Size vgap) {
add(new WHeading(HeadingLevel.H2, "Column Layout: hgap=" + hgap.toString() + " vgap=" + vgap.toString()));
WPanel panel = new WPanel();
panel.setLayout(new ColumnLayout(new int[]{25, 25, 25, 25}, hgap, vgap));
add(panel);
for (int i = 0; i <... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTableRowRenderer renderer = (WTableRowRenderer) component;
XmlStringBuilder xml = renderContext.getWriter();
WTable table = renderer.getTable();
TableModel dataModel = table.getTableModel();
int[] columnOr... | java |
public static Policy createPolicy(final String resourceName) {
if (StringUtils.isBlank(resourceName)) {
throw new SystemException("AntiSamy Policy resourceName cannot be null ");
}
URL resource = HtmlSanitizerUtil.class.getClassLoader().getResource(resourceName);
if (resource == null) {
throw new SystemEx... | java |
@Override
public void handleRequest(final Request request) {
// Let the wcomponent gather data from the request.
super.handleRequest(request);
Object data = getData();
if (data != null) {
// Now update the data object (bound to this wcomponent) by copying
// values from this wcomponent and its children... | java |
@Override
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws
ServletException,
IOException {
ServletUtil.handleThemeResourceRequest(req, resp);
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WCollapsibleToggle toggle = (WCollapsibleToggle) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:collapsibletoggle");
xml.appendAttribute("id", component.getId());
xml.app... | java |
public static boolean empty(final String aString) {
if (aString != null) {
final int len = aString.length();
for (int i = 0; i < len; i++) {
// This mirrors String.trim(), which removes ASCII
// control characters as well as whitespace.
if (aString.charAt(i) > ' ') {
return false;
}
}
... | java |
public static int compareAllowNull(final Comparable c1, final Comparable c2) {
if (c1 == null && c2 == null) {
return 0;
} else if (c1 == null) {
return -1;
} else if (c2 == null) {
return 1;
} else {
return c1.compareTo(c2);
}
} | java |
public static String rightTrim(final String aString) {
if (aString == null) {
return null;
}
int end = aString.length() - 1;
while ((end >= 0) && (aString.charAt(end) <= ' ')) {
end--;
}
if (end == aString.length() - 1) {
return aString;
}
return aString.substring(0, end + 1);
} | java |
public static String leftTrim(final String aString) {
if (aString == null) {
return null;
}
int start = 0;
while ((start < aString.length()) && (aString.charAt(start) <= ' ')) {
start++;
}
if (start == 0) {
return aString;
}
return aString.substring(start);
} | java |
public static UIContext getCurrent() {
Stack<UIContext> stack = CONTEXT_STACK.get();
if (stack == null || stack.isEmpty()) {
return null;
}
return getStack().peek();
} | java |
private static Stack<UIContext> getStack() {
Stack<UIContext> stack = CONTEXT_STACK.get();
if (stack == null) {
stack = new Stack<>();
CONTEXT_STACK.set(stack);
}
return stack;
} | java |
public static List getAllFields(final Object obj, final boolean excludeStatic,
final boolean excludeTransient) {
List fieldList = new ArrayList();
for (Class clazz = obj.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
Field[] declaredFields = clazz.getDeclaredFields();
for (int i = 0; i < dec... | java |
public static void setProperty(final Object object, final String property,
final Class propertyType, final Object value) {
Class[] paramTypes = new Class[]{propertyType};
Object[] params = new Object[]{value};
String methodName = "set" + property.substring(0, 1).toUpperCase() + property.substring(1);
Reflec... | java |
public static Object getProperty(final Object object, final String property) {
Class[] paramTypes = new Class[]{};
Object[] params = new Object[]{};
String methodName = "get" + property.substring(0, 1).toUpperCase() + property.substring(1);
return ReflectionUtil.invokeMethod(object, methodName, params, paramTy... | java |
public int createRating(Reference reference, RatingType type, int value) {
return getResourceFactory()
.getApiResource("/rating/" + reference.toURLFragment() + type)
.entity(Collections.singletonMap("value", value),
MediaType.APPLICATION_JSON_TYPE)
.post(RatingCreateResponse.class).getId();
} | java |
public void deleteRating(Reference reference, RatingType type) {
getResourceFactory().getApiResource(
"/rating/" + reference.toURLFragment() + type).delete();
} | java |
public RatingValuesMap getAllRatings(Reference reference) {
return getResourceFactory().getApiResource(
"/rating/" + reference.toURLFragment()).get(
RatingValuesMap.class);
} | java |
public int getRating(Reference reference, RatingType type, int userId) {
return getResourceFactory()
.getApiResource(
"/rating/" + reference.toURLFragment() + type + "/"
+ userId).get(SingleRatingValue.class)
.getValue();
} | java |
private String getMenuType(final WSubMenu submenu) {
WMenu menu = WebUtilities.getAncestorOfClass(WMenu.class, submenu);
switch (menu.getType()) {
case BAR:
return "bar";
case FLYOUT:
return "flyout";
case TREE:
return "tree";
case COLUMN:
return "column";
default:
throw new Illeg... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSubMenu menu = (WSubMenu) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:submenu");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", co... | java |
@Override
protected List getNewSelections(final Request request) {
List selections = super.getNewSelections(request);
if (selections != null) {
// Ensure that there are no duplicates
for (int i = 0; i < selections.size(); i++) {
Object selection = selections.get(i);
for (int j = i + 1; j < selectio... | java |
public static String rowIndexListToString(final List<Integer> row) {
if (row == null || row.isEmpty()) {
return null;
}
StringBuffer index = new StringBuffer();
boolean addDelimiter = false;
for (Integer lvl : row) {
if (addDelimiter) {
index.append(INDEX_DELIMITER);
}
index.append(lvl);
... | java |
public static List<Integer> rowIndexStringToList(final String row) {
if (row == null) {
return null;
}
List<Integer> rowIndex = new ArrayList<>();
try {
// Convert StringId to array
String[] rowIdString = row.split(INDEX_DELIMITER);
for (int i = 0; i < rowIdString.length; i++) {
rowIndex.add(... | java |
public static void sortData(final Object[] data, final Comparator<Object> comparator,
final boolean ascending,
final int lowIndex, final int highIndex, final int[] sortIndices) {
if (lowIndex >= highIndex) {
return; // 1 element, so sorted already!
}
Object midValue = data[sortIndices[(lowIndex + highIn... | java |
private static Date parse(final String dateString) {
try {
return new SimpleDateFormat("dd/mm/yyyy").parse(dateString);
} catch (ParseException e) {
LOG.error("Error parsing date: " + dateString, e);
return null;
}
} | java |
private TableDataModel createTableModel() {
return new AbstractTableDataModel() {
/**
* Column id for the first name column.
*/
private static final int FIRST_NAME = 0;
/**
* Column id for the last name column.
*/
private static final int LAST_NAME = 1;
/**
* Column id for the dat... | java |
public static void addAllHeadlines(final PrintWriter writer, final Headers headers) {
PageContentHelper.addHeadlines(writer, headers.getHeadLines());
PageContentHelper.addJsHeadlines(writer, headers.getHeadLines(Headers.JAVASCRIPT_HEADLINE));
PageContentHelper.addCssHeadlines(writer, headers.getHeadLines(Headers.... | java |
private void paintAjax(final WButton button, final XmlStringBuilder xml) {
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
xml.appendAttribute("triggerId", button.getId());
xml.appendClose();
// Target
xml.appendTagOpen("ui:ajaxtargetid");
xml.appendAttribute("targetId", button.getAjaxTarget().getId())... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDialog dialog = (WDialog) component;
int state = dialog.getState();
if (state == WDialog.ACTIVE_STATE || dialog.getTrigger() != null) {
int width = dialog.getWidth();
int height = dialog.getHeight();
... | java |
@Override
public void paint(final RenderContext renderContext) {
if (!DebugUtil.isDebugFeaturesEnabled() || !(renderContext instanceof WebXmlRenderContext)) {
getBackingComponent().paint(renderContext);
return;
}
AjaxOperation operation = AjaxHelper.getCurrentOperation();
if (operation == null) {
ge... | java |
public void setParameter(final String key, final String value) {
parameters.put(key, new String[]{value});
} | java |
public void addParameterForButton(final UIContext uic, final WButton button) {
UIContextHolder.pushContext(uic);
try {
setParameter(button.getId(), "x");
} finally {
UIContextHolder.popContext();
}
} | java |
public void setFileContents(final String key, final byte[] contents) {
MockFileItem fileItem = new MockFileItem();
fileItem.set(contents);
files.put(key, new FileItem[]{fileItem});
} | java |
private void addMessage(final WMessageBox box, final Message message, final boolean encode) {
String code = message.getMessage();
if (!Util.empty(code)) {
box.addMessage(encode, code, message.getArgs());
}
} | java |
protected static MessageContainer getMessageContainer(final WComponent component) {
for (WComponent c = component; c != null; c = c.getParent()) {
if (c instanceof MessageContainer) {
return (MessageContainer) c;
}
}
return null;
} | java |
public int addItem(int appId, ItemCreate create, boolean silent) {
return getResourceFactory().getApiResource("/item/app/" + appId + "/")
.queryParam("silent", silent ? "1" : "0")
.entity(create, MediaType.APPLICATION_JSON_TYPE)
.post(ItemCreateResponse.class).getId();
} | java |
public void updateItem(int itemId, ItemUpdate update, boolean silent, boolean hook) {
getResourceFactory().getApiResource("/item/" + itemId)
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public void updateItemValues(int itemId, List<FieldValuesUpdate> values,
boolean silent, boolean hook) {
getResourceFactory().getApiResource("/item/" + itemId + "/value/")
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(values, MediaType.APPLICATION_JSON_TYPE).pu... | java |
public void updateItemFieldValues(int itemId, int fieldId,
List<Map<String, Object>> values, boolean silent, boolean hook) {
getResourceFactory()
.getApiResource("/item/" + itemId + "/value/" + fieldId)
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(values, ... | java |
public List<Map<String, Object>> getItemFieldValues(int itemId, int fieldId) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/value/" + fieldId).get(
new GenericType<List<Map<String, Object>>>() {
});
} | java |
public List<FieldValuesView> getItemValues(int itemId) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/value/").get(
new GenericType<List<FieldValuesView>>() {
});
} | java |
public List<ItemMini> getItemsByFieldAndTitle(int fieldId, String text,
List<Integer> notItemIds, Integer limit) {
WebResource resource = getResourceFactory().getApiResource(
"/item/field/" + fieldId + "/find");
if (limit != null) {
resource = resource.queryParam("limit", limit.toString());
}
... | java |
public List<ItemReference> getItemReference(int itemId) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/reference/").get(
new GenericType<List<ItemReference>>() {
});
} | java |
public ItemRevision getItemRevision(int itemId, int revisionId) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/revision/" + revisionId).get(
ItemRevision.class);
} | java |
public List<ItemFieldDifference> getItemRevisionDifference(int itemId,
int revisionFrom, int revisionTo) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/revision/" + revisionFrom + "/"
+ revisionTo).get(
new GenericType<List<ItemFieldDifference>>() {
});
} | java |
public List<ItemRevision> getItemRevisions(int itemId) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/revision/").get(
new GenericType<List<ItemRevision>>() {
});
} | java |
public ItemsResponse getItems(int appId, Integer limit, Integer offset,
SortBy sortBy, Boolean sortDesc, FilterByValue<?>... filters) {
WebResource resource = getResourceFactory().getApiResource(
"/item/app/" + appId + "/v2/");
if (limit != null) {
resource = resource.queryParam("limit", limit.toString())... | java |
public ItemsResponse getItemsByExternalId(int appId, String externalId) {
return getItems(appId, null, null, null, null,
new FilterByValue<String>(new ExternalIdFilterBy(), externalId));
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WAjaxControl ajaxControl = (WAjaxControl) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent trigger = ajaxControl.getTrigger() == null ? ajaxControl : ajaxControl.
getTrigger();
int d... | java |
public void setNameAction(final Action action) {
LinkComponent linkComponent = new LinkComponent();
linkComponent.setNameAction(action);
repeater.setRepeatedComponent(linkComponent);
} | java |
protected Object getNewSelection(final Request request) {
String paramValue = request.getParameter(getId());
if (paramValue == null) {
return null;
}
// Figure out which option has been selected.
List<?> options = getOptions();
if (options == null || options.isEmpty()) {
if (!isEditable()) {
//... | java |
public static Object pipe(final Object in) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
os.writeObject(in);
os.close();
byte[] bytes = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
ObjectInp... | java |
public void markAsViewed(int notificationId) {
getResourceFactory()
.getApiResource("/notification/" + notificationId + "/viewed")
.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
} | java |
@Override
protected void afterPaint(final RenderContext renderContext) {
if (renderContext instanceof WebXmlRenderContext) {
PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();
writer.println(WebUtilities.encode(message));
if (error != null) {
writer.println("\n<br/>\n<pre>\n");
... | java |
protected void serviceInt(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException, IOException {
// Check for resource request
boolean continueProcess = ServletUtil.checkResourceRequest(request, response);
if (!continueProcess) {
return;
}
// Create a support class... | java |
protected WServletHelper createServletHelper(final HttpServletRequest httpServletRequest,
final HttpServletResponse httpServletResponse) {
LOG.debug("Creating a new WServletHelper instance");
WServletHelper helper = new WServletHelper(this, httpServletRequest, httpServletResponse);
return helper;
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WPanel panel = (WPanel) component;
XmlStringBuilder xml = renderContext.getWriter();
WButton submitButton = panel.getDefaultSubmitButton();
String submitId = submitButton == null ? null : submitButton.getId();... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSubordinateControl subordinate = (WSubordinateControl) component;
XmlStringBuilder xml = renderContext.getWriter();
if (!subordinate.getRules().isEmpty()) {
int seq = 0;
for (Rule rule : subordinate.get... | java |
private void paintRule(final Rule rule, final XmlStringBuilder xml) {
if (rule.getCondition() == null) {
throw new SystemException("Rule cannot be painted as it has no condition");
}
paintCondition(rule.getCondition(), xml);
for (Action action : rule.getOnTrue()) {
paintAction(action, "ui:onTrue", xml);... | java |
private void paintCondition(final Condition condition, final XmlStringBuilder xml) {
if (condition instanceof And) {
xml.appendTag("ui:and");
for (Condition operand : ((And) condition).getConditions()) {
paintCondition(operand, xml);
}
xml.appendEndTag("ui:and");
} else if (condition instanceof Or... | java |
private void paintAction(final Action action, final String elementName,
final XmlStringBuilder xml) {
switch (action.getActionType()) {
case SHOW:
case HIDE:
case ENABLE:
case DISABLE:
case OPTIONAL:
case MANDATORY:
paintStandardAction(action, elementName, xml);
break;
case SHOWIN:
... | java |
private void paintStandardAction(final Action action, final String elementName,
final XmlStringBuilder xml) {
xml.appendTagOpen(elementName);
xml.appendAttribute("action", getActionTypeName(action.getActionType()));
xml.appendClose();
xml.appendTagOpen("ui:target");
SubordinateTarget target = action.getTa... | java |
private void paintInGroupAction(final Action action, final String elementName,
final XmlStringBuilder xml) {
xml.appendTagOpen(elementName);
xml.appendAttribute("action", getActionTypeName(action.getActionType()));
xml.appendClose();
xml.appendTagOpen("ui:target");
xml.appendAttribute("groupId", action.get... | java |
private String getCompareTypeName(final CompareType type) {
String compare = null;
switch (type) {
case EQUAL:
break;
case NOT_EQUAL:
compare = "ne";
break;
case LESS_THAN:
compare = "lt";
break;
case LESS_THAN_OR_EQUAL:
compare = "le";
break;
case GREATER_THAN:
compa... | java |
private String getActionTypeName(final ActionType type) {
String action = null;
switch (type) {
case SHOW:
action = "show";
break;
case SHOWIN:
action = "showIn";
break;
case HIDE:
action = "hide";
break;
case HIDEIN:
action = "hideIn";
break;
case ENABLE:
action ... | java |
private void buildUI() {
add(messages);
add(tabset);
// add(new AccessibilityWarningContainer());
container.add(new WText("Select an example from the menu"));
// Set a static ID on container and it becomes a de-facto naming context.
container.setIdName("eg");
tabset.addTab(container, "(no selection)", WT... | java |
private void addToTail(final WComponent component) {
WContainer tail = (WContainer) getDecoratedLabel().getTail();
if (null != tail) { // bloody well better not be...
tail.add(component);
}
} | java |
public void selectExample(final WComponent example, final String exampleName) {
WComponent currentExample = container.getChildAt(0).getParent();
if (currentExample != null && currentExample.getClass().equals(example.getClass())) {
// Same example selected, do nothing
return;
}
resetExample();
containe... | java |
public void selectExample(final ExampleData example) {
try {
StringBuilder exampleName = new StringBuilder();
if (example.getExampleGroupName() != null && !example.getExampleGroupName().equals("")) {
exampleName.append(example.getExampleGroupName()).append(" - ");
}
exampleName.append(example.getExamp... | java |
private static String getSource(final String className) {
String sourceName = '/' + className.replace('.', '/') + ".java";
InputStream stream = null;
try {
stream = ExampleSection.class.getResourceAsStream(sourceName);
if (stream != null) {
byte[] sourceBytes = StreamUtil.getBytes(stream);
// we... | java |
protected String optionToCode(final Object option, final int index) {
if (index < 0) {
List<?> options = getOptions();
if (options == null || options.isEmpty()) {
Integrity.issue(this, "No options available, so cannot convert the option \""
+ option + "\" to a code.");
} else {
StringBuffer me... | java |
protected int getOptionIndex(final Object option) {
int optionCount = 0;
List<?> options = getOptions();
if (options != null) {
for (Object obj : getOptions()) {
if (obj instanceof OptionGroup) {
List<?> groupOptions = ((OptionGroup) obj).getOptions();
int groupIndex = groupOptions.indexOf(opti... | java |
public String getListCacheKey() {
Object table = getLookupTable();
if (table != null && ConfigurationProperties.getDatalistCaching()) {
String key = APPLICATION_LOOKUP_TABLE.getCacheKeyForTable(table);
return key;
}
return null;
} | java |
public List<?> getOptions() {
if (getLookupTable() == null) {
SelectionModel model = getComponentModel();
return model.getOptions();
} else {
return APPLICATION_LOOKUP_TABLE.getTable(getLookupTable());
}
} | java |
public void setOptions(final Object[] aArray) {
setOptions(aArray == null ? null : Arrays.asList(aArray));
} | java |
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (isAjax() && UIContextHolder.getCurrent().getUI() != null) {
AjaxTarget target = getAjaxTarget();
AjaxHelper.registerComponent(target.getId(), getId());
}
String cacheKey = getListCacheKey()... | java |
public String getDesc(final Object option, final int index) {
String desc = "";
if (option instanceof Option) {
String optDesc = ((Option) option).getDesc();
if (optDesc != null) {
desc = optDesc;
}
} else {
String tableDesc = APPLICATION_LOOKUP_TABLE.getDescription(getLookupTable(), option);
... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSingleSelect listBox = (WSingleSelect) component;
XmlStringBuilder xml = renderContext.getWriter();
String dataKey = listBox.getListCacheKey();
boolean readOnly = listBox.isReadOnly();
int rows = listBox.ge... | java |
private void initialiseInstanceVariables() {
backing = new HashMap<>();
booleanBacking = new HashSet<>();
locations = new HashMap<>();
// subContextCache is updated on the fly so ensure no concurrent modification.
subcontextCache = Collections.synchronizedMap(new HashMap());
runtimeProperties = new Include... | java |
@SuppressWarnings("checkstyle:emptyblock")
private void load() {
recordMessage("Loading parameters");
File cwd = new File(".");
String workingDir;
try {
workingDir = cwd.getCanonicalPath();
} catch (IOException ex) {
workingDir = "UNKNOWN";
}
recordMessage("Working directory is " + workingDir);
... | java |
@SuppressWarnings("checkstyle:emptyblock")
private void loadTop(final String resourceName) {
try {
resources.push(resourceName);
load(resourceName);
// Now check for INCLUDE_AFTER resources
String includes = get(INCLUDE_AFTER);
if (includes != null) {
// First, do substitution on the INCLUDE_AF... | java |
private void load(final String resourceName) {
boolean found = false;
try {
resources.push(resourceName);
// Try classloader - load the resources in reverse order of the enumeration. Since later-loaded resources
// override earlier-loaded ones, this better corresponds to the usual classpath behaviour.
... | java |
private String filename(final File aFile) {
try {
return aFile.getCanonicalPath();
} catch (IOException ex) {
recordException(ex);
return "UNKNOWN FILE";
}
} | java |
private void load(final Properties properties, final String location,
final boolean overwriteOnly) {
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String key = (String) entry.getKey();
String already = get(key);
if (overwriteOnly && already == null && !INCLUDE.equals(key)) {
contin... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.