protected void quickFilterChanged() { LogView4JEvent clearEvent = new LogView4JEvent(LogView4JEventId.CLEAR_EVENT_SELECTION); LogView4JEventManager.getInstance().fireEvent(clearEvent); LogView4JEvent filterChangedEvent = new LogView4JEvent(LogView4JEventId.QUICK_FILTER_CHANGED); filterChangedEvent.set(LogView4JEventKey.QUICK_FILTER, quickFilterTextField.getText()); filterChangedEvent.set( LogView4JEventKey.REGEX_FILTER, (regularExpressionCheckBox.isSelected()) ? Boolean.TRUE : Boolean.FALSE); LogView4JEventManager.getInstance().fireEvent(filterChangedEvent); }
/** * Toggles the button level state and notifies listeners of the change * * @param button the button that was clicked */ protected void updateLevelFilter(SimpleToggleButton button) { button.toggleOn(); LogView4JEvent clearEvent = new LogView4JEvent(LogView4JEventId.CLEAR_EVENT_SELECTION); LogView4JEventManager.getInstance().fireEvent(clearEvent); LogView4JEvent event = new LogView4JEvent(LogView4JEventId.LOGGING_LEVEL_FILTER_CHANGED); event.set(LogView4JEventKey.LEVEL_FILTER_FLAGS, getLevelFlags()); event.set(LogView4JEventKey.JUST_FIRE_EVENT, Boolean.TRUE); LogView4JEventManager.getInstance().fireEvent(event); }
private void filterValidStateChanged(LogView4JEvent event) { Boolean isValid = (Boolean) event.get(LogView4JEventKey.FILTER_VALID); if (Boolean.TRUE.equals(isValid)) { quickFilterTextField.setToolTipText("Quick filter"); quickFilterTextField.setBackground(Color.WHITE); quickFilterTextField.setForeground(Color.BLACK); } else { String error = (String) event.get(LogView4JEventKey.ERROR_MESSAGE); quickFilterTextField.setToolTipText("Quick filter : " + error); quickFilterTextField.setBackground(INVALID_COLOR); quickFilterTextField.setForeground(Color.WHITE); } }
/** Toggles the play button state and fires an event */ protected void togglePlayPause() { playButton.toggleOn(); if (playButton.isOn()) { playButton.setToolTipText("Event receival is active, click to pause"); } else { playButton.setToolTipText("Event receival is inactive, click to start"); } LogView4JEvent event = new LogView4JEvent(LogView4JEventId.PAUSE_PROCESSING_EVENTS); event.set(LogView4JEventKey.PAUSED, new Boolean(!playButton.isOn())); LogView4JEventManager.getInstance().fireEvent(event); }
/** @param event */ public void eventReceived(LogView4JEvent event) { switch (event.getEventId().getId()) { case LogView4JEventId.LOGGING_EVENT_SELECTED_ID: { logEventSelected(event); break; } case LogView4JEventId.FILTER_VALID_ID: { filterValidStateChanged(event); break; } } }
protected void logEventSelected(LogView4JEvent event) { Object eventObj = event.get(LogView4JEventKey.LOGGING_EVENT); markerButton.setEnabled(false); if (eventObj == null) { markerButton.setEnabled(false); } else { LogView4JLoggingEvent[] events = (LogView4JLoggingEvent[]) eventObj; if (events.length > 0) { markerButton.setEnabled(true); } } }
/** Fired to clear events */ protected void clearEvents() { LogView4JEvent event = new LogView4JEvent(LogView4JEventId.REMOVE_ALL_EVENTS); event.set(LogView4JEventKey.JUST_FIRE_EVENT, Boolean.TRUE); LogView4JEventManager.getInstance().fireEvent(event); }