Prepares the keyboard event handlers, appending them to the the given
StringBuffer.

@param handlers
The StringBuffer that output will be appended to.
770718
protected void prepareKeyEvents(StringBuffer handlers) {
		prepareAttribute(handlers, "onkeydown", getAttribute("onkeydown"));
		prepareAttribute(handlers, "onkeyup", getAttribute("onkeyup"));
		prepareAttribute(handlers, "onkeypress", getAttribute("onkeypress"));
	}
641652
private static void addShortcut(StringBuilder sb, Set<String> shortcuts) {
        if (sb.length() > 0) {
            String shortcut = validateShortcut(sb.toString());
            
            if (shortcut != null) {
                shortcuts.add(shortcut);
            }
            
            sb.delete(0, sb.length());
        }
    }
694980
public static OnJqueryFunction on(final CharSequence events, final CharSequence selector, JavaScriptInlineFunction handler) {
        return on(JQuery.quoted(events), JQuery.quoted(selector), Attr.nullValue(), handler);
    }
524046
private static void initPrefixHandlers()
    {
        PrefixHandlerConfig[] prefixHandlers = ConfigUtil.getConfig().getPrefixHandlers();
        if ( prefixHandlers == null )
        {
            return;
        }
        for ( int i = 0; i < prefixHandlers.length; i++ )
        {
            try
            {
                Class prefixClass = Class.forName( prefixHandlers[i].getHandlerClass() );
                String name = prefixHandlers[i].getName();
                if ( name == null || name.equals( "" ) )
                {
                    _log.warn( "The name for the prefix handler '" + prefixHandlers[i].getHandlerClass()
                            + "' must not be null" );
                    continue;
                }
                Object o = prefixClass.newInstance();
                if ( !( o instanceof RequestParameterHandler ) )
                {
                    _log.warn( "The class '" + prefixHandlers[i].getHandlerClass()
                            + "' must be an instance of RequestParameterHandler" );
                    continue;
                }
                ProcessPopulate.registerPrefixHandler( name, ( RequestParameterHandler ) o );
            }
            catch ( ClassNotFoundException e )
            {
                _log.warn( "Class '" + prefixHandlers[i].getHandlerClass() + "' not found", e );
            }
            catch ( IllegalAccessException e )
            {
                _log.warn( "Illegal access on Class '" + prefixHandlers[i].getHandlerClass() + "'", e );

            }
            catch ( InstantiationException e )
            {
                _log.warn( "InstantiationException on Class '" + prefixHandlers[i].getHandlerClass() + "'",
                        e.getCause() );
            }
        }
    }
221380
public Router patch(@NotNull final Pattern regex, @NotNull final IMiddleware... handlers) {
        addRegEx("PATCH", regex, handlers, patchBindings);
        return this;
    }
404298
static void initHandlers() {
		if (config != null && config.getHandlers() != null) {
			// initialize handlers
			for (Object handler : config.getHandlers()) {
				// If the handler is configured as just a string, it's a fully qualified class
				// name with a default constructor.
				if (handler instanceof String) {
					initStringDefinedHandler((String) handler);
				} else if (handler instanceof Map) {
					initMapDefinedHandler((Map<String, Object>) handler);
				}
			}
		}
	}
866372
public void setListeners(java.util.Collection<Listener> listeners) {
        if (listeners == null) {
            this.listeners = null;
            return;
        }

        this.listeners = new java.util.ArrayList<Listener>(listeners);
    }
227653
function(events, handler) {
        if (events === undefined) {
            return;
        }
        if (handler === undefined) {
            return;
        }

        var handlers = this.handlers;
        each(splitStr(events), function(event) {
            handlers[event] = handlers[event] || [];
            handlers[event].push(handler);
        });
        return this;
    }
629257
protected void prepareAttribute(StringBuffer handlers, String name, boolean value) {

		handlers.append(" ");
		handlers.append(name);
		handlers.append("=\"");
		handlers.append(value);
		handlers.append("\"");

	}
1254087
public void initActionHandler(final Window window) {

        if (m_actionHandler != null) {
            window.addActionHandler(m_actionHandler);
            window.addCloseListener(new CloseListener() {

                private static final long serialVersionUID = 1L;

                public void windowClose(CloseEvent e) {

                    clearActionHandler(window);
                }
            });
        }
    }
1143619
public void clearHandlers() {

        for (Map<String, CmsAttributeHandler> handlers : m_handlers) {
            for (CmsAttributeHandler handler : handlers.values()) {
                handler.clearHandlers();
            }
            handlers.clear();
        }
        m_handlers.clear();
        m_handlers.add(new HashMap<String, CmsAttributeHandler>());
        m_handlerById.clear();
    }
1198517
protected Map<String, FunctionConfiguration> getFunctionConfigurations(final AnnotationHandler handler,
                                                                           final Set<Method> methods) throws Exception {
        info("");
        info(GENERATE_CONFIG);
        final Map<String, FunctionConfiguration> configMap = handler.generateConfigurations(methods);
        if (configMap.size() == 0) {
            info(GENERATE_SKIP);
        } else {
            final String scriptFilePath = getScriptFilePath();
            configMap.values().forEach(config -> config.setScriptFile(scriptFilePath));
            info(GENERATE_DONE);
        }

        return configMap;
    }
641342
public void addHandler(Handler handler) {
        if (null == handlers) {
            handlers = new ArrayList<>();
        }
        handlers.add(handler);
    }
1101512
public void ensureHandlers(int index) {

        if (m_handlers.size() <= index) {
            // make sure the handler maps are available
            // this may be necessary
            for (int i = m_handlers.size(); i <= index; i++) {
                insertHandlers(i);
            }
        }
    }
899955
function (events, handler) {
    var handlers = this.handlers;
    splitStr(events).forEach(function (event) {
      if (!handler) {
        delete handlers[event];
      } else {
        handlers[event].splice(handlers[event].indexOf(handler), 1);
      }
    });
    return this;
  }
46879
function getHandlers(handlers) {
        if (typeof handlers === 'string') {
          prev[c.script].handlers.push(handlers)
        } else if (Array.isArray(c.handlers)) {
          c.handlers.forEach(h => {
            prev[c.script].handlers.push(h)
          })
        } else {
          Object.keys(handlers).forEach(k => getHandlers(handlers[k]))
        }
      }
168431
public void onKeyPress (KeyPressEvent event)
    {
        if (event.getCharCode() == KeyCodes.KEY_ESCAPE) {
            _onEscape.onClick(null);
        }
    }