org.eclipse.mylyn.commons.notifications_0.9.1.v20120412-0100

16:46:27.222 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.commons.notifications_0.9.1.v20120412-0100.jar
package org.eclipse.mylyn.commons.ui.notifications;

import java.util.List;

@Deprecated
public abstract interface INotificationService
{
  public abstract void notify(List<? extends AbstractNotification> paramList);
}

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

import java.util.List;

@Deprecated
public class NotificationSinkEvent
{
  private final List<AbstractNotification> notifications;
  
  public NotificationSinkEvent(List<AbstractNotification> notifications)
  {
    this.notifications = notifications;
  }
  
  public List<AbstractNotification> getNotifications()
  {
    return notifications;
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.swt.graphics.Image;

@Deprecated
public abstract class AbstractNotification
  implements Comparable<AbstractNotification>, IAdaptable
{
  private final String eventId;
  
  public AbstractNotification(String eventId)
  {
    Assert.isNotNull(eventId);
    this.eventId = eventId;
  }
  
  public String getEventId()
  {
    return eventId;
  }
  
  public abstract void open();
  
  public abstract String getDescription();
  
  public abstract String getLabel();
  
  public abstract Image getNotificationImage();
  
  public abstract Image getNotificationKindImage();
  
  public Object getToken()
  {
    return null;
  }
}

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

import org.eclipse.mylyn.internal.commons.ui.notifications.NotificationsPlugin;

@Deprecated
public final class Notifications
{
  public static INotificationService getService()
  {
    return NotificationsPlugin.getDefault().getService();
  }
}

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

@Deprecated
public abstract class NotificationSink
{
  public abstract void notify(NotificationSinkEvent paramNotificationSinkEvent);
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.ui.notifications.NotificationSink;
import org.eclipse.mylyn.commons.ui.notifications.NotificationSinkEvent;

class NotificationService$1
  implements ISafeRunnable
{
  NotificationService$1(NotificationService paramNotificationService, NotificationSink paramNotificationSink, NotificationSinkEvent paramNotificationSinkEvent) {}
  
  public void handleException(Throwable e)
  {
    StatusHandler.log(new Status(2, "org.eclipse.mylyn.commons.notifications", "Sink failed: " + 
      val$sink.getClass(), e));
  }
  
  public void run()
    throws Exception
  {
    val$sink.notify(val$event);
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;

@Deprecated
public class NotificationCategory
  extends NotificationElement
{
  private final List<NotificationEvent> events;
  
  public NotificationCategory(IConfigurationElement element)
  {
    super(element);
    events = new ArrayList();
  }
  
  public void addEvent(NotificationEvent event)
  {
    event.setCategory(this);
    events.add(event);
  }
  
  public List<NotificationEvent> getEvents()
  {
    return events;
  }
  
  public void removeEvent(NotificationEvent event)
  {
    event.setCategory(null);
    events.remove(event);
  }
}

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

import java.util.List;

@Deprecated
public class NotificationHandler
{
  private final List<NotificationAction> actions;
  private final NotificationEvent event;
  
  public NotificationHandler(NotificationEvent event, List<NotificationAction> actions)
  {
    this.event = event;
    this.actions = actions;
  }
  
  public List<NotificationAction> getActions()
  {
    return actions;
  }
  
  public NotificationEvent getEvent()
  {
    return event;
  }
}

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

import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.TreeViewer;

class NotificationsPreferencesPage$3
  implements ICheckStateListener
{
  NotificationsPreferencesPage$3(NotificationsPreferencesPage paramNotificationsPreferencesPage) {}
  
  public void checkStateChanged(CheckStateChangedEvent event)
  {
    NotificationAction action = (NotificationAction)event.getElement();
    action.setSelected(event.getChecked());
    NotificationsPreferencesPage.access$1(this$0).setDirty(true);
    NotificationsPreferencesPage.access$5(this$0).refresh();
  }
}

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

import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

class NotificationPopup$2
  extends HyperlinkAdapter
{
  NotificationPopup$2(NotificationPopup paramNotificationPopup) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null)
    {
      Shell windowShell = window.getShell();
      if (windowShell != null)
      {
        windowShell.setMaximized(true);
        windowShell.open();
      }
    }
  }
}

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

import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import org.eclipse.mylyn.commons.ui.notifications.AbstractNotification;

class PopupNotificationSink$1$1
  implements Runnable
{
  PopupNotificationSink$1$1(PopupNotificationSink.1 param1) {}
  
  public void run()
  {
    PopupNotificationSink.1.access$0(this$1).collectNotifications();
    if ((PopupNotificationSink.access$0(PopupNotificationSink.1.access$0(this$1)) != null) && (PopupNotificationSink.access$0(PopupNotificationSink.1.access$0(this$1)).getReturnCode() == 1))
    {
      List<AbstractNotification> notifications = PopupNotificationSink.access$0(PopupNotificationSink.1.access$0(this$1)).getNotifications();
      for (AbstractNotification notification : notifications) {
        if (notification.getToken() != null) {
          PopupNotificationSink.access$1(PopupNotificationSink.1.access$0(this$1)).put(notification.getToken(), null);
        }
      }
    }
    for (Iterator<AbstractNotification> it = PopupNotificationSink.access$2(PopupNotificationSink.1.access$0(this$1)).iterator(); it.hasNext();)
    {
      AbstractNotification notification = (AbstractNotification)it.next();
      if ((notification.getToken() != null) && 
        (PopupNotificationSink.access$1(PopupNotificationSink.1.access$0(this$1)).containsKey(notification.getToken()))) {
        it.remove();
      }
    }
    synchronized (PopupNotificationSink.class)
    {
      if (PopupNotificationSink.access$2(PopupNotificationSink.1.access$0(this$1)).size() > 0) {
        PopupNotificationSink.1.access$0(this$1).showPopup();
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.commons.ui.notifications.popup.PopupNotificationSink.1.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.ui.notifications.popup;

import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.commons.ui.notifications.AbstractNotification;

class PopupNotificationSink$1
  extends Job
{
  PopupNotificationSink$1(PopupNotificationSink paramPopupNotificationSink, String $anonymous0)
  {
    super($anonymous0);
  }
  
  /* Error */
  protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
  {
    // Byte code:
    //   0: invokestatic 76	org/eclipse/core/runtime/Platform:isRunning	()Z
    //   3: ifeq +87 -> 90
    //   6: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
    //   9: ifnull +81 -> 90
    //   12: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
    //   15: invokeinterface 86 1 0
    //   20: ifnull +70 -> 90
    //   23: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
    //   26: invokeinterface 86 1 0
    //   31: invokevirtual 82	org/eclipse/swt/widgets/Display:isDisposed	()Z
    //   34: ifne +56 -> 90
    //   37: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
    //   40: invokeinterface 86 1 0
    //   45: new 41	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1$1
    //   48: dup
    //   49: aload_0
    //   50: invokespecial 81	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1$1:<init>	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1;)V
    //   53: invokevirtual 83	org/eclipse/swt/widgets/Display:asyncExec	(Ljava/lang/Runnable;)V
    //   56: goto +34 -> 90
    //   59: astore_2
    //   60: aload_0
    //   61: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
    //   64: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
    //   67: ifnull +21 -> 88
    //   70: aload_0
    //   71: aload_0
    //   72: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
    //   75: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
    //   78: invokevirtual 78	org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup:getDelayClose	()J
    //   81: ldc2_w 32
    //   84: ldiv
    //   85: invokevirtual 80	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:schedule	(J)V
    //   88: aload_2
    //   89: athrow
    //   90: aload_0
    //   91: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
    //   94: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
    //   97: ifnull +21 -> 118
    //   100: aload_0
    //   101: aload_0
    //   102: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
    //   105: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
    //   108: invokevirtual 78	org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup:getDelayClose	()J
    //   111: ldc2_w 32
    //   114: ldiv
    //   115: invokevirtual 80	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:schedule	(J)V
    //   118: aload_1
    //   119: invokeinterface 85 1 0
    //   124: ifeq +7 -> 131
    //   127: getstatic 73	org/eclipse/core/runtime/Status:CANCEL_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   130: areturn
    //   131: getstatic 74	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   134: areturn
    // Line number table:
    //   Java source line #58	-> byte code offset #0
    //   Java source line #59	-> byte code offset #12
    //   Java source line #60	-> byte code offset #23
    //   Java source line #61	-> byte code offset #37
    //   Java source line #92	-> byte code offset #59
    //   Java source line #93	-> byte code offset #60
    //   Java source line #94	-> byte code offset #70
    //   Java source line #96	-> byte code offset #88
    //   Java source line #93	-> byte code offset #90
    //   Java source line #94	-> byte code offset #100
    //   Java source line #98	-> byte code offset #118
    //   Java source line #99	-> byte code offset #127
    //   Java source line #102	-> byte code offset #131
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	135	0	this	1
    //   0	135	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   59	30	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	59	59	finally
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.mylyn.commons.ui.notifications.AbstractNotification;
import org.eclipse.mylyn.internal.commons.ui.CommonsUiPlugin;
import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonColors;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonUiUtil;
import org.eclipse.mylyn.internal.provisional.commons.ui.ScalingHyperlink;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

@Deprecated
public class NotificationPopup
  extends AbstractNotificationPopup
{
  private static final int NUM_NOTIFICATIONS_TO_DISPLAY = 4;
  private List<AbstractNotification> notifications;
  
  public NotificationPopup(Shell parent)
  {
    super(parent.getDisplay());
  }
  
  protected void createContentArea(Composite parent)
  {
    int count = 0;
    for (final AbstractNotification notification : notifications)
    {
      Composite notificationComposite = new Composite(parent, 524288);
      GridLayout gridLayout = new GridLayout(2, false);
      GridDataFactory.fillDefaults().grab(true, false).align(4, 128).applyTo(notificationComposite);
      notificationComposite.setLayout(gridLayout);
      notificationComposite.setBackground(parent.getBackground());
      if (count < 4)
      {
        Label notificationLabelIcon = new Label(notificationComposite, 524288);
        notificationLabelIcon.setBackground(parent.getBackground());
        notificationLabelIcon.setImage(notification.getNotificationKindImage());
        
        ScalingHyperlink itemLink = new ScalingHyperlink(notificationComposite, 524289);
        
        GridDataFactory.fillDefaults().grab(true, false).align(4, 128).applyTo(itemLink);
        itemLink.setForeground(CommonColors.HYPERLINK_WIDGET);
        itemLink.registerMouseTrackListener();
        itemLink.setText(CommonUiUtil.toLabel(notification.getLabel()));
        itemLink.setImage(notification.getNotificationImage());
        itemLink.setBackground(parent.getBackground());
        itemLink.addHyperlinkListener(new HyperlinkAdapter()
        {
          public void linkActivated(HyperlinkEvent e)
          {
            notification.open();
            IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            if (window != null)
            {
              Shell windowShell = window.getShell();
              if (windowShell != null)
              {
                if (windowShell.getMinimized()) {
                  windowShell.setMinimized(false);
                }
                windowShell.open();
                windowShell.forceActive();
              }
            }
          }
        });
        String descriptionText = null;
        if (notification.getDescription() != null) {
          descriptionText = notification.getDescription();
        }
        if ((descriptionText != null) && (!descriptionText.trim().equals("")))
        {
          Label descriptionLabel = new Label(notificationComposite, 524288);
          descriptionLabel.setText(CommonUiUtil.toLabel(descriptionText));
          descriptionLabel.setBackground(parent.getBackground());
          GridDataFactory.fillDefaults()
            .span(2, -1)
            .grab(true, false)
            .align(4, 128)
            .applyTo(descriptionLabel);
        }
      }
      else
      {
        int numNotificationsRemain = notifications.size() - count;
        ScalingHyperlink remainingLink = new ScalingHyperlink(notificationComposite, 524288);
        remainingLink.setForeground(CommonColors.HYPERLINK_WIDGET);
        remainingLink.registerMouseTrackListener();
        remainingLink.setBackground(parent.getBackground());
        
        remainingLink.setText(NLS.bind("{0} more", Integer.valueOf(numNotificationsRemain)));
        GridDataFactory.fillDefaults().span(2, -1).applyTo(remainingLink);
        remainingLink.addHyperlinkListener(new HyperlinkAdapter()
        {
          public void linkActivated(HyperlinkEvent e)
          {
            IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            if (window != null)
            {
              Shell windowShell = window.getShell();
              if (windowShell != null)
              {
                windowShell.setMaximized(true);
                windowShell.open();
              }
            }
          }
        });
        break;
      }
      count++;
    }
  }
  
  protected void createTitleArea(Composite parent)
  {
    super.createTitleArea(parent);
  }
  
  public List<AbstractNotification> getNotifications()
  {
    return new ArrayList(notifications);
  }
  
  protected Color getTitleForeground()
  {
    return CommonsUiPlugin.getDefault().getFormColors(Display.getDefault()).getColor("org.eclipse.ui.forms.TITLE");
  }
  
  public void setContents(List<AbstractNotification> notifications)
  {
    this.notifications = notifications;
  }
}

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

import org.eclipse.mylyn.commons.ui.notifications.AbstractNotification;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

class NotificationPopup$1
  extends HyperlinkAdapter
{
  NotificationPopup$1(NotificationPopup paramNotificationPopup, AbstractNotification paramAbstractNotification) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    val$notification.open();
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null)
    {
      Shell windowShell = window.getShell();
      if (windowShell != null)
      {
        if (windowShell.getMinimized()) {
          windowShell.setMinimized(false);
        }
        windowShell.open();
        windowShell.forceActive();
      }
    }
  }
}

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

import org.eclipse.osgi.util.NLS;

@Deprecated
public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.commons.ui.notifications.popup.messages";
  public static String PopupNotificationSink_Popup_Noifier_Job_Label;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.commons.ui.notifications.popup.messages", Messages.class);
  }
}

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

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylyn.commons.ui.notifications.AbstractNotification;
import org.eclipse.mylyn.commons.ui.notifications.NotificationSink;
import org.eclipse.mylyn.commons.ui.notifications.NotificationSinkEvent;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

@Deprecated
public class PopupNotificationSink
  extends NotificationSink
{
  private static final long DELAY_OPEN = 1000L;
  private static final boolean runSystem = true;
  private final WeakHashMap<Object, Object> cancelledTokens = new WeakHashMap();
  private final Set<AbstractNotification> notifications = new HashSet();
  private final Set<AbstractNotification> currentlyNotifying = Collections.synchronizedSet(notifications);
  private final Job openJob = new Job(Messages.PopupNotificationSink_Popup_Noifier_Job_Label)
  {
    /* Error */
    protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
    {
      // Byte code:
      //   0: invokestatic 76	org/eclipse/core/runtime/Platform:isRunning	()Z
      //   3: ifeq +87 -> 90
      //   6: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
      //   9: ifnull +81 -> 90
      //   12: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
      //   15: invokeinterface 86 1 0
      //   20: ifnull +70 -> 90
      //   23: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
      //   26: invokeinterface 86 1 0
      //   31: invokevirtual 82	org/eclipse/swt/widgets/Display:isDisposed	()Z
      //   34: ifne +56 -> 90
      //   37: invokestatic 84	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
      //   40: invokeinterface 86 1 0
      //   45: new 41	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1$1
      //   48: dup
      //   49: aload_0
      //   50: invokespecial 81	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1$1:<init>	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1;)V
      //   53: invokevirtual 83	org/eclipse/swt/widgets/Display:asyncExec	(Ljava/lang/Runnable;)V
      //   56: goto +34 -> 90
      //   59: astore_2
      //   60: aload_0
      //   61: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
      //   64: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
      //   67: ifnull +21 -> 88
      //   70: aload_0
      //   71: aload_0
      //   72: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
      //   75: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
      //   78: invokevirtual 78	org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup:getDelayClose	()J
      //   81: ldc2_w 32
      //   84: ldiv
      //   85: invokevirtual 80	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:schedule	(J)V
      //   88: aload_2
      //   89: athrow
      //   90: aload_0
      //   91: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
      //   94: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
      //   97: ifnull +21 -> 118
      //   100: aload_0
      //   101: aload_0
      //   102: getfield 75	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;
      //   105: invokestatic 79	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup;
      //   108: invokevirtual 78	org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup:getDelayClose	()J
      //   111: ldc2_w 32
      //   114: ldiv
      //   115: invokevirtual 80	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink$1:schedule	(J)V
      //   118: aload_1
      //   119: invokeinterface 85 1 0
      //   124: ifeq +7 -> 131
      //   127: getstatic 73	org/eclipse/core/runtime/Status:CANCEL_STATUS	Lorg/eclipse/core/runtime/IStatus;
      //   130: areturn
      //   131: getstatic 74	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
      //   134: areturn
      // Line number table:
      //   Java source line #58	-> byte code offset #0
      //   Java source line #59	-> byte code offset #12
      //   Java source line #60	-> byte code offset #23
      //   Java source line #61	-> byte code offset #37
      //   Java source line #92	-> byte code offset #59
      //   Java source line #93	-> byte code offset #60
      //   Java source line #94	-> byte code offset #70
      //   Java source line #96	-> byte code offset #88
      //   Java source line #93	-> byte code offset #90
      //   Java source line #94	-> byte code offset #100
      //   Java source line #98	-> byte code offset #118
      //   Java source line #99	-> byte code offset #127
      //   Java source line #102	-> byte code offset #131
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	135	0	this	1
      //   0	135	1	monitor	org.eclipse.core.runtime.IProgressMonitor
      //   59	30	2	localObject	Object
      // Exception table:
      //   from	to	target	type
      //   0	59	59	finally
    }
  };
  private NotificationPopup popup;
  
  private void cleanNotified()
  {
    currentlyNotifying.clear();
  }
  
  public void collectNotifications() {}
  
  /* Error */
  public Set<AbstractNotification> getNotifications()
  {
    // Byte code:
    //   0: ldc 2
    //   2: dup
    //   3: astore_1
    //   4: monitorenter
    //   5: aload_0
    //   6: getfield 151	org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink:currentlyNotifying	Ljava/util/Set;
    //   9: aload_1
    //   10: monitorexit
    //   11: areturn
    //   12: aload_1
    //   13: monitorexit
    //   14: athrow
    // Line number table:
    //   Java source line #124	-> byte code offset #0
    //   Java source line #125	-> byte code offset #5
    //   Java source line #124	-> byte code offset #12
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	15	0	this	PopupNotificationSink
    //   3	10	1	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   5	11	12	finally
    //   12	14	12	finally
  }
  
  public boolean isAnimationsEnabled()
  {
    IPreferenceStore store = PlatformUI.getPreferenceStore();
    return store.getBoolean("ENABLE_ANIMATIONS");
  }
  
  public void notify(NotificationSinkEvent event)
  {
    currentlyNotifying.addAll(event.getNotifications());
    if (!openJob.cancel()) {
      try
      {
        openJob.join();
      }
      catch (InterruptedException localInterruptedException) {}
    }
    openJob.setSystem(true);
    openJob.schedule(1000L);
  }
  
  public void showPopup()
  {
    if (popup != null) {
      popup.close();
    }
    Shell shell = new Shell(PlatformUI.getWorkbench().getDisplay());
    popup = new NotificationPopup(shell);
    popup.setFadingEnabled(isAnimationsEnabled());
    List<AbstractNotification> toDisplay = new ArrayList(currentlyNotifying);
    Collections.sort(toDisplay);
    popup.setContents(toDisplay);
    cleanNotified();
    popup.setBlockOnOpen(false);
    popup.open();
  }
}

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

import org.eclipse.jface.viewers.ICheckStateProvider;

class NotificationsPreferencesPage$4
  implements ICheckStateProvider
{
  NotificationsPreferencesPage$4(NotificationsPreferencesPage paramNotificationsPreferencesPage) {}
  
  public boolean isChecked(Object element)
  {
    return ((NotificationAction)element).isSelected();
  }
  
  public boolean isGrayed(Object element)
  {
    return false;
  }
}

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

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;

class NotificationsPreferencesPage$5
  implements ISelectionChangedListener
{
  NotificationsPreferencesPage$5(NotificationsPreferencesPage paramNotificationsPreferencesPage) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    Object item = ((IStructuredSelection)event.getSelection()).getFirstElement();
    (item instanceof NotificationAction);
  }
}

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

import org.eclipse.jface.viewers.IElementComparer;

public class NotificationsPreferencesPage$NotificationEventComparer
  implements IElementComparer
{
  public NotificationsPreferencesPage$NotificationEventComparer(NotificationsPreferencesPage paramNotificationsPreferencesPage) {}
  
  public boolean equals(Object a, Object b)
  {
    if (((a instanceof NotificationEvent)) && ((b instanceof NotificationEvent)))
    {
      String idA = ((NotificationEvent)a).getId();
      String idB = ((NotificationEvent)b).getId();
      return idA.equals(idB);
    }
    return a.equals(b);
  }
  
  public int hashCode(Object element)
  {
    return element.hashCode();
  }
}

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

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.ui.notifications.NotificationSink;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.statushandlers.StatusManager;

@Deprecated
public class NotificationSinkDescriptor
  extends NotificationElement
{
  private NotificationSink sink;
  private Status status;
  
  public NotificationSinkDescriptor(IConfigurationElement element)
  {
    super(element);
  }
  
  public NotificationSink getSink()
  {
    if ((sink != null) || (status != null)) {
      return sink;
    }
    try
    {
      Object object = element.createExecutableExtension("class");
      if ((object instanceof NotificationSink))
      {
        sink = ((NotificationSink)object);
        return sink;
      }
      status = new Status(4, "org.eclipse.mylyn.commons.notifications", NLS.bind(
        "Sink ''{0}'' does not extend expected class for extension contributed by {1}", 
        object.getClass().getCanonicalName(), getPluginId()));
    }
    catch (Throwable e)
    {
      status = new Status(4, "org.eclipse.mylyn.commons.notifications", NLS.bind(
        "Sink failed to load for extension contributed by {0}", getPluginId()), e);
    }
    StatusManager.getManager().handle(status);
    return null;
  }
}

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

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ICheckStateProvider;
import org.eclipse.jface.viewers.IElementComparer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.provisional.commons.ui.SubstringPatternFilter;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.dialogs.FilteredTree;

@Deprecated
public class NotificationsPreferencesPage
  extends PreferencePage
  implements IWorkbenchPreferencePage
{
  public class NotificationEventComparer
    implements IElementComparer
  {
    public NotificationEventComparer() {}
    
    public boolean equals(Object a, Object b)
    {
      if (((a instanceof NotificationEvent)) && ((b instanceof NotificationEvent)))
      {
        String idA = ((NotificationEvent)a).getId();
        String idB = ((NotificationEvent)b).getId();
        return idA.equals(idB);
      }
      return a.equals(b);
    }
    
    public int hashCode(Object element)
    {
      return element.hashCode();
    }
  }
  
  private static final Object[] EMPTY = new Object[0];
  private TreeViewer eventsViewer;
  private CheckboxTableViewer notifiersViewer;
  private Button enableNotificationsButton;
  private NotificationModel model;
  private Text descriptionText;
  
  private final class EventContentProvider
    implements ITreeContentProvider
  {
    private EventContentProvider() {}
    
    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
    
    public void dispose() {}
    
    public boolean hasChildren(Object element)
    {
      if ((element instanceof NotificationCategory)) {
        return ((NotificationCategory)element).getEvents().size() > 0;
      }
      return false;
    }
    
    public Object getParent(Object element)
    {
      if ((element instanceof NotificationEvent)) {
        return ((NotificationEvent)element).getCategory();
      }
      return null;
    }
    
    public Object[] getElements(Object inputElement)
    {
      if ((inputElement instanceof Object[])) {
        return (Object[])inputElement;
      }
      return NotificationsPreferencesPage.EMPTY;
    }
    
    public Object[] getChildren(Object parentElement)
    {
      if ((parentElement instanceof NotificationCategory)) {
        return ((NotificationCategory)parentElement).getEvents().toArray();
      }
      return NotificationsPreferencesPage.EMPTY;
    }
  }
  
  private final class NotifiersContentProvider
    implements IStructuredContentProvider
  {
    private NotificationHandler handler;
    
    privat
1 2 3

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