org.eclipse.mylyn.commons.notifications.ui_0.9.1.v20120425-0100

16:46:26.692 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.commons.notifications.ui_0.9.1.v20120425-0100.jar
package org.eclipse.mylyn.commons.notifications.ui;

import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.commons.workbench.forms.MessageControl;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.ImageHyperlink;

public abstract class NotificationControl
  extends MessageControl
{
  private static final String NOTIFICATIONS_PREF_PAGE = "org.eclipse.mylyn.commons.notifications.preferencePages.Notifications";
  private ImageHyperlink configureLink;
  private String preferencesPageId;
  
  public NotificationControl(Composite parent)
  {
    super(parent);
    setPreferencesPageId("org.eclipse.mylyn.commons.notifications.preferencePages.Notifications");
  }
  
  public String getPreferencesPageId()
  {
    return preferencesPageId;
  }
  
  public void setPreferencesPageId(String preferencesPageId)
  {
    this.preferencesPageId = preferencesPageId;
  }
  
  protected void createLinkControls(Composite buttonsComp)
  {
    if (getPreferencesPageId() != null)
    {
      configureLink = new ImageHyperlink(buttonsComp, 0);
      configureLink.setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CONFIGURE));
      configureLink.addHyperlinkListener(new HyperlinkAdapter()
      {
        public void linkActivated(HyperlinkEvent e)
        {
          PreferenceDialog pd = PreferencesUtil.createPreferenceDialogOn(getShell(), getPreferencesPageId(), 
            new String[0], getEventId());
          if (pd != null) {
            pd.open();
          }
        }
        
        public void linkEntered(HyperlinkEvent e)
        {
          configureLink.setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CONFIGURE_HOVER));
        }
        
        public void linkExited(HyperlinkEvent e)
        {
          configureLink.setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CONFIGURE));
        }
      });
      configureLink.setVisible(getEventId() != null);
    }
    super.createLinkControls(buttonsComp);
  }
  
  protected void setEventId(String eventId)
  {
    super.setEventId(eventId);
    if (configureLink != null) {
      configureLink.setVisible(eventId != null);
    }
  }
}

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

import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.ImageHyperlink;

class NotificationControl$1
  extends HyperlinkAdapter
{
  NotificationControl$1(NotificationControl paramNotificationControl) {}
  
  public void linkActivated(HyperlinkEvent e)
  {
    PreferenceDialog pd = PreferencesUtil.createPreferenceDialogOn(NotificationControl.access$0(this$0), this$0.getPreferencesPageId(), 
      new String[0], NotificationControl.access$1(this$0));
    if (pd != null) {
      pd.open();
    }
  }
  
  public void linkEntered(HyperlinkEvent e)
  {
    NotificationControl.access$2(this$0).setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CONFIGURE_HOVER));
  }
  
  public void linkExited(HyperlinkEvent e)
  {
    NotificationControl.access$2(this$0).setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CONFIGURE));
  }
}

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

import org.eclipse.mylyn.commons.notifications.core.AbstractNotification;
import org.eclipse.swt.graphics.Image;

public abstract class AbstractUiNotification
  extends AbstractNotification
{
  public AbstractUiNotification(String eventId)
  {
    super(eventId);
  }
  
  public abstract Image getNotificationImage();
  
  public abstract Image getNotificationKindImage();
  
  public abstract void open();
}

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

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

public final class NotificationsUi
{
  public static INotificationService getService()
  {
    return NotificationsPlugin.getDefault().getService();
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.notifications.core.NotificationSink;
import org.eclipse.mylyn.commons.notifications.core.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.ui", "Sink failed: " + 
      val$sink.getClass(), e));
  }
  
  public void run()
    throws Exception
  {
    val$sink.notify(val$event);
  }
}

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

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

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.notifications.ui.NotificationCategory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui;

import java.util.List;

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.notifications.ui.NotificationHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui;

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.notifications.ui.NotificationsPreferencesPage.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui.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.notifications.ui.popup.NotificationPopup.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui.popup;

import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import org.eclipse.mylyn.commons.notifications.core.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.notifications.ui.popup.PopupNotificationSink.1.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui.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.notifications.core.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/notifications/ui/popup/PopupNotificationSink$1$1
    //   48: dup
    //   49: aload_0
    //   50: invokespecial 81	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1$1:<init>	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/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/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
    //   64: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
    //   67: ifnull +21 -> 88
    //   70: aload_0
    //   71: aload_0
    //   72: getfield 75	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
    //   75: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
    //   78: invokevirtual 78	org/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup:getDelayClose	()J
    //   81: ldc2_w 32
    //   84: ldiv
    //   85: invokevirtual 80	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:schedule	(J)V
    //   88: aload_2
    //   89: athrow
    //   90: aload_0
    //   91: getfield 75	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
    //   94: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
    //   97: ifnull +21 -> 118
    //   100: aload_0
    //   101: aload_0
    //   102: getfield 75	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
    //   105: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
    //   108: invokevirtual 78	org/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup:getDelayClose	()J
    //   111: ldc2_w 32
    //   114: ldiv
    //   115: invokevirtual 80	org/eclipse/mylyn/internal/commons/notifications/ui/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 #56	-> byte code offset #0
    //   Java source line #57	-> byte code offset #12
    //   Java source line #58	-> byte code offset #23
    //   Java source line #59	-> byte code offset #37
    //   Java source line #90	-> byte code offset #59
    //   Java source line #91	-> byte code offset #60
    //   Java source line #92	-> byte code offset #70
    //   Java source line #94	-> byte code offset #88
    //   Java source line #91	-> byte code offset #90
    //   Java source line #92	-> byte code offset #100
    //   Java source line #96	-> byte code offset #118
    //   Java source line #97	-> byte code offset #127
    //   Java source line #100	-> 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.notifications.ui.popup.PopupNotificationSink.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui.popup;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.mylyn.commons.notifications.core.AbstractNotification;
import org.eclipse.mylyn.commons.notifications.ui.AbstractUiNotification;
import org.eclipse.mylyn.commons.ui.CommonUiUtil;
import org.eclipse.mylyn.commons.ui.compatibility.CommonColors;
import org.eclipse.mylyn.commons.workbench.AbstractWorkbenchNotificationPopup;
import org.eclipse.mylyn.commons.workbench.forms.CommonFormUtil;
import org.eclipse.mylyn.commons.workbench.forms.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.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;

public class NotificationPopup
  extends AbstractWorkbenchNotificationPopup
{
  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());
        if ((notification instanceof AbstractUiNotification)) {
          notificationLabelIcon.setImage(((AbstractUiNotification)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()));
        if ((notification instanceof AbstractUiNotification)) {
          itemLink.setImage(((AbstractUiNotification)notification).getNotificationImage());
        }
        itemLink.setBackground(parent.getBackground());
        itemLink.addHyperlinkListener(new HyperlinkAdapter()
        {
          public void linkActivated(HyperlinkEvent e)
          {
            if ((notification instanceof AbstractUiNotification)) {
              ((AbstractUiNotification)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 CommonFormUtil.getSharedColors().getColor("org.eclipse.ui.forms.TITLE");
  }
  
  public void setContents(List<AbstractNotification> notifications)
  {
    this.notifications = notifications;
  }
}

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

import org.eclipse.mylyn.commons.notifications.core.AbstractNotification;
import org.eclipse.mylyn.commons.notifications.ui.AbstractUiNotification;
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)
  {
    if ((val$notification instanceof AbstractUiNotification)) {
      ((AbstractUiNotification)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.notifications.ui.popup.NotificationPopup.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui.popup;

import org.eclipse.osgi.util.NLS;

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

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.commons.notifications.ui.popup.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui.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.notifications.core.AbstractNotification;
import org.eclipse.mylyn.commons.notifications.core.NotificationSink;
import org.eclipse.mylyn.commons.notifications.core.NotificationSinkEvent;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

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/notifications/ui/popup/PopupNotificationSink$1$1
      //   48: dup
      //   49: aload_0
      //   50: invokespecial 81	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1$1:<init>	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/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/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
      //   64: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
      //   67: ifnull +21 -> 88
      //   70: aload_0
      //   71: aload_0
      //   72: getfield 75	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
      //   75: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
      //   78: invokevirtual 78	org/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup:getDelayClose	()J
      //   81: ldc2_w 32
      //   84: ldiv
      //   85: invokevirtual 80	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:schedule	(J)V
      //   88: aload_2
      //   89: athrow
      //   90: aload_0
      //   91: getfield 75	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
      //   94: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
      //   97: ifnull +21 -> 118
      //   100: aload_0
      //   101: aload_0
      //   102: getfield 75	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink$1:this$0	Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;
      //   105: invokestatic 79	org/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink:access$0	(Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/PopupNotificationSink;)Lorg/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup;
      //   108: invokevirtual 78	org/eclipse/mylyn/internal/commons/notifications/ui/popup/NotificationPopup:getDelayClose	()J
      //   111: ldc2_w 32
      //   114: ldiv
      //   115: invokevirtual 80	org/eclipse/mylyn/internal/commons/notifications/ui/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 #56	-> byte code offset #0
      //   Java source line #57	-> byte code offset #12
      //   Java source line #58	-> byte code offset #23
      //   Java source line #59	-> byte code offset #37
      //   Java source line #90	-> byte code offset #59
      //   Java source line #91	-> byte code offset #60
      //   Java source line #92	-> byte code offset #70
      //   Java source line #94	-> byte code offset #88
      //   Java source line #91	-> byte code offset #90
      //   Java source line #92	-> byte code offset #100
      //   Java source line #96	-> byte code offset #118
      //   Java source line #97	-> byte code offset #127
      //   Java source line #100	-> 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;
  
  public PopupNotificationSink()
  {
    openJob.setSystem(true);
  }
  
  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 150	org/eclipse/mylyn/internal/commons/notifications/ui/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 #123	-> byte code offset #0
    //   Java source line #124	-> byte code offset #5
    //   Java source line #123	-> 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.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.notifications.ui.popup.PopupNotificationSink
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui;

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.notifications.ui.NotificationsPreferencesPage.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui;

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.notifications.ui.NotificationsPreferencesPage.5
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui;

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.notifications.ui.NotificationsPreferencesPage.NotificationEventComparer
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui;

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

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.ui", 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.ui", 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.notifications.ui.NotificationSinkDescriptor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.notifications.ui;

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.commons.ui.CommonImages;
import org.eclipse.mylyn.commons.workbench.SubstringPatternFilter;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.Sel
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