@Override public void processLowLevelEvent(String name, String... values) { // System.out.println("DND: name: " + name + " values[0]: " + values[0]); this.valuesToProcess = values[0]; SForm.addArmedComponent(this); }
@Override public void processLowLevelEvent(String action, String... values) { processKeyEvents(values); if (action.endsWith("_keystroke")) return; // we have to wait, until all changed states of our form have // changed, before we anything can happen. SForm.addArmedComponent(this); }
@Override public void writeInternal(final Device device, final SComponent component) throws IOException { final SForm form = (SForm) component; SLayoutManager layout = form.getLayout(); boolean formTagRequired = !form.getResidesInForm(); if (form.getDefaultButton() != null) { defaultButtonName = Utils.event(form.getDefaultButton()); if (form.isPostMethod()) { device.print("post"); } else { Utils.optAttribute(device, "name", form.getName()); Utils.optAttribute(device, "enctype", form.getEncodingType()); Utils.optAttribute(device, "action", form.getRequestURL()); Utils.writeEvents(device, form, (String[]) null); Utils.write(device, Utils.event(form)); device.print("\" value=\""); Utils.write(device, form.getName()); device.print(SConstants.UID_DIVIDER); device.print("\" />"); SDimension preferredSize = form.getPreferredSize(); String height = preferredSize != null ? preferredSize.getHeight() : null; boolean clientLayout = Utils.isMSIE(form) && height != null && !"auto".equals(height) && (layout instanceof SBorderLayout || layout instanceof SGridBagLayout);
public static void dispatchEvents(HttpServletRequest request, HttpServletResponse response) throws ServletException { synchronized (request.getSession()) { WingsSession wingsSession = getSession(request, response); try { SForm.clearArmedComponents(); Enumeration en = request.getParameterNames(); if (en.hasMoreElements()) { wingsSession.fireRequestEvent(SRequestEvent.DISPATCH_START); while (en.hasMoreElements()) { String paramName = (String) en.nextElement(); String[] value = request.getParameterValues(paramName); wingsSession.getDispatcher().dispatch(paramName, value); } SForm.fireEvents(); wingsSession.fireRequestEvent(SRequestEvent.DISPATCH_DONE); } wingsSession.getReloadManager().invalidateFrames(); } finally { wingsSession.getReloadManager().clear(); SessionManager.removeSession(); SForm.clearArmedComponents(); } } }
layout.setVgap(40); form = new SForm(layout); form.add(new SLabel("slider 1 [0,200]")); form.add(horizSlider1); form.add(new SLabel("slider 2 [-100, 100]")); form.add(horizSlider2); form.add(new SLabel("slider 3 [-400, -200], snaps to every 25 ticks")); form.add(horizSlider3); form.add(new SLabel("slider 4 [0, 300], snaps to every 30 ticks")); form.add(vertSlider); form.add(button); form.add(label);
@Override protected void initializeContentPane() { setContentPane(new SForm(new SBorderLayout())); }
session.setServletResponse(null); SessionManager.removeSession(); SForm.clearArmedComponents();
@Override public void writeInternal(final Device device, final SComponent component) throws IOException { final SForm form = (SForm) component; SLayoutManager layout = form.getLayout(); boolean formTagRequired = !form.getResidesInForm(); if (form.getDefaultButton() != null) { defaultButtonName = Utils.event(form.getDefaultButton()); if (form.isPostMethod()) { device.print("post"); } else { Utils.optAttribute(device, "name", form.getName()); Utils.optAttribute(device, "enctype", form.getEncodingType()); Utils.optAttribute(device, "action", form.getRequestURL()); Utils.writeEvents(device, form, (String[]) null); Utils.write(device, Utils.event(form)); device.print("\" value=\""); Utils.write(device, form.getName()); device.print(SConstants.UID_DIVIDER); device.print("\" />"); SDimension preferredSize = form.getPreferredSize(); String height = preferredSize != null ? preferredSize.getHeight() : null; boolean clientLayout = Utils.isMSIE(form) && height != null && !"auto".equals(height) && (layout instanceof SBorderLayout || layout instanceof SGridBagLayout);
SForm.clearArmedComponents(); SForm.fireEvents(); SForm.clearArmedComponents();
/** * Determine wether the contentPane shall be an SForm. The property is true by default. * @param contentPaneForm <code>true</code> if the contentPane shall be an SForm, <code>false</code> otherwise */ public void setFormContentPane(boolean contentPaneForm) { if (contentPane instanceof SForm && !contentPaneForm) { SPanel newPanel = new SPanel(); rebuildPanel(contentPane, newPanel); setContentPane(newPanel); } else if (!(contentPane instanceof SForm) && contentPaneForm) { SForm newPanel = new SForm(); rebuildPanel(contentPane, newPanel); setContentPane(newPanel); } }
session.setServletResponse(null); SessionManager.removeSession(); SForm.clearArmedComponents();
@Override public void processLowLevelEvent(String name, String... values) { this.newLocation = new Integer(values[0]); SForm.addArmedComponent(this); }
SForm.clearArmedComponents(); SForm.fireEvents(); SForm.clearArmedComponents();
@Override public void processLowLevelEvent(String name, String... values) { log.debug("processLowLevelEvent processing"); // handle the somehow coded drag to drop connection, look for the components and dispatch sourceName = null; targetName = null; String value = values[0]; int index = value.indexOf(':'); sourceName = value.substring(0, index); targetName= value.substring(index + 1); log.info("sourcename: " + sourceName); log.info("targetname: " + targetName); SForm.addArmedComponent(this); }
/** * notifies the parent form, to fire action performed. This is necessary, if an exception in parsing a MultiPartRequest * occurs, e.g. upload file is too big. */ protected final void notifyParentForm() { SForm form = getParentForm(); if (form != null) { SForm.addArmedComponent(form); } }
@Override public void processLowLevelEvent(String action, String... values) { processKeyEvents(values); if (action.endsWith("_keystroke")) return; this.lowLevelEvents = values; SForm.addArmedComponent(this); }
@Override public void processLowLevelEvent(String name, String... values) { if (name.endsWith("_panel")) { if ("ok".equals(values[0])) okFinalEvents = true; else if ("cancel".equals(values[0])) cancelFinalEvents = true; } else if (name.endsWith("_ed") && editorComponent instanceof LowLevelEventListener) { LowLevelEventListener lowLevelEventListener = (LowLevelEventListener) editorComponent; lowLevelEventListener.processLowLevelEvent(name, values); } SForm.addArmedComponent(this); }
protected boolean processKeyEvents(String... values) { if (actionMap == null) return false; if (log.isDebugEnabled()) log.debug("processKeyEvents " + Arrays.asList(values)); boolean arm = false; for (String value : values) { final Action action = actionMap.get(value); if (action != null) { if (actionEvents == null) actionEvents = new HashMap<>(); actionEvents.put(action, new ActionEvent(this, 0, value)); arm = true; } } if (arm) SForm.addArmedComponent((LowLevelEventListener) this); return arm; }
/** * {@inheritDoc} */ @Override public void processLowLevelEvent(String action, String[] values) { for (int i = 0; i < values.length; i++) { String value = values[i]; if (value != null && value.length() > 0) { char modus = value.charAt(0); try { // editor event switch (modus) { case 'o': delayedClickedHeaderColumn = Integer.parseInt(value.substring(1)); SForm.addArmedComponent(this); break; default: break; } } catch (NumberFormatException ex) { // ignored } } } super.processLowLevelEvent(action, values); }
/** * Tab was clicked. * * @see LowLevelEventListener#processLowLevelEvent(String, String[]) */ @Override public void processLowLevelEvent(String action, String... values) { processKeyEvents(values); if (action.endsWith("_keystroke")) return; for (String value : values) { try { int index = new Integer(value); if (index < 0 || index >= pages.size()) continue; /* prevent clever users from showing * disabled tabs */ if (((Page) pages.get(index)).enabled) { lleChangedIndex = index; SForm.addArmedComponent(this); return; } } catch (NumberFormatException nfe) { } } }