| package aeri.rcp; |
| |
| import org.eclipse.core.runtime.IStatus; |
| import org.eclipse.e4.core.contexts.IEclipseContext; |
| import org.eclipse.e4.core.internal.contexts.EclipseContext; |
| import org.eclipse.epp.logging.aeri.core.IProblemState; |
| import org.eclipse.epp.logging.aeri.core.ISendOptions; |
| import org.eclipse.epp.logging.aeri.core.IServerConnection; |
| |
| public class LogEvent { |
| |
| private IStatus status; |
| private IEclipseContext context; |
| private ISendOptions options; |
| private IProblemState response; |
| private IProblemState interest; |
| private IServerConnection connection; |
| |
| public LogEvent() { |
| } |
| |
| public LogEvent(IStatus status) { |
| setStatus(status); |
| setContext(new EclipseContext(null)); |
| } |
| |
| public LogEvent(IStatus status, IEclipseContext context) { |
| setStatus(status); |
| setContext(context); |
| } |
| |
| public IStatus getStatus() { |
| return status; |
| } |
| |
| public void setStatus(IStatus status) { |
| this.status = status; |
| } |
| |
| public IEclipseContext getContext() { |
| return context; |
| } |
| |
| public void setContext(IEclipseContext context) { |
| this.context = context; |
| } |
| |
| public <T> void set(Class<T> key, T value) { |
| context.set(key, value); |
| } |
| |
| // not sure how good this idea (S extends T) will be: |
| public <T, S extends T> S get(Class<T> key) { |
| return (S) context.get(key); |
| } |
| |
| public <T, S extends T> T get(Class<T> key, S defaultValue) { |
| return context.get(key); |
| } |
| |
| public void setOptions(ISendOptions options) { |
| this.options = options; |
| |
| } |
| |
| public ISendOptions getOptions() { |
| return options; |
| |
| } |
| |
| public void setResponse(IProblemState response) { |
| this.response = response; |
| } |
| |
| public IProblemState getResponse() { |
| return response; |
| } |
| |
| public IProblemState getInterest() { |
| return interest; |
| } |
| |
| public void setInterest(IProblemState interest) { |
| this.interest = interest; |
| } |
| |
| public IServerConnection getConnection() { |
| return connection; |
| } |
| |
| public void setConnection(IServerConnection connection) { |
| this.connection = connection; |
| } |
| } |