code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
@Override
protected void paintComponent(final RenderContext renderContext) {
if (renderContext instanceof WebXmlRenderContext) {
PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();
writer.println(getMessage());
if (developerFriendly) {
writer.println("<pre style=\"background: lightg... | java |
public void setText(final String text, final Serializable... args) {
Serializable currText = getComponentModel().text;
Serializable textToBeSet = I18nUtilities.asMessage(text, args);
if (!Objects.equals(textToBeSet, currText)) {
getOrCreateComponentModel().text = textToBeSet;
}
} | java |
public void setHint(final String hint, final Serializable... args) {
Serializable currHint = getComponentModel().hint;
Serializable hintToBeSet = I18nUtilities.asMessage(hint, args);
if (!Objects.equals(hintToBeSet, currHint)) {
getOrCreateComponentModel().hint = hintToBeSet;
}
} | java |
public void setForComponent(final WComponent forComponent) {
getOrCreateComponentModel().forComponent = forComponent;
if (forComponent instanceof AbstractWComponent) {
((AbstractWComponent) forComponent).setLabel(this);
}
} | java |
@Override
protected void preparePaintComponent(final Request request) {
if (!isInitialised()) {
repeat.setData(getNames());
setInitialised(true);
}
} | java |
private void setupUI(final String labelText) {
WButton dupBtn = new WButton("Duplicate");
dupBtn.setAction(new DuplicateAction());
WButton clrBtn = new WButton("Clear");
clrBtn.setAction(new ClearAction());
add(new WLabel(labelText, textFld));
add(textFld);
add(dupBtn);
add(clrBtn);
add(new WAjaxCon... | java |
private void addRecentExample(final String text, final ExampleData data, final boolean select) {
WMenuItem item = new WMenuItem(text, new SelectExampleAction());
item.setCancel(true);
menu.add(item);
item.setActionObject(data);
if (select) {
menu.setSelectedMenuItem(item);
}
} | java |
private ExampleData getMatch(final WComponent node, final String name, final boolean partial) {
if (node instanceof WMenuItem) {
ExampleData data = (ExampleData) ((WMenuItem) node).getActionObject();
Class<? extends WComponent> clazz = data.getExampleClass();
if (clazz.getName().equals(name) || data.getExa... | java |
private void loadRecentList() {
recent.clear();
File file = new File(RECENT_FILE_NAME);
if (file.exists()) {
try {
InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
XMLDecoder decoder = new XMLDecoder(inputStream);
List result = (List) decoder.readObject();
decoder... | java |
private void storeRecentList() {
synchronized (recent) {
try {
OutputStream out = new BufferedOutputStream(new FileOutputStream(RECENT_FILE_NAME));
XMLEncoder encoder = new XMLEncoder(out);
encoder.writeObject(recent);
encoder.close();
} catch (IOException ex) {
LogFactory.getLog(getClass())... | java |
public void addToRecent(final ExampleData example) {
synchronized (recent) {
recent.remove(example); // only add it once
recent.add(0, example);
// Only keep the last few entries.
while (recent.size() > MAX_RECENT_ITEMS) {
recent.remove(MAX_RECENT_ITEMS);
}
storeRecentList();
setInitialised... | java |
private void updateRecentMenu() {
menu.removeAllMenuItems();
int index = 1;
boolean first = true;
for (Iterator<ExampleData> i = recent.iterator(); i.hasNext();) {
ExampleData data = i.next();
try {
StringBuilder builder = new StringBuilder(Integer.toString(index++)).append(". ");
if (data.get... | java |
public void setContent(final WComponent content) {
WComponent oldContent = getContent();
if (oldContent != null) {
remove(oldContent);
}
if (content != null) {
add(content);
}
} | java |
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
WComponent content = getContent();
if (content != null) {
switch (getMode()) {
case EAGER: {
// Will always be visible
content.setVisible(true);
AjaxHelper.registerContainer(getId(... | java |
public SpaceCreateResponse createSpace(SpaceCreate data) {
return getResourceFactory().getApiResource("/space/")
.entity(data, MediaType.APPLICATION_JSON_TYPE)
.post(SpaceCreateResponse.class);
} | java |
public void updateSpace(int spaceId, SpaceUpdate data) {
getResourceFactory().getApiResource("/space/" + spaceId)
.entity(data, MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public SpaceWithOrganization getSpaceByURL(String url) {
return getResourceFactory().getApiResource("/space/url")
.queryParam("url", url).get(SpaceWithOrganization.class);
} | java |
public SpaceMember getSpaceMembership(int spaceId, int userId) {
return getResourceFactory().getApiResource(
"/space/" + spaceId + "/member/" + userId).get(
SpaceMember.class);
} | java |
public void updateSpaceMembership(int spaceId, int userId, Role role) {
getResourceFactory()
.getApiResource("/space/" + spaceId + "/member/" + userId)
.entity(new SpaceMemberUpdate(role),
MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public List<SpaceMember> getActiveMembers(int spaceId) {
return getResourceFactory().getApiResource(
"/space/" + spaceId + "/member/").get(
new GenericType<List<SpaceMember>>() {
});
} | java |
public List<SpaceMember> getEndedMembers(int spaceId) {
return getResourceFactory().getApiResource(
"/space/" + spaceId + "/member/ended/").get(
new GenericType<List<SpaceMember>>() {
});
} | java |
public List<SpaceWithOrganization> getTopSpaces(Integer limit) {
WebResource resource = getResourceFactory().getApiResource(
"/space/top/");
if (limit != null) {
resource = resource.queryParam("limit", limit.toString());
}
return resource.get(new GenericType<List<SpaceWithOrganization>>() {
})... | java |
public static void registerList(final String key, final Request request) {
request.setSessionAttribute(DATA_LIST_UIC_SESSION_KEY, UIContextHolder.getCurrentPrimaryUIContext());
} | java |
public static UIContext getContext(final String key, final Request request) {
return (UIContext) request.getSessionAttribute(DATA_LIST_UIC_SESSION_KEY);
} | java |
public static List<ComponentWithContext> collateVisibles(final WComponent comp) {
final List<ComponentWithContext> list = new ArrayList<>();
WComponentTreeVisitor visitor = new WComponentTreeVisitor() {
@Override
public VisitorResult visit(final WComponent comp) {
// In traversing the tree, special compo... | java |
public static WComponent getRoot(final UIContext uic, final WComponent comp) {
UIContextHolder.pushContext(uic);
try {
return WebUtilities.getTop(comp);
} finally {
UIContextHolder.popContext();
}
} | java |
public static List<ComponentWithContext> findComponentsByClass(final WComponent root, final String className,
final boolean includeRoot, final boolean visibleOnly) {
FindComponentsByClassVisitor visitor = new FindComponentsByClassVisitor(root, className, includeRoot);
doTraverse(root, visibleOnly, visitor);
... | java |
public static WComponent getComponentWithId(final WComponent root, final String id,
final boolean visibleOnly) {
ComponentWithContext comp = getComponentWithContextForId(root, id, visibleOnly);
return comp == null ? null : comp.getComponent();
} | java |
public static UIContext getClosestContextForId(final WComponent root, final String id,
final boolean visibleOnly) {
FindComponentByIdVisitor visitor = new FindComponentByIdVisitor(id) {
@Override
public VisitorResult visit(final WComponent comp) {
VisitorResult result = super.visit(comp);
if (result... | java |
private static VisitorResult doTraverse(final WComponent node, final boolean visibleOnly,
final WComponentTreeVisitor visitor) {
if (visibleOnly) {
// Push through Invisible Containers
// Certain components have their visibility altered to implement custom processing.
if (node instanceof WInvisibleContain... | java |
public void setText(final String text, final Serializable... args) {
getOrCreateComponentModel().text = I18nUtilities.asMessage(text, args);
} | java |
@Override
public void handleRequest(final Request request) {
// Check if this link was the AJAX Trigger
AjaxOperation operation = AjaxHelper.getCurrentOperation();
boolean pressed = (operation != null && getId().equals(operation.getTriggerId()));
// Protect against client-side tampering of disabled/read-only ... | java |
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
UIContext uic = UIContextHolder.getCurrent();
// If the link has an action, register it for AJAX
final Action action = getAction();
final AjaxTarget[] actionTargets = getActionTargets();
if (acti... | java |
public void setImage(final Image image) {
LinkModel model = getOrCreateComponentModel();
model.image = image;
model.imageUrl = null;
} | java |
public void setImageUrl(final String imageUrl) {
LinkModel model = getOrCreateComponentModel();
model.imageUrl = imageUrl;
model.image = null;
} | java |
public void addFile(final FileWidgetUpload file) {
List<FileWidgetUpload> files = (List<FileWidgetUpload>) getData();
if (files == null) {
files = new ArrayList<>();
setData(files);
}
files.add(file);
MemoryUtil.checkSize(files.size(), this.getClass().getSimpleName());
} | java |
public void removeFile(final FileWidgetUpload file) {
List<FileWidgetUpload> files = (List<FileWidgetUpload>) getData();
if (files != null) {
files.remove(file);
if (files.isEmpty()) {
setData(null);
}
}
} | java |
private boolean isValid(final String fileType) {
boolean result = false;
if (fileType != null && fileType.length() > 1) { // the shortest I can think of would be something like ".h"
if (fileType.startsWith(".")) { // assume it's a file extension
result = true;
} else if (fileType.length() > 2 && fileType.... | java |
public List<String> getFileTypes() {
Set<String> fileTypes = getComponentModel().fileTypes;
List<String> result;
if (fileTypes == null || fileTypes.isEmpty()) {
return Collections.emptyList();
}
result = new ArrayList<>(fileTypes);
return result;
} | java |
public void setColumns(final Integer cols) {
if (cols != null && cols < 0) {
throw new IllegalArgumentException("Must have zero or more columns");
}
Integer currColumns = getColumns();
if (!Objects.equals(cols, currColumns)) {
getOrCreateComponentModel().cols = cols;
}
} | java |
protected void doHandleFileAjaxActionRequest(final Request request) {
// Protect against client-side tampering of disabled components
if (isDisabled()) {
throw new SystemException("File widget is disabled.");
}
// Check for file id
String fileId = request.getParameter(FILE_UPLOAD_ID_KEY);
if (fileId == ... | java |
protected void doHandleTargetedRequest(final Request request) {
// Check for file id
String fileId = request.getParameter(FILE_UPLOAD_ID_KEY);
if (fileId == null) {
throw new SystemException("No file id provided for content request.");
}
// Check valid file id
FileWidgetUpload file = getFile(fileId);
... | java |
protected void doHandleUploadRequest(final Request request) {
// Protect against client-side tampering of disabled/read-only fields.
if (isDisabled() || isReadOnly()) {
throw new SystemException("File widget cannot be updated.");
}
// Only process on a POST
if (!"POST".equals(request.getMethod())) {
th... | java |
protected void doHandleThumbnailRequest(final FileWidgetUpload file) {
// Create thumb nail (if required)
if (file.getThumbnail() == null) {
Image thumbnail = createThumbNail(file.getFile());
file.setThumbnail(thumbnail);
}
ContentEscape escape = new ContentEscape(file.getThumbnail());
throw escape;
} | java |
public String getFileUrl(final String fileId) {
FileWidgetUpload file = getFile(fileId);
if (file == null) {
return null;
}
Environment env = getEnvironment();
Map<String, String> parameters = env.getHiddenParameters();
parameters.put(Environment.TARGET_ID, getTargetId());
if (Util.empty(file.getFile... | java |
public String getFileThumbnailUrl(final String fileId) {
FileWidgetUpload file = getFile(fileId);
if (file == null) {
return null;
}
// Check static resource
Image thumbnail = file.getThumbnail();
if (thumbnail instanceof InternalResource) {
return ((InternalResource) thumbnail).getTargetUrl();
}
... | java |
@Override
public void serviceRequest(final Request request) {
// Reset the focus for this new request.
UIContext uic = UIContextHolder.getCurrent();
uic.setFocussed(null, null);
// We've hit the action phase, so we do want focus on this app.
uic.setFocusRequired(true);
super.serviceRequest(request);
} | java |
@Override
public void paint(final RenderContext renderContext) {
getBackingComponent().paint(renderContext);
// We don't want to remember the focus for the next render because on
// a multi portlet page, we'd end up with multiple portlets trying to
// set the focus.
UIContext uic = UIContextHolder.getCurren... | java |
private void applyEnableAction(final WComponent target, final boolean enabled) {
// Found Disableable component
if (target instanceof Disableable) {
target.setValidate(enabled);
((Disableable) target).setDisabled(!enabled);
} else if (target instanceof Container) { // Apply to any Disableable children
C... | java |
private void startLoad() {
tableLayout.setVisible(true);
List<PersonBean> beans = ExampleDataUtil.createExampleData(numRows.getNumber().intValue(),
numDocs.getNumber()
.intValue());
if (isLoadWTable()) {
table.setBean(beans);
}
if (isLoadWDataTable()) {
TableTreeNode tree = createTree(beans);... | java |
private void applyMandatoryAction(final WComponent target, final boolean mandatory) {
if (target instanceof Mandatable) {
((Mandatable) target).setMandatory(mandatory);
} else if (target instanceof Container) { // Apply to the Mandatable children
Container cont = (Container) target;
final int size = cont.g... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WShuffler shuffler = (WShuffler) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = shuffler.isReadOnly();
// Start tag
xml.appendTagOpen("ui:shuffler");
xml.appendAttribute("... | java |
private String deriveId(final String idName) {
// Find parent naming context
NamingContextable parent = WebUtilities.getParentNamingContext(this);
// No Parent
if (parent == null) {
return idName;
}
// Get ID prefix
String prefix = parent.getNamingContextId();
// No Prefix, just use id name
if (... | java |
void registerInContext() {
if (!ConfigurationProperties.getCheckDuplicateIds()) {
return;
}
// Register Component if it has an ID name set
if (getIdName() != null) {
// Find parent context
NamingContextable context = WebUtilities.getParentNamingContext(this);
if (context == null) {
// If this ... | java |
protected void invokeLaters() {
if (getParent() == null) {
UIContext uic = UIContextHolder.getCurrent();
if (uic != null) {
uic.doInvokeLaters();
}
}
} | java |
protected void paintComponent(final RenderContext renderContext) {
Renderer renderer = UIManager.getRenderer(this, renderContext);
if (getTemplate() != null || getTemplateMarkUp() != null) {
Renderer templateRenderer = UIManager.getTemplateRenderer(renderContext);
templateRenderer.render(this, renderContext)... | java |
protected Diagnostic createErrorDiagnostic(final WComponent source, final String message,
final Serializable... args) {
return new DiagnosticImpl(Diagnostic.ERROR, source, message, args);
} | java |
protected void setFlag(final int mask, final boolean flag) {
// Only store the flag value if it is not the default.
if (flag != isFlagSet(mask)) {
ComponentModel model = getOrCreateComponentModel();
model.setFlags(switchFlag(model.getFlags(), mask, flag));
}
} | java |
private static int switchFlag(final int flags, final int mask, final boolean value) {
int newFlags = value ? flags | mask : flags & ~mask;
return newFlags;
} | java |
protected ComponentModel getComponentModel() {
UIContext effectiveContext = UIContextHolder.getCurrent();
if (effectiveContext == null) {
return sharedModel;
} else {
ComponentModel model = (ComponentModel) effectiveContext.getModel(this);
if (model == null) {
return sharedModel;
} else if (mode... | java |
protected ComponentModel getOrCreateComponentModel() {
ComponentModel model = getComponentModel();
if (locked && model == sharedModel) {
UIContext effectiveContext = UIContextHolder.getCurrent();
if (effectiveContext != null) {
model = newComponentModel();
model.setSharedModel(sharedModel);
eff... | java |
WComponent getChildAt(final int index) {
ComponentModel model = getComponentModel();
return model.getChildren().get(index);
} | java |
int getIndexOfChild(final WComponent childComponent) {
ComponentModel model = getComponentModel();
List<WComponent> children = model.getChildren();
return children == null ? -1 : children.indexOf(childComponent);
} | java |
List<WComponent> getChildren() {
List<WComponent> children = getComponentModel().getChildren();
return children != null && !children.isEmpty()
? Collections.unmodifiableList(children)
: Collections.<WComponent>emptyList();
} | java |
void add(final WComponent component) {
assertAddSupported(component);
assertNotReparenting(component);
if (!(this instanceof Container)) {
throw new UnsupportedOperationException("Components can only be added to a container");
}
ComponentModel model = getOrCreateComponentModel();
if (model.getChildren... | java |
void remove(final WComponent aChild) {
ComponentModel model = getOrCreateComponentModel();
if (model.getChildren() == null) {
model.setChildren(copyChildren(getComponentModel().getChildren()));
}
if (model.getChildren().remove(aChild)) {
// Deallocate children list if possible, to reduce session size.
... | java |
private static List<WComponent> copyChildren(final List<WComponent> children) {
ArrayList<WComponent> copy;
if (children == null) {
copy = new ArrayList<>(1);
} else {
copy = new ArrayList<>(children);
}
return copy;
} | java |
protected Object writeReplace() throws ObjectStreamException {
WComponent top = WebUtilities.getTop(this);
String repositoryKey;
if (top instanceof WApplication) {
repositoryKey = ((WApplication) top).getUiVersionKey();
} else {
repositoryKey = top.getClass().getName();
}
if (UIRegistry.getInstance()... | java |
private void addLink(final WSubMenu subMenu, final WLink link) {
subMenu.add(new WMenuItem(new WDecoratedLabel(link)));
} | java |
public void setLabelWidth(final int labelWidth) {
if (labelWidth > 100) {
throw new IllegalArgumentException(
"labelWidth (" + labelWidth + ") cannot be greater than 100 percent.");
}
getOrCreateComponentModel().labelWidth = Math.max(0, labelWidth);
} | java |
public WField addField(final WButton button) {
WField field = new WField((WLabel) null, button);
add(field);
return field;
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WPartialDateField dateField = (WPartialDateField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = dateField.isReadOnly();
String date = formatDate(dateField);
xml.appendTagO... | java |
private String formatDate(final WPartialDateField dateField) {
Integer day = dateField.getDay();
Integer month = dateField.getMonth();
Integer year = dateField.getYear();
if (day != null || month != null || year != null) {
StringBuffer buf = new StringBuffer(10);
append(buf, year, 4);
buf.append('-')... | java |
private void append(final StringBuffer buf, final Integer num, final int digits) {
if (num == null) {
for (int i = 0; i < digits; i++) {
buf.append('?');
}
} else {
for (int digit = 1, test = 10; digit < digits; digit++, test *= 10) {
if (num < test) {
buf.append('0');
}
}
buf.appen... | java |
@Override
protected void validateComponent(final List<Diagnostic> diags) {
String text1 = field1.getText();
String text2 = field2.getText();
String text3 = field3.getText();
if (text1 != null && text1.length() > 0 && text1.equals(text2)) {
// Note that this error will hyperlink to Field 2.
diags.add(cre... | java |
public StateChange nextState(final char c) {
StateChange change = currentState.getChange(c);
currentState = change.getNewState();
return change;
} | java |
@Override
protected boolean doHandleRequest(final Request request) {
// Check if the group has a value on the Request
if (request.getParameter(getId()) != null) {
// Allow the handle request to be processed by the radio buttons
return false;
}
// If no value, then clear the current value (if required)
... | java |
private void addDateRangeExample() {
add(new WHeading(HeadingLevel.H2, "Example of a date range component"));
WFieldSet dateRange = new WFieldSet("Enter the expected arrival and departure dates.");
add(dateRange);
WPanel dateRangePanel = new WPanel();
dateRangePanel.setLayout(new FlowLayout(FlowLayout.LEFT,... | java |
private void addContraintExamples() {
add(new WHeading(HeadingLevel.H2, "Date fields with input constraints"));
WFieldLayout layout = new WFieldLayout();
layout.setLabelWidth(33);
add(layout);
/* mandatory */
WDateField constrainedDateField = new WDateField();
constrainedDateField.setMandatory(true);
l... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSelectToggle toggle = (WSelectToggle) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:selecttoggle");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttr... | java |
private void buildUI() {
// build the configuration options UI.
WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
layout.setMargin(new Margin(null, null, Size.LARGE, null));
add(layout);
layout.addField("Autoplay", cbAutoPlay);
layout.addField("Loop", cbLoop);
layout.addField("Disable",... | java |
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request); //To change body of generated methods, choose Tools | Templates.
if (!isInitialised()) {
setInitialised(true);
setupAudio();
}
} | java |
private void setupAudio() {
audio.setAutoplay(cbAutoPlay.isSelected());
audio.setLoop(!cbLoop.isDisabled() && cbLoop.isSelected());
audio.setControls(cbControls.isSelected() ? WAudio.Controls.PLAY_PAUSE : WAudio.Controls.NATIVE);
audio.setDisabled(cbControls.isSelected() && cbDisable.isSelected());
} | java |
@Override
protected void afterPaint(final RenderContext renderContext) {
super.afterPaint(renderContext);
final int size = getChildCount();
for (int i = 0; i < size; i++) {
WComponent child = getChildAt(i);
child.reset();
}
} | java |
public String getGroupName() {
if (collapsibleToggle != null) {
return collapsibleToggle.getId();
} else if (!collapsibleList.isEmpty()) {
// This is only to retain compatibility with the
// previous implementation, and should be removed post-Sfp11,
// as it doesn't make much sense to create a group wit... | java |
private void addComponent(final WComponent component) {
collapsibleList.add(component);
MemoryUtil.checkSize(collapsibleList.size(), this.getClass().getSimpleName());
} | java |
private List<?> getNewOptions(final String[] paramValues) {
// Take a copy of the old options
List<?> copyOldOptions = new ArrayList(getOptions());
// Create a new list to hold the shuffled options
List<Object> newOptions = new ArrayList<>(paramValues.length);
// Process the option parameters
for (String ... | java |
private void addListItems(final WDefinitionList list) {
// Example of adding multiple data items at once.
list.addTerm("Colours", new WText("Red"), new WText("Green"), new WText("Blue"));
// Example of adding multiple data items using multiple calls.
list.addTerm("Shapes", new WText("Circle"));
list.addTerm(... | java |
private void applySettings() {
container.reset();
// Now show an example of the number of different columns
WPanel gridLayoutPanel = new WPanel();
if (cbResponsive.isSelected()) {
gridLayoutPanel.setHtmlClass(HtmlClassProperties.RESPOND);
}
GridLayout layout = new GridLayout(rowCount.getValue().intVal... | java |
public Subscription getSubscription(Reference reference) {
return getResourceFactory().getApiResource(
"/subscription/" + reference.toURLFragment(false)).get(
Subscription.class);
} | java |
public void subscribe(Reference reference) {
getResourceFactory()
.getApiResource(
"/subscription/" + reference.toURLFragment(false))
.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
} | java |
@Override
public void paint(final RenderContext renderContext) {
AjaxOperation operation = AjaxHelper.getCurrentOperation();
if (operation == null) {
// the request attribute that we place in the ui context in the action phase can't be null
throw new SystemException(
"Can't paint AJAX response. Couldn't... | java |
private void paintContainerResponse(final RenderContext renderContext,
final AjaxOperation operation) {
WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
XmlStringBuilder xml = webRenderContext.getWriter();
// Get trigger's context
ComponentWithContext trigger = AjaxHelper.getCurre... | java |
private boolean isProcessTriggerOnly(final ComponentWithContext triggerWithContext,
final AjaxOperation operation) {
// Target container implies only process the trigger or is Internal Ajax
if (operation.getTargetContainerId() != null || operation.isInternalAjaxRequest()) {
return true;
}
WComponent tri... | java |
public static boolean getHandleErrorWithFatalErrorPageFactory() {
Boolean parameterValue = get().getBoolean(HANDLE_ERROR_WITH_FATAL_PAGE_FACTORY, null);
if (parameterValue != null) {
return parameterValue;
}
// fall-back to the old parameter value if the new value is not set.
return get().getBoolean(HANDL... | java |
public static String getRendererOverride(final String classname) {
if (StringUtils.isBlank(classname)) {
throw new IllegalArgumentException("classname cannot be blank.");
}
return get().getString(RENDERER_OVERRIDE_PREFIX + classname);
} | java |
public static String getResponseCacheHeaderSettings(final String contentType) {
String parameter = MessageFormat.format(RESPONSE_CACHE_HEADER_SETTINGS, contentType);
return get().getString(parameter);
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSuggestions suggestions = (WSuggestions) component;
XmlStringBuilder xml = renderContext.getWriter();
// Cache key for a lookup table
String dataKey = suggestions.getListCacheKey();
// Use AJAX if not usin... | java |
@Override
public void handleRequest(final Request request) {
if (!isDisabled()) {
final SelectToggleModel model = getComponentModel();
String requestParam = request.getParameter(getId());
final State newValue;
if ("all".equals(requestParam)) {
newValue = State.ALL;
} else if ("none".equals(reques... | java |
private static void setSelections(final WComponent component, final boolean selected) {
if (component instanceof WCheckBox) {
((WCheckBox) component).setSelected(selected);
} else if (component instanceof WCheckBoxSelect) {
WCheckBoxSelect select = (WCheckBoxSelect) component;
select.setSelected(selected ?... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.