code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private static WComponent loadUI(final String key) {
String classname = key.trim();
try {
Class<?> clas = Class.forName(classname);
if (WComponent.class.isAssignableFrom(clas)) {
WComponent instance = (WComponent) clas.newInstance();
LOG.debug("WComponent successfully loaded with class name \"" + cl... | java |
private void addList(final WList.Type type, final WList.Separator separator,
final boolean renderBorder, final WComponent renderer) {
WList list = new WList(type);
if (separator != null) {
list.setSeparator(separator);
}
list.setRenderBorder(renderBorder);
list.setRepeatedComponent(renderer);
add(li... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WMenu menu = (WMenu) component;
XmlStringBuilder xml = renderContext.getWriter();
int rows = menu.getRows();
xml.appendTagOpen("ui:menu");
xml.appendAttribute("id", component.getId());
xml.appendOptionalA... | java |
public SearchInAppResponse searchInApp(int appId, String query, Boolean counts,
Boolean highlights, Integer limit, Integer offset, ReferenceTypeSearchInApp refType,
String searchFields) {
WebResource resource = getResourceFactory().getApiResource("/search/app/" + appId +... | java |
private void renderOption(final WMultiSelect listBox, final Object option,
final int optionIndex, final XmlStringBuilder html,
final List<?> selections, final boolean renderSelectionsOnly) {
boolean selected = selections.contains(option);
if (selected || !renderSelectionsOnly) {
// Get Code and Desc
St... | java |
@Override
public void paint(final RenderContext renderContext) {
super.paint(renderContext);
if (!DebugUtil.isDebugFeaturesEnabled() || !(renderContext instanceof WebXmlRenderContext)) {
return;
}
XmlStringBuilder xml = ((WebXmlRenderContext) renderContext).getWriter();
xml.appendTag("ui:debug");
wri... | java |
protected void writeDebugInfo(final WComponent component, final XmlStringBuilder xml) {
if (component != null && (component.isVisible() || component instanceof WInvisibleContainer)) {
xml.appendTagOpen("ui:debugInfo");
xml.appendAttribute("for", component.getId());
xml.appendAttribute("class", component.getC... | java |
private String getType(final WComponent component) {
for (Class<?> clazz = component.getClass(); clazz != null && WComponent.class.
isAssignableFrom(clazz); clazz = clazz.getSuperclass()) {
if ("com.github.bordertech.wcomponents".equals(clazz.getPackage().getName())) {
return clazz.getName();
}
}
r... | java |
public static void deserializeSessionAttributes(final HttpSession session) {
File file = new File(SERIALIZE_SESSION_NAME);
FileInputStream fis = null;
ObjectInputStream ois = null;
if (file.canRead()) {
try {
fis = new FileInputStream(file);
ois = new ObjectInputStream(fis);
List data = (List) ... | java |
public static synchronized void serializeSessionAttributes(final HttpSession session) {
if (session != null) {
File file = new File(SERIALIZE_SESSION_NAME);
if (!file.exists() || file.canWrite()) {
// Retrieve the session attributes
List data = new ArrayList();
for (Enumeration keyEnum = session.g... | java |
public static void incrementSessionStep(final UIContext uic) {
int step = uic.getEnvironment().getStep();
uic.getEnvironment().setStep(step + 1);
} | java |
public static int getRequestStep(final Request request) {
String val = request.getParameter(Environment.STEP_VARIABLE);
if (val == null) {
return 0;
}
try {
return Integer.parseInt(val);
} catch (NumberFormatException ex) {
return -1;
}
} | java |
public static boolean isStepOnRequest(final Request request) {
String val = request.getParameter(Environment.STEP_VARIABLE);
return val != null;
} | java |
public static boolean isCachedContentRequest(final Request request) {
// Get target id on request
String targetId = request.getParameter(Environment.TARGET_ID);
if (targetId == null) {
return false;
}
// Get target
ComponentWithContext targetWithContext = WebUtilities.getComponentById(targetId, true);
... | java |
private synchronized HttpSubSession getSubSession() {
HttpSession backingSession = super.getSession();
Map<Integer, HttpSubSession> subsessions = (Map<Integer, HttpSubSession>) backingSession
.getAttribute(SESSION_MAP_KEY);
HttpSubSession subsession = subsessions.get(sessionId);
subsession.setLastAccessedT... | java |
private void addSubordinate() {
// Set up subordinate (to make mandatory/optional)
WComponentGroup<SubordinateTarget> inputs = new WComponentGroup<>();
add(inputs);
inputs.addToGroup(checkBoxSelect);
inputs.addToGroup(multiDropdown);
inputs.addToGroup(multiSelect);
inputs.addToGroup(multiSelectPair);
in... | java |
private void addButtons() {
// Validation Button
WButton buttonValidate = new WButton("Validate and Update Bean");
add(buttonValidate);
buttonValidate.setAction(new ValidatingAction(messages.getValidationErrors(), layout) {
@Override
public void executeOnValid(final ActionEvent event) {
WebUtilities.u... | java |
@Override
public String getWServletPath() {
final String configValue = ConfigurationProperties.getServletSupportPath();
return configValue == null ? getPostPath() : getServletPath(configValue);
} | java |
private String getServletPath(final String relativePath) {
if (relativePath == null) {
LOG.error("relativePath must not be null");
}
String context = getHostFreeBaseUrl();
if (!Util.empty(context)) {
return context + relativePath;
}
return relativePath;
} | java |
private static WComponent build() {
WContainer root = new WContainer();
WSubordinateControl control = new WSubordinateControl();
root.add(control);
WFieldLayout layout = new WFieldLayout();
layout.setLabelWidth(25);
layout.setMargin(new com.github.bordertech.wcomponents.Margin(0, 0, 12, 0));
WCheckBox c... | java |
@Override
public void paint(final RenderContext renderContext) {
// Check interceptor is enabled
if (!DebugValidateXML.isEnabled()) {
super.paint(renderContext);
return;
}
if (!(renderContext instanceof WebXmlRenderContext)) {
LOG.warn("Unable to validate against a " + renderContext);
super.paint(... | java |
private void paintOriginalXML(final String originalXML, final PrintWriter writer) {
// Replace any CDATA Sections embedded in XML
String xml = originalXML.replaceAll("<!\\[CDATA\\[", "CDATASTART");
xml = xml.replaceAll("\\]\\]>", "CDATAFINISH");
// Paint Output
writer.println("<div>");
writer.println("<!--... | java |
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!this.isInitialised()) {
List recent = loadRecentList();
if (recent != null && !recent.isEmpty()) {
String selection = (String) recent.get(0);
displaySelection(selection);
}
this... | java |
private void updateTitle() {
String title;
if (this.getCurrentComponent() == null) {
title = "Example Picker";
} else {
title = this.getCurrentComponent().getClass().getName();
}
WApplication app = WebUtilities.getAncestorOfClass(WApplication.class, this);
if (app != null) {
app.setTitle(title);... | java |
@Override
protected void afterPaint(final RenderContext renderContext) {
super.afterPaint(renderContext);
if (profileBtn.isPressed()) {
// UIC serialization stats
UicStats stats = new UicStats(UIContextHolder.getCurrent());
WComponent currentComp = this.getCurrentComponent();
if (currentComp != null... | java |
private List loadRecentList() {
try {
InputStream in = new BufferedInputStream(new FileInputStream(
RECENT_FILE_NAME));
XMLDecoder d = new XMLDecoder(in);
Object result = d.readObject();
d.close();
return (List) result;
} catch (FileNotFoundException ex) {
// This is ok, it's probably the f... | java |
public Container getCurrentComponent() {
Container currentComponent = null;
if (((Container) (container.getChildAt(0))).getChildCount() > 0) {
currentComponent = (Container) container.getChildAt(0);
}
return currentComponent;
} | java |
public void displaySelection(final String selection) {
WComponent selectedComponent = UIRegistry.getInstance().getUI(selection);
if (selectedComponent == null) {
// Can't load selected component.
WMessages.getInstance(this).error(
"Unable to load example: " + selection + ", see log for details.");
re... | java |
public void displaySelection(final WComponent selectedComponent) {
WComponent currentComponent = getCurrentComponent();
if (selectedComponent == currentComponent) {
// We are already displaying this component, so nothing to do.
return;
}
// We have a new selection so display it.
container.removeAll();... | java |
private void storeRecentList(final List recent) {
try {
if (recent == null) {
return;
}
// Only keep the last 8 entries.
while (recent.size() > 8) {
recent.remove(recent.size() - 1);
}
OutputStream out = new BufferedOutputStream(new FileOutputStream(
RECENT_FILE_NAME));
XMLEncoder ... | java |
public static void setCurrentOperationDetails(final AjaxOperation operation, final ComponentWithContext trigger) {
if (operation == null) {
THREAD_LOCAL_OPERATION.remove();
} else {
THREAD_LOCAL_OPERATION.set(operation);
}
if (trigger == null) {
THREAD_LOCAL_COMPONENT_WITH_CONTEXT.remove();
} else {... | java |
public static AjaxOperation registerComponents(final List<String> targetIds, final String triggerId) {
AjaxOperation operation = new AjaxOperation(triggerId, targetIds);
registerAjaxOperation(operation);
return operation;
} | java |
public static AjaxOperation registerComponent(final String targetId, final String triggerId) {
AjaxOperation operation = new AjaxOperation(triggerId, targetId);
registerAjaxOperation(operation);
return operation;
} | java |
public static AjaxOperation getAjaxOperation(final String triggerId) {
Map<String, AjaxOperation> operations = getRegisteredOperations();
return operations == null ? null : operations.get(triggerId);
} | java |
public static void clearAllRegisteredOperations() {
UIContext uic = UIContextHolder.getCurrentPrimaryUIContext();
if (uic != null) {
uic.setFwkAttribute(AJAX_OPERATIONS_SESSION_KEY, null);
}
} | java |
private static void registerAjaxOperation(final AjaxOperation operation) {
UIContext uic = UIContextHolder.getCurrentPrimaryUIContext();
if (uic == null) {
throw new SystemException("No User Context Available to Register AJAX Operations.");
}
Map<String, AjaxOperation> operations = (Map<String, AjaxOperation... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WCheckBoxSelect select = (WCheckBoxSelect) component;
XmlStringBuilder xml = renderContext.getWriter();
int cols = select.getButtonColumns();
boolean readOnly = select.isReadOnly();
xml.appendTagOpen("ui:ch... | java |
public WSubordinateControl build() {
if (!condition().validate()) {
throw new SystemException("Invalid condition: " + condition);
}
if (getActionsWhenTrue().isEmpty() && getActionsWhenFalse().isEmpty()) {
throw new SystemException("No actions to execute");
}
WSubordinateControl subordinate = new WSubo... | java |
@Override
public void preparePaint(final Request request) {
Headers headers = this.getUI().getHeaders();
headers.reset();
headers.setContentType(WebUtilities.CONTENT_TYPE_XML);
super.preparePaint(request);
} | java |
@Override
public void paint(final RenderContext renderContext) {
WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
PrintWriter writer = webRenderContext.getWriter();
beforePaint(writer);
getBackingComponent().paint(renderContext);
afterPaint(writer);
} | java |
protected void beforePaint(final PrintWriter writer) {
PageShell pageShell = Factory.newInstance(PageShell.class);
pageShell.openDoc(writer);
pageShell.writeHeader(writer);
} | java |
protected void afterPaint(final PrintWriter writer) {
PageShell pageShell = Factory.newInstance(PageShell.class);
pageShell.writeFooter(writer);
pageShell.closeDoc(writer);
} | java |
@Override
public void handleRequest(final Request request) {
// Clear pressed
clearPressed();
String requestValue = request.getParameter(getId());
boolean pressed = "x".equals(requestValue);
// Only process on a POST
if (pressed && !"POST".equals(request.getMethod())) {
LOG.warn("Button pressed on a r... | java |
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
UIContext uic = UIContextHolder.getCurrent();
if (isAjax() && uic.getUI() != null) {
AjaxTarget target = getAjaxTarget();
AjaxHelper.registerComponent(target.getId(), getId());
}
} | java |
public String getValue() {
Object value = getData();
if (value != null) {
return value.toString();
}
String text = getText();
return text == null ? NO_VALUE : text;
} | java |
public void setImage(final Image image) {
ButtonModel model = getOrCreateComponentModel();
model.image = image;
model.imageUrl = null;
} | java |
@Override
protected void preparePaintComponent(final Request request) {
if (OPTION_CONTENT1.equals(rbSelect.getSelected())) {
content.setText("This is content 1");
} else if (OPTION_CONTENT2.equals(rbSelect.getSelected())) {
content.setText("This is content 2");
} else if (OPTION_CONTENT3.equals(rbSelect.g... | java |
public void execute() {
if (condition == null) {
throw new SystemException("Rule cannot be executed as it has no condition");
}
if (condition.isTrue()) {
for (Action action : onTrue) {
action.execute();
}
} else {
for (Action action : onFalse) {
action.execute();
}
}
} | java |
public static void applyRegisteredControls(final Request request, final boolean useRequestValues) {
Set<String> controls = getRegisteredSubordinateControls();
if (controls == null) {
return;
}
// Process Controls
for (String controlId : controls) {
// Find the Component for this ID
ComponentWithCon... | java |
public static void clearAllRegisteredControls() {
UIContext uic = UIContextHolder.getCurrentPrimaryUIContext();
if (uic != null) {
uic.setFwkAttribute(SUBORDINATE_CONTROL_SESSION_KEY, null);
}
} | java |
public void setContent(final WComponent content) {
getOrCreateComponentModel().content = content;
// There should only be one content.
holder.removeAll();
holder.add(content);
} | java |
public void setTitle(final String title, final Serializable... args) {
getOrCreateComponentModel().title = I18nUtilities.asMessage(title, args);
} | java |
public void setTrigger(final DialogOpenTrigger trigger) {
// pre-1.2.3 compatibilty only:
if (this.hasLegacyTriggerButton()) {
DialogOpenTrigger theTrigger = getTrigger();
if (theTrigger instanceof WButton) {
remove(theTrigger);
}
setLegacyTriggerButton(false);
}
// end of backwards compatibilit... | java |
protected void handleTriggerOpenAction(final Request request) {
// Run the action (if set)
final Action action = getTriggerOpenAction();
if (action != null) {
final ActionEvent event = new ActionEvent(this, OPEN_DIALOG_ACTION);
Runnable later = new Runnable() {
@Override
public void run() {
act... | java |
public final boolean isAjaxTargeted() {
// If the AJAX target is within the dialog, it should be visible.
AjaxOperation operation = AjaxHelper.getCurrentOperation();
if (operation == null) {
return false;
}
String dialogId = getId();
String containerId = operation.getTargetContainerId();
if (containe... | java |
public List<Application> getAppsOnSpace(int spaceId) {
return getResourceFactory().getApiResource(
"/app/space/" + spaceId + "/").get(
new GenericType<List<Application>>() {
});
} | java |
public List<Application> getTopApps(Integer limit) {
WebResource resource = getResourceFactory().getApiResource("/app/top/");
if (limit != null) {
resource = resource.queryParam("limit", limit.toString());
}
return resource.get(new GenericType<List<Application>>() {
});
} | java |
public int addApp(ApplicationCreate app) {
return getResourceFactory().getApiResource("/app/")
.entity(app, MediaType.APPLICATION_JSON_TYPE)
.post(ApplicationCreateResponse.class).getId();
} | java |
public void updateApp(int appId, ApplicationUpdate app) {
getResourceFactory().getApiResource("/app/" + appId)
.entity(app, MediaType.APPLICATION_JSON).put();
} | java |
public int addField(int appId, ApplicationFieldCreate field) {
return getResourceFactory().getApiResource("/app/" + appId + "/field/")
.entity(field, MediaType.APPLICATION_JSON_TYPE)
.post(ApplicationFieldCreateResponse.class).getId();
} | java |
public void updateField(int appId, int fieldId,
ApplicationFieldConfiguration configuration) {
getResourceFactory()
.getApiResource("/app/" + appId + "/field/" + fieldId)
.entity(configuration, MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public int install(int appId, int spaceId) {
return getResourceFactory()
.getApiResource("/app/" + appId + "/install")
.entity(new ApplicationInstall(spaceId),
MediaType.APPLICATION_JSON_TYPE)
.post(ApplicationCreateResponse.class).getId();
} | java |
public void updateOrder(int spaceId, List<Integer> appIds) {
getResourceFactory().getApiResource("/app/space/" + spaceId + "/order")
.entity(appIds, MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public void deactivateApp(int appId) {
getResourceFactory().getApiResource("/app/" + appId + "/deactivate")
.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
} | java |
public void downloadFile(int fileId, java.io.File target, FileSize size)
throws IOException {
WebResource builder = getResourceFactory()
.getFileResource("/" + fileId);
if (size != null) {
builder = builder.path("/" + size.name().toLowerCase());
}
byte[] data = builder.get(byte[].class);
FileUtils.w... | java |
public int uploadFile(String name, java.io.File file) {
FileDataBodyPart filePart = new FileDataBodyPart("source", file);
// Work around for bug in cherrypy
FormDataContentDisposition.FormDataContentDispositionBuilder builder = FormDataContentDisposition
.name(filePart.getName());
builder.fileName(file.getN... | java |
public void updateFile(int fileId, FileUpdate update) {
getResourceFactory().getApiResource("/file/" + fileId)
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public List<File> getOnApp(int appId, Integer limit, Integer offset) {
WebResource resource = getResourceFactory().getApiResource(
"/file/app/" + appId + "/");
if (limit != null) {
resource = resource.queryParam("limit", limit.toString());
}
if (offset != null) {
resource = resource.queryParam("offset... | java |
public List<File> getOnSpace(int spaceId, Integer limit, Integer offset) {
WebResource resource = getResourceFactory().getApiResource(
"/file/space/" + spaceId + "/");
if (limit != null) {
resource = resource.queryParam("limit", limit.toString());
}
if (offset != null) {
resource = resource.queryParam... | java |
@Override
public List<Diagnostic> validate(final List<Diagnostic> diags) {
if (!isValid()) {
List<Serializable> argList = getMessageArguments();
Serializable[] args = argList.toArray(new Serializable[argList.size()]);
diags.add(new DiagnosticImpl(Diagnostic.ERROR, input, getErrorMessage(), args));
}
r... | java |
public R between(int lower, int upper) {
expr().between(_name, lower, upper);
return _root;
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WFieldSet fieldSet = (WFieldSet) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:fieldset");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("cla... | java |
private WApplication findApplication() {
WApplication appl = WApplication.instance(this);
if (appl == null) {
messages.addMessage(new Message(Message.WARNING_MESSAGE,
"There is no WApplication available for this example."));
}
return appl;
} | java |
public void addTaggedComponent(final String tag, final WComponent component) {
if (Util.empty(tag)) {
throw new IllegalArgumentException("A tag must be provided.");
}
if (component == null) {
throw new IllegalArgumentException("A component must be provided.");
}
TemplateModel model = getOrCreateCompone... | java |
public void removeTaggedComponent(final WComponent component) {
TemplateModel model = getOrCreateComponentModel();
if (model.taggedComponents != null) {
// Find tag
String tag = null;
for (Map.Entry<String, WComponent> entry : model.taggedComponents.entrySet()) {
if (entry.getValue().equals(component))... | java |
public void removeTaggedComponent(final String tag) {
TemplateModel model = getOrCreateComponentModel();
if (model.taggedComponents != null) {
WComponent component = model.taggedComponents.remove(tag);
if (model.taggedComponents.isEmpty()) {
model.taggedComponents = null;
}
if (component != null) {
... | java |
public void addParameter(final String tag, final Object value) {
if (Util.empty(tag)) {
throw new IllegalArgumentException("A tag must be provided");
}
TemplateModel model = getOrCreateComponentModel();
if (model.parameters == null) {
model.parameters = new HashMap<>();
}
model.parameters.put(tag, va... | java |
public void setEngineName(final TemplateRendererFactory.TemplateEngine templateEngine) {
setEngineName(templateEngine == null ? null : templateEngine.getEngineName());
} | java |
public void removeEngineOption(final String key) {
TemplateModel model = getOrCreateComponentModel();
if (model.engineOptions != null) {
model.engineOptions.remove(key);
}
} | java |
public static Date createDate(final int day, final int month, final int year) {
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(Calendar.DAY_OF_MONTH, day);
cal.set(Calendar.MONTH, month - 1);
cal.set(Calendar.YEAR, year);
return cal.getTime();
} | java |
@Override
public void preparePaint(final Request request) {
// Headers
// The WHeaders comes from the root WComponent and is a
// mechanism for WComponents to add their own headers
// (eg more JavaScript references).
Headers headers = this.getUI().getHeaders();
headers.reset();
super.preparePaint(reque... | java |
@Override
public void paint(final RenderContext renderContext) {
if (renderContext instanceof WebXmlRenderContext) {
PageContentHelper.addAllHeadlines(((WebXmlRenderContext) renderContext).getWriter(),
getUI().getHeaders());
}
getBackingComponent().paint(renderContext);
} | java |
@Override
public void handleRequest(final Request request) {
super.handleRequest(request);
WComponent visibleDialog = getVisible();
if (visibleDialog != null) {
visibleDialog.serviceRequest(request);
}
} | java |
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
WComponent visibleDialog = getVisible();
if (visibleDialog != null) {
visibleDialog.preparePaint(request);
}
} | java |
@Override
protected void paintComponent(final RenderContext renderContext) {
super.paintComponent(renderContext);
WComponent visibleDialog = getVisible();
if (visibleDialog != null) {
visibleDialog.paint(renderContext);
}
} | java |
@Override
protected void validateComponent(final List<Diagnostic> diags) {
super.validateComponent(diags);
WComponent visibleDialog = getVisible();
if (visibleDialog != null) {
visibleDialog.validate(diags);
}
} | java |
@Override
public void showErrorIndicators(final List<Diagnostic> diags) {
WComponent visibleComponent = getVisible();
visibleComponent.showErrorIndicators(diags);
} | java |
@Override
public void showWarningIndicators(final List<Diagnostic> diags) {
WComponent visibleComponent = getVisible();
visibleComponent.showWarningIndicators(diags);
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WList list = (WList) component;
XmlStringBuilder xml = renderContext.getWriter();
WList.Type type = list.getType();
WList.Separator separator = list.getSeparator();
Size gap = list.getSpace();
String gapSt... | java |
private void addInteractiveExamples() {
add(new WHeading(HeadingLevel.H2, "Simple WCheckBoxSelect examples"));
addExampleUsingLookupTable();
addExampleUsingArrayList();
addExampleUsingStringArray();
addInsideAFieldLayoutExamples();
add(new WHeading(HeadingLevel.H2, "Examples showing LAYOUT properties"));
... | java |
private void addExampleUsingStringArray() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using a String array"));
String[] options = new String[]{"Dog", "Cat", "Bird", "Turtle"};
final WCheckBoxSelect select = new WCheckBoxSelect(options);
select.setToolTip("Animals");
select.setMandatory(true);... | java |
private void addExampleUsingArrayList() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect created using an array list of options"));
List<CarOption> options = new ArrayList<>();
options.add(new CarOption("1", "Ferrari", "F-360"));
options.add(new CarOption("2", "Mercedez Benz", "amg"));
options.add(new Car... | java |
private void addInsideAFieldLayoutExamples() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect inside a WFieldLayout"));
add(new ExplanatoryText("When a WCheckBoxSelect is inside a WField its label is exposed in a way which appears and behaves like a regular "
+ "HTML label. This allows WCheckBoxSelects to b... | java |
private void addColumnSelectExample() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect laid out in columns"));
add(new ExplanatoryText("Setting the layout to COLUMN will make the check boxes be rendered in 'n' columns. The number of columns is"
+ " determined by the layoutColumnCount property."));
final W... | java |
private void addAntiPatternExamples() {
add(new WHeading(HeadingLevel.H2, "WCheckBoxSelect anti-pattern examples"));
add(new WMessageBox(
WMessageBox.WARN,
"These examples are purposely bad and should not be used as samples of how to use WComponents but samples of how NOT to use them."));
add(new WHeadin... | java |
private void paintAjaxTrigger(final WLink link, final XmlStringBuilder xml) {
AjaxTarget[] actionTargets = link.getActionTargets();
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
xml.appendAttribute("triggerId", link.getId());
xml.appendClose();
if (actionTargets != null && actionTargets.length > 0) {
... | java |
@Override
public void paint(final RenderContext renderContext) {
if (!(renderContext instanceof WebXmlRenderContext)) {
throw new SystemException("Unable to render to " + renderContext);
}
PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();
Template template = null;
try {
templa... | java |
private static String[] getRegions(final String state) {
if ("ACT".equals(state)) {
return ACT_REGIONS;
} else if ("VIC".equals(state)) {
return VIC_REGIONS;
} else {
return null;
}
} | java |
private static String[] getSuburbs(final String region) {
if ("Tuggeranong".equals(region)) {
return TUGGERANONG_SUBURBS;
} else if ("Woden".equals(region)) {
return WODEN_SUBURBS;
} else if ("Melbourne".equals(region)) {
return MELBOURNE_SUBURBS;
} else if ("Mornington Peninsula".equals(region)) {
... | java |
private void applySettings() {
// reset the container.
container.reset();
// create the new collapsible.
WText component1 = new WText("Here is some text that is collapsible via ajax.");
WCollapsible collapsible1 = new WCollapsible(component1, "Collapsible",
(CollapsibleMode) rbCollapsibleSelect.getSelect... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.