org.eclipse.mylyn.monitor.ui_3.7.1.v20120425-0100

16:46:46.974 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.monitor.ui_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.monitor.ui;

import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;

public abstract class AbstractPartTracker
  implements IPartListener
{
  public void install(IWorkbench workbench)
  {
    MonitorUiPlugin.getDefault().addWindowPartListener(this);
  }
  
  public void dispose(IWorkbench workbench)
  {
    MonitorUiPlugin.getDefault().removeWindowPartListener(this);
  }
  
  public abstract void partActivated(IWorkbenchPart paramIWorkbenchPart);
  
  public abstract void partBroughtToTop(IWorkbenchPart paramIWorkbenchPart);
  
  public abstract void partClosed(IWorkbenchPart paramIWorkbenchPart);
  
  public abstract void partDeactivated(IWorkbenchPart paramIWorkbenchPart);
  
  public abstract void partOpened(IWorkbenchPart paramIWorkbenchPart);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.AbstractPartTracker
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

public abstract interface IUserAttentionListener
{
  public abstract void userAttentionGained();
  
  public abstract void userAttentionLost();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.IUserAttentionListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

import org.eclipse.jface.action.IAction;

public abstract interface IActionExecutionListener
{
  public abstract void actionObserved(IAction paramIAction);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.IActionExecutionListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

import java.util.List;
import java.util.Set;
import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
import org.eclipse.mylyn.monitor.core.IInteractionEventListener;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IPerspectiveListener;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchWindow;

public class MonitorUi
{
  public static void addWindowPostSelectionListener(ISelectionListener listener)
  {
    MonitorUiPlugin.getDefault().addWindowPostSelectionListener(listener);
  }
  
  public static void removeWindowPostSelectionListener(ISelectionListener listener)
  {
    MonitorUiPlugin.getDefault().removeWindowPostSelectionListener(listener);
  }
  
  public static void addInteractionListener(IInteractionEventListener listener)
  {
    MonitorUiPlugin.getDefault().addInteractionListener(listener);
  }
  
  public static List<AbstractUserInteractionMonitor> getSelectionMonitors()
  {
    return MonitorUiPlugin.getDefault().getSelectionMonitors();
  }
  
  public static void removeInteractionListener(IInteractionEventListener listener)
  {
    MonitorUiPlugin.getDefault().removeInteractionListener(listener);
  }
  
  public static IActivityContextManager getActivityContextManager()
  {
    return MonitorUiPlugin.getDefault().getActivityContextManager();
  }
  
  @Deprecated
  public static IWorkbenchWindow getLaunchingWorkbenchWindow()
  {
    return MonitorUiPlugin.getDefault().getLaunchingWorkbenchWindow();
  }
  
  public static Set<IWorkbenchWindow> getMonitoredWindows()
  {
    return MonitorUiPlugin.getDefault().getMonitoredWindows();
  }
  
  public static void addWindowPartListener(IPartListener listener)
  {
    MonitorUiPlugin.getDefault().addWindowPartListener(listener);
  }
  
  public static void removeWindowPartListener(IPartListener listener)
  {
    MonitorUiPlugin.getDefault().removeWindowPartListener(listener);
  }
  
  public static void addWindowPerspectiveListener(IPerspectiveListener listener)
  {
    MonitorUiPlugin.getDefault().addWindowPerspectiveListener(listener);
  }
  
  public static void removeWindowPerspectiveListener(IPerspectiveListener listener)
  {
    MonitorUiPlugin.getDefault().removeWindowPerspectiveListener(listener);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.MonitorUi
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

public abstract interface IActivityContextManager
{
  public abstract void removeActivityTime(String paramString, long paramLong1, long paramLong2);
  
  public abstract void setInactivityTimeout(int paramInt);
  
  public abstract int getInactivityTimeout();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.IActivityContextManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IExecutionListener;
import org.eclipse.core.commands.NotHandledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;

public abstract class AbstractCommandMonitor
  implements IExecutionListener
{
  public AbstractCommandMonitor()
  {
    try
    {
      ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getAdapter(
        ICommandService.class);
      commandService.addExecutionListener(this);
    }
    catch (NullPointerException e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.monitor.ui", 
        "Monitors can not be instantiated until the workbench is active.", e));
    }
  }
  
  public void dispose()
  {
    try
    {
      ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getAdapter(
        ICommandService.class);
      commandService.removeExecutionListener(this);
    }
    catch (NullPointerException e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.monitor.ui", "Could not dispose monitor.", e));
    }
  }
  
  public void postExecuteFailure(String commandId, ExecutionException exception) {}
  
  public void notHandled(String commandId, NotHandledException exception) {}
  
  public void postExecuteSuccess(String commandId, Object returnValue) {}
  
  public void preExecute(String commandId, ExecutionEvent event)
  {
    if (commandId != null) {
      handleCommandExecution(commandId, event);
    }
  }
  
  protected abstract void handleCommandExecution(String paramString, ExecutionEvent paramExecutionEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.AbstractCommandMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;

public abstract class AbstractEditorTracker
  extends AbstractPartTracker
{
  public void partClosed(IWorkbenchPart part)
  {
    if ((part instanceof IEditorPart)) {
      editorClosed((IEditorPart)part);
    }
  }
  
  public void partOpened(IWorkbenchPart part)
  {
    if ((part instanceof IEditorPart)) {
      editorOpened((IEditorPart)part);
    }
  }
  
  public void partBroughtToTop(IWorkbenchPart part)
  {
    if ((part instanceof IEditorPart)) {
      editorBroughtToTop((IEditorPart)part);
    }
  }
  
  protected abstract void editorOpened(IEditorPart paramIEditorPart);
  
  protected abstract void editorClosed(IEditorPart paramIEditorPart);
  
  protected abstract void editorBroughtToTop(IEditorPart paramIEditorPart);
  
  public void partActivated(IWorkbenchPart part) {}
  
  public void partDeactivated(IWorkbenchPart part) {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.AbstractEditorTracker
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

public abstract class AbstractUserActivityMonitor
{
  private long lastEventTimeStamp = -1L;
  
  /* Error */
  public long getLastInteractionTime()
  {
    // Byte code:
    //   0: aload_0
    //   1: dup
    //   2: astore_1
    //   3: monitorenter
    //   4: aload_0
    //   5: getfield 26	org/eclipse/mylyn/monitor/ui/AbstractUserActivityMonitor:lastEventTimeStamp	J
    //   8: aload_1
    //   9: monitorexit
    //   10: lreturn
    //   11: aload_1
    //   12: monitorexit
    //   13: athrow
    // Line number table:
    //   Java source line #29	-> byte code offset #0
    //   Java source line #30	-> byte code offset #4
    //   Java source line #29	-> byte code offset #11
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	14	0	this	AbstractUserActivityMonitor
    //   2	10	1	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   4	10	11	finally
    //   11	13	11	finally
  }
  
  public void setLastEventTime(long lastEventTime)
  {
    synchronized (this)
    {
      lastEventTimeStamp = lastEventTime;
    }
  }
  
  public abstract void start();
  
  public abstract void stop();
  
  public boolean isEnabled()
  {
    return true;
  }
  
  public String getOriginId()
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.AbstractUserActivityMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

public abstract interface IMonitorLifecycleListener
{
  public abstract void startMonitoring();
  
  public abstract void stopMonitoring();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.IMonitorLifecycleListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.monitor.ui;

import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContextManager;
import org.eclipse.mylyn.internal.monitor.ui.IMonitoredWindow;
import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.monitor.core.InteractionEvent.Kind;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;

public abstract class AbstractUserInteractionMonitor
  implements ISelectionListener
{
  protected Object lastSelectedElement = null;
  
  public AbstractUserInteractionMonitor()
  {
    try
    {
      MonitorUiPlugin.getDefault().addWindowPostSelectionListener(this);
    }
    catch (NullPointerException e)
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.monitor.ui", 
        "Monitors can not be instantiated until the workbench is active", e));
    }
  }
  
  public void dispose()
  {
    try
    {
      MonitorUiPlugin.getDefault().removeWindowPostSelectionListener(this);
    }
    catch (NullPointerException e)
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.monitor.ui", "Could not dispose monitor", e));
    }
  }
  
  public void selectionChanged(IWorkbenchPart part, ISelection selection)
  {
    if ((part.getSite() != null) && (part.getSite().getWorkbenchWindow() != null))
    {
      IWorkbenchWindow window = part.getSite().getWorkbenchWindow();
      if (((window instanceof IMonitoredWindow)) && (!((IMonitoredWindow)window).isMonitored())) {
        return;
      }
    }
    if ((selection == null) || (selection.isEmpty())) {
      return;
    }
    if (!ContextCore.getContextManager().isContextActive()) {
      handleWorkbenchPartSelection(part, selection, false);
    } else {
      handleWorkbenchPartSelection(part, selection, true);
    }
  }
  
  protected abstract void handleWorkbenchPartSelection(IWorkbenchPart paramIWorkbenchPart, ISelection paramISelection, boolean paramBoolean);
  
  protected InteractionEvent handleElementSelection(IWorkbenchPart part, Object selectedElement, boolean contributeToContext)
  {
    return handleElementSelection(part.getSite().getId(), selectedElement, contributeToContext);
  }
  
  protected void handleElementEdit(IWorkbenchPart part, Object selectedElement, boolean contributeToContext)
  {
    handleElementEdit(part.getSite().getId(), selectedElement, contributeToContext);
  }
  
  protected void handleNavigation(IWorkbenchPart part, Object targetElement, String kind, boolean contributeToContext)
  {
    handleNavigation(part.getSite().getId(), targetElement, kind, contributeToContext);
  }
  
  protected void handleNavigation(String partId, Object targetElement, String kind, boolean contributeToContext)
  {
    AbstractContextStructureBridge adapter = ContextCore.getStructureBridge(targetElement);
    if (adapter.getContentType() != null)
    {
      String handleIdentifier = adapter.getHandleIdentifier(targetElement);
      InteractionEvent navigationEvent = new InteractionEvent(InteractionEvent.Kind.SELECTION, 
        adapter.getContentType(), handleIdentifier, partId, kind);
      if ((handleIdentifier != null) && (contributeToContext)) {
        ContextCore.getContextManager().processInteractionEvent(navigationEvent);
      }
      MonitorUiPlugin.getDefault().notifyInteractionObserved(navigationEvent);
    }
  }
  
  protected void handleElementEdit(String partId, Object selectedElement, boolean contributeToContext)
  {
    if (selectedElement == null) {
      return;
    }
    AbstractContextStructureBridge bridge = ContextCore.getStructureBridge(selectedElement);
    String handleIdentifier = bridge.getHandleIdentifier(selectedElement);
    InteractionEvent editEvent = new InteractionEvent(InteractionEvent.Kind.EDIT, bridge.getContentType(), 
      handleIdentifier, partId);
    if ((handleIdentifier != null) && (contributeToContext)) {
      ContextCore.getContextManager().processInteractionEvent(editEvent);
    }
    MonitorUiPlugin.getDefault().notifyInteractionObserved(editEvent);
  }
  
  protected InteractionEvent handleElementSelection(String partId, Object selectedElement, boolean contributeToContext)
  {
    if ((selectedElement == null) || (selectedElement.equals(lastSelectedElement))) {
      return null;
    }
    AbstractContextStructureBridge bridge = ContextCore.getStructureBridge(selectedElement);
    String handleIdentifier = bridge.getHandleIdentifier(selectedElement);
    InteractionEvent selectionEvent;
    InteractionEvent selectionEvent;
    if (bridge.getContentType() != null) {
      selectionEvent = new InteractionEvent(InteractionEvent.Kind.SELECTION, bridge.getContentType(), 
        handleIdentifier, partId);
    } else {
      selectionEvent = new InteractionEvent(InteractionEvent.Kind.SELECTION, null, null, partId);
    }
    if ((handleIdentifier != null) && (contributeToContext)) {
      ContextCore.getContextManager().processInteractionEvent(selectionEvent);
    }
    MonitorUiPlugin.getDefault().notifyInteractionObserved(selectionEvent);
    return selectionEvent;
  }
  
  public InteractionEvent.Kind getEventKind()
  {
    return InteractionEvent.Kind.SELECTION;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.monitor.ui.AbstractUserInteractionMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import java.io.File;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.mylyn.monitor.core.InteractionEvent;

public class PreferenceChangeMonitor
  implements IPropertyChangeListener
{
  public void propertyChange(PropertyChangeEvent event)
  {
    String newValue = obfuscateValueIfContainsPath(event.getNewValue().toString());
    InteractionEvent interactionEvent = InteractionEvent.makePreference(event.getProperty(), newValue);
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  private String obfuscateValueIfContainsPath(String preferenceValue)
  {
    if ((preferenceValue.indexOf(File.separator) != -1) || (preferenceValue.indexOf('/') != -1)) {
      return "[obfuscated]";
    }
    return preferenceValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.PreferenceChangeMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.monitor.ui.AbstractCommandMonitor;

public class KeybindingCommandMonitor
  extends AbstractCommandMonitor
{
  public static final String COMMAND_INVOKED = "keybinding";
  
  protected void handleCommandExecution(String commandId, ExecutionEvent event)
  {
    InteractionEvent interactionEvent = InteractionEvent.makeCommand(commandId, "keybinding");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.KeybindingCommandMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

public abstract interface IActivityManagerCallback
{
  public abstract void inactive();
  
  public abstract void active();
  
  public abstract void addMonitoredActivityTime(long paramLong1, long paramLong2);
  
  public abstract long getLastEventTime();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.IActivityManagerCallback
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

class ActivityContextManager$1
  implements IPropertyChangeListener
{
  ActivityContextManager$1(ActivityContextManager paramActivityContextManager) {}
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if ("workingSetContentChange".equals(event.getProperty())) {
      this$0.updateWorkingSetSelection();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.ActivityContextManager.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.jface.action.IAction;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.monitor.ui.IActionExecutionListener;

public class ActionExecutionMonitor
  implements IActionExecutionListener
{
  public void actionObserved(IAction action)
  {
    InteractionEvent interactionEvent = InteractionEvent.makeCommand(action.getId(), "");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.ActionExecutionMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.ui.activities.ActivityManagerEvent;
import org.eclipse.ui.activities.IActivityManager;
import org.eclipse.ui.activities.IActivityManagerListener;

public class ActivityChangeMonitor
  implements IActivityManagerListener
{
  private static final String ACTIVITIES_CHANGED = "activities changed";
  
  public void activityManagerChanged(ActivityManagerEvent activityManagerEvent)
  {
    if (activityManagerEvent.haveEnabledActivityIdsChanged())
    {
      String source = activityManagerEvent.getActivityManager().toString();
      String delta = activityManagerEvent.getActivityManager().getEnabledActivityIds().toString();
      InteractionEvent interactionEvent = InteractionEvent.makePreference(source, "activities changed: " + 
        delta);
      MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.ActivityChangeMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

class ActivityContextManager$2
  implements IActivityManagerCallback
{
  ActivityContextManager$2(ActivityContextManager paramActivityContextManager) {}
  
  public void addMonitoredActivityTime(long localStartTime, long currentTime)
  {
    ActivityContextManager.access$0(this$0, localStartTime, currentTime);
  }
  
  public void inactive()
  {
    ActivityContextManager.access$1(this$0);
  }
  
  public long getLastEventTime()
  {
    return this$0.getLastInteractionTime();
  }
  
  public void active()
  {
    ActivityContextManager.access$2(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.ActivityContextManager.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.ui.IWindowListener;
import org.eclipse.ui.IWorkbenchWindow;

public class WindowChangeMonitor
  implements IWindowListener
{
  public static final String WINDOW_CLOSED = "closed";
  public static final String WINDOW_OPENED = "opened";
  public static final String WINDOW_ACTIVATED = "activated";
  public static final String WINDOW_DEACTIVATED = "deactivated";
  
  public void windowOpened(IWorkbenchWindow window)
  {
    InteractionEvent interactionEvent = InteractionEvent.makeCommand(getWindowOrigin(window), "opened");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  public void windowClosed(IWorkbenchWindow window)
  {
    InteractionEvent interactionEvent = InteractionEvent.makeCommand(getWindowOrigin(window), "closed");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  public void windowDeactivated(IWorkbenchWindow window) {}
  
  public void windowActivated(IWorkbenchWindow window)
  {
    InteractionEvent interactionEvent = InteractionEvent.makeCommand(getWindowOrigin(window), "activated");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  protected String getWindowOrigin(IWorkbenchWindow window)
  {
    return window.getClass().getCanonicalName();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.WindowChangeMonitor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

public abstract interface IMonitoredWindow
{
  public abstract boolean isMonitored();
  
  public abstract boolean isPerspectiveManaged();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.IMonitoredWindow
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public class CheckActivityJob
  extends Job
{
  private boolean active;
  private final int ACTIVE_TICK = 30000;
  private final IActivityManagerCallback callback;
  private int inactivityTimeout;
  protected long previousEventTime;
  protected long tick = 30000L;
  volatile boolean errorLogged;
  
  public CheckActivityJob(IActivityManagerCallback callback)
  {
    super(Messages.CheckActivityJob_Activity_Monitor_Job);
    this.callback = callback;
  }
  
  public int getInactivityTimeout()
  {
    return inactivityTimeout;
  }
  
  public boolean isActive()
  {
    return active;
  }
  
  protected boolean isEnabled()
  {
    return (Platform.isRunning()) && (!PlatformUI.getWorkbench().isClosing());
  }
  
  public void reschedule()
  {
    schedule(active ? tick : tick / 6L);
  }
  
  /* Error */
  protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 124	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:isEnabled	()Z
    //   4: ifeq +248 -> 252
    //   7: aload_0
    //   8: getfield 116	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:callback	Lorg/eclipse/mylyn/internal/monitor/ui/IActivityManagerCallback;
    //   11: invokeinterface 127 1 0
    //   16: lstore_2
    //   17: invokestatic 118	java/lang/System:currentTimeMillis	()J
    //   20: lstore 4
    //   22: lload 4
    //   24: lload_2
    //   25: lsub
    //   26: aload_0
    //   27: getfield 111	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:inactivityTimeout	I
    //   30: i2l
    //   31: lcmp
    //   32: iflt +34 -> 66
    //   35: aload_0
    //   36: getfield 111	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:inactivityTimeout	I
    //   39: ifeq +27 -> 66
    //   42: aload_0
    //   43: getfield 114	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:active	Z
    //   46: ifeq +170 -> 216
    //   49: aload_0
    //   50: iconst_0
    //   51: putfield 114	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:active	Z
    //   54: aload_0
    //   55: getfield 116	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:callback	Lorg/eclipse/mylyn/internal/monitor/ui/IActivityManagerCallback;
    //   58: invokeinterface 129 1 0
    //   63: goto +153 -> 216
    //   66: aload_0
    //   67: getfield 114	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:active	Z
    //   70: ifne +41 -> 111
    //   73: aload_0
    //   74: iconst_1
    //   75: putfield 114	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:active	Z
    //   78: aload_0
    //   79: getfield 111	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:inactivityTimeout	I
    //   82: ifeq +11 -> 93
    //   85: aload_0
    //   86: lload_2
    //   87: putfield 112	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:previousEventTime	J
    //   90: goto +9 -> 99
    //   93: aload_0
    //   94: lload 4
    //   96: putfield 112	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:previousEventTime	J
    //   99: aload_0
    //   100: getfield 116	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:callback	Lorg/eclipse/mylyn/internal/monitor/ui/IActivityManagerCallback;
    //   103: invokeinterface 128 1 0
    //   108: goto +108 -> 216
    //   111: lload 4
    //   113: aload_0
    //   114: getfield 112	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:previousEventTime	J
    //   117: lsub
    //   118: aload_0
    //   119: getfield 113	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:tick	J
    //   122: ldc2_w 57
    //   125: lmul
    //   126: lcmp
    //   127: ifle +56 -> 183
    //   130: aload_0
    //   131: getfield 111	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:inactivityTimeout	I
    //   134: ifeq +40 -> 174
    //   137: lload 4
    //   139: lload_2
    //   140: lsub
    //   141: aload_0
    //   142: getfield 113	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:tick	J
    //   145: lcmp
    //   146: ifgt +11 -> 157
    //   149: aload_0
    //   150: lload_2
    //   151: putfield 112	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:previousEventTime	J
    //   154: goto +62 -> 216
    //   157: aload_0
    //   158: iconst_0
    //   159: putfield 114	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:active	Z
    //   162: aload_0
    //   163: getfield 116	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:callback	Lorg/eclipse/mylyn/internal/monitor/ui/IActivityManagerCallback;
    //   166: invokeinterface 129 1 0
    //   171: goto +45 -> 216
    //   174: aload_0
    //   175: lload 4
    //   177: putfield 112	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:previousEventTime	J
    //   180: goto +36 -> 216
    //   183: aload_0
    //   184: getfield 116	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:callback	Lorg/eclipse/mylyn/internal/monitor/ui/IActivityManagerCallback;
    //   187: aload_0
    //   188: getfield 112	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:previousEventTime	J
    //   191: lload 4
    //   193: invokeinterface 130 5 0
    //   198: aload_0
    //   199: lload 4
    //   201: putfield 112	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:previousEventTime	J
    //   204: goto +12 -> 216
    //   207: astore 6
    //   209: aload_0
    //   210: invokevirtual 123	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:reschedule	()V
    //   213: aload 6
    //   215: athrow
    //   216: aload_0
    //   217: invokevirtual 123	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:reschedule	()V
    //   220: goto +32 -> 252
    //   223: astore_2
    //   224: aload_0
    //   225: getfield 115	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:errorLogged	Z
    //   228: ifne +24 -> 252
    //   231: new 66	org/eclipse/core/runtime/Status
    //   234: dup
    //   235: iconst_4
    //   236: ldc 2
    //   238: ldc 1
    //   240: aload_2
    //   241: invokespecial 120	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   244: invokestatic 122	org/eclipse/mylyn/commons/core/StatusHandler:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   247: aload_0
    //   248: iconst_1
    //   249: putfield 115	org/eclipse/mylyn/internal/monitor/ui/CheckActivityJob:errorLogged	Z
    //   252: getstatic 109	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   255: areturn
    // Line number table:
    //   Java source line #84	-> byte code offset #0
    //   Java source line #86	-> byte code offset #7
    //   Java source line #87	-> byte code offset #17
    //   Java source line #89	-> byte code offset #22
    //   Java source line #90	-> byte code offset #42
    //   Java source line #92	-> byte code offset #49
    //   Java source line #93	-> byte code offset #54
    //   Java source line #96	-> byte code offset #66
    //   Java source line #97	-> byte code offset #73
    //   Java source line #99	-> byte code offset #78
    //   Java source line #100	-> byte code offset #85
    //   Java source line #103	-> byte code offset #93
    //   Java source line #105	-> byte code offset #99
    //   Java source line #109	-> byte code offset #111
    //   Java source line #110	-> byte code offset #130
    //   Java source line #112	-> byte code offset #137
    //   Java source line #114	-> byte code offset #149
    //   Java source line #117	-> byte code offset #157
    //   Java source line #118	-> byte code offset #162
    //   Java source line #122	-> byte code offset #174
    //   Java source line #125	-> byte code offset #183
    //   Java source line #126	-> byte code offset #198
    //   Java source line #130	-> byte code offset #207
    //   Java source line #131	-> byte code offset #209
    //   Java source line #132	-> byte code offset #213
    //   Java source line #131	-> byte code offset #216
    //   Java source line #134	-> byte code offset #223
    //   Java source line #136	-> byte code offset #224
    //   Java source line #137	-> byte code offset #231
    //   Java source line #138	-> byte code offset #238
    //   Java source line #137	-> byte code offset #241
    //   Java source line #139	-> byte code offset #247
    //   Java source line #142	-> byte code offset #252
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	256	0	this	CheckActivityJob
    //   0	256	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   16	135	2	lastEventTime	long
    //   223	18	2	t	Throwable
    //   20	180	4	currentTime	long
    //   207	7	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   7	207	207	finally
    //   0	220	223	java/lang/Throwable
  }
  
  public void setInactivityTimeout(int inactivityTimeout)
  {
    this.inactivityTimeout = inactivityTimeout;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.CheckActivityJob
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.monitor.ui.AbstractUserActivityMonitor;

class MonitorUiPlugin$MonitorUiExtensionPointReader
{
  public static final String EXTENSION_ID_USER = "org.eclipse.mylyn.monitor.ui.user";
  public static final String ELEMENT_ACTIVITY_TIMER = "osActivityTimer";
  public static final String ELEMENT_CLASS = "class";
  private boolean extensionsRead = false;
  
  MonitorUiPlugin$MonitorUiExtensionPointReader(MonitorUiPlugin paramMonitorUiPlugin) {}
  
  public void initExtensions()
  {
    try
    {
      if (!extensionsRead)
      {
        IExtensionRegistry registry = Platform.getExtensionRegistry();
        IExtensionPoint extensionPoint = registry.getExtensionPoint("org.eclipse.mylyn.monitor.ui.user");
        if (extensionPoint != null)
        {
          IExtension[] extensions = extensionPoint.getExtensions();
          IExtension[] arrayOfIExtension1;
          int j = (arrayOfIExtension1 = extensions).length;
          for (int i = 0; i < j; i++)
          {
            IExtension extension = arrayOfIExtension1[i];
            IConfigurationElement[] elements = extension.getConfigurationElements();
            IConfigurationElement[] arrayOfIConfigurationElement1;
            int m = (arrayOfIConfigurationElement1 = elements).length;
            for (int k = 0; k < m; k++)
            {
              IConfigurationElement element = arrayOfIConfigurationElement1[k];
              if (element.getName().compareTo("osActivityTimer") == 0) {
                readActivityMonitor(element);
              }
            }
          }
          extensionsRead = true;
        }
      }
    }
    catch (Throwable t)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.monitor.ui", 
        "Could not read monitor extension", t));
    }
  }
  
  private void readActivityMonitor(IConfigurationElement element)
    throws CoreException
  {
    try
    {
      if (element.getAttribute("class") != null)
      {
        Object activityTimer = element.createExecutableExtension("class");
        if ((activityTimer instanceof AbstractUserActivityMonitor)) {
          MonitorUiPlugin.access$5(this$0).add(0, (AbstractUserActivityMonitor)activityTimer);
        }
      }
    }
    catch (Throwable e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.monitor.ui", "Could not load activity timer", 
        e));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin.MonitorUiExtensionPointReader
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

class MonitorUiPlugin$1
  implements IPropertyChangeListener
{
  MonitorUiPlugin$1(MonitorUiPlugin paramMonitorUiPlugin) {}
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if ((event.getProperty().equals("org.eclipse.mylyn.monitor.ui.activity.timeout")) || 
      (event.getProperty().equals("org.eclipse.mylyn.monitor.ui.activity.timeout.enabled"))) {
      MonitorUiPlugin.access$0(this$0);
    } else if (event.getProperty().equals("org.eclipse.mylyn.monitor.activity.tracking.enabled")) {
      this$0.setActivityTrackingEnabled(this$0.getPreferenceStore().getBoolean("org.eclipse.mylyn.monitor.activity.tracking.enabled"));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

class ActivityContextManager$3
  implements Runnable
{
  ActivityContextManager$3(ActivityContextManager paramActivityContextManager) {}
  
  public void run()
  {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null)
    {
      IWorkbenchPage page = window.getActivePage();
      ActivityContextManager.access$3(this$0, page.getWorkingSets());
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.monitor.ui.ActivityContextManager.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.monitor.ui;

import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.ui.IPerspectiveDescriptor;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.PerspectiveAdapter;
import org.eclipse.ui.internal.registry.PerspectiveDescriptor;

public class PerspectiveChangeMonitor
  extends PerspectiveAdapter
{
  public static final String PERSPECTIVE_SAVED = "perspective saved";
  public static final String PERSPECTIVE_OPENED = "perspective opened";
  public static final String PERSPECTIVE_CLOSED = "perspective closed";
  public static final String PERSPECTIVE_CHANGED = "perspective changed";
  public static final String PERSPECTIVE_ACTIVATED = "perspective activated";
  
  public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective)
  {
    String source = getPerspectiveId(perspective);
    
    InteractionEvent interactionEvent = InteractionEvent.makePreference(source, "perspective activated");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId)
  {
    if (partRef != null)
    {
      String source = partRef.getId();
      InteractionEvent interactionEvent = InteractionEvent.makePreference(source, "perspective changed: " + 
        changeId);
      MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
    }
  }
  
  public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId)
  {
    String source = getPerspectiveId(perspective);
    InteractionEvent interactionEvent = InteractionEvent.makePreference(source, "perspective changed: " + 
      changeId);
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  public void perspectiveClosed(IWorkbenchPage page, IPerspectiveDescriptor perspective)
  {
    String source = getPerspectiveId(perspective);
    InteractionEvent interactionEvent = InteractionEvent.makePreference(source, "perspective closed");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  public void perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective)
  {
    String source = getPerspectiveId(perspective);
    InteractionEvent interactionEvent = InteractionEvent.makePreference(source, "perspective opened");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  public void perspectiveSavedAs(IWorkbenchPage page, IPerspectiveDescriptor oldPerspective, IPerspectiveDescriptor newPerspective)
  {
    String source = getPerspectiveId(newPerspective);
    InteractionEvent interactionEvent = InteractionEvent.makePreference(source, "perspective saved");
    MonitorUiPlugin.getDefault().notifyInteractionObserved(interactionEvent);
  }
  
  private String getPerspectiveId(IPerspectiveDescriptor perspe
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd