code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
@SuppressWarnings("unchecked")
private void loadServlets(Map<String, ServletConfiguration> servlets, Environment environment) throws ClassNotFoundException {
if (servlets != null) {
for (Map.Entry<String, ServletConfiguration> servletEntry : servlets.entrySet()) {
ServletConfigur... | java |
private String getPart(int pos) {
String value = this.getValue();
if (value == null) {
return null;
}
String[] parts = value.split("/");
return parts.length >= pos + 1 ? parts[pos] : null;
} | java |
public NeedleRule withOuter(final MethodRule rule) {
if (rule instanceof InjectionProvider) {
addInjectionProvider((InjectionProvider<?>) rule);
}
methodRuleChain.add(0, rule);
return this;
} | java |
private List<String> buildCommand() {
List<String> command = new ArrayList<String>();
command.add(cmd);
command.add("thin");
command.add("--sourceAppPath=" + getSourceAppPath());
command.add("--targetLibCachePath=" + getTargetLibCachePath());
command.add("--targetThinAppP... | java |
@SuppressWarnings("unchecked")
public <X> X resetToNice(final Object mock) {
EasyMock.resetToNice(mock);
return (X) mock;
} | java |
@SuppressWarnings("unchecked")
public <X> X resetToStrict(final Object mock) {
EasyMock.resetToStrict(mock);
return (X) mock;
} | java |
@SuppressWarnings("unchecked")
public <X> X resetToDefault(final Object mock) {
EasyMock.resetToDefault(mock);
return (X) mock;
} | java |
protected void deleteContent(final List<String> tables, final Statement statement) throws SQLException {
final ArrayList<String> tempTables = new ArrayList<String>(tables);
// Loop until all data is deleted: we don't know the correct DROP
// order, so we have to retry upon failure
while (!tempTables.isEmpty()... | java |
private List<String> initCommand(){
List<String> command = new ArrayList<String>();
command.add(cmd);
command.add("install");
if (acceptLicense) {
command.add("--acceptLicense");
} else {
command.add("--viewLicenseAgreement");
}
if (to != n... | java |
private <T extends XSString> T createXSString(Class<T> clazz, String value) {
if (value == null) {
return null;
}
QName elementName = null;
String localName = null;
try {
elementName = (QName) clazz.getDeclaredField("DEFAULT_ELEMENT_NAME").get(null);
localName = (String) clazz.getD... | java |
public Annotation[] getAnnotations() {
final Annotation[] accessibleObjectAnnotations = accessibleObject.getAnnotations();
final Annotation[] annotations = new Annotation[accessibleObjectAnnotations.length
+ parameterAnnotations.length];
System.arraycopy(accessibleObjectAnnotati... | java |
public static final MetadataServiceListVersion valueOf(final int majorVersion, final int minorVersion) {
if (majorVersion == 1 && minorVersion == 0) {
return MetadataServiceListVersion.VERSION_10;
}
return new MetadataServiceListVersion(majorVersion, minorVersion);
} | java |
public static final MetadataServiceListVersion valueOf(String version) {
String[] components = version.split("\\.");
return valueOf(Integer.valueOf(components[0]), Integer.valueOf(components[1]));
} | java |
public static <T> InjectionProvider<T> providerForQualifiedInstance(final Class<? extends Annotation> qualifier, final T instance) {
return new QualifiedInstanceInjectionProvider<T>(qualifier, instance);
} | java |
private static Set<InjectionProvider<?>> newProviderSet(final InjectionProvider<?>... providers) {
final Set<InjectionProvider<?>> result = new LinkedHashSet<InjectionProvider<?>>();
if (providers != null && providers.length > 0) {
for (final InjectionProvider<?> provider : providers) {
... | java |
private static InjectionProviderInstancesSupplier mergeSuppliers(final InjectionProviderInstancesSupplier... suppliers) {
final Set<InjectionProvider<?>> result = new LinkedHashSet<InjectionProvider<?>>();
if (suppliers != null && suppliers.length > 0) {
for (final InjectionProviderInstanc... | java |
public static InjectionProvider<?>[] providersForInstancesSuppliers(final InjectionProviderInstancesSupplier... suppliers) {
final InjectionProviderInstancesSupplier supplier = mergeSuppliers(suppliers);
return supplier.get().toArray(new InjectionProvider<?>[supplier.get().size()]);
} | java |
public static InjectionProvider<?>[] providersToArray(final Collection<InjectionProvider<?>> providers) {
return providers == null ? new InjectionProvider<?>[0] : providers
.toArray(new InjectionProvider<?>[providers.size()]);
} | java |
public final <T> T saveObject(final T obj) throws Exception {
return executeInTransaction(new Runnable<T>() {
@Override
public T run(final EntityManager entityManager) {
return persist(obj, entityManager);
}
});
} | java |
public final <T> T loadObject(final Class<T> clazz, final Object id) throws Exception {
return executeInTransaction(new Runnable<T>() {
@Override
public T run(final EntityManager entityManager) {
return loadObject(entityManager, clazz, id);
}
});
} | java |
public final <T> List<T> loadAllObjects(final Class<T> clazz) throws Exception {
final Entity entityAnnotation = clazz.getAnnotation(Entity.class);
if(entityAnnotation == null){
throw new IllegalArgumentException("Unknown entity: " + clazz.getName());
}
return execut... | java |
@Override
public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
Document newDocument = null;
Node childNode = domElement.getFirstChild();
while (childNode != null) {
if (childNode.getNodeType() != Node.TEXT_NODE) {
// We skip everything except for a text node.
... | java |
private static Map<String, String> getNamespaceBindings(Element element) {
Map<String, String> namespaceMap = new HashMap<String, String>();
getNamespaceBindings(element, namespaceMap);
return namespaceMap;
} | java |
public String waitForStringInLog(String regexp, long timeout,
File outputFile) {
int waited = 0;
final int waitIncrement = 500;
log(MessageFormat.format(messages.getString("info.search.string"), regexp, outputFile.getAbsolutePath(), timeout / 1000));
... | java |
public void bootstrap() throws ConfigurationException {
XMLConfigurator configurator = new XMLConfigurator();
for (String config : configs) {
log.debug("Loading XMLTooling configuration " + config);
configurator.load(Configuration.class.getResourceAsStream(config));
}
} | java |
public static InputStream loadResource(final String resource) throws FileNotFoundException {
final boolean hasLeadingSlash = resource.startsWith("/");
final String stripped = hasLeadingSlash ? resource.substring(1) : resource;
InputStream stream = null;
final ClassLoader classLoader = ... | java |
@Override
public OperationResult operate(TestStep testStep) {
String testStepName = testStep.getLocator().getValue();
LogRecord log = LogRecord.info(LOG, testStep, "script.execute", testStepName);
current.backup();
TestScript testScript = dao.load(new File(pm.getPageScript... | java |
@Override
public OperationResult operate(TestStep testStep) {
String value = testStep.getValue();
LogRecord record = LogRecord.info(log, testStep, "test.step.execute", value);
TestScript testScript = current.getTestScript();
int nextIndex = testScript.getIndexByScriptNo(valu... | java |
private WMenu buildTreeMenu(final WText selectedMenuText) {
WMenu menu = new WMenu(WMenu.MenuType.TREE);
menu.setSelectMode(SelectMode.SINGLE);
mapTreeHierarchy(menu, createExampleHierarchy(), selectedMenuText);
return menu;
} | java |
private void mapTreeHierarchy(final WComponent currentComponent,
final StringTreeNode currentNode, final WText selectedMenuText) {
if (currentNode.isLeaf()) {
WMenuItem menuItem = new WMenuItem(currentNode.getData(), new ExampleMenuAction(
selectedMenuText));
menuItem.setActionObject(currentNode.getData... | java |
private static StringTreeNode createExampleHierarchy() {
StringTreeNode root = new StringTreeNode(Object.class.getName());
Map<String, StringTreeNode> nodeMap = new HashMap<>();
nodeMap.put(root.getData(), root);
// The classes to show in the hierarchy
Class<?>[] classes = new Class[]{
WMenu.class,
WMe... | java |
public void addTerm(final String term, final WComponent... data) {
for (WComponent component : data) {
if (component != null) {
content.add(component, term);
}
}
// If the term doesn't exist, we may need to add a dummy component
if (getComponentsForTerm(term).isEmpty()) {
content.add(new DefaultWC... | java |
public List<Duplet<String, ArrayList<WComponent>>> getTerms() {
Map<String, Duplet<String, ArrayList<WComponent>>> componentsByTerm = new HashMap<>();
List<Duplet<String, ArrayList<WComponent>>> result = new ArrayList<>();
List<WComponent> childList = content.getComponentModel().getChildren();
if (childList !... | java |
private List<WComponent> getComponentsForTerm(final String term) {
List<WComponent> childList = content.getComponentModel().getChildren();
List<WComponent> result = new ArrayList<>();
if (childList != null) {
for (int i = 0; i < childList.size(); i++) {
WComponent child = childList.get(i);
if (term.e... | java |
public void setArgs(final Serializable... args) {
this.args = args == null || args.length == 0 ? null : args;
} | java |
public int addSpaceContact(int spaceId, ContactCreate create, boolean silent) {
return getResourceFactory().getApiResource("/contact/space/" + spaceId + "/")
.queryParam("silent", silent ? "1" : "0")
.entity(create, MediaType.APPLICATION_JSON_TYPE)
.post(ContactCreateResponse.class).getId();
} | java |
public void updateSpaceContact(int profileId, ContactUpdate update, boolean silent, boolean hook) {
getResourceFactory().getApiResource("/contact/" + profileId)
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public <T, F, R> List<T> getContacts(ProfileField<F, R> key, F value,
Integer limit, Integer offset, ProfileType<T> type,
ContactOrder order, ContactType contactType) {
WebResource resource = getResourceFactory().getApiResource("/contact/");
return getContactsCommon(resource, key, value, limit, offset, type,... | java |
@Override
public void handleRequest(final Request request) {
super.handleRequest(request);
String targ = request.getParameter(Environment.TARGET_ID);
boolean contentReqested = (targ != null && targ.equals(getTargetId()));
if (contentReqested) {
ContentEscape escape = new ContentEscape(getImage());
esca... | java |
public void setImage(final Image image) {
ImageModel model = getOrCreateComponentModel();
model.image = image;
model.imageUrl = null;
} | java |
public void setImageUrl(final String imageUrl) {
ImageModel model = getOrCreateComponentModel();
model.imageUrl = imageUrl;
model.image = null;
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WRadioButtonSelect rbSelect = (WRadioButtonSelect) component;
XmlStringBuilder xml = renderContext.getWriter();
int cols = rbSelect.getButtonColumns();
boolean readOnly = rbSelect.isReadOnly();
xml.appendTa... | java |
private void paintAjax(final WRadioButtonSelect rbSelect, final XmlStringBuilder xml) {
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
xml.appendAttribute("triggerId", rbSelect.getId());
xml.appendClose();
// Target
xml.appendTagOpen("ui:ajaxtargetid");
xml.appendAttribute("targetId", rbSelect.getAjax... | java |
@Override
public void setBean(final Object bean) {
BeanAndProviderBoundComponentModel model = getOrCreateComponentModel();
model.setBean(bean);
if (getBeanProperty() == null) {
setBeanProperty(".");
}
// Remove values in scratch map
removeBeanFromScratchMap();
} | java |
@Override
public void setBeanId(final Object beanId) {
BeanAndProviderBoundComponentModel model = getOrCreateComponentModel();
model.setBeanId(beanId);
// Remove values in scratch map
removeBeanFromScratchMap();
} | java |
@Override
public void setBeanProperty(final String propertyName) {
String currBeanProperty = getBeanProperty();
if (!Objects.equals(propertyName, currBeanProperty)) {
getOrCreateComponentModel().setBeanProperty(propertyName);
}
} | java |
protected void doUpdateBeanValue(final Object value) {
String beanProperty = getBeanProperty();
if (beanProperty != null && beanProperty.length() > 0 && !".".equals(beanProperty)) {
Object bean = getBean();
if (bean != null) {
try {
Object beanValue = getBeanValue();
if (!Util.equals(beanValue, ... | java |
protected void removeBeanFromScratchMap() {
Map<Object, Object> scratchMap = getBeanScratchMap();
if (scratchMap == null) {
return;
}
scratchMap.remove(SCRATCHMAP_BEAN_ID_KEY);
scratchMap.remove(SCRATCHMAP_BEAN_OBJECT_KEY);
} | java |
public boolean isChanged() {
Object currentValue = getData();
Object sharedValue = ((BeanAndProviderBoundComponentModel) getDefaultModel()).getData();
if (getBeanProperty() != null) {
sharedValue = getBeanValue();
}
return !Util.equals(currentValue, sharedValue);
} | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTabSet tabSet = (WTabSet) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:tabset");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", com... | java |
private void createUI() {
add(new WHeading(HeadingLevel.H2, "Contacts"));
add(repeater);
createButtonBar();
createAddContactSubForm();
createPrintContactsSubForm();
} | java |
private void createButtonBar() {
// Update and reset controls for the repeater.
WPanel buttonPanel = new WPanel(WPanel.Type.FEATURE);
buttonPanel.setMargin(new Margin(Size.MEDIUM, null , Size.LARGE, null));
buttonPanel.setLayout(new BorderLayout());
WButton updateButton = new WButton("Update");
updateButto... | java |
private void createAddContactSubForm() {
add(new WHeading(HeadingLevel.H3, "Add a new contact"));
WButton addBtn = new WButton("Add");
addBtn.setAction(new Action() {
@Override
public void execute(final ActionEvent event) {
addNewContact();
}
});
addBtn.setImage("/image/address-book-new.png");
... | java |
private void createPrintContactsSubForm() {
add(new WHeading(HeadingLevel.H3, "Print to CSV"));
WButton printBtn = new WButton("Print");
printBtn.setAction(new Action() {
@Override
public void execute(final ActionEvent event) {
printDetails();
}
});
printBtn.setImage("/image/document-print.png")... | java |
private void printDetails() {
StringBuilder builder = new StringBuilder("\"Name\",\"Phone\",\"Roles\",\"Identifier\"\n");
for (Object contact : repeater.getBeanList()) {
builder.append(contact).append('\n');
}
printOutput.setText(builder.toString());
} | java |
private static List<ContactDetails> fetchDataList() {
List<ContactDetails> list = new ArrayList<>();
list.add(new ContactDetails("David", "1234", new String[]{"a", "b"}));
list.add(new ContactDetails("Jun", "1111", new String[]{"c"}));
list.add(new ContactDetails("Martin", null, new String[]{"b"}));
return li... | java |
private WFieldSet addFieldSet(final String title, final WFieldSet.FrameType type) {
final WFieldSet fieldset = new WFieldSet(title);
fieldset.setFrameType(type);
fieldset.setMargin(new Margin(null, null, Size.LARGE, null));
final WFieldLayout layout = new WFieldLayout();
fieldset.add(layout);
layout.setLabe... | java |
private void makeSimpleExample() {
add(new WHeading(HeadingLevel.H3, "Simple WRadioButtonSelect"));
WPanel examplePanel = new WPanel();
examplePanel.setLayout(new FlowLayout(FlowLayout.VERTICAL, Size.MEDIUM));
add(examplePanel);
/**
* The radio button select.
*/
final WRadioButtonSelect rbSelect = ne... | java |
private void makeFramelessExample() {
add(new WHeading(HeadingLevel.H3, "WRadioButtonSelect without its frame"));
add(new ExplanatoryText("When a WRadioButtonSelect is frameless it loses some of its coherence, especially when its WLabel is hidden or "
+ "replaced by a toolTip. Using a frameless WRadioButtonSele... | java |
private void addInsideAFieldLayoutExample() {
add(new WHeading(HeadingLevel.H3, "WRadioButtonSelect inside a WFieldLayout"));
add(new ExplanatoryText(
"When a WRadioButtonSelect is inside a WField its label is exposed in a way which appears and behaves like a regular HTML label."
+ " This allows WRadioButto... | java |
private void addFlatSelectExample() {
add(new WHeading(HeadingLevel.H3, "WRadioButtonSelect with flat layout"));
add(new ExplanatoryText("Setting the layout to FLAT will make the radio buttons be rendered in a horizontal line. They will wrap when they"
+ " reach the edge of the parent container."));
final WRa... | java |
private void addReadOnlyExamples() {
add(new WHeading(HeadingLevel.H3, "Read-only WRadioButtonSelect examples"));
add(new ExplanatoryText("These examples all use the same list of options: the states and territories list from the editable examples above. "
+ "When the readOnly state is specified only that option... | java |
private void addContentRow(final String contentDesc, final ContentAccess contentAccess,
final MutableContainer target) {
// Demonstrate WButton + WContent, round trip
WButton button = new WButton(contentDesc);
final WContent buttonContent = new WContent();
button.setAction(new Action() {
@Override
pub... | java |
private void applySettings() {
linkContainer.reset();
WLink exampleLink = new WLink();
exampleLink.setText(tfLinkLabel.getText());
final String url = tfUrlField.getValue();
if ("".equals(url) || !isValidUrl(url)) {
tfUrlField.setText(URL);
exampleLink.setUrl(URL);
} else {
exampleLink.setUrl(url);... | java |
public void showDetails(final ActionEvent event) {
// Track down the data associated with this event.
MyData data = (MyData) event.getActionObject();
displayDialog.setData(data);
dialog.display();
} | java |
private WMessages getWMessageInstance() {
MessageContainer container = getMessageContainer(component);
WMessages result = null;
if (container == null) {
LOG.warn("No MessageContainer as ancestor of " + component
+ ". Messages will not be added");
} else {
result = container.getMessages();
if (re... | java |
@Override
public void error(final String code) {
WMessages instance = getWMessageInstance();
if (instance != null) {
instance.error(code);
}
} | java |
public void setBeanList(final List beanList) {
RepeaterModel model = getOrCreateComponentModel();
model.setData(beanList);
// Clean up any stale data.
HashSet rowIds = new HashSet(beanList.size());
for (Object bean : beanList) {
rowIds.add(getRowId(bean));
}
cleanupStaleContexts(rowIds);
// Clean... | java |
protected void clearScratchMaps(final WComponent node) {
UIContext uic = UIContextHolder.getCurrent();
uic.clearRequestScratchMap(node);
uic.clearScratchMap(node);
if (node instanceof WRepeater) {
WRepeater repeater = (WRepeater) node;
List<UIContext> rowContextList = repeater.getRowContexts();
WComp... | java |
public List getBeanList() {
List beanList = (List) getData();
if (beanList == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(beanList);
} | java |
@Override
public void validate(final List<Diagnostic> diags) {
// Validate each row.
List beanList = this.getBeanList();
WComponent row = getRepeatedComponent();
for (int i = 0; i < beanList.size(); i++) {
Object rowData = beanList.get(i);
UIContext rowContext = getRowContext(rowData, i);
UIContextH... | java |
@Override
public void handleRequest(final Request request) {
assertConfigured();
//
// Service the request for each row.
//
List beanList = getBeanList();
HashSet rowIds = new HashSet(beanList.size());
WComponent row = getRepeatedComponent();
for (int i = 0; i < beanList.size(); i++) {
Object rowD... | java |
protected void cleanupStaleContexts(final Set<?> rowIds) {
RepeaterModel model = getOrCreateComponentModel();
if (model.rowContextMap != null) {
for (Iterator<Map.Entry<Object, SubUIContext>> i = model.rowContextMap.entrySet().
iterator(); i.hasNext();) {
Map.Entry<Object, SubUIContext> entry = i.next(... | java |
@Override
protected void preparePaintComponent(final Request request) {
assertConfigured();
List beanList = getBeanList();
List<Integer> used = new ArrayList<>();
for (int i = 0; i < beanList.size(); i++) {
Object rowData = beanList.get(i);
// Each row has its own context. This is why we can reuse th... | java |
protected void prepareRow(final Request request, final int rowIndex) {
WComponent row = getRepeatedComponent();
row.preparePaint(request);
} | java |
public UIContext getRowContext(final Object rowBean, final int rowIndex) {
RepeaterModel model = getOrCreateComponentModel();
Object rowId = getRowId(rowBean);
if (model.rowContextMap == null) {
model.rowContextMap = new HashMap<>();
}
SubUIContext rowContext = model.rowContextMap.get(rowId);
if (rowC... | java |
public Object getRowBeanForSubcontext(final SubUIContext subContext) {
if (subContext.repeatRoot != getRepeatRoot()) {
// TODO: Is this still necessary?
throw new IllegalArgumentException("SubUIContext is not for this WRepeater instance.");
}
// We need to get the list using the parent context
// so that... | java |
private Object getRowData(final Object rowId) {
// We cache row id --> row bean mapping per request for performance (to avoid nested loops)
Map dataByRowId = (Map) getScratchMap().get(SCRATCHMAP_DATA_BY_ROW_ID_KEY);
if (dataByRowId == null) {
dataByRowId = createRowIdCache();
}
Object data = dataByRowId.... | java |
protected Object getRowId(final Object rowBean) {
String rowIdProperty = getComponentModel().rowIdProperty;
if (rowIdProperty == null || rowBean == null) {
return rowBean;
}
try {
return PropertyUtils.getProperty(rowBean, rowIdProperty);
} catch (Exception e) {
LOG.error("Failed to read row propert... | java |
public List<UIContext> getRowContexts() {
List<?> beanList = this.getBeanList();
List<UIContext> contexts = new ArrayList<>(beanList.size());
for (int i = 0; i < beanList.size(); i++) {
Object rowData = beanList.get(i);
contexts.add(this.getRowContext(rowData, i));
}
return Collections.unmodifiableLis... | java |
public void assignTask(int taskId, int responsible) {
getResourceFactory()
.getApiResource("/task/" + taskId + "/assign")
.entity(new AssignValue(responsible),
MediaType.APPLICATION_JSON_TYPE).post();
} | java |
public void completeTask(int taskId) {
getResourceFactory().getApiResource("/task/" + taskId + "/complete")
.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
} | java |
public void updateDueDate(int taskId, LocalDate dueDate) {
getResourceFactory()
.getApiResource("/task/" + taskId + "/due_date")
.entity(new TaskDueDate(dueDate),
MediaType.APPLICATION_JSON_TYPE).put();
} | java |
public void updatePrivate(int taskId, boolean priv) {
getResourceFactory().getApiResource("/task/" + taskId + "/private")
.entity(new TaskPrivate(priv), MediaType.APPLICATION_JSON_TYPE)
.put();
} | java |
public void updateText(int taskId, String text) {
getResourceFactory().getApiResource("/task/" + taskId + "/text")
.entity(new TaskText(text), MediaType.APPLICATION_JSON_TYPE)
.put();
} | java |
public int createTask(TaskCreate task, boolean silent, boolean hook) {
TaskCreateResponse response = getResourceFactory()
.getApiResource("/task/")
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(task, MediaType.APPLICATION_JSON_TYPE)
.post(TaskCreateRespons... | java |
public List<Task> getTasksWithReference(Reference reference) {
return getResourceFactory().getApiResource(
"/task/" + reference.getType().name().toLowerCase() + "/"
+ reference.getId() + "/").get(
new GenericType<List<Task>>() {
});
} | java |
private Date convertDate(final Object data) {
if (data == null) {
return null;
} else if (data instanceof Date) {
return (Date) data;
} else if (data instanceof Long) {
return new Date((Long) data);
} else if (data instanceof Calendar) {
return ((Calendar) data).getTime();
} else if (data instance... | java |
@Override
protected void validateComponent(final List<Diagnostic> diags) {
if (isParseable()) {
super.validateComponent(diags);
validateDate(diags);
} else {
diags.add(createErrorDiagnostic(getComponentModel().errorMessage, this));
}
} | java |
@Override
public void setModel(final WebComponent component, final WebModel model) {
map.put(component, model);
} | java |
@Override
public void invokeLater(final UIContext uic, final Runnable runnable) {
if (invokeLaterRunnables == null) {
invokeLaterRunnables = new ArrayList<>();
}
invokeLaterRunnables.add(new UIContextImplRunnable(uic, runnable));
} | java |
@Override
public void setFocussed(final WComponent component, final UIContext uic) {
this.focussed = component;
this.focussedUIC = uic;
} | java |
@Override
public Object getFwkAttribute(final String name) {
if (attribMap == null) {
return null;
}
return attribMap.get(name);
} | java |
@Override
public void setFwkAttribute(final String name, final Object value) {
if (attribMap == null) {
attribMap = new HashMap<>();
}
attribMap.put(name, value);
} | java |
@Override
public Map<Object, Object> getScratchMap(final WComponent component) {
if (scratchMaps == null) {
scratchMaps = new HashMap<>();
}
Map<Object, Object> componentScratchMap = scratchMaps.get(component);
if (componentScratchMap == null) {
componentScratchMap = new HashMap<>(2);
scratchMaps.pu... | java |
private void setupLabel() {
// To retain compatibility with the WText API, create a WText for this component,
// which gets added to the label body.
WText textBody = new WText() {
@Override
public boolean isEncodeText() {
return WHeading.this.isEncodeText();
}
@Override
public String getText()... | java |
private void addNullLabelExample() {
add(new WHeading(HeadingLevel.H2, "How to use accessible null WLabels"));
add(new ExplanatoryText("These examples shows how sometime a null WLabel is the right thing to do."
+ "\n This example uses a WFieldSet as the labelled component and it has its own \"label\"."));
//... | java |
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WHeading heading = (WHeading) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:heading");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class",... | java |
@Override
protected boolean execute() {
// Disabled triggers are always false
if ((trigger instanceof Disableable) && ((Disableable) trigger).isDisabled()
&& !(trigger instanceof Input && ((Input) trigger).isReadOnly())) {
return false;
}
final Object triggerValue = getTriggerValue(null);
final Objec... | java |
public boolean isTabVisible(final int idx) {
WTab tab = getTab(idx);
Container tabParent = tab.getParent();
if (tabParent instanceof WTabGroup) {
return tab.isVisible() && tabParent.isVisible();
} else {
return tab.isVisible();
}
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.