/** * Requests the edit focus for this component for the following renderings * by calling {@link SFrame#setFocus(SComponent)}. */ public void requestFocus() { if (getParentFrame() != null) { getParentFrame().setFocus(this); } }
/** * Returns <code>true</code> if this <code>SComponent</code> is owning the edit focus. * * @return <code>true</code> if this <code>SComponent</code> is owning the edit focus otherwise <code>false</code> * @see #requestFocus() */ public boolean isFocusOwner() { if (getParentFrame() != null) return this == getParentFrame().getFocus(); return false; }
public Set<SComponent> getMenues(SFrame frame) { Set<SComponent> menuesUsedInFrame = new HashSet<>(menuLinkMap.keySet()); for (Iterator<SComponent> i = menuesUsedInFrame.iterator(); i.hasNext();) { if (i.next().getParentFrame() != frame) { i.remove(); } } return menuesUsedInFrame; }
final void setParentMenu(SComponent menuParent) { SComponent oldVal = this.menuParent; this.menuParent = menuParent; propertyChangeSupport.firePropertyChange("parentMenu", oldVal, this.menuParent); setParentFrame(menuParent != null ? menuParent.getParentFrame() : null); }
@Override public Set<SFrame> getDirtyFrames() { final Set<SFrame> dirtyFrames = new HashSet<>(5); for (Object o : getDirtyComponents()) { SFrame parentFrame = ((SComponent) o).getParentFrame(); if (parentFrame != null) { dirtyFrames.add(parentFrame); } } return dirtyFrames; }
/** * The URL under which this component is accessible for the browser. * This is equivalent to the URL of the component's root frame, as this is the * node externalized to the browser via the {@link org.wings.resource.ReloadResource} * externalizer. * * @return The HTTP URL where this component can be accessed. */ public RequestURL getRequestURL() { SFrame p = getParentFrame(); if (p == null) throw new IllegalStateException("no parent frame"); return p.getRequestURL(); }
if (component.getParentFrame() == null || !component.isVisible() || (!component.isRecursivelyVisible() && !(component instanceof SMenu))) { fullReplaceUpdates.remove(component); fineGrainedUpdates.remove(component);
/** * Factory method for error dialog. * * @param sourceComponent * one of the components insinde the owning window. * @param translationProvider * the translationProvider for labels. * @param locale * the locale used. * @return the created error dialog instance. */ public static SErrorDialog createInstance(SComponent sourceComponent, ITranslationProvider translationProvider, Locale locale) { SErrorDialog errorDialog; errorDialog = new SErrorDialog(sourceComponent.getParentFrame()); errorDialog.translationProvider = translationProvider; errorDialog.locale = locale; errorDialog.initGui(); return errorDialog; }
private void registerGlobalInputMapWithFrame() { final SFrame parentFrame = getParentFrame(); if (parentFrame != null) parentFrame.registerGlobalInputMapComponent(this); if (globalInputMapListener == null) { globalInputMapListener = new GlobalInputMapParentFrameListener(this); addParentFrameListener(globalInputMapListener); } }
@Override @SuppressWarnings("unchecked") public void addUpdate(SComponent component, Update update) { if (component == null) throw new IllegalArgumentException("Component must not be null!"); if (update == null) { update = component.getCG().getComponentUpdate(component); if (update == null) { SFrame frame = component.getParentFrame(); if (frame != null) fullReplaceUpdates.put(frame, null); return; } } component = update.getComponent(); if (acceptChanges) { PotentialUpdate potentialUpdate = new PotentialUpdate(update); if ((update.getProperty() & Update.FULL_REPLACE_UPDATE) == Update.FULL_REPLACE_UPDATE) { fullReplaceUpdates.put(component, potentialUpdate); } else { Set<PotentialUpdate> potentialUpdates = getFineGrainedUpdates(component); potentialUpdates.remove(potentialUpdate); potentialUpdates.add(potentialUpdate); fineGrainedUpdates.put(component, potentialUpdates); } } else if (log.isDebugEnabled()) { //log.debug("Component " + component + " changed after invalidation of frames."); } }
protected boolean isEventEpochValid(LowLevelEventListener gl) { if (eventEpoch != null) { SFrame frame = ((SComponent) gl).getParentFrame(); if (frame == null) { if (log.isDebugEnabled()) { log.debug("request for dangling component '" + gl.getName() + '\''); } unregister(gl); return false; } if (!eventEpoch.equals(frame.getEventEpoch())) { if (log.isDebugEnabled()) { log.debug("### got outdated event '" + gl.getName() + "' from frame '" + frame.getName() + "' --> received epoch: " + eventEpoch + " | expected epoch: " + frame.getEventEpoch()); } frame.fireInvalidLowLevelEventListener(gl); frame.reload(); return false; } } return true; }
@Override public void uninstallCG(SComponent component) { super.uninstallCG(component); component.removeParentFrameListener(this); if (component.getParentFrame() != null) SessionHeaders.getInstance().deregisterHeaders(headers); }
/** * Sets the parent frame. * * @param f parent frame */ @Override protected void setParentFrame(SFrame f) { if (f != super.getParentFrame()) { super.setParentFrame(f); for (int i = 0; i < getComponentCount(); i++) { getComponent(i).setParentFrame(getParentFrame()); } } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, final Map<String, Object> context) { if (fileSaveCallback != null) { DynamicResource resource = new DynamicResource( getSourceComponent(context).getParentFrame()) { private static final long serialVersionUID = 2216910348294774650L; public void write(Device device) throws IOException { DeviceOutputStream out = new DeviceOutputStream(device); fileSaveCallback.fileChosen(out, context); out.flush(); device.close(); } }; Map<String, String> headers = new HashMap<String, String>(); headers.put("Content-Disposition", "attachment; filename=" + getDefaultFileName()); String url = SessionManager.getSession().getExternalizeManager() .externalize(resource, headers.entrySet(), AbstractExternalizeManager.REQUEST); ScriptListener listener = new JavaScriptListener(null, null, "location.href='" + url.toString() + "'"); SessionManager.getSession().getScriptManager() .addScriptListener(listener); } return super.execute(actionHandler, context); }
public void setComponentPopupMenu(SPopupMenu popupMenu) { reloadIfChange(this.popupMenu, popupMenu); if (this.popupMenu != null) { getSession().getMenuManager().deregisterMenuLink(this.popupMenu, this); this.popupMenu.setParentFrame(null); } SPopupMenu oldVal = this.popupMenu; this.popupMenu = popupMenu; if (this.popupMenu != null) { getSession().getMenuManager().registerMenuLink(this.popupMenu, this); this.popupMenu.setParentFrame(getParentFrame()); } propertyChangeSupport.firePropertyChange("componentPopupMenu", oldVal, this.popupMenu); }
if (fileSaveCallback != null) { DynamicResource resource = new DynamicResource( getSourceComponent(context).getParentFrame()) {
final SDialog dialog; IView<SComponent> mainView = getMainView(context); SFrame window = getSourceComponent(context).getParentFrame(); dialog = new SDialog(window, getI18nName(getTranslationProvider(context), getLocale(context)), true);
SFrame window; if (sourceComponent != null) { window = sourceComponent.getParentFrame(); } else { window = controllerFrame;
context.put(ActionContextConstants.ACTION_PARAM, wizardModel); SFrame window = getSourceComponent(context).getParentFrame(); dialog = new SDialog(window, getI18nName(getTranslationProvider(context), getLocale(context)), true);