/com.plugin.log4j.viewer/src/com/log4jviewer/ui/views/ClearLogsAction.java
https://code.google.com/p/log4j-viewer/ · Java · 32 lines · 20 code · 6 blank · 6 comment · 0 complexity · e9dafe344183f70219b8d60cdfd3dd22 MD5 · raw file
- package com.log4jviewer.ui.views;
- import org.eclipse.jface.action.IAction;
- import org.eclipse.jface.viewers.ISelection;
- import org.eclipse.ui.IViewActionDelegate;
- import org.eclipse.ui.IViewPart;
- /**
- * Class represents a handler for 'Clear' button. It removes all logs from log list and clears LogView table.
- *
- * @author <a href="mailto:rd.ryly@gmail.com">Ruslan Diachenko</a>
- */
- public class ClearLogsAction implements IViewActionDelegate {
- private LogView logView;
- @Override
- public void run(final IAction action) {
- logView.getLogList().clear();
- logView.clearLogTable();
- }
- @Override
- public void selectionChanged(final IAction action, final ISelection selection) {
- // no code
- }
- @Override
- public void init(final IViewPart view) {
- this.logView = (LogView) view;
- }
- }