/** * Finds a component with the current address using the given RequestCycle. * * @param cycle * the RequestCycle to use to locate the component * @return IComponent a component that has been initialized for the given RequestCycle */ public IComponent findComponent(IRequestCycle cycle) { IPage objPage = cycle.getPage(_pageName); return objPage.getNestedComponent(_idPath); }
/** * Finds a component with the current address using the given RequestCycle. * * @param cycle * the RequestCycle to use to locate the component * @return IComponent a component that has been initialized for the given RequestCycle */ public IComponent findComponent(IRequestCycle cycle) { IPage objPage = cycle.getPage(_pageName); return objPage.getNestedComponent(_idPath); }
/** * Returns the {@link IComponent} current inspected; this is determined * from the inspectedPageName and inspectedIdPath properties. * **/ public IComponent getInspectedComponent() { return getInspectedPage().getNestedComponent(getInspectedIdPath()); }
private void applyChange(IPage page, PropertyChange change) { String idPath = change.getComponentPath(); IComponent component = (idPath == null) ? page : page.getNestedComponent(idPath); PropertyUtils.write(component, change.getPropertyName(), change.getNewValue()); }
private void applyChange(IPage page, PropertyChange change) { String idPath = change.getComponentPath(); IComponent component = (idPath == null) ? page : page.getNestedComponent(idPath); PropertyUtils.write(component, change.getPropertyName(), change.getNewValue()); }
void invokeComponentListeners(IComponent component, IRequestCycle cycle, BrowserEvent event) { String idPath = component.getExtendedId(); List listeners = getEventListeners(idPath); if (listeners == null) return; IPage page = component.getPage(); for (int i = 0; i < listeners.size(); i++) { IComponentSpecification listener = (IComponentSpecification)listeners.get(i); ComponentEventProperty props = listener.getComponentEvents(idPath); if (props == null) continue; List clisteners = props.getEventListeners(event.getName()); for (int e=0; e < clisteners.size(); e++) { EventBoundListener eventListener = (EventBoundListener)clisteners.get(e); IComponent target = page.getNestedComponent(eventListener.getComponentIdPath()); _invoker.invokeListener(target.getListeners().getListener(eventListener.getMethodName()), target, cycle); } } }
void invokeComponentListeners(IComponent component, IRequestCycle cycle, BrowserEvent event) { String idPath = component.getExtendedId(); List listeners = getEventListeners(idPath); if (listeners == null) return; IPage page = component.getPage(); for (int i = 0; i < listeners.size(); i++) { IComponentSpecification listener = (IComponentSpecification)listeners.get(i); ComponentEventProperty props = listener.getComponentEvents(idPath); if (props == null) continue; List clisteners = props.getEventListeners(event.getName()); for (int e=0; e < clisteners.size(); e++) { EventBoundListener eventListener = (EventBoundListener)clisteners.get(e); IComponent target = page.getNestedComponent(eventListener.getComponentIdPath()); _invoker.invokeListener(target.getListeners().getListener(eventListener.getMethodName()), target, cycle); } } }
/** * Locates the {@link IDirect}component that was previously identified (and whose page and id * path were stored). Invokes {@link IRequestCycle#setListenerParameters(Object[]) (Object[])} to * restore the service parameters, then invokes {@link IDirect#trigger(IRequestCycle)}on the * component. */ public void performCallback(IRequestCycle cycle) { IPage page = cycle.getPage(_pageName); IComponent component = page.getNestedComponent(_componentIdPath); IDirect direct = null; try { direct = (IDirect) component; } catch (ClassCastException ex) { throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component), component, null, ex); } cycle.setListenerParameters(_parameters); direct.trigger(cycle); } }
public void service(IRequestCycle cycle) throws IOException { String pageName = cycle.getParameter(ServiceConstants.PAGE); String componentId = cycle.getParameter(ServiceConstants.COMPONENT); IPage componentPage = cycle.getPage(pageName); IComponent component = componentPage.getNestedComponent(componentId); if (!(component instanceof IXTile)) throw new ApplicationRuntimeException("Incorrect component type: was " + component.getClass() + " but must be " + IXTile.class, component, null, null); IXTile xtile = (IXTile) component; String[] params = cycle.getParameters(ServiceConstants.PARAMETER); cycle.setListenerParameters(params); xtile.trigger(cycle); // do not squeeze on output either Object[] args = cycle.getListenerParameters(); String strArgs = generateOutputString(args); if (strArgs != null) { OutputStream output = _response.getOutputStream(new ContentType("text/xml")); output.write(strArgs.getBytes("utf-8")); } }
/** * Locates the {@link IDirect}component that was previously identified (and whose page and id * path were stored). Invokes {@link IRequestCycle#setListenerParameters(Object[]) (Object[])} to * restore the service parameters, then invokes {@link IDirect#trigger(IRequestCycle)}on the * component. */ public void performCallback(IRequestCycle cycle) { IPage page = cycle.getPage(_pageName); IComponent component = page.getNestedComponent(_componentIdPath); IDirect direct = null; try { direct = (IDirect) component; } catch (ClassCastException ex) { throw new ApplicationRuntimeException(CallbackMessages.componentNotDirect(component), component, null, ex); } cycle.setListenerParameters(_parameters); direct.trigger(cycle); } }
disableFocus = true; IComponent target = page.getNestedComponent(listeners[e].getComponentIdPath());
disableFocus = true; IComponent target = page.getNestedComponent(listeners[e].getComponentIdPath());
IComponent component = componentPage.getNestedComponent(componentId);
IComponent component = componentPage.getNestedComponent(componentId);
IComponent component = componentPage.getNestedComponent(componentId);
IComponent component = componentPage.getNestedComponent(componentId);