Initializes the handler to be used for the given entity.<p>

@param entity the edited entity
@param editor the editor instance
@param rootHandler the root attribute handler
197488
public void initialize(CmsEntity entity, CmsEditorBase editor, CmsRootHandler rootHandler) {

        m_undo.clear();
        m_redo.clear();
        m_entity = entity;
        m_editor = editor;
        m_rootHandler = rootHandler;
        m_current = new Change(m_entity.cloneEntity(), null, null, 0, null);
        fireStateChange();
    }
127485
private void initEventPreviewHandler() {

        m_previewHandlerRegistration = Event.addNativePreviewHandler(new NativePreviewHandler() {

            public void onPreviewNativeEvent(NativePreviewEvent event) {

                previewNativeEvent(event);
            }
        });
    }
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() );
            }
        }
    }
600244
function Delegate(root) {

  /**
   * Maintain a map of listener
   * lists, keyed by event name.
   *
   * @type Object
   */
  this.listenerMap = [{}, {}];
  if (root) {
    this.root(root);
  }

  /** @type function() */
  this.handle = Delegate.prototype.handle.bind(this);
}
244181
protected static void appendHandler(LogRecordHandler parent, LogRecordHandler child){
    RecordHandlerTree p = handlers.find(parent);
    if(p != null){
      p.addChild(child);
    } else {
      throw new IllegalArgumentException("No such parent handler: " + parent);
    }
  }
1031513
protected void initEditOverlay(Element element) {

        CmsInlineEditOverlay.removeAll();
        m_editOverlay = CmsInlineEditOverlay.addOverlayForElement(element);
        if (m_resizeHandlerRegistration != null) {
            m_resizeHandlerRegistration.removeHandler();
        }
        // add a handler to ensure the edit overlays get adjusted to changed window size
        m_resizeHandlerRegistration = Window.addResizeHandler(new ResizeHandler() {

            private Timer m_resizeTimer;

            public void onResize(ResizeEvent event) {

                if (m_resizeTimer == null) {
                    m_resizeTimer = new Timer() {

                        @Override
                        public void run() {

                            handleResize();
                        }
                    };
                    m_resizeTimer.schedule(300);
                }
            }

            /**
             * Handles the window resize.<p>
             */
            void handleResize() {

                m_resizeTimer = null;
                CmsInlineEditOverlay.updateCurrentOverlayPosition();
            }
        });
    }
426949
protected void initListener(XmlParser.Node node)
    {
        String className=node.getString("listener-class",false,true);
        Object listener=null;
        try
        {
            Class listenerClass=getWebApplicationContext().loadClass(className);
            listener=listenerClass.newInstance();
        }
        catch(Exception e)
        {
            log.warn("Could not instantiate listener "+className,e);
            return;
        }
        if(!(listener instanceof EventListener))
        {
            log.warn("Not an EventListener: "+listener);
            return;
        }
        boolean known=false;
        try
        {
            getWebApplicationContext().addEventListener((EventListener)listener);
            known=true;
        }
        catch(Exception e)
        {
            LogSupport.ignore(log,e);
        }
        try
        {
            getWebApplicationHandler().addEventListener((EventListener)listener);
            known=true;
        }
        catch(Exception e)
        {
            LogSupport.ignore(log,e);
        }
        if(!known)
            log.warn("Unknown: "+listener);
    }
754231
final void addHandler(final HttpHandler handler) {
    if (handler != null) {
      if (!eventHandlers.containsKey(handler.getUriSpecification().toLowerCase())) {
        eventHandlers.put(handler.getUriSpecification().toLowerCase(), handler);
      } else {
        LOG.log(Level.WARNING, "JettyHandler handle is already registered: {0} ", handler.getUriSpecification());
      }
    }
  }
107769
public void handle(ASTNode node, GroovyParser.GroovyParserRuleContext ctx) {
        if (!(groovydocEnabled || runtimeGroovydocEnabled)) {
            return;
        }

        if (!asBoolean(node) || !asBoolean(ctx)) {
            return;
        }

        String docCommentNodeText = this.findDocCommentByNode(ctx);
        if (null == docCommentNodeText) {
            return;
        }

        attachDocCommentAsMetaData(node, docCommentNodeText);
        attachGroovydocAnnotation(node, docCommentNodeText);
    }
178201
private static void initMapDefinedHandler(Map<String, Object> handler) {
		// If the handler is a map, the keys are the class name, values are the
		// parameters.
		for (Map.Entry<String, Object> entry : handler.entrySet()) {
			Tuple<String, Class> namedClass = splitClassAndName(entry.getKey());

			// If the values in the config are a map, construct the object using named
			// parameters.
			if (entry.getValue() instanceof Map) {
				HttpHandler httpHandler;
				try {
					httpHandler = (HttpHandler) ServiceUtil.constructByNamedParams(namedClass.second,
							(Map) entry.getValue());
				} catch (Exception e) {
					throw new RuntimeException(
							"Could not construct a handler with values provided as a map: " + namedClass.second);
				}
				registerMiddlewareHandler(httpHandler);
				handlers.put(namedClass.first, httpHandler);
				handlerListById.put(namedClass.first, Collections.singletonList(httpHandler));
			} else if (entry.getValue() instanceof List) {

				// If the values in the config are a list, call the constructor of the handler
				// with those fields.
				HttpHandler httpHandler;
				try {
					httpHandler = (HttpHandler) ServiceUtil.constructByParameterizedConstructor(namedClass.second,
							(List) entry.getValue());
				} catch (Exception e) {
					throw new RuntimeException(
							"Could not construct a handler with values provided as a list: " + namedClass.second);
				}
				registerMiddlewareHandler(httpHandler);
				handlers.put(namedClass.first, httpHandler);
				handlerListById.put(namedClass.first, Collections.singletonList(httpHandler));
			}
		}
	}
143666
public void setIndirectionHandlerClass(Class indirectionHandlerClass)
    {
        if(indirectionHandlerClass == null)
        {
            //throw new MetadataException("No IndirectionHandlerClass specified.");
            /**
             * andrew.clute
             * Allow the default IndirectionHandler for the given ProxyFactory implementation
             * when the parameter is not given
             */
            indirectionHandlerClass = getDefaultIndirectionHandlerClass();
        }
        if(indirectionHandlerClass.isInterface()
                || Modifier.isAbstract(indirectionHandlerClass.getModifiers())
                || !getIndirectionHandlerBaseClass().isAssignableFrom(indirectionHandlerClass))
        {
            throw new MetadataException("Illegal class "
                    + indirectionHandlerClass.getName()
                    + " specified for IndirectionHandlerClass. Must be a concrete subclass of "
                    + getIndirectionHandlerBaseClass().getName());
        }
        _indirectionHandlerClass = indirectionHandlerClass;
    }
618352
private void configureToolRoot(CmsObject cms, CmsToolRootHandler toolRoot) throws CmsException {

        List<I_CmsToolHandler> handlers = new ArrayList<I_CmsToolHandler>();

        // add tool root handler
        handlers.add(toolRoot);

        // look in every file under the root uri for valid
        // admin tools and register them
        List<CmsResource> resources = cms.readResourcesWithProperty(toolRoot.getUri(), HANDLERCLASS_PROPERTY);
        Iterator<CmsResource> itRes = resources.iterator();
        while (itRes.hasNext()) {
            CmsResource res = itRes.next();
            CmsProperty prop = cms.readPropertyObject(res.getRootPath(), HANDLERCLASS_PROPERTY, false);
            if (!prop.isNullProperty()) {
                try {
                    // instantiate the handler
                    Class<?> handlerClass = Class.forName(prop.getValue());
                    I_CmsToolHandler handler = (I_CmsToolHandler)handlerClass.newInstance();

                    if (!handler.setup(cms, toolRoot, res.getRootPath())) {
                        // log failure
                        if (CmsLog.INIT.isWarnEnabled()) {
                            CmsLog.INIT.warn(
                                Messages.get().getBundle().key(
                                    Messages.INIT_TOOLMANAGER_TOOL_SETUP_ERROR_1,
                                    res.getRootPath()));
                        }
                    }

                    // keep for later use
                    handlers.add(handler);
                    // log success
                    if (CmsLog.INIT.isDebugEnabled()) {
                        if (!handler.getLink().equals(VIEW_JSPPAGE_LOCATION)) {
                            CmsLog.INIT.debug(
                                Messages.get().getBundle().key(
                                    Messages.INIT_TOOLMANAGER_NEWTOOL_FOUND_2,
                                    handler.getPath(),
                                    handler.getLink()));
                        } else {
                            CmsLog.INIT.debug(
                                Messages.get().getBundle().key(
                                    Messages.INIT_TOOLMANAGER_NEWTOOL_FOUND_2,
                                    handler.getPath(),
                                    res.getRootPath()));
                        }
                    }
                } catch (Exception e) {
                    // log failure
                    if (CmsLog.INIT.isWarnEnabled()) {
                        CmsLog.INIT.warn(
                            Messages.get().getBundle().key(
                                Messages.INIT_TOOLMANAGER_TOOL_SETUP_ERROR_1,
                                res.getRootPath()),
                            e);
                    }
                }
            }
        }
        registerHandlerList(cms, toolRoot, 1, handlers);
    }
1278317
public void setEditorAction(I_CmsEditorActionHandler clazz) {

        m_editorAction = clazz;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_EDITOR_ACTION_CLASS_1,
                    m_editorAction.getClass().getName()));
        }
    }
1237327
public void addEntityChangeHandler(String entityId, ValueChangeHandler<CmsEntity> handler) {

        CmsEntity entity = m_entityBackend.getEntity(entityId);
        if (entity != null) {
            entity.addValueChangeHandler(handler);
        }
    }
297646
private void initEditorStates() {

        m_editorState = new HashMap<CmsMessageBundleEditorTypes.EditMode, EditorState>();
        List<TableProperty> cols = null;
        switch (m_bundleType) {
            case PROPERTY:
            case XML:
                if (hasDescriptor()) { // bundle descriptor is present, keys are not editable in default mode, maybe master mode is available
                    m_editorState.put(CmsMessageBundleEditorTypes.EditMode.DEFAULT, getDefaultState());
                    if (hasMasterMode()) { // the bundle descriptor is editable
                        m_editorState.put(CmsMessageBundleEditorTypes.EditMode.MASTER, getMasterState());
                    }
                } else { // no bundle descriptor given - implies no master mode
                    cols = new ArrayList<TableProperty>(1);
                    cols.add(TableProperty.KEY);
                    cols.add(TableProperty.TRANSLATION);
                    m_editorState.put(CmsMessageBundleEditorTypes.EditMode.DEFAULT, new EditorState(cols, true));
                }
                break;
            case DESCRIPTOR:
                cols = new ArrayList<TableProperty>(3);
                cols.add(TableProperty.KEY);
                cols.add(TableProperty.DESCRIPTION);
                cols.add(TableProperty.DEFAULT);
                m_editorState.put(CmsMessageBundleEditorTypes.EditMode.DEFAULT, new EditorState(cols, true));
                break;
            default:
                throw new IllegalArgumentException();
        }

    }
1059893
@Override
	public void init(EntityManager entityManager, Object entity) {
		
		// Initialisation des parametres
		this.entityManager = entityManager;
		this.entity = entity;
	}
174986
@Override
    public synchronized void dispatch(@NonNull Event event) {
        String type = event.type;
        List<EventHandlerWrapper> eventHandlers = subscribers.get(type);
        if (eventHandlers != null) {
            EventHandlerWrapper handler = null;
            for (int i = 0, size = eventHandlers.size(); i < size; i++) {
                handler = eventHandlers.get(i);
                if (handler.eventHandlerReceiver != null) {
                    handler.handleEvent(event);
                } else {
                    if (!TextUtils.isEmpty(handler.producer) && handler.producer.equals(event.sourceId)
                            || TextUtils.isEmpty(handler.producer)) {
                        handler.handleEvent(event);
                    }
                }
            }
        }
    }