/** @since 1.0.6 * */ public Collection getBeanNames() { if (_beanNames == null) { Collection c = _component.getSpecification().getBeanNames(); if (c == null || c.isEmpty()) _beanNames = Collections.EMPTY_SET; else _beanNames = Collections.unmodifiableSet(new HashSet(c)); } return _beanNames; }
public boolean getKnownComponent(String componentId) { return _component.getSpecification().getComponent(componentId) != null; }
/** @since 1.0.6 * */ public Collection getBeanNames() { if (_beanNames == null) { Collection c = _component.getSpecification().getBeanNames(); if (c == null || c.isEmpty()) _beanNames = Collections.EMPTY_SET; else _beanNames = Collections.unmodifiableSet(new HashSet(c)); } return _beanNames; }
public boolean getKnownComponent(String componentId) { return _component.getSpecification().getComponent(componentId) != null; }
private IPropertySource getSourceForComponent(IComponent component) { Resource key = component.getSpecification().getSpecificationLocation(); IPropertySource result = (IPropertySource) _componentSources.get(key); if (result == null) { result = createSourceForComponent(component); _componentSources.put(key, result); } return result; }
private IPropertySource getSourceForComponent(IComponent component) { Resource key = component.getSpecification().getSpecificationLocation(); IPropertySource result = (IPropertySource) _componentSources.get(key); if (result == null) { result = createSourceForComponent(component); _componentSources.put(key, result); } return result; }
private LocalizedPropertySource getLocalizedSourceForComponent(IComponent component) { Resource key = component.getSpecification().getSpecificationLocation(); LocalizedPropertySource result = (LocalizedPropertySource) _localizedComponentSources.get(key); if (result == null) { result = new LocalizedPropertySource(getSourceForComponent(component)); _localizedComponentSources.put(key, result); } return result; }
private LocalizedPropertySource getLocalizedSourceForComponent(IComponent component) { Resource key = component.getSpecification().getSpecificationLocation(); LocalizedPropertySource result = (LocalizedPropertySource) _localizedComponentSources.get(key); if (result == null) { result = new LocalizedPropertySource(getSourceForComponent(component)); _localizedComponentSources.put(key, result); } return result; }
/** * Gets the inspected component and specification from the {@link Inspector} page. * * @since 1.0.5 */ public void pageBeginRender(PageEvent event) { Inspector inspector = (Inspector) getPage(); _inspectedComponent = inspector.getInspectedComponent(); _inspectedSpecification = _inspectedComponent.getSpecification(); }
private IPropertySource createSourceForComponent(IComponent component) { IComponentSpecification specification = component.getSpecification(); List sources = new ArrayList(); sources.add(new PropertyHolderPropertySource(specification)); sources.add(getSourceForNamespace(component.getNamespace())); return (IPropertySource) _chainBuilder.buildImplementation( IPropertySource.class, sources, ImplMessages.componentPropertySourceDescription(specification)); }
private IPropertySource createSourceForComponent(IComponent component) { IComponentSpecification specification = component.getSpecification(); List sources = new ArrayList(); sources.add(new PropertyHolderPropertySource(specification)); sources.add(getSourceForNamespace(component.getNamespace())); return (IPropertySource) _chainBuilder.buildImplementation( IPropertySource.class, sources, ImplMessages.componentPropertySourceDescription(specification)); }
static String missingPropertySpecification(String propertyName, IComponent component) { return _formatter.format("missing-property-specification", propertyName, component.getExtendedId(), component .getSpecification().getSpecificationLocation()); }
public boolean getAllowBody(String componentId, Location location) { IComponent embedded = _component.getComponent(componentId); if (embedded == null) throw Tapestry.createNoSuchComponentException(_component, componentId, location); return embedded.getSpecification().getAllowBody(); }
public boolean getAllowBody(String componentId, Location location) { IComponent embedded = _component.getComponent(componentId); if (embedded == null) throw Tapestry.createNoSuchComponentException(_component, componentId, location); return embedded.getSpecification().getAllowBody(); }
static String missingPropertySpecification(String propertyName, IComponent component) { return _formatter.format("missing-property-specification", propertyName, component.getExtendedId(), component .getSpecification().getSpecificationLocation()); }
/** * @see org.apache.tapestry.pageload.IComponentVisitor#visitComponent(org.apache.tapestry.IComponent) */ public void visitComponent(IComponent component) { IComponentSpecification spec = component.getSpecification(); Iterator i = spec.getRequiredParameters().iterator(); while (i.hasNext()) { IParameterSpecification parameterSpec = (IParameterSpecification) i.next(); String name = parameterSpec.getParameterName(); if (component.getBinding(name) == null) throw new ApplicationRuntimeException(PageloadMessages.requiredParameterNotBound( name, component), component, component.getLocation(), null); } }
/** * @see org.apache.tapestry.pageload.IComponentVisitor#visitComponent(org.apache.tapestry.IComponent) */ public void visitComponent(IComponent component) { IComponentSpecification spec = component.getSpecification(); Iterator i = spec.getRequiredParameters().iterator(); while (i.hasNext()) { IParameterSpecification parameterSpec = (IParameterSpecification) i.next(); String name = parameterSpec.getParameterName(); if (component.getBinding(name) == null) throw new ApplicationRuntimeException(PageloadMessages.requiredParameterNotBound( name, component), component, component.getLocation(), null); } }
/** * Adds the token (which implements {@link IRender}) to the active component (using * {@link IComponent#addBody(IRender)}), or to this component * {@link org.apache.tapestry.BaseComponent#addOuter(IRender)}. * <p> * A check is made that the active component allows a body. */ private void process(TextToken token) { if (_activeComponent == null) { _loadComponent.addOuter(token); return; } if (!_activeComponent.getSpecification().getAllowBody()) throw createBodylessComponentException(_activeComponent); _activeComponent.addBody(token); }
void invokeElementListeners(IComponent component, IRequestCycle cycle, BrowserEvent event) { String targetId = (String)event.getTarget().get("id"); if (targetId == null) return; ComponentEventProperty prop = component.getSpecification().getElementEvents(targetId); if (prop == null) return; List listeners = prop.getEventListeners(event.getName()); for (int i=0; i < listeners.size(); i++) { EventBoundListener listener = (EventBoundListener)listeners.get(i); _invoker.invokeListener(component.getListeners().getListener(listener.getMethodName()), component, cycle); } }
void invokeElementListeners(IComponent component, IRequestCycle cycle, BrowserEvent event) { String targetId = (String)event.getTarget().get("id"); if (targetId == null) return; ComponentEventProperty prop = component.getSpecification().getElementEvents(targetId); if (prop == null) return; List listeners = prop.getEventListeners(event.getName()); for (int i=0; i < listeners.size(); i++) { EventBoundListener listener = (EventBoundListener)listeners.get(i); _invoker.invokeListener(component.getListeners().getListener(listener.getMethodName()), component, cycle); } }