Adds a given event to the model with UI update.

@param event           event to be added
@param timelineUpdater TimelineUpdater instance to add the event in UI
433461
public void add(TimelineEvent event, TimelineUpdater timelineUpdater) {
        events.add(event);

        if (timelineUpdater != null) {
            // update UI
            timelineUpdater.add(event);
        }
    }
136808
function(timeline) {
        let eventIndex;

        const events = timeline.getEvents();

        if (!initialEventId) {
            // we were looking for the live timeline: initialise to the end
            eventIndex = events.length;
        } else {
            for (let i = 0; i < events.length; i++) {
                if (events[i].getId() == initialEventId) {
                    eventIndex = i;
                    break;
                }
            }

            if (eventIndex === undefined) {
                throw new Error("getEventTimeline result didn't include requested event");
            }
        }

        const endIndex = Math.min(events.length,
                                eventIndex + Math.ceil(initialWindowSize / 2));
        const startIndex = Math.max(0, endIndex - initialWindowSize);
        self._start = new TimelineIndex(timeline, startIndex - timeline.getBaseIndex());
        self._end = new TimelineIndex(timeline, endIndex - timeline.getBaseIndex());
        self._eventCount = endIndex - startIndex;
    }
1317211
public void addAppenderEvent(final Category cat, final Appender appender) {

		updateDefaultLayout(appender);

		if (appender instanceof FoundationFileRollingAppender) {
			final FoundationFileRollingAppender timeSizeRollingAppender = (FoundationFileRollingAppender) appender;

			// update the appender with default vales such as logging pattern, file size etc.
			//updateDefaultTimeAndSizeRollingAppender(timeSizeRollingAppender);

			// read teh proeprties and determine if archiving should be enabled.
			updateArchivingSupport(timeSizeRollingAppender);

			// by default add the rolling file listener to enable application
			// state.
			timeSizeRollingAppender.setFileRollEventListener(FoundationRollEventListener.class.getName());

			boolean rollOnStartup = true;

			if (FoundationLogger.log4jConfigProps != null && FoundationLogger.log4jConfigProps.containsKey(FoundationLoggerConstants.Foundation_ROLL_ON_STARTUP.toString())) {
				rollOnStartup = Boolean.valueOf(FoundationLogger.log4jConfigProps.getProperty(FoundationLoggerConstants.Foundation_ROLL_ON_STARTUP.toString()));
			}

			timeSizeRollingAppender.setRollOnStartup(rollOnStartup);

			// refresh the appender
			timeSizeRollingAppender.activateOptions();

			
		//	timeSizeRollingAppender.setOriginalLayout(); //So application state will not make any problems

		}else if(!(appender instanceof FoundationFileRollingAppender) && (appender instanceof TimeAndSizeRollingAppender)){ //TimeAndSizeRollingAppender
			final TimeAndSizeRollingAppender timeSizeRollingAppender = (TimeAndSizeRollingAppender) appender;

			// update the appender with default vales such as logging pattern, file size etc.
			updateDefaultTimeAndSizeRollingAppender(timeSizeRollingAppender);

			// read teh proeprties and determine if archiving should be enabled.
			updateArchivingSupport(timeSizeRollingAppender);

			// by default add the rolling file listener to enable application
			// state.
			timeSizeRollingAppender.setFileRollEventListener(FoundationRollEventListener.class.getName());

			boolean rollOnStartup = true;

			if (FoundationLogger.log4jConfigProps != null && FoundationLogger.log4jConfigProps.containsKey(FoundationLoggerConstants.Foundation_ROLL_ON_STARTUP.toString())) {
				rollOnStartup = Boolean.valueOf(FoundationLogger.log4jConfigProps.getProperty(FoundationLoggerConstants.Foundation_ROLL_ON_STARTUP.toString()));
			}

			timeSizeRollingAppender.setRollOnStartup(rollOnStartup);

			// refresh the appender
			timeSizeRollingAppender.activateOptions();

			
		//	timeSizeRollingAppender.setOriginalLayout();
		}
		if ( ! (appender instanceof org.apache.log4j.AsyncAppender))
            initiateAsyncSupport(appender);

	}
1269251
public void update(List<UninstallationProgressEvent> events) {
        if (!isVisible()) {
            if ((System.currentTimeMillis() - startTime) >= MS_TO_WAIT_BEFORE_SHOW) {
                if (!done && !setVisibleInvoked) {
                    setVisibleInvoked = true;
                    EventQueue.invokeLater(new Runnable() {

                        @Override
                        public void run() {
                            if (!done) {
                                UninstallationProgressDialogue.super.setVisible(true);
                            }
                        }
                    });
                }
            }
        }

        int totalAmount = 0;
        AddOn addOn = null;

        for (UninstallationProgressEvent event : events) {
            totalAmount += event.getAmount();
            if (UninstallationProgressEvent.Type.FINISHED_ADD_ON == event.getType()) {
                for (AddOnUninstallListener listener : listeners) {
                    failedUninstallations = !event.isUninstalled();
                    listener.addOnUninstalled(currentAddOn, update, event.isUninstalled());
                }
            } else if (UninstallationProgressEvent.Type.ADD_ON == event.getType()) {
                addOn = event.getAddOn();
                currentAddOn = addOn;
                update = event.isUpdate();

                for (AddOnUninstallListener listener : listeners) {
                    listener.uninstallingAddOn(addOn, update);
                }
            }
        }

        UninstallationProgressEvent last = events.get(events.size() - 1);

        if (addOn != null) {
            setCurrentAddOn(addOn);
        }

        if (totalAmount != 0) {
            incrementProgress(totalAmount);
        }

        if (currentType != last.getType()) {
            String keyMessage;
            switch (last.getType()) {
            case FILE:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingFile";
                break;
            case ACTIVE_RULE:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingActiveScanner";
                break;
            case PASSIVE_RULE:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingPassiveScanner";
                break;
            case EXTENSION:
                keyMessage = "cfu.uninstallation.progress.dialogue.uninstallingExtension";
                break;
            default:
                keyMessage = "";
                break;
            }
            currentType = last.getType();
            keyBaseStatusMessage = keyMessage;
        }

        if (keyBaseStatusMessage.isEmpty()) {
            setCustomMessage("");
        } else {
            setCustomMessage(
                    Constant.messages
                            .getString(keyBaseStatusMessage, last.getValue(), last.getMax()));
        }
    }
785995
function (event) {
        var self = this;

        event.monologued = false;
        event.recorded_at = new Date();

        self.events.insert(event, function (err) {
          if (!err) {
            _.delay(function () {
              self.events.remove({
                event_id: event.event_id
              });
            }, 60000);
          }
        });
      }
274284
@Controller(next = "askWhetherToRepeat")
    public void askTimeForMeeting(Event event) {
        if (event.getMessage().getText().contains("yes")) {
            reply(event, "Okay. Would you like me to set a reminder for you?");
            nextConversation(event);    // jump to next question in conversation  
        } else {
            reply(event, "No problem. You can always schedule one with 'setup meeting' command.");
            stopConversation(event);    // stop conversation only if user says no
        }
    }
373155
public void entryUpdated (EntryUpdatedEvent<T> event)
    {
        dispatchMethod(event.getName() + "Updated",
            new Object[] { event.getEntry() });
    }
427318
private void onEvent(CounterManager.Event2C.OnCounterUpdated event) {
        getModel().count = String.valueOf(event.getCount());

        if (view != null) {
            view.update();
        }
    }
1219164
public void addGroup(TimelineGroup group) {
        if (groups == null) {
            groups = new ArrayList<>();
        }

        groups.add(group);
    }
1198364
public void onAdd(FavouriteEvent event) {
		FavouriteListRecord flr = new FavouriteListRecord(event.getNewFavourite());
		favouriteItems.addData(flr);
	}
854063
@EventHandler
    public void playerJoinEvent(PlayerJoinEvent event) {
        if (Common.getInstance().getMainConfig().getBoolean("System.CheckNewVersion") && Common.getInstance().getServerCaller().getPlayerCaller().isOp(event.getP().getName()) && Common.getInstance().getVersionChecker().getResult() == Updater.UpdateResult.UPDATE_AVAILABLE) {
            Common.getInstance().getServerCaller().getPlayerCaller().sendMessage(event.getP().getName(), "{{DARK_CYAN}}Craftconomy is out of date! New version is " + Common.getInstance().getVersionChecker().getLatestName());
        }

    }
1123788
private void onParticipantUpdated(ParticipantUpdatedEvent event) {
        handler.post(() -> listener.onParticipantUpdated(event));
        log("Event published " + event.toString());
    }
295960
@Override
    public synchronized void controllerUpdate(ControllerEvent ce) {

        Player p = (Player) ce.getSourceController();

        if (p == null)
            return;

        // Get this when the internal players are realized.
        if (ce instanceof RealizeCompleteEvent) {
            p.start();
        }

        if (ce instanceof ControllerErrorEvent) {
            p.removeControllerListener(this);
            LOGGER.severe("Receiver internal error: " + ce);
        }

    }
297828
public void append(final T event) {

		// make sure we can append the log message

		if (backgroundService == null) {
			return;
		}

		if (!backgroundService.isRunning()) {
			return;
		}

		// skip internal logging
		
		if (!allowComDotStackify) {
			String className = eventAdapter.getClassName(event);
			
			if (className != null) {
				if (className.startsWith(COM_DOT_STACKIFY)) {
					return;
				}
			}
		}
		
		// build the log message and queue it to be sent to Stackify

		Throwable exception = eventAdapter.getThrowable(event);

		StackifyError error = null;

		if ((exception != null) || (eventAdapter.isErrorLevel(event))) {
			StackifyError e = eventAdapter.getStackifyError(event, exception);

			if (errorGovernor.errorShouldBeSent(e)) {
				error = e;
			}
		}

		LogMsg logMsg = eventAdapter.getLogMsg(event, error);

		collector.addLogMsg(logMsg);
	}
636767
@Override
	public void addEventHandler(EventHandler eventHandler) {
		Preconditions.checkNotNull(eventHandler.getName(), "Missing Name");
		if(getEventHandler(eventHandler.getName()) != null) {
			throw new ApplicationException(Code.CONFLICT, "EventHandler with name " + eventHandler.getName() + " already exists!");
		}
		index(eventHandler);
		dynoClient.hset(nsKey(EVENT_HANDLERS), eventHandler.getName(), toJson(eventHandler));
		recordRedisDaoRequests("addEventHandler");
	}
844120
public void addEvent(UserFeedbackEvent event) {
    UserFeedbackEvent[] oldEvents = feedbackEvents;
    feedbackEvents = new UserFeedbackEvent[feedbackEvents.length + 1];
    System.arraycopy(oldEvents, 0, feedbackEvents, 0, oldEvents.length);
    feedbackEvents[oldEvents.length] = event;
  }
1302660
public void elementUpdated (ElementUpdatedEvent event)
    {
        dispatchMethod(event.getName() + "Updated",
            new Object[] { event.getIndex(), event.getValue() });
    }